Skip to content

Commit

Permalink
net/dpaa: use dynamic log type
Browse files Browse the repository at this point in the history
[ upstream commit b7c7ff6 ]

The static PMD logtype should not be used by drivers.
Instead, use existing log macros in this driver.

Also use standard rte_ether routine to format ether address.

Fixes: 37f9b54 ("net/dpaa: support Tx and Rx queue setup")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  • Loading branch information
shemminger authored and kevintraynor committed May 27, 2020
1 parent beb011f commit 84c30c5
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions drivers/net/dpaa/dpaa_ethdev.c
Expand Up @@ -827,8 +827,8 @@ dpaa_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
PMD_INIT_FUNC_TRACE();

if (qman_query_fq_frm_cnt(rxq, &frm_cnt) == 0) {
RTE_LOG(DEBUG, PMD, "RX frame count for q(%d) is %u\n",
rx_queue_id, frm_cnt);
DPAA_PMD_DEBUG("RX frame count for q(%d) is %u",
rx_queue_id, frm_cnt);
}
return frm_cnt;
}
Expand Down Expand Up @@ -942,8 +942,7 @@ dpaa_dev_add_mac_addr(struct rte_eth_dev *dev,
ret = fman_if_add_mac_addr(dpaa_intf->fif, addr->addr_bytes, index);

if (ret)
RTE_LOG(ERR, PMD, "error: Adding the MAC ADDR failed:"
" err = %d", ret);
DPAA_PMD_ERR("Adding the MAC ADDR failed: err = %d", ret);
return 0;
}

Expand All @@ -969,7 +968,7 @@ dpaa_dev_set_mac_addr(struct rte_eth_dev *dev,

ret = fman_if_add_mac_addr(dpaa_intf->fif, addr->addr_bytes, 0);
if (ret)
RTE_LOG(ERR, PMD, "error: Setting the MAC ADDR failed %d", ret);
DPAA_PMD_ERR("Setting the MAC ADDR failed %d", ret);

return ret;
}
Expand Down Expand Up @@ -1219,6 +1218,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
struct fman_if *fman_intf;
struct fman_if_bpool *bp, *tmp_bp;
uint32_t cgrid[DPAA_MAX_NUM_PCD_QUEUES];
char eth_buf[ETHER_ADDR_FMT_SIZE];

PMD_INIT_FUNC_TRACE();

Expand Down Expand Up @@ -1365,15 +1365,9 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)

/* copy the primary mac address */
ether_addr_copy(&fman_intf->mac_addr, &eth_dev->data->mac_addrs[0]);
ether_format_addr(eth_buf, sizeof(eth_buf), &fman_intf->mac_addr);

RTE_LOG(INFO, PMD, "net: dpaa: %s: %02x:%02x:%02x:%02x:%02x:%02x\n",
dpaa_device->name,
fman_intf->mac_addr.addr_bytes[0],
fman_intf->mac_addr.addr_bytes[1],
fman_intf->mac_addr.addr_bytes[2],
fman_intf->mac_addr.addr_bytes[3],
fman_intf->mac_addr.addr_bytes[4],
fman_intf->mac_addr.addr_bytes[5]);
DPAA_PMD_INFO("net: dpaa: %s: %s", dpaa_device->name, eth_buf);

/* Disable RX mode */
fman_if_discard_rx_errors(fman_intf);
Expand Down Expand Up @@ -1500,8 +1494,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
}

if (access("/tmp/fmc.bin", F_OK) == -1) {
RTE_LOG(INFO, PMD,
"* FMC not configured.Enabling default mode\n");
DPAA_PMD_INFO("* FMC not configured.Enabling default mode");
default_q = 1;
}

Expand Down

0 comments on commit 84c30c5

Please sign in to comment.