DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Lance Richardson <lance.richardson@broadcom.com>,
	Steve Yang <stevex.yang@intel.com>
Cc: dev@dpdk.org, Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>
Subject: Re: [dpdk-dev] [PATCH v4 02/22] app/testpmd: fix max rx packet length for VLAN packets
Date: Mon, 25 Jan 2021 12:14:23 +0000
Message-ID: <a591a083-4130-f516-be9e-d2297c8eec1e@intel.com> (raw)
In-Reply-To: <CADyeNECVU-w0nXxU4ib-4zikyBWvrnDzC4vRcVF2DgTfsiSJug@mail.gmail.com>

On 1/21/2021 3:27 PM, Lance Richardson wrote:
> On Mon, Jan 18, 2021 at 2:08 AM Steve Yang <stevex.yang@intel.com> wrote:
>>
>> When the max rx packet length is smaller than the sum of mtu size and
>> ether overhead size, it should be enlarged, otherwise the VLAN packets
>> will be dropped.
>>
>> Removed the rx_offloads assignment for jumbo frame during command line
>> parsing, and set the correct jumbo frame flag if MTU size is larger than
>> the default value 'RTE_ETHER_MTU' within 'init_config()'.
>>
>> Fixes: 384161e00627 ("app/testpmd: adjust on the fly VLAN configuration")
>> Fixes: 35b2d13fd6fd ("net: add rte prefix to ether defines")
>> Fixes: ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
>> Fixes: 150c9ac2df13 ("app/testpmd: update Rx offload after setting MTU")
>>
>> Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
>> Cc: Beilei Xing <beilei.xing@intel.com>
>> Cc: Bernard Iremonger <bernard.iremonger@intel.com>
>>
>> Signed-off-by: Steve Yang <stevex.yang@intel.com>
>> ---
>>   app/test-pmd/cmdline.c    |  6 ------
>>   app/test-pmd/config.c     |  2 +-
>>   app/test-pmd/parameters.c |  7 ++-----
>>   app/test-pmd/testpmd.c    | 18 ++++++++++++++++++
>>   4 files changed, 21 insertions(+), 12 deletions(-)
>>
>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
>> index 2ccbaa039e..65042fcff5 100644
>> --- a/app/test-pmd/cmdline.c
>> +++ b/app/test-pmd/cmdline.c
>> @@ -1886,7 +1886,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
>>
>>          RTE_ETH_FOREACH_DEV(pid) {
>>                  struct rte_port *port = &ports[pid];
>> -               uint64_t rx_offloads = port->dev_conf.rxmode.offloads;
>>
>>                  if (!strcmp(res->name, "max-pkt-len")) {
>>                          if (res->value < RTE_ETHER_MIN_LEN) {
>> @@ -1898,11 +1897,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
>>                                  return;
>>
>>                          port->dev_conf.rxmode.max_rx_pkt_len = res->value;
>> -                       if (res->value > RTE_ETHER_MAX_LEN)
>> -                               rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
>> -                       else
>> -                               rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
>> -                       port->dev_conf.rxmode.offloads = rx_offloads;
>>                  } else {
>>                          printf("Unknown parameter\n");
>>                          return;
>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
>> index 3f6c8642b1..1195f054f3 100644
>> --- a/app/test-pmd/config.c
>> +++ b/app/test-pmd/config.c
>> @@ -1434,7 +1434,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
>>                   * device supports jumbo frame.
>>                   */
>>                  eth_overhead = dev_info.max_rx_pktlen - dev_info.max_mtu;
>> -               if (mtu > RTE_ETHER_MAX_LEN - eth_overhead) {
>> +               if (mtu > RTE_ETHER_MTU) {
>>                          rte_port->dev_conf.rxmode.offloads |=
>>                                                  DEV_RX_OFFLOAD_JUMBO_FRAME;
>>                          rte_port->dev_conf.rxmode.max_rx_pkt_len =
>> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
>> index 414a0068fb..df5eb10d84 100644
>> --- a/app/test-pmd/parameters.c
>> +++ b/app/test-pmd/parameters.c
>> @@ -834,12 +834,9 @@ launch_args_parse(int argc, char** argv)
>>                          }
>>                          if (!strcmp(lgopts[opt_idx].name, "max-pkt-len")) {
>>                                  n = atoi(optarg);
>> -                               if (n >= RTE_ETHER_MIN_LEN) {
>> +                               if (n >= RTE_ETHER_MIN_LEN)
>>                                          rx_mode.max_rx_pkt_len = (uint32_t) n;
>> -                                       if (n > RTE_ETHER_MAX_LEN)
>> -                                               rx_offloads |=
>> -                                                       DEV_RX_OFFLOAD_JUMBO_FRAME;
>> -                               } else
>> +                               else
>>                                          rte_exit(EXIT_FAILURE,
>>                                                   "Invalid max-pkt-len=%d - should be > %d\n",
>>                                                   n, RTE_ETHER_MIN_LEN);
>> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
>> index 2b60f6c5d3..c256e719ae 100644
>> --- a/app/test-pmd/testpmd.c
>> +++ b/app/test-pmd/testpmd.c
>> @@ -1410,6 +1410,7 @@ init_config(void)
>>          struct rte_gro_param gro_param;
>>          uint32_t gso_types;
>>          uint16_t data_size;
>> +       uint16_t eth_overhead;
>>          bool warning = 0;
>>          int k;
>>          int ret;
>> @@ -1446,6 +1447,23 @@ init_config(void)
>>                          rte_exit(EXIT_FAILURE,
>>                                   "rte_eth_dev_info_get() failed\n");
>>
>> +               /* Update the max_rx_pkt_len to have MTU as RTE_ETHER_MTU */
>> +               if (port->dev_info.max_mtu != UINT16_MAX &&
>> +                   port->dev_info.max_rx_pktlen > port->dev_info.max_mtu)
>> +                       eth_overhead = port->dev_info.max_rx_pktlen -
>> +                               port->dev_info.max_mtu;
>> +               else
>> +                       eth_overhead =
>> +                               RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
>> +
>> +               if (port->dev_conf.rxmode.max_rx_pkt_len <=
>> +                       (uint32_t)(RTE_ETHER_MTU + eth_overhead))
>> +                       port->dev_conf.rxmode.max_rx_pkt_len =
>> +                                       RTE_ETHER_MTU + eth_overhead;
>> +               else
>> +                       port->dev_conf.rxmode.offloads |=
>> +                                       DEV_RX_OFFLOAD_JUMBO_FRAME;
>> +
>>                  if (!(port->dev_info.tx_offload_capa &
>>                        DEV_TX_OFFLOAD_MBUF_FAST_FREE))
>>                          port->dev_conf.txmode.offloads &=
>> --
>> 2.17.1
>>
> 
> Moving the setting of DEV_RX_OFFLOAD_JUMBO_FRAME from
> cmd_config_max_pkt_len_parsed() to init_config() doesn't seem to
> be correct for the case where max_rx_pkt_len is changed from the
> command line via "port config all max-pkt-len".
> 
> The init_config() function is only called when testpmd is started,
> but the DEV_RX_OFFLOAD_JUMBO_FRAME setting needs to
> be recomputed whenever max_rx_pkt_len changes.
> 

Hi Lance,

You are right, there is a patch trying to fix the command, can you please review it?
https://patches.dpdk.org/project/dpdk/list/?series=14925


> (Of course this won't matter when DEV_RX_OFFLOAD_JUMBO_FRAME
> is removed, which seems like a great idea, but for now this is impacting
> some test automation with 21.02-rc1.)
> 


  parent reply	other threads:[~2021-01-25 12:14 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09  3:16 [dpdk-dev] [PATCH v1 00/12] fix rx packets dropped issue Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 01/12] net/dpaa2: fix the jumbo frame flag condition for mtu set Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 02/12] net/e1000: " Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 03/12] net/hns3: " Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 04/12] net/i40e: fix the jumbo frame flag condition Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 05/12] net/iavf: " Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 06/12] net/ice: " Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 07/12] net/ipn3ke: fix the jumbo frame flag condition for mtu set Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 08/12] net/octeontx: " Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 09/12] net/octeontx2: fix the jumbo frame flag condition for mtu Steve Yang
2020-12-21  7:16   ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 10/12] net/qede: fix the jumbo frame flag condition for mtu set Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 11/12] net/sfc: " Steve Yang
2020-12-09  3:16 ` [dpdk-dev] [PATCH v1 12/12] net/thunderx: " Steve Yang
2020-12-11  4:31 ` [dpdk-dev] [PATCH v1 00/12] fix rx packets dropped issue Guo, Jia
2020-12-14 17:44 ` Ferruh Yigit
2020-12-17  9:22 ` [dpdk-dev] [PATCH v2 00/22] " Steve Yang
2020-12-17  9:22   ` [dpdk-dev] [PATCH v2 01/22] ethdev: fix MTU size exceeds max rx packet length Steve Yang
2020-12-28 14:51     ` Andrew Rybchenko
2021-01-13 10:32       ` Ferruh Yigit
2020-12-30 10:19     ` oulijun
     [not found]       ` <DM6PR11MB43627F10DDAFC9801816FF5BF9D00@DM6PR11MB4362.namprd11.prod.outlook.com>
2021-01-13 10:25         ` Ferruh Yigit
2021-01-13 11:04         ` Ferruh Yigit
2020-12-17  9:22   ` [dpdk-dev] [PATCH v2 02/22] app/testpmd: fix max rx packet length for VLAN packets Steve Yang
2021-01-13 11:26     ` Ferruh Yigit
2020-12-17  9:22   ` [dpdk-dev] [PATCH v2 03/22] net/dpaa: fix the jumbo frame flag condition for mtu set Steve Yang
2020-12-17  9:22   ` [dpdk-dev] [PATCH v2 04/22] net/dpaa2: " Steve Yang
2020-12-17  9:22   ` [dpdk-dev] [PATCH v2 05/22] net/e1000: " Steve Yang
2020-12-18  2:42     ` Guo, Jia
2020-12-17  9:22   ` [dpdk-dev] [PATCH v2 06/22] net/hns3: " Steve Yang
2020-12-17  9:22   ` [dpdk-dev] [PATCH v2 07/22] net/i40e: fix the jumbo frame flag condition Steve Yang
2020-12-18  2:44     ` Guo, Jia
2020-12-17  9:22   ` [dpdk-dev] [PATCH v2 08/22] net/iavf: " Steve Yang
2020-12-17  9:22   ` [dpdk-dev] [PATCH v2 09/22] net/ice: " Steve Yang
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 10/22] net/ipn3ke: fix the jumbo frame flag condition for mtu set Steve Yang
2020-12-19  0:54     ` Xu, Rosen
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 11/22] net/octeontx: " Steve Yang
2020-12-21 15:04     ` [dpdk-dev] [EXT] " Harman Kalra
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 12/22] net/octeontx2: fix the jumbo frame flag condition for mtu Steve Yang
2020-12-18 10:15     ` Nithin Dabilpuram
2020-12-21  7:19     ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 13/22] net/qede: fix the jumbo frame flag condition for mtu set Steve Yang
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 14/22] net/sfc: " Steve Yang
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 15/22] net/thunderx: " Steve Yang
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 16/22] net/ixgbe: fix the jumbo frame flag condition Steve Yang
2020-12-18  2:43     ` Guo, Jia
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 17/22] net/cxgbe: " Steve Yang
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 18/22] net/axgbe: fix the jumbo frame flag condition for mtu set Steve Yang
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 19/22] net/enetc: " Steve Yang
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 20/22] net/hinic: " Steve Yang
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 21/22] net/nfp: " Steve Yang
2020-12-17  9:23   ` [dpdk-dev] [PATCH v2 22/22] net/liquidio: " Steve Yang
2021-01-13 11:32   ` [dpdk-dev] [PATCH v2 00/22] fix rx packets dropped issue Ferruh Yigit
2021-01-14  9:45   ` [dpdk-dev] [PATCH v3 " Steve Yang
2021-01-14  9:45   ` [dpdk-dev] [PATCH v3 01/22] ethdev: fix MTU size exceeds max rx packet length Steve Yang
2021-01-14 16:36     ` Ferruh Yigit
2021-01-14 17:13       ` Ferruh Yigit
2021-01-14 17:29         ` Andrew Boyer
2021-01-14 20:44           ` Ferruh Yigit
2021-01-15 10:44     ` oulijun
2021-01-18 10:42       ` Ferruh Yigit
2021-01-19  8:46         ` oulijun
2021-01-23  9:05           ` oulijun
2021-01-25 12:22           ` Ferruh Yigit
2021-01-18  7:04     ` [dpdk-dev] [PATCH v4 00/22] fix rx packets dropped issue Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 01/22] ethdev: fix MTU size exceeds max rx packet length Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 02/22] app/testpmd: fix max rx packet length for VLAN packets Steve Yang
2021-01-21 15:27         ` Lance Richardson
2021-01-22 14:26           ` Lance Richardson
2021-01-25 12:14           ` Ferruh Yigit [this message]
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 03/22] net/dpaa: fix the jumbo frame flag condition for mtu set Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 04/22] net/dpaa2: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 05/22] net/e1000: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 06/22] net/hns3: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 07/22] net/i40e: fix the jumbo frame flag condition Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 08/22] net/iavf: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 09/22] net/ice: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 10/22] net/ipn3ke: fix the jumbo frame flag condition for mtu set Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 11/22] net/octeontx: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 12/22] net/octeontx2: fix the jumbo frame flag condition for mtu Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 13/22] net/qede: fix the jumbo frame flag condition for mtu set Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 14/22] net/sfc: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 15/22] net/thunderx: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 16/22] net/ixgbe: fix the jumbo frame flag condition Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 17/22] net/cxgbe: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 18/22] net/axgbe: fix the jumbo frame flag condition for mtu set Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 19/22] net/enetc: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 20/22] net/hinic: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 21/22] net/nfp: " Steve Yang
2021-01-18  7:04       ` [dpdk-dev] [PATCH v4 22/22] net/liquidio: " Steve Yang
2021-01-18 11:54       ` [dpdk-dev] [PATCH v4 00/22] fix rx packets dropped issue Ferruh Yigit
2021-01-14  9:45   ` [dpdk-dev] [PATCH v3 02/22] app/testpmd: fix max rx packet length for VLAN packets Steve Yang
2021-01-14  9:45   ` [dpdk-dev] [PATCH v3 03/22] net/dpaa: fix the jumbo frame flag condition for mtu set Steve Yang
2021-01-14 10:26     ` Hemant Agrawal
2021-01-14  9:46   ` [dpdk-dev] [PATCH v3 04/22] net/dpaa2: " Steve Yang
2021-01-14 10:27     ` Hemant Agrawal
2021-01-14  9:46   ` [dpdk-dev] [PATCH v3 05/22] net/e1000: " Steve Yang
2021-01-14  9:46   ` [dpdk-dev] [PATCH v3 06/22] net/hns3: " Steve Yang
2021-01-18  1:30     ` oulijun
2021-01-14  9:46   ` [dpdk-dev] [PATCH v3 07/22] net/i40e: fix the jumbo frame flag condition Steve Yang
2021-01-14  9:46   ` [dpdk-dev] [PATCH v3 08/22] net/iavf: " Steve Yang
2021-01-14  9:46   ` [dpdk-dev] [PATCH v3 09/22] net/ice: " Steve Yang
2021-01-14  9:46   ` [dpdk-dev] [PATCH v3 10/22] net/ipn3ke: fix the jumbo frame flag condition for mtu set Steve Yang
2021-01-14  9:46   ` [dpdk-dev] [PATCH v3 11/22] net/octeontx: " Steve Yang
2021-01-14  9:46   ` [dpdk-dev] [PATCH v3 12/22] net/octeontx2: fix the jumbo frame flag condition for mtu Steve Yang
2021-01-14  9:46   ` [dpdk-dev] [PATCH v3 13/22] net/qede: fix the jumbo frame flag condition for mtu set Steve Yang
2021-01-14  9:47   ` [dpdk-dev] [PATCH v3 14/22] net/sfc: " Steve Yang
2021-01-14  9:47   ` [dpdk-dev] [PATCH v3 15/22] net/thunderx: " Steve Yang
2021-01-14  9:47   ` [dpdk-dev] [PATCH v3 16/22] net/ixgbe: fix the jumbo frame flag condition Steve Yang
2021-01-14  9:47   ` [dpdk-dev] [PATCH v3 17/22] net/cxgbe: " Steve Yang
2021-01-14  9:47   ` [dpdk-dev] [PATCH v3 18/22] net/axgbe: fix the jumbo frame flag condition for mtu set Steve Yang
2021-01-14  9:47   ` [dpdk-dev] [PATCH v3 19/22] net/enetc: " Steve Yang
2021-01-14  9:47   ` [dpdk-dev] [PATCH v3 20/22] net/hinic: " Steve Yang
2021-01-14  9:47   ` [dpdk-dev] [PATCH v3 21/22] net/nfp: " Steve Yang
2021-01-14  9:47   ` [dpdk-dev] [PATCH v3 22/22] net/liquidio: " Steve Yang

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=a591a083-4130-f516-be9e-d2297c8eec1e@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=lance.richardson@broadcom.com \
    --cc=stevex.yang@intel.com \
    --cc=wenzhuo.lu@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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git