All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Gagandeep Singh <g.singh@nxp.com>, dev@dpdk.org
Cc: pankaj.chauhan@nxp.com
Subject: Re: [PATCH v4 1/4] net/enetc: add ENETC PMD with basic operations
Date: Mon, 1 Oct 2018 16:58:38 +0100	[thread overview]
Message-ID: <db79de59-85cb-22f3-3aae-c17ab7a25eee@intel.com> (raw)
In-Reply-To: <20180928074601.4287-2-g.singh@nxp.com>

On 9/28/2018 8:45 AM, Gagandeep Singh wrote:
> This patch introduces the enetc PMD with basic
> initialisation functions includes probe, teardown,
> hardware initialisation
> 
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>

<...>

> +struct enetc_eth_mac_info {
> +	uint8_t addr[ETH_ADDR_LEN];
> +	uint8_t perm_addr[ETH_ADDR_LEN];

Can reuse DPDK ETHER_ADDR_LEN for this instead of re-defining? (You can skip if
this is coming from a common code and you need to maintain the difference
yourself for this change.)

<...>

> +static int
> +enetc_dev_init(struct rte_eth_dev *eth_dev)
> +{
> +	int error = 0;
> +	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
> +	struct enetc_eth_hw *hw =
> +		ENETC_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
> +
> +	PMD_INIT_FUNC_TRACE();
> +	eth_dev->dev_ops = &enetc_ops;
> +	eth_dev->rx_pkt_burst = NULL;
> +	eth_dev->tx_pkt_burst = NULL;
> +
> +	/* Retrieving and storing the HW base address of device */
> +	hw->hw.reg = (void *)pci_dev->mem_resource[0].addr;
> +	hw->device_id = pci_dev->id.device_id;
> +
> +	error = enetc_hardware_init(hw);
> +	if (error != 0) {
> +		ENETC_PMD_ERR("Hardware initialization failed");
> +		return -1;
> +	}
> +
> +	/* Allocate memory for storing MAC addresses */
> +	eth_dev->data->mac_addrs = rte_zmalloc("enetc_eth", ETHER_ADDR_LEN, 0);
> +	if (!eth_dev->data->mac_addrs) {
> +		ENETC_PMD_ERR("Failed to allocate %d bytes needed to "
> +			      "store MAC addresses",
> +			      ETHER_ADDR_LEN * 1);
> +		error = -ENOMEM;
> +		return -1;
> +	}

Need to free eth_dev->data->mac_addrs on uninit()

<...>

> +static int
> +enetc_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
> +{
> +	struct enetc_eth_hw *hw =
> +		ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +	struct rte_eth_link link;
> +
> +	PMD_INIT_FUNC_TRACE();
> +	hw->mac.get_link_status = 1;
> +
> +	memset(&link, 0, sizeof(link));
> +	rte_eth_linkstatus_get(dev, &link);
> +
> +	link.link_duplex = ETH_LINK_FULL_DUPLEX;
> +	link.link_status = ETH_LINK_UP;
> +	rte_eth_linkstatus_set(dev, &link);

rte_eth_linkstatus_get() / rte_eth_linkstatus_set() updates variables that holds
the status of the link, but this PMD function should update the HW link status
not just the state.

<...>

> +/* DP Logs, toggled out at compile time if level lower than current level */
> +#define ENETC_PMD_DP_LOG(level, fmt, args...) \
> +	RTE_LOG_DP(level, PMD, fmt, ## args)
> +
> +#define ENETC_PMD_DP_DEBUG(fmt, args...) \
> +	ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
> +#define ENETC_PMD_DP_INFO(fmt, args...) \
> +	ENETC_PMD_DP_LOG(INFO, fmt, ## args)
> +#define ENETC_PMD_DP_WARN(fmt, args...) \
> +	ENETC_PMD_DP_LOG(WARNING, fmt, ## args)

What about adding DP logs when you need them?

  reply	other threads:[~2018-10-01 15:59 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  5:54 [PATCH 0/3] introduces the ENETC PMD Gagandeep Singh
2018-09-06  5:54 ` [PATCH 1/3] doc: add usage doc for " Gagandeep Singh
2018-09-06  5:54 ` [PATCH 2/3] net/enetc: add ENETC PMD with basic operations Gagandeep Singh
2018-09-19 12:15   ` Shreyansh Jain
2018-09-06  5:54 ` [PATCH 3/3] net/enetc: enable Rx and Tx Gagandeep Singh
2018-09-13  9:41 ` [PATCH v2 0/3] introduces the enetc PMD driver Gagandeep Singh
2018-09-13  9:41   ` [PATCH v2 1/3] doc: add usage doc for ENETC PMD Gagandeep Singh
2018-09-21 13:22     ` Ferruh Yigit
2018-09-13  9:42   ` [PATCH v2 2/3] net/enetc: add ENETC PMD with basic operations Gagandeep Singh
2018-09-21 13:27     ` Ferruh Yigit
2018-09-13  9:42   ` [PATCH v2 3/3] net/enetc: enable Rx and Tx Gagandeep Singh
2018-09-19 12:26     ` Shreyansh Jain
2018-09-21 13:28     ` Ferruh Yigit
2018-09-28  5:16   ` [PATCH v3 0/3] introduces the enetc PMD driver Gagandeep Singh
2018-09-28  5:16     ` [PATCH v3 1/3] net/enetc: enable Rx and Tx Gagandeep Singh
2018-09-28  5:16     ` [PATCH v3 2/3] net/enetc: support packet parse type Gagandeep Singh
2018-09-28  5:16     ` [PATCH v3 3/3] doc: add usage doc for ENETC PMD Gagandeep Singh
2018-09-28  5:26     ` [PATCH v3 0/3] introduces the enetc PMD driver Gagandeep Singh
2018-09-28  7:45     ` [PATCH v4 0/4] " Gagandeep Singh
2018-09-28  7:45       ` [PATCH v4 1/4] net/enetc: add ENETC PMD with basic operations Gagandeep Singh
2018-10-01 15:58         ` Ferruh Yigit [this message]
2018-09-28  7:45       ` [PATCH v4 2/4] net/enetc: enable Rx and Tx Gagandeep Singh
2018-10-01 15:59         ` Ferruh Yigit
2018-09-28  7:46       ` [PATCH v4 3/4] net/enetc: support packet parse type Gagandeep Singh
2018-09-28 10:17         ` Shreyansh Jain
2018-10-01 15:59           ` Ferruh Yigit
2018-09-28  7:46       ` [PATCH v4 4/4] doc: add usage doc for ENETC PMD Gagandeep Singh
2018-10-01 16:00         ` Ferruh Yigit
2018-09-28 10:36       ` [PATCH v4 0/4] introduces the enetc PMD driver Shreyansh Jain
2018-10-03 13:36       ` [PATCH v5 " Gagandeep Singh
2018-10-03 13:36         ` [PATCH v5 1/4] net/enetc: add ENETC PMD with basic operations Gagandeep Singh
2018-10-03 19:47           ` Ferruh Yigit
2018-10-03 13:36         ` [PATCH v5 2/4] net/enetc: enable Rx and Tx Gagandeep Singh
2018-10-03 13:36         ` [PATCH v5 3/4] net/enetc: support packet parse type Gagandeep Singh
2018-10-03 13:36         ` [PATCH v5 4/4] doc: add usage doc for ENETC PMD Gagandeep Singh
2018-10-03 19:47           ` Ferruh Yigit
2018-10-03 19:48         ` [PATCH v5 0/4] introduces the enetc PMD driver Ferruh Yigit
2018-11-21 17:36           ` Ferruh Yigit
2018-11-22 10:34             ` Shreyansh Jain
2018-11-22 12:08               ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db79de59-85cb-22f3-3aae-c17ab7a25eee@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=pankaj.chauhan@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.