From: Andrew Rybchenko Date: Thu, 7 Feb 2019 12:17:32 +0000 (+0000) Subject: net/sfc: move main log type to process private data X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f52fa243fd23e8011de470a94dbf8a19225c05f5;p=dpdk.git net/sfc: move main log type to process private data Dynamic log type value may differ in primary and secondary processes. Signed-off-by: Andrew Rybchenko --- diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index 5c836b1c37..f04127bbc7 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -175,6 +175,7 @@ struct sfc_rss { struct sfc_adapter_priv { const struct sfc_dp_rx *dp_rx; const struct sfc_dp_tx *dp_tx; + uint32_t logtype_main; }; static inline struct sfc_adapter_priv * @@ -207,7 +208,6 @@ struct sfc_adapter { uint16_t port_id; struct rte_eth_dev *eth_dev; struct rte_kvargs *kvargs; - uint32_t logtype_main; int socket_id; efsys_bar_t mem_bar; efx_family_t family; diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 46cd36fa54..bb53c7d53f 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -1905,6 +1905,8 @@ sfc_eth_dev_secondary_init(struct rte_eth_dev *dev, uint32_t logtype_main) goto fail_alloc_priv; } + sap->logtype_main = logtype_main; + dp_rx = sfc_dp_find_rx_by_name(&sfc_dp_head, sa->dp_rx_name); if (dp_rx == NULL) { SFC_LOG(sa, RTE_LOG_ERR, logtype_main, @@ -2011,7 +2013,7 @@ sfc_eth_dev_init(struct rte_eth_dev *dev) /* Required for logging */ sa->pci_addr = pci_dev->addr; sa->port_id = dev->data->port_id; - sa->logtype_main = logtype_main; + sa->priv.logtype_main = logtype_main; sa->eth_dev = dev; diff --git a/drivers/net/sfc/sfc_log.h b/drivers/net/sfc/sfc_log.h index b11fbfb0a6..405cc2a26e 100644 --- a/drivers/net/sfc/sfc_log.h +++ b/drivers/net/sfc/sfc_log.h @@ -52,7 +52,7 @@ extern uint32_t sfc_logtype_driver; do { \ const struct sfc_adapter *_sa = (sa); \ \ - SFC_LOG(_sa, RTE_LOG_ERR, _sa->logtype_main, \ + SFC_LOG(_sa, RTE_LOG_ERR, _sa->priv.logtype_main, \ __VA_ARGS__); \ } while (0) @@ -60,7 +60,7 @@ extern uint32_t sfc_logtype_driver; do { \ const struct sfc_adapter *_sa = (sa); \ \ - SFC_LOG(_sa, RTE_LOG_WARNING, _sa->logtype_main, \ + SFC_LOG(_sa, RTE_LOG_WARNING, _sa->priv.logtype_main, \ __VA_ARGS__); \ } while (0) @@ -68,7 +68,7 @@ extern uint32_t sfc_logtype_driver; do { \ const struct sfc_adapter *_sa = (sa); \ \ - SFC_LOG(_sa, RTE_LOG_NOTICE, _sa->logtype_main, \ + SFC_LOG(_sa, RTE_LOG_NOTICE, _sa->priv.logtype_main, \ __VA_ARGS__); \ } while (0) @@ -76,7 +76,7 @@ extern uint32_t sfc_logtype_driver; do { \ const struct sfc_adapter *_sa = (sa); \ \ - SFC_LOG(_sa, RTE_LOG_INFO, _sa->logtype_main, \ + SFC_LOG(_sa, RTE_LOG_INFO, _sa->priv.logtype_main, \ __VA_ARGS__); \ } while (0) @@ -84,7 +84,7 @@ extern uint32_t sfc_logtype_driver; do { \ const struct sfc_adapter *_sa = (sa); \ \ - SFC_LOG(_sa, RTE_LOG_INFO, _sa->logtype_main, \ + SFC_LOG(_sa, RTE_LOG_INFO, _sa->priv.logtype_main, \ RTE_FMT("%s(): " \ RTE_FMT_HEAD(__VA_ARGS__ ,), \ __func__, \