net/sfc: prepare to merge init logs with main log type
authorIvan Malov <ivan.malov@oktetlabs.ru>
Wed, 21 Mar 2018 11:28:19 +0000 (11:28 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:44 +0000 (14:08 +0200)
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 <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
drivers/net/sfc/sfc.c
drivers/net/sfc/sfc_ethdev.c
drivers/net/sfc/sfc_intr.c
drivers/net/sfc/sfc_mcdi.c
drivers/net/sfc/sfc_rx.c
drivers/net/sfc/sfc_tx.c

index cb3a581..681e117 100644 (file)
@@ -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
index 15aee22..f27ce63 100644 (file)
@@ -259,8 +259,9 @@ sfc_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 
        ret = rte_eth_linkstatus_set(dev, &current_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;
 
index d6c8492..fbdc7ee 100644 (file)
@@ -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;
        }
 
index 9d92b8c..895c2f5 100644 (file)
@@ -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);
        }
 }
 
index abc53fb..f7aaab0 100644 (file)
@@ -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);
index 757b03b..0035c5c 100644 (file)
@@ -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);