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 <arybchenko@solarflare.com>
This commit is contained in:
parent
5dec95e36d
commit
f52fa243fd
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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__, \
|
||||
|
Loading…
x
Reference in New Issue
Block a user