}
uint32_t
-sfc_register_logtype(struct sfc_adapter *sa, const char *lt_prefix_str,
- uint32_t ll_default)
+sfc_register_logtype(const struct rte_pci_addr *pci_addr,
+ const char *lt_prefix_str, uint32_t ll_default)
{
size_t lt_prefix_str_size = strlen(lt_prefix_str);
size_t lt_str_size_max;
strncpy(lt_str, lt_prefix_str, lt_prefix_str_size);
lt_str[lt_prefix_str_size - 1] = '.';
- rte_pci_device_name(&sa->pci_addr, lt_str + lt_prefix_str_size,
+ rte_pci_device_name(pci_addr, lt_str + lt_prefix_str_size,
lt_str_size_max - lt_prefix_str_size);
lt_str[lt_str_size_max - 1] = '\0';
};
static int
-sfc_eth_dev_secondary_set_ops(struct rte_eth_dev *dev)
+sfc_eth_dev_secondary_set_ops(struct rte_eth_dev *dev, uint32_t logtype_main)
{
/*
* Device private data has really many process-local pointers.
dp_rx = sfc_dp_find_rx_by_name(&sfc_dp_head, sa->dp_rx_name);
if (dp_rx == NULL) {
- sfc_err(sa, "cannot find %s Rx datapath", sa->dp_rx_name);
+ SFC_LOG(sa, RTE_LOG_ERR, logtype_main,
+ "cannot find %s Rx datapath", sa->dp_rx_name);
rc = ENOENT;
goto fail_dp_rx;
}
if (~dp_rx->features & SFC_DP_RX_FEAT_MULTI_PROCESS) {
- sfc_err(sa, "%s Rx datapath does not support multi-process",
+ SFC_LOG(sa, RTE_LOG_ERR, logtype_main,
+ "%s Rx datapath does not support multi-process",
sa->dp_rx_name);
rc = EINVAL;
goto fail_dp_rx_multi_process;
dp_tx = sfc_dp_find_tx_by_name(&sfc_dp_head, sa->dp_tx_name);
if (dp_tx == NULL) {
- sfc_err(sa, "cannot find %s Tx datapath", sa->dp_tx_name);
+ SFC_LOG(sa, RTE_LOG_ERR, logtype_main,
+ "cannot find %s Tx datapath", sa->dp_tx_name);
rc = ENOENT;
goto fail_dp_tx;
}
if (~dp_tx->features & SFC_DP_TX_FEAT_MULTI_PROCESS) {
- sfc_err(sa, "%s Tx datapath does not support multi-process",
+ SFC_LOG(sa, RTE_LOG_ERR, logtype_main,
+ "%s Tx datapath does not support multi-process",
sa->dp_tx_name);
rc = EINVAL;
goto fail_dp_tx_multi_process;
{
struct sfc_adapter *sa = dev->data->dev_private;
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
+ uint32_t logtype_main;
int rc;
const efx_nic_cfg_t *encp;
const struct ether_addr *from;
sfc_register_dp();
+ logtype_main = sfc_register_logtype(&pci_dev->addr,
+ SFC_LOGTYPE_MAIN_STR,
+ RTE_LOG_NOTICE);
+
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return -sfc_eth_dev_secondary_set_ops(dev);
+ return -sfc_eth_dev_secondary_set_ops(dev, logtype_main);
/* Required for logging */
sa->pci_addr = pci_dev->addr;
sa->port_id = dev->data->port_id;
+ sa->logtype_main = logtype_main;
sa->eth_dev = dev;
/* Copy PCI device info to the dev->data */
rte_eth_copy_pci_info(dev, pci_dev);
- sa->logtype_main = sfc_register_logtype(sa, SFC_LOGTYPE_MAIN_STR,
- RTE_LOG_NOTICE);
-
rc = sfc_kvargs_parse(sa);
if (rc != 0)
goto fail_kvargs_parse;