From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
To: Shy Shyman <shys@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
"Xing, Beilei" <beilei.xing@intel.com>,
"xavier.huwei@huawei.com" <xavier.huwei@huawei.com>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix error detection in MTU command
Date: Tue, 19 May 2020 14:15:20 +0000 [thread overview]
Message-ID: <DM6PR11MB2537394E5F1B2A69ECE57F88EFB90@DM6PR11MB2537.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200518092704.188832-1-shys@mellanox.com>
Hi Shy
> -----Original Message-----
> From: Shy Shyman <shys@mellanox.com>
> Sent: Monday, May 18, 2020 10:27 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; xavier.huwei@huawei.com
> Subject: [PATCH] app/testpmd: fix error detection in MTU command
>
> MTU is used in testpmd to set the maximum payload size for packets.
> According to testpmd, the setting influnce RX only.
> In rte_ethdev there's no relation between MTU setting and JUMBO offload
> or rx_max_pkt_len.
>
> The previous fix in patch referenced below was meant to update the
> correlated variables of max_pkt_len and JUMBO offload, but by doing so it
> assumes that MTU setting can only exist when JUMBO offload supported in
> the device. For example fail-safe device does supports set MTU and doesn't
Typo: supports should be support
> support JUMBO offload, and in this case, though set MTU succeed an error
> mesage still printed since the JUMBO packet offload is disabled.
Typo: mesage should be message
> The fix separates the two conditions to make sure the error triggers
> A warning message is provided in this special case to alert the user.
>
> Fixes: 150c9ac2df13 ("app/testpmd: update Rx offload after setting MTU")
> Cc: xavier.huwei@huawei.com
Should the patch be backported to 20.02 ?(ie add Cc: stable@dpdk.org)
>
> Signed-off-by: Shy Shyman <shys@mellanox.com>
> ---
> app/test-pmd/config.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> 5381207cc..73b53c50b 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -1277,8 +1277,9 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
> return;
> }
> diag = rte_eth_dev_set_mtu(port_id, mtu);
> - if (diag == 0 &&
> - dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) {
> + if (diag)
> + printf("Set MTU failed. diag=%d\n", diag);
> + else if (dev_info.rx_offload_capa &
> DEV_RX_OFFLOAD_JUMBO_FRAME) {
> /*
> * Ether overhead in driver is equal to the difference of
> * max_rx_pktlen and max_mtu in rte_eth_dev_info when
> the @@ -1293,10 +1294,9 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
> } else
> rte_port->dev_conf.rxmode.offloads &=
>
> ~DEV_RX_OFFLOAD_JUMBO_FRAME;
> -
> - return;
> - }
> - printf("Set MTU failed. diag=%d\n", diag);
> + } else
> + printf("WARNING: MTU was set while jumbo frame offload
> is"
> + " not supported by the device\n");
> }
>
> /* Generic flow management functions. */
> --
> 2.21.0
Otherwise
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
next prev parent reply other threads:[~2020-05-19 14:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-18 9:27 Shy Shyman
2020-05-19 11:10 ` Asaf Penso
2020-05-19 14:15 ` Iremonger, Bernard [this message]
2020-05-19 14:57 ` Ferruh Yigit
2020-05-19 16:40 ` Shy Shyman
2020-05-20 14:14 ` Ferruh Yigit
2020-06-08 14:17 ` [dpdk-dev] [PATCH v2] " Shy Shyman
2020-06-08 15:04 ` Ferruh Yigit
2020-06-09 14:44 ` Phil Yang
2020-06-09 14:59 ` 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=DM6PR11MB2537394E5F1B2A69ECE57F88EFB90@DM6PR11MB2537.namprd11.prod.outlook.com \
--to=bernard.iremonger@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=shys@mellanox.com \
--cc=wenzhuo.lu@intel.com \
--cc=xavier.huwei@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).