DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>, dev@dpdk.org
Cc: jijiang.liu@intel.com, stable@dpdk.org
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 6/6] examples/tep_termination: rework the port setup logic
Date: Fri, 10 Apr 2020 17:16:47 +0100	[thread overview]
Message-ID: <2e762dcf-1040-f9e7-eec5-0939e49a3413@intel.com> (raw)
In-Reply-To: <20200402171953.13356-7-stephen@networkplumber.org>

On 4/2/2020 6:19 PM, Stephen Hemminger wrote:
> The handling of ports in this application had many problems.
> It was checking for things that can never happen with current
> DPDK library (like rte_ethdev_avail_count() >= RTE_MAX_ETHPORTS)
> and it was not checking if the port was owned and should
> not be used directly. Also the variable nb_ports was used
> as both local and global variable.
> 
> Fix by rewriting the initialization logic to iterate over
> valid ports and check if there are any leftovers.
> 
> Fixes: a50245ede72a ("examples/tep_term: initialize VXLAN sample")
> Cc: jijiang.liu@intel.com
> Cc: stable@dpdk.org
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  examples/tep_termination/Makefile    |  2 +
>  examples/tep_termination/main.c      | 70 ++++++++++------------------
>  examples/tep_termination/meson.build |  1 +
>  3 files changed, 28 insertions(+), 45 deletions(-)
> 
> diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
> index 645112498d33..f55331fb24c2 100644
> --- a/examples/tep_termination/Makefile
> +++ b/examples/tep_termination/Makefile
> @@ -26,6 +26,7 @@ CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
>  LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
>  LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
>  
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  CFLAGS += -Wno-deprecated-declarations
>  
>  build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
> @@ -61,6 +62,7 @@ endif
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
>  CFLAGS += -Wno-deprecated-declarations
> +CFLAGS += -DALLOW_EXPERIMENTAL_API

Why 'ALLOW_EXPERIMENTAL_API' added in this patch, what is the experimental API
started to use?

<...>

>  
> -	for (portid = 0; portid < nb_ports; portid++) {
> -		if (!rte_eth_dev_is_valid_port(ports[portid])) {
> -			RTE_LOG(INFO, VHOST_PORT,
> -				"\nSpecified port ID(%u) is not valid\n",
> -				ports[portid]);
> -			ports[portid] = INVALID_PORT_ID;

'INVALID_PORT_ID' macro seems can be removed now.

      reply	other threads:[~2020-04-10 16:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 17:20 [dpdk-dev] [PATCH 0/7] checking for owned ports in portmask Stephen Hemminger
2020-03-12 17:20 ` [dpdk-dev] [PATCH 1/7] ethdev: add function to test port ownership Stephen Hemminger
2020-03-15  7:45   ` Matan Azrad
2020-03-12 17:20 ` [dpdk-dev] [PATCH 2/7] examples/l2fwd-cat: block attempts to use owned ports Stephen Hemminger
2020-03-15  7:51   ` Matan Azrad
2020-03-12 17:20 ` [dpdk-dev] [PATCH 3/7] examples/l3fwd: " Stephen Hemminger
2020-03-12 17:20 ` [dpdk-dev] [PATCH 4/7] examples/l3fwd-acl: " Stephen Hemminger
2020-03-12 17:20 ` [dpdk-dev] [PATCH 5/7] examples/l3fwd-power: " Stephen Hemminger
2020-03-12 17:20 ` [dpdk-dev] [PATCH 6/7] examples/tep_termination: " Stephen Hemminger
2020-03-12 17:20 ` [dpdk-dev] [PATCH 7/7] examples/vhost: " Stephen Hemminger
2020-03-16 16:09 ` [dpdk-dev] [PATCH v2 0/6] check for owned ports in portmask Stephen Hemminger
2020-03-16 16:09   ` [dpdk-dev] [PATCH v2 1/6] rte_ethdev: add function to check if device is owned Stephen Hemminger
2020-04-01 21:42     ` Thomas Monjalon
2020-04-01 22:24       ` Stephen Hemminger
2020-04-02  8:04         ` Thomas Monjalon
2020-03-16 16:09   ` [dpdk-dev] [PATCH v2 2/6] examples/l2fwd-cat: block attempts to use owned ports Stephen Hemminger
2020-03-16 16:09   ` [dpdk-dev] [PATCH v2 3/6] examples/l3fwd: " Stephen Hemminger
2020-03-16 16:09   ` [dpdk-dev] [PATCH v2 4/6] examples/l3fwd-acl: " Stephen Hemminger
2020-03-16 16:09   ` [dpdk-dev] [PATCH v2 5/6] examples/l3fwd-power: " Stephen Hemminger
2020-03-16 16:09   ` [dpdk-dev] [PATCH v2 6/6] examples/tep_termination: " Stephen Hemminger
2020-03-17  8:18   ` [dpdk-dev] [PATCH v2 0/6] check for owned ports in portmask Matan Azrad
2020-04-02 17:19 ` [dpdk-dev] [PATCH v3 0/6] checking " Stephen Hemminger
2020-04-02 17:19   ` [dpdk-dev] [PATCH v3 1/6] rte_ethdev: change rte_eth_dev_owner_get to return error if unowned Stephen Hemminger
2020-04-10 15:45     ` Ferruh Yigit
2020-04-02 17:19   ` [dpdk-dev] [PATCH v3 2/6] examples/l2fwd-cat: make applicaton aware of port ownership Stephen Hemminger
2020-04-10 15:47     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2020-04-02 17:19   ` [dpdk-dev] [PATCH v3 3/6] examples/l3fwd: " Stephen Hemminger
2020-04-02 17:19   ` [dpdk-dev] [PATCH v3 4/6] examples/l3fwd-acl: " Stephen Hemminger
2020-04-02 17:19   ` [dpdk-dev] [PATCH v3 5/6] examples/l3fwd-power: " Stephen Hemminger
2020-04-02 17:19   ` [dpdk-dev] [PATCH v3 6/6] examples/tep_termination: rework the port setup logic Stephen Hemminger
2020-04-10 16:16     ` Ferruh Yigit [this message]

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=2e762dcf-1040-f9e7-eec5-0939e49a3413@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=jijiang.liu@intel.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.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).