* [dpdk-dev] [PATCH] examples/vhost: fix port init failure in mergeable mode
@ 2021-11-04 5:11 Chenbo Xia
2021-11-05 7:32 ` Xia, Chenbo
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Chenbo Xia @ 2021-11-04 5:11 UTC (permalink / raw)
To: dev; +Cc: maxime.coquelin
When the example starts in mergeable mode with an i40e port,
it fails to launch because the examples use default mtu MAX_MTU
to configure ethdev. The root cause is some devices have Ethernet
frame overhead and then MAX_MTU will be larger than device's max
mtu, so the ethdev configure will fail.
This patch checks the device's max mtu before setting the ethdev
configuration. If the device has a max mtu, use that value to
configure.
Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reported-by: Xingguang He <xingguang.he@intel.com>
---
examples/vhost/main.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 58e12aa710..09fb2382bf 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -273,6 +273,13 @@ port_init(uint16_t port)
tx_rings = (uint16_t)rte_lcore_count();
+ if (mergeable) {
+ if (dev_info.max_mtu != UINT16_MAX && dev_info.max_rx_pktlen > dev_info.max_mtu)
+ vmdq_conf_default.rxmode.mtu = dev_info.max_mtu;
+ else
+ vmdq_conf_default.rxmode.mtu = MAX_MTU;
+ }
+
/* Get port configuration. */
retval = get_eth_conf(&port_conf, num_devices);
if (retval < 0)
@@ -631,8 +638,6 @@ us_vhost_parse_args(int argc, char **argv)
return -1;
}
mergeable = !!ret;
- if (ret)
- vmdq_conf_default.rxmode.mtu = MAX_MTU;
break;
case OPT_STATS_NUM:
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/vhost: fix port init failure in mergeable mode
2021-11-04 5:11 [dpdk-dev] [PATCH] examples/vhost: fix port init failure in mergeable mode Chenbo Xia
@ 2021-11-05 7:32 ` Xia, Chenbo
2021-11-05 9:00 ` Maxime Coquelin
2021-11-16 9:14 ` Maxime Coquelin
2021-11-16 10:25 ` Maxime Coquelin
2 siblings, 1 reply; 5+ messages in thread
From: Xia, Chenbo @ 2021-11-05 7:32 UTC (permalink / raw)
To: maxime.coquelin; +Cc: dev
Hi Maxime,
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Chenbo Xia
> Sent: Thursday, November 4, 2021 1:11 PM
> To: dev@dpdk.org
> Cc: maxime.coquelin@redhat.com
> Subject: [dpdk-dev] [PATCH] examples/vhost: fix port init failure in mergeable
> mode
>
> When the example starts in mergeable mode with an i40e port,
> it fails to launch because the examples use default mtu MAX_MTU
> to configure ethdev. The root cause is some devices have Ethernet
> frame overhead and then MAX_MTU will be larger than device's max
> mtu, so the ethdev configure will fail.
>
> This patch checks the device's max mtu before setting the ethdev
> configuration. If the device has a max mtu, use that value to
> configure.
>
> Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
>
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> Reported-by: Xingguang He <xingguang.he@intel.com>
> ---
I see a unit test failure on this patch, but I think this patch should not cause
issues in unit test, could you help me confirm it?
Thanks,
Chenbo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/vhost: fix port init failure in mergeable mode
2021-11-05 7:32 ` Xia, Chenbo
@ 2021-11-05 9:00 ` Maxime Coquelin
0 siblings, 0 replies; 5+ messages in thread
From: Maxime Coquelin @ 2021-11-05 9:00 UTC (permalink / raw)
To: Xia, Chenbo; +Cc: dev
On 11/5/21 08:32, Xia, Chenbo wrote:
> Hi Maxime,
>
>> -----Original Message-----
>> From: dev <dev-bounces@dpdk.org> On Behalf Of Chenbo Xia
>> Sent: Thursday, November 4, 2021 1:11 PM
>> To: dev@dpdk.org
>> Cc: maxime.coquelin@redhat.com
>> Subject: [dpdk-dev] [PATCH] examples/vhost: fix port init failure in mergeable
>> mode
>>
>> When the example starts in mergeable mode with an i40e port,
>> it fails to launch because the examples use default mtu MAX_MTU
>> to configure ethdev. The root cause is some devices have Ethernet
>> frame overhead and then MAX_MTU will be larger than device's max
>> mtu, so the ethdev configure will fail.
>>
>> This patch checks the device's max mtu before setting the ethdev
>> configuration. If the device has a max mtu, use that value to
>> configure.
>>
>> Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
>>
>> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
>> Reported-by: Xingguang He <xingguang.he@intel.com>
>> ---
>
> I see a unit test failure on this patch, but I think this patch should not cause
> issues in unit test, could you help me confirm it?
I can confirm, mcslock_autotest is not related to your change, and it
seems other patches are facing the same issue, eg:
https://lab.dpdk.org/results/dashboard/patchsets/19997/
Maxime
> Thanks,
> Chenbo
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] examples/vhost: fix port init failure in mergeable mode
2021-11-04 5:11 [dpdk-dev] [PATCH] examples/vhost: fix port init failure in mergeable mode Chenbo Xia
2021-11-05 7:32 ` Xia, Chenbo
@ 2021-11-16 9:14 ` Maxime Coquelin
2021-11-16 10:25 ` Maxime Coquelin
2 siblings, 0 replies; 5+ messages in thread
From: Maxime Coquelin @ 2021-11-16 9:14 UTC (permalink / raw)
To: Chenbo Xia, dev
On 11/4/21 06:11, Chenbo Xia wrote:
> When the example starts in mergeable mode with an i40e port,
> it fails to launch because the examples use default mtu MAX_MTU
> to configure ethdev. The root cause is some devices have Ethernet
> frame overhead and then MAX_MTU will be larger than device's max
> mtu, so the ethdev configure will fail.
>
> This patch checks the device's max mtu before setting the ethdev
> configuration. If the device has a max mtu, use that value to
> configure.
>
> Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
>
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> Reported-by: Xingguang He <xingguang.he@intel.com>
> ---
> examples/vhost/main.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index 58e12aa710..09fb2382bf 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -273,6 +273,13 @@ port_init(uint16_t port)
>
> tx_rings = (uint16_t)rte_lcore_count();
>
> + if (mergeable) {
> + if (dev_info.max_mtu != UINT16_MAX && dev_info.max_rx_pktlen > dev_info.max_mtu)
> + vmdq_conf_default.rxmode.mtu = dev_info.max_mtu;
> + else
> + vmdq_conf_default.rxmode.mtu = MAX_MTU;
> + }
> +
> /* Get port configuration. */
> retval = get_eth_conf(&port_conf, num_devices);
> if (retval < 0)
> @@ -631,8 +638,6 @@ us_vhost_parse_args(int argc, char **argv)
> return -1;
> }
> mergeable = !!ret;
> - if (ret)
> - vmdq_conf_default.rxmode.mtu = MAX_MTU;
> break;
>
> case OPT_STATS_NUM:
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] examples/vhost: fix port init failure in mergeable mode
2021-11-04 5:11 [dpdk-dev] [PATCH] examples/vhost: fix port init failure in mergeable mode Chenbo Xia
2021-11-05 7:32 ` Xia, Chenbo
2021-11-16 9:14 ` Maxime Coquelin
@ 2021-11-16 10:25 ` Maxime Coquelin
2 siblings, 0 replies; 5+ messages in thread
From: Maxime Coquelin @ 2021-11-16 10:25 UTC (permalink / raw)
To: Chenbo Xia, dev
On 11/4/21 06:11, Chenbo Xia wrote:
> When the example starts in mergeable mode with an i40e port,
> it fails to launch because the examples use default mtu MAX_MTU
> to configure ethdev. The root cause is some devices have Ethernet
> frame overhead and then MAX_MTU will be larger than device's max
> mtu, so the ethdev configure will fail.
>
> This patch checks the device's max mtu before setting the ethdev
> configuration. If the device has a max mtu, use that value to
> configure.
>
> Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
>
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> Reported-by: Xingguang He <xingguang.he@intel.com>
> ---
> examples/vhost/main.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
Applied to dpdk-next-virtio/main.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-11-16 10:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04 5:11 [dpdk-dev] [PATCH] examples/vhost: fix port init failure in mergeable mode Chenbo Xia
2021-11-05 7:32 ` Xia, Chenbo
2021-11-05 9:00 ` Maxime Coquelin
2021-11-16 9:14 ` Maxime Coquelin
2021-11-16 10:25 ` Maxime Coquelin
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).