DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wang, YuanX" <yuanx.wang@intel.com>
To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	"Singh, Aman Deep" <aman.deep.singh@intel.com>,
	"Zhang, Yuying" <yuying.zhang@intel.com>
Cc: "Ding, Xuan" <xuan.ding@intel.com>,
	"Tang, Yaqi" <yaqi.tang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH v4] app/testpmd: fix protocol header display for Rx buffer split
Date: Thu, 10 Nov 2022 07:49:05 +0000	[thread overview]
Message-ID: <PH7PR11MB6953F8DD08A0770C56BE7E6685019@PH7PR11MB6953.namprd11.prod.outlook.com> (raw)
In-Reply-To: <9822082f-27ac-c2e3-7225-6acbe8ecc6fa@oktetlabs.ru>

Hi Andrew,

> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: Thursday, November 10, 2022 2:56 PM
> To: Wang, YuanX <yuanx.wang@intel.com>; Singh, Aman Deep
> <aman.deep.singh@intel.com>; Zhang, Yuying <yuying.zhang@intel.com>
> Cc: Ding, Xuan <xuan.ding@intel.com>; Tang, Yaqi <yaqi.tang@intel.com>;
> dev@dpdk.org
> Subject: Re: [PATCH v4] app/testpmd: fix protocol header display for Rx
> buffer split
> 
> On 11/9/22 04:37, Yuan Wang wrote:
> > The "show config rxhdrs" cmd displays the configured protocol headers
> > that are used for protocol-based buffer split.
> > However, it shows inner-ipv6 as inner-ipv4.
> >
> > This patch fixes that by redefining rx_pkt_hdr_protos to hold the full
> > ptypes, and the show and set commands therefore remain symmetrical.
> >
> > Fixes: 52e2e7edcf48 ("app/testpmd: add protocol-based buffer split")
> >
> > Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
> >
> > ---
> > v4:
> > - redefine rx_pkt_hdr_protos to hold the full ptypes.
> > - use single switch in get_ptype_str().
> > v3:
> > - use RTE_PTYPE_*_MASK as masks.
> > - refactor to use switch statement.
> > v2:
> > - add fixline.
> >
> > ---
> >   app/test-pmd/cmdline.c |  12 ++--
> >   app/test-pmd/config.c  | 141 +++++++++++++++++++++--------------------
> >   app/test-pmd/testpmd.c |   5 +-
> >   3 files changed, 82 insertions(+), 76 deletions(-)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > 3fbcb6ca8f..f7df24f105 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -3443,20 +3443,16 @@ parse_hdrs_list(const char *str, const char
> *item_name, unsigned int max_items,
> >   				unsigned int *parsed_items)
> >   {
> >   	unsigned int nb_item;
> > -	char *cur;
> > -	char *tmp;
> > -	unsigned int cur_item, prev_items = 0;
> > +	char *cur, *tmp;
> 
> above line is unrelated changes

Sorry for the unrelated changes, they will be removed in the new version.

> 
> > +	char *str2;
> >
> >   	nb_item = 0;
> > -	char *str2 = strdup(str);
> > +	str2 = strdup(str);
> 
> I've failed to find where str2 is freed.

This is also an unrelated change to make the code to follow the code style. It is not a new variable that has been freed in the code.
The change will be removed to make the patch clean.

> 
> >   	cur = strtok_r(str2, ",", &tmp);
> >   	while (cur != NULL) {
> > -		cur_item = get_ptype(cur);
> > -		cur_item &= ~prev_items;
> > -		parsed_items[nb_item] = cur_item;
> > +		parsed_items[nb_item] = get_ptype(cur);
> >   		cur = strtok_r(NULL, ",", &tmp);
> >   		nb_item++;
> > -		prev_items |= cur_item;
> >   	}
> >   	if (nb_item > max_items)
> >   		fprintf(stderr, "Number of %s = %u > %u (maximum
> items)\n", diff

[...]


> >
> >   void
> > @@ -5169,6 +5175,7 @@ set_rx_pkt_hdrs(unsigned int *seg_hdrs,
> unsigned
> > int nb_segs)
> >
> >   	for (i = 0; i < nb_segs; i++)
> >   		rx_pkt_hdr_protos[i] = (uint32_t)seg_hdrs[i];
> > +
> >   	/*
> >   	 * We calculate the number of hdrs, but payload is not included,
> >   	 * so rx_pkt_nb_segs would increase 1.
> > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> > 7381dfd9e5..b4a1fb360f 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -2654,6 +2654,7 @@ rx_queue_setup(uint16_t port_id, uint16_t
> rx_queue_id,
> >   {
> >   	union rte_eth_rxseg rx_useg[MAX_SEGS_BUFFER_SPLIT] = {};
> >   	unsigned int i, mp_n;
> > +	uint32_t prev_hdrs = 0;
> >   	int ret;
> >
> >   	if (rx_pkt_nb_segs <= 1 ||
> > @@ -2668,6 +2669,7 @@ rx_queue_setup(uint16_t port_id, uint16_t
> rx_queue_id,
> >   	for (i = 0; i < rx_pkt_nb_segs; i++) {
> >   		struct rte_eth_rxseg_split *rx_seg = &rx_useg[i].split;
> >   		struct rte_mempool *mpx;
> > +
> 
> unrelated changes, avoid it

Will fix in v5.

Thanks,
Yuan



  reply	other threads:[~2022-11-10  7:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17 17:40 [PATCH] app/testpmd: fix protocol headers " Yuan Wang
2022-10-17 10:03 ` Tang, Yaqi
2022-10-18 14:50 ` [PATCH v2] " Yuan Wang
2022-10-28  2:04   ` Wang, YuanX
2022-11-06  9:58   ` Andrew Rybchenko
2022-11-07  5:55     ` Wang, YuanX
2022-11-07  8:45 ` [PATCH v3] app/testpmd: fix protocol header " Yuan Wang
2022-11-07  8:51   ` Tang, Yaqi
2022-11-07 11:31   ` Andrew Rybchenko
2022-11-08 13:53     ` Wang, YuanX
2022-11-09  1:37 ` [PATCH v4] " Yuan Wang
2022-11-10  6:55   ` Andrew Rybchenko
2022-11-10  7:49     ` Wang, YuanX [this message]
2022-11-10  8:20 ` [PATCH v5] " Yuan Wang
2022-11-10  8:54   ` Andrew Rybchenko

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=PH7PR11MB6953F8DD08A0770C56BE7E6685019@PH7PR11MB6953.namprd11.prod.outlook.com \
    --to=yuanx.wang@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=xuan.ding@intel.com \
    --cc=yaqi.tang@intel.com \
    --cc=yuying.zhang@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).