DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: Zhiyong Yang <zhiyong.yang@intel.com>
Cc: dev@dpdk.org, thomas@monjalon.net, ferruh.yigit@intel.com,
	hemant.agrawal@nxp.com, david.hunt@intel.com
Subject: Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range
Date: Mon, 11 Sep 2017 11:37:02 +0200	[thread overview]
Message-ID: <20170911093702.GD2481@6wind.com> (raw)
In-Reply-To: <20170909144727.46388-2-zhiyong.yang@intel.com>

Hi Zhiyong,

On Sat, Sep 09, 2017 at 10:47:24PM +0800, Zhiyong Yang wrote:
> Extend port_id definition from uint8_t to uint16_t in lib and drivers
> data structures, specifically rte_eth_dev_data.
> Modify the APIs, drivers and app using port_id at the same time.
> 
> Fix some checkpatch issues from the original code and remove some
> unnecessary cast operations.
> 
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>

Thanks for the mlx4/mlx5 update, I have some comments, see below.

By the way, since this commit breaks ABI compatibility for pretty much all
public functions in librte_ether and a few in other places, remember to
update rte_ethdev_version.map and other affected .map files accordingly.
I think this change has to be part of this series.

<snip>
> diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
> index c0ade4f1a..fe911c3a7 100644
> --- a/drivers/net/mlx4/mlx4.h
> +++ b/drivers/net/mlx4/mlx4.h
> @@ -334,7 +334,7 @@ struct priv {
>  	} vlan_filter[MLX4_MAX_VLAN_IDS]; /* VLAN filters table. */
>  	/* Device properties. */
>  	uint16_t mtu; /* Configured MTU. */
> -	uint8_t port; /* Physical port number. */
> +	uint16_t port; /* Physical port number. */
>  	unsigned int started:1; /* Device started, flows enabled. */
>  	unsigned int promisc:1; /* Device in promiscuous mode. */
>  	unsigned int allmulti:1; /* Device receives all multicast packets. */

This is a physical port number internal to the device, not DPDK's. Please
drop this change.

What would need change is struct rxq's port_id field (already large enough)
if you want to enforce uint16_t everywhere.

> diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
> index 43c538419..54a2e8a54 100644
> --- a/drivers/net/mlx5/mlx5.h
> +++ b/drivers/net/mlx5/mlx5.h
> @@ -114,7 +114,7 @@ struct priv {
>  	unsigned int vlan_filter_n; /* Number of configured VLAN filters. */
>  	/* Device properties. */
>  	uint16_t mtu; /* Configured MTU. */
> -	uint8_t port; /* Physical port number. */
> +	uint16_t port; /* Physical port number. */

Same comment here.

>  	unsigned int started:1; /* Device started, flows enabled. */
>  	unsigned int promisc_req:1; /* Promiscuous mode requested. */
>  	unsigned int allmulti_req:1; /* All multicast mode requested. */
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
> index b0eb3cdfc..58e7cf571 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -75,7 +75,7 @@ struct ethtool_link_settings {
>  	uint32_t cmd;
>  	uint32_t speed;
>  	uint8_t duplex;
> -	uint8_t port;
> +	uint16_t port;

This is the ethtool interface from the Linux kernel, again this field has to
remain 8 bits.

That's the kind of mistakes a dedicated type might have prevented by the
way, I'm still not convinced that not adding one was the right decision.

>  	uint8_t phy_address;
>  	uint8_t autoneg;
>  	uint8_t mdio_support;
> diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
> index 7de1d1086..c47e54fe0 100644
> --- a/drivers/net/mlx5/mlx5_rxtx.h
> +++ b/drivers/net/mlx5/mlx5_rxtx.h
> @@ -112,7 +112,6 @@ struct rxq {
>  	unsigned int sges_n:2; /* Log 2 of SGEs (max buffers per packet). */
>  	unsigned int cqe_n:4; /* Log 2 of CQ elements. */
>  	unsigned int elts_n:4; /* Log 2 of Mbufs. */
> -	unsigned int port_id:8;
>  	unsigned int rss_hash:1; /* RSS hash result is enabled. */
>  	unsigned int mark:1; /* Marked flow available on the queue. */
>  	unsigned int pending_err:1; /* CQE error needs to be handled. */
> @@ -120,6 +119,7 @@ struct rxq {
>  	unsigned int :6; /* Remaining bits. */
>  	volatile uint32_t *rq_db;
>  	volatile uint32_t *cq_db;
> +	uint16_t port_id;
>  	uint16_t rq_ci;
>  	uint16_t rq_pi;
>  	uint16_t cq_ci;

This change might have a performance impact. All important fields are found
at the beginning of this structure for that reason. Since there's not enough
room in the above bit-field (8 + 6), I guess there's no other choice for
now, however you should at least update the "Remaining bits" comment.

<snip>

-- 
Adrien Mazarguil
6WIND

  reply	other threads:[~2017-09-11  9:37 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  8:42 [dpdk-dev] [PATCH 0/2] " Zhiyong Yang
2017-08-09  8:42 ` [dpdk-dev] [PATCH 1/2] ethdev: " Zhiyong Yang
2017-08-09 12:52   ` Ferruh Yigit
2017-08-09 12:57     ` Wiles, Keith
2017-08-10  0:53       ` Yang, Zhiyong
2017-08-10  0:51     ` Yang, Zhiyong
2017-08-09  8:42 ` [dpdk-dev] [PATCH 2/2] examples: " Zhiyong Yang
2017-08-09 14:48   ` Stephen Hemminger
2017-08-10  1:03     ` Yang, Zhiyong
2017-08-09  9:00 ` [dpdk-dev] [PATCH 0/2] " De Lara Guarch, Pablo
2017-08-09  9:17   ` Yang, Zhiyong
2017-09-04  5:57 ` [dpdk-dev] [PATCH v2 0/4] " Zhiyong Yang
2017-09-04  5:57   ` [dpdk-dev] [PATCH v2 1/4] ethdev: " Zhiyong Yang
2017-09-04  9:06     ` Bruce Richardson
2017-09-04  9:29       ` Ferruh Yigit
2017-09-04  9:47         ` Yang, Zhiyong
2017-09-04 13:12           ` Adrien Mazarguil
2017-09-04 13:17             ` Richardson, Bruce
2017-09-04 13:36               ` Adrien Mazarguil
2017-09-04 13:59                 ` Yang, Zhiyong
2017-09-04 14:41                   ` Adrien Mazarguil
2017-09-05  6:51       ` Yang, Zhiyong
2017-09-06  8:32     ` Hemant Agrawal
2017-09-06  8:48       ` Yang, Zhiyong
     [not found]     ` <CALZ3Guikt9x8sz-oEKCuDCSp_wtKa64bSXTrMhqcWyg7f_dS7g@mail.gmail.com>
2017-09-07  0:45       ` Yang, Zhiyong
2017-09-04  5:57   ` [dpdk-dev] [PATCH v2 2/4] examples: " Zhiyong Yang
2017-09-04 14:15     ` Hunt, David
2017-09-04 15:01       ` Yang, Zhiyong
2017-09-04  5:57   ` [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 Zhiyong Yang
2017-09-04  7:46     ` Yao, Lei A
2017-09-04  7:59       ` Yang, Zhiyong
2017-09-04  9:09         ` Bruce Richardson
2017-09-04 10:05           ` Yang, Zhiyong
2017-09-04 10:27             ` Ananyev, Konstantin
2017-09-04 14:18               ` Yang, Zhiyong
2017-09-06  8:42               ` Hemant Agrawal
2017-09-06  8:52                 ` Yang, Zhiyong
2017-09-04 10:29             ` Bruce Richardson
2017-09-04  9:27       ` Ananyev, Konstantin
2017-09-04  5:57   ` [dpdk-dev] [PATCH v2 4/4] testpmd: add flexibility to mbuf allocation Zhiyong Yang
2017-09-09 14:47   ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang
2017-09-09 14:47     ` [dpdk-dev] [PATCH v3 1/4] ethdev: " Zhiyong Yang
2017-09-11  9:37       ` Adrien Mazarguil [this message]
2017-09-11 10:51         ` Yang, Zhiyong
2017-09-11 10:21       ` Ferruh Yigit
2017-09-13  2:26         ` Yang, Zhiyong
2017-09-13 11:56           ` Ferruh Yigit
2017-09-13 12:15             ` Yang, Zhiyong
2017-09-13 12:18             ` Thomas Monjalon
2017-09-13 13:33               ` Ferruh Yigit
2017-09-19  6:05                 ` Yang, Zhiyong
2017-09-19 12:30                   ` Wiles, Keith
2017-09-14 12:49           ` Ferruh Yigit
2017-09-15  5:11             ` Yang, Zhiyong
2017-09-09 14:47     ` [dpdk-dev] [PATCH v3 2/4] test: " Zhiyong Yang
2017-09-09 14:47     ` [dpdk-dev] [PATCH v3 3/4] examples: " Zhiyong Yang
2017-09-14 14:41       ` Ferruh Yigit
2017-09-09 14:47     ` [dpdk-dev] [PATCH v3 4/4] librte_mbuf: modify port initialization value Zhiyong Yang
2017-09-11 10:23     ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Ferruh Yigit
2017-09-11 11:25       ` Yang, Zhiyong
2017-09-13  8:14       ` Matej Vido
2017-09-13  8:21         ` Yang, Zhiyong
2017-09-18 14:54           ` Laatz, Kevin
2017-09-19  1:39             ` Yang, Zhiyong
2017-09-11 10:26     ` Ferruh Yigit
2017-09-11 10:55       ` Yang, Zhiyong
2017-09-11 11:24         ` Ferruh Yigit
2017-09-21  8:32     ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang
2017-09-21  8:32       ` [dpdk-dev] [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang
2017-09-21 10:36         ` Ferruh Yigit
2017-09-22  2:02           ` Yang, Zhiyong
2017-09-21  8:32       ` [dpdk-dev] [PATCH v4 2/5] ethdev: increase port_id range Zhiyong Yang
2017-09-21 11:49         ` Adrien Mazarguil
2017-10-06 14:34           ` Nélio Laranjeiro
2017-09-21  8:32       ` [dpdk-dev] [PATCH v4 3/5] examples: " Zhiyong Yang
2017-09-21  8:32       ` [dpdk-dev] [PATCH v4 4/5] test: " Zhiyong Yang
2017-09-21  8:32       ` [dpdk-dev] [PATCH v4 5/5] librte_mbuf: modify port initialization value Zhiyong Yang
2017-09-25  3:22       ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang
2017-09-25  3:22         ` [dpdk-dev] [PATCH v5 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang
2017-09-25 11:34           ` Ferruh Yigit
2017-09-25  3:22         ` [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range Zhiyong Yang
2017-09-25 11:37           ` Ferruh Yigit
2017-09-25 12:06           ` Ferruh Yigit
2017-09-26  7:01             ` Yang, Zhiyong
2017-09-27 18:44               ` Ferruh Yigit
2017-09-28  2:12                 ` Yang, Zhiyong
2017-09-25  3:22         ` [dpdk-dev] [PATCH v5 3/5] examples: " Zhiyong Yang
2017-09-25  3:22         ` [dpdk-dev] [PATCH v5 4/5] test: " Zhiyong Yang
2017-09-25  3:22         ` [dpdk-dev] [PATCH v5 5/5] librte_mbuf: modify port initialization value Zhiyong Yang
2017-09-29  7:17         ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang
2017-09-29  7:17           ` [dpdk-dev] [PATCH v6 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang
2017-09-29  7:17           ` [dpdk-dev] [PATCH v6 2/5] ethdev: increase port_id range Zhiyong Yang
2017-09-29  7:17           ` [dpdk-dev] [PATCH v6 3/5] examples: " Zhiyong Yang
2017-09-29  7:17           ` [dpdk-dev] [PATCH v6 4/5] test: " Zhiyong Yang
2017-09-29  7:17           ` [dpdk-dev] [PATCH v6 5/5] librte_mbuf: modify port initialization value Zhiyong Yang
2017-10-06  2:15           ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Ferruh Yigit
2017-10-06 13:31             ` Gaëtan Rivet
2017-10-06 14:29             ` Thomas Monjalon
2017-10-06 16:02             ` Thomas Monjalon
2017-10-11 21:21             ` Ferruh Yigit
2017-10-12  1:33               ` Yang, Zhiyong

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=20170911093702.GD2481@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=thomas@monjalon.net \
    --cc=zhiyong.yang@intel.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 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).