DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Rastislav Cernay <cernay@netcope.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/nfb: new netcope driver
Date: Tue, 26 Feb 2019 07:46:04 -0800	[thread overview]
Message-ID: <20190226074604.228632d3@shemminger-XPS-13-9360> (raw)
In-Reply-To: <1551185824-5501-2-git-send-email-cernay@netcope.com>

On Tue, 26 Feb 2019 13:57:04 +0100
Rastislav Cernay <cernay@netcope.com> wrote:

> +static void
> +nfb_eth_dev_info(struct rte_eth_dev *dev,
> +	struct rte_eth_dev_info *dev_info)
> +{
> +	dev_info->if_index = 0;
> +	dev_info->max_mac_addrs = 1;
> +	dev_info->max_rx_pktlen = (uint32_t)-1;
> +	dev_info->max_rx_queues = dev->data->nb_rx_queues;
> +	dev_info->max_tx_queues = dev->data->nb_tx_queues;
> +	dev_info->min_rx_bufsize = 0;
> +	dev_info->speed_capa = ETH_LINK_SPEED_100G;
> +}

Minor nit, you don't need to zero entries here, the calling
code (in rte_eth_dev_info_get) already does a memset.

+static int
+nfb_eth_link_update(struct rte_eth_dev *dev,
+	int wait_to_complete __rte_unused)
+{
+	uint16_t i;
+	struct rte_eth_link link;
+	memset(&link, 0, sizeof(link));
+
+	struct pmd_internals *internals = (struct pmd_internals *)
+		dev->data->dev_private;

Since dev_private is a void * cast is unnecessary


+	struct nc_rxmac_status status;
+	status.speed = MAC_SPEED_UNKNOWN;
+
+	link.link_speed = ETH_SPEED_NUM_NONE;
+	link.link_status = ETH_LINK_DOWN;
+	link.link_duplex = ETH_LINK_FULL_DUPLEX;
+	link.link_autoneg = ETH_LINK_SPEED;

Don't mix declarations with code.

You can use C99 structure initialization to avoid memset here.

  parent reply	other threads:[~2019-02-26 15:46 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-26 12:57 [dpdk-dev] [PATCH] net/nfb: new Netcope driver Rastislav Cernay
2019-02-26 12:57 ` [dpdk-dev] [PATCH] net/nfb: new netcope driver Rastislav Cernay
2019-02-26 14:20   ` Rami Rosen
2019-02-26 16:33     ` Rastislav Černay
2019-02-26 15:46   ` Stephen Hemminger [this message]
2019-02-27 11:43   ` [dpdk-dev] [PATCH v2] net/nfb: new Netcope driver Rastislav Cernay
2019-02-27 15:28     ` Ferruh Yigit
2019-03-01 14:37   ` [dpdk-dev] [PATCH v3] net/nfb: new netcope driver Rastislav Cernay
2019-03-01 18:47     ` Stephen Hemminger
2019-03-04 14:07       ` Rastislav Černay
2019-03-01 18:50     ` Stephen Hemminger
2019-03-04  9:53       ` David Marchand
2019-03-04 11:34     ` David Marchand
2019-03-04 14:33       ` Rastislav Černay
2019-03-04 12:35         ` David Marchand
2019-03-04 12:48           ` David Marchand
2019-03-04 15:15             ` Rastislav Černay
2019-03-05 20:31     ` Rami Rosen
2019-03-05 22:41     ` Luca Boccassi
2019-03-06 14:51       ` Rastislav Černay
2019-03-06 13:25         ` Luca Boccassi
2019-03-07 13:24   ` [dpdk-dev] [PATCH v4] " Rastislav Cernay
2019-03-07 13:46     ` Luca Boccassi
2019-03-07 14:14       ` Jan Remeš
2019-03-22 12:12   ` [dpdk-dev] [PATCH v5] " Rastislav Cernay
2019-03-22 12:12     ` Rastislav Cernay
2019-03-28 16:01     ` Ferruh Yigit
2019-03-28 16:01       ` Ferruh Yigit
2019-04-01 14:55       ` Rastislav Černay
2019-04-01 14:22         ` Ferruh Yigit
2019-04-01 14:22           ` Ferruh Yigit
2019-04-02 16:05           ` Rastislav Černay
2019-04-02 16:05             ` Rastislav Černay
2019-04-01 14:23         ` Luca Boccassi
2019-04-01 14:23           ` Luca Boccassi
2019-04-01 14:55         ` Rastislav Černay
2019-04-04  9:05   ` [dpdk-dev] [PATCH v6] " Rastislav Cernay
2019-04-04  9:05     ` Rastislav Cernay
2019-04-05  0:08     ` Ferruh Yigit
2019-04-05  0:08       ` Ferruh Yigit
2019-04-07 15:03   ` [dpdk-dev] [PATCH v7] " Rastislav Cernay
2019-04-07 15:03     ` Rastislav Cernay
2019-04-12 12:15     ` Ferruh Yigit
2019-04-12 12:15       ` Ferruh Yigit
2019-04-12 12:16     ` Ferruh Yigit
2019-04-12 12:16       ` Ferruh Yigit
2019-04-12 14:37   ` [dpdk-dev] [PATCH] net/nfb: remove redundant linking Rastislav Cernay
2019-04-12 14:37     ` Rastislav Cernay
2019-04-12 15:02     ` Ferruh Yigit
2019-04-12 15:02       ` 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=20190226074604.228632d3@shemminger-XPS-13-9360 \
    --to=stephen@networkplumber.org \
    --cc=cernay@netcope.com \
    --cc=dev@dpdk.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).