From: Ivan Malov Date: Wed, 21 Mar 2018 11:28:19 +0000 (+0000) Subject: net/sfc: prepare to merge init logs with main log type X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=91d1627654af7f78ccb2b4a5c1f779e083dc2bca;p=dpdk.git net/sfc: prepare to merge init logs with main log type Conversion to dynamic logging done in the previous patches makes it possible to simplify internal controls for init logging. This patch allows to prepare for such a change. It makes init-unrelated messages use NOTICE level so that the following patch will be able to convert init logging to use INFO level and remain silent by default. Signed-off-by: Ivan Malov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c index cb3a581ae1..681e117bdf 100644 --- a/drivers/net/sfc/sfc.c +++ b/drivers/net/sfc/sfc.c @@ -344,7 +344,7 @@ sfc_start(struct sfc_adapter *sa) case SFC_ADAPTER_CONFIGURED: break; case SFC_ADAPTER_STARTED: - sfc_info(sa, "already started"); + sfc_notice(sa, "already started"); return 0; default: rc = EINVAL; @@ -383,7 +383,7 @@ sfc_stop(struct sfc_adapter *sa) case SFC_ADAPTER_STARTED: break; case SFC_ADAPTER_CONFIGURED: - sfc_info(sa, "already stopped"); + sfc_notice(sa, "already stopped"); return; default: sfc_err(sa, "stop in unexpected state %u", sa->state); @@ -454,7 +454,7 @@ sfc_schedule_restart(struct sfc_adapter *sa) else if (rc != 0) sfc_err(sa, "cannot arm restart alarm (rc=%d)", rc); else - sfc_info(sa, "restart scheduled"); + sfc_notice(sa, "restart scheduled"); } int diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 15aee22299..f27ce63db8 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -259,8 +259,9 @@ sfc_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete) ret = rte_eth_linkstatus_set(dev, ¤t_link); if (ret == 0) - sfc_info(sa, "Link status is %s", - current_link.link_status ? "UP" : "DOWN"); + sfc_notice(sa, "Link status is %s", + current_link.link_status ? "UP" : "DOWN"); + return ret; } @@ -931,8 +932,8 @@ sfc_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) } if (sa->state != SFC_ADAPTER_STARTED) { - sfc_info(sa, "the port is not started"); - sfc_info(sa, "the new MAC address will be set on port start"); + sfc_notice(sa, "the port is not started"); + sfc_notice(sa, "the new MAC address will be set on port start"); goto unlock; } @@ -1737,7 +1738,7 @@ sfc_eth_dev_set_ops(struct rte_eth_dev *dev) goto fail_dp_rx_name; } - sfc_info(sa, "use %s Rx datapath", sa->dp_rx_name); + sfc_notice(sa, "use %s Rx datapath", sa->dp_rx_name); dev->rx_pkt_burst = sa->dp_rx->pkt_burst; @@ -1776,7 +1777,7 @@ sfc_eth_dev_set_ops(struct rte_eth_dev *dev) goto fail_dp_tx_name; } - sfc_info(sa, "use %s Tx datapath", sa->dp_tx_name); + sfc_notice(sa, "use %s Tx datapath", sa->dp_tx_name); dev->tx_pkt_burst = sa->dp_tx->pkt_burst; diff --git a/drivers/net/sfc/sfc_intr.c b/drivers/net/sfc/sfc_intr.c index d6c84927bf..fbdc7eea1c 100644 --- a/drivers/net/sfc/sfc_intr.c +++ b/drivers/net/sfc/sfc_intr.c @@ -86,7 +86,7 @@ sfc_intr_line_handler(void *cb_arg) exit: if (lsc_seq != sa->port.lsc_seq) { - sfc_info(sa, "link status change event: link %s", + sfc_notice(sa, "link status change event: link %s", sa->eth_dev->data->dev_link.link_status ? "UP" : "DOWN"); _rte_eth_dev_callback_process(sa->eth_dev, @@ -130,7 +130,7 @@ sfc_intr_message_handler(void *cb_arg) exit: if (lsc_seq != sa->port.lsc_seq) { - sfc_info(sa, "link status change event"); + sfc_notice(sa, "link status change event"); _rte_eth_dev_callback_process(sa->eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); @@ -251,7 +251,7 @@ sfc_intr_configure(struct sfc_adapter *sa) intr->handler = NULL; intr->lsc_intr = (sa->eth_dev->data->dev_conf.intr_conf.lsc != 0); if (!intr->lsc_intr) { - sfc_info(sa, "LSC tracking using interrupts is disabled"); + sfc_notice(sa, "LSC tracking using interrupts is disabled"); goto done; } diff --git a/drivers/net/sfc/sfc_mcdi.c b/drivers/net/sfc/sfc_mcdi.c index 9d92b8c537..895c2f5d5b 100644 --- a/drivers/net/sfc/sfc_mcdi.c +++ b/drivers/net/sfc/sfc_mcdi.c @@ -176,7 +176,7 @@ sfc_mcdi_do_log(const struct sfc_adapter *sa, * at the end which is required by netlogdecode. */ buffer[position] = '\0'; - sfc_info(sa, "%s \\", buffer); + sfc_notice(sa, "%s \\", buffer); /* Preserve prefix for the next log message */ position = pfxsize; } @@ -201,7 +201,7 @@ sfc_mcdi_logger(void *arg, efx_log_msg_t type, if (!sa->mcdi.logging) return; - /* The format including prefix added by sfc_info() is the format + /* The format including prefix added by sfc_notice() is the format * consumed by the Solarflare netlogdecode tool. */ pfxsize = snprintf(buffer, sizeof(buffer), "MCDI RPC %s:", @@ -212,7 +212,7 @@ sfc_mcdi_logger(void *arg, efx_log_msg_t type, start = sfc_mcdi_do_log(sa, buffer, data, data_size, pfxsize, start); if (start != pfxsize) { buffer[start] = '\0'; - sfc_info(sa, "%s", buffer); + sfc_notice(sa, "%s", buffer); } } diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index abc53fb5b0..f7aaab0705 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -608,7 +608,7 @@ sfc_rx_qflush(struct sfc_adapter *sa, unsigned int sw_index) sfc_err(sa, "RxQ %u flush failed", sw_index); if (rxq->state & SFC_RXQ_FLUSHED) - sfc_info(sa, "RxQ %u flushed", sw_index); + sfc_notice(sa, "RxQ %u flushed", sw_index); } sa->dp_rx->qpurge(rxq->dp); diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c index 757b03ba89..0035c5cf17 100644 --- a/drivers/net/sfc/sfc_tx.c +++ b/drivers/net/sfc/sfc_tx.c @@ -606,7 +606,7 @@ sfc_tx_qstop(struct sfc_adapter *sa, unsigned int sw_index) sfc_err(sa, "TxQ %u flush timed out", sw_index); if (txq->state & SFC_TXQ_FLUSHED) - sfc_info(sa, "TxQ %u flushed", sw_index); + sfc_notice(sa, "TxQ %u flushed", sw_index); } sa->dp_tx->qreap(txq->dp);