patches for DPDK stable branches
 help / color / mirror / Atom feed
From: wangyunjian <wangyunjian@huawei.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
	"andrew.rybchenko@oktetlabs.ru" <andrew.rybchenko@oktetlabs.ru>,
	"Lilijun (Jerry)" <jerry.lilijun@huawei.com>,
	xudingke <xudingke@huawei.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v3] ethdev: fix data type for port id
Date: Wed, 4 Nov 2020 01:57:44 +0000	[thread overview]
Message-ID: <34EFBCA9F01B0748BEB6B629CE643AE60DAF1197@dggemm513-mbx.china.huawei.com> (raw)
In-Reply-To: <16713936.kKKOxVssse@thomas>

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Wednesday, November 4, 2020 2:44 AM
> To: wangyunjian <wangyunjian@huawei.com>
> Cc: dev@dpdk.org; ferruh.yigit@intel.com; andrew.rybchenko@oktetlabs.ru;
> Lilijun (Jerry) <jerry.lilijun@huawei.com>; xudingke <xudingke@huawei.com>;
> stable@dpdk.org
> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v3] ethdev: fix data type for port id
> 
> 02/11/2020 10:18, wangyunjian:
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > The ethdev port id is 16 bits now. This patch fixes the data type of
> > the variable for 'pid', which changing from uint32_t to uint16_t.
> >
> > RTE_MAX_ETHPORTS is the maximum number of ports, which customized by
> > the user. To avoid 16-bit unsigned integer overflow, the valid value
> > of RTE_MAX_ETHPORTS should be set from 0 to UINT16_MAX, and it is
> > safer to cut one more port from space.
> >
> > So we use RTE_BUILD_BUG_ON() to ensure that RTE_MAX_ETHPORTS is less
> > to UINT16_MAX.
> >
> > Fixes: 5b7ba31148a8 ("ethdev: add port ownership")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> > v3:
> >    fix code styles suggested by Thomas Monjalon and Andrew Rybchenko
> 
> I don't understand why you add the compile check in several place.
> We should just find one good place for checking RTE_MAX_ETHPORTS at
> compilation time.
> 
> I suggest rte_eth_find_next() or rte_eth_dev_allocate().
> Or maybe rte_eth_dev_is_valid_port().
> 
> Please choose only one.
> 
OK, I will add the compile check in function rte_eth_dev_allocate().

Thanks
Yunjian


  parent reply	other threads:[~2020-11-04  1:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 12:24 [dpdk-stable] [dpdk-dev] [PATCH] " wangyunjian
2020-10-26 12:29 ` Andrew Rybchenko
2020-10-27 13:41 ` [dpdk-stable] [dpdk-dev] [PATCH v2] " wangyunjian
2020-10-27 14:29   ` Thomas Monjalon
2020-10-29 12:18     ` wangyunjian
2020-10-29 12:40       ` Andrew Rybchenko
2020-10-29 12:43       ` Thomas Monjalon
2020-11-02  9:18   ` [dpdk-stable] [dpdk-dev] [PATCH v3] " wangyunjian
2020-11-03 18:44     ` Thomas Monjalon
2020-11-03 23:42       ` Stephen Hemminger
2020-11-04  1:57       ` wangyunjian [this message]
2020-11-04  2:57     ` [dpdk-stable] [dpdk-dev] [PATCH v4] " wangyunjian
2020-11-04  3:26       ` Ajit Khaparde
2020-11-04 11:46         ` Ferruh Yigit
2020-11-04 13:49           ` 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=34EFBCA9F01B0748BEB6B629CE643AE60DAF1197@dggemm513-mbx.china.huawei.com \
    --to=wangyunjian@huawei.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerry.lilijun@huawei.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=xudingke@huawei.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).