From: Long Li <longli@microsoft.com>
To: Alexander Skorichenko <askorichenko@netgate.com>,
"stephen@networkplumber.org" <stephen@networkplumber.org>,
Sam Andrew <samandrew@microsoft.com>
Cc: "ferruh.yigit@amd.com" <ferruh.yigit@amd.com>,
"andrew.rybchenko@oktetlabs.ru" <andrew.rybchenko@oktetlabs.ru>,
Wei Hu <weh@microsoft.com>, "dev@dpdk.org" <dev@dpdk.org>,
Matthew Smith <mgsmith@netgate.com>
Subject: RE: [PATCH] net/netvsc: fix mtu_set in netvsc devices
Date: Wed, 3 Jul 2024 00:35:08 +0000 [thread overview]
Message-ID: <PH7PR21MB3071639147C08FC949321153CEDD2@PH7PR21MB3071.namprd21.prod.outlook.com> (raw)
In-Reply-To: <CAGxBn5BZOO6fz=TG50pOaGwFLXYXa=d+GRxWb09M5RrvwsdG=w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2299 bytes --]
Thank you, Alexander.
The patch looks good to me. With this patch, do you see other problems with VPP?
I'd like to get a review from @Sam Andrew<mailto:samandrew@microsoft.com>.
Acked-by: Long Li <longli@microsoft.com>
From: Alexander Skorichenko <askorichenko@netgate.com>
Sent: Tuesday, July 2, 2024 1:49 AM
To: stephen@networkplumber.org
Cc: Sam Andrew <samandrew@microsoft.com>; ferruh.yigit@amd.com; andrew.rybchenko@oktetlabs.ru; Long Li <longli@microsoft.com>; Wei Hu <weh@microsoft.com>; dev@dpdk.org; Matthew Smith <mgsmith@netgate.com>
Subject: Re: [PATCH] net/netvsc: fix mtu_set in netvsc devices
You don't often get email from askorichenko@netgate.com<mailto:askorichenko@netgate.com>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Hello,
The failure happens when running under VPP. In terms of dpdk calls the following sequence of events occurs for a NetVSC device:
Durung device probing stage of VPP
1. eth_hn_dev_init() memory for a single primary rx_queue is allocated
dev->data->rx_queues[0] = 0, allocated, but not set yet
no allocation happened for tx_queues[i] and non-primary rx_queues[i]
During device setup stage of VPP from VPP's own generic dpdk_device_setup():
2. rte_eth_dev_set_mtu()
currently it segfaults in hn_reinit() when trying to reach into
dev->data->rx_queues[i], dev->data->tx_queues[i]
3. rte_eth_tx_queue_setup()
dev->data->tx_queues[i] are being allocated and set
4. rte_eth_rx_queue_setup()
dev->data->rx_queues[i] get allocated (i > 0) and set
So rx_queues[0] could be set in step 1, but rx_queues[i] and tx_queues[i] are still NULL.
Allocating all the remaining rx/tx queues in step 1 would prevent the crash, but then in steps 3-4 would go through releasing and allocating all of the queues again.
Another comment regarding the uniform condition introduced in hn_reinit() in the patch:
if (dev->data->rx_queues[0] != NULL) ...
Because of the difference between rx/tx queues described above, it's probably safer to extend the condition to check both rx and tx separately
if (dev->data->rx_queues[0] != NULL && dev->data->tx_queues[0] != NULL)
- Alexander Skorichenko
[-- Attachment #2: Type: text/html, Size: 7026 bytes --]
next prev parent reply other threads:[~2024-07-03 0:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 16:35 Alexander Skorichenko
2024-06-30 15:40 ` Stephen Hemminger
2024-07-02 8:49 ` Alexander Skorichenko
2024-07-03 0:35 ` Long Li [this message]
2024-07-03 10:13 ` Alexander Skorichenko
2024-07-03 22:50 ` [EXTERNAL] " Sam Andrew
2024-07-03 22:57 ` Long Li
2024-07-07 2:11 ` 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=PH7PR21MB3071639147C08FC949321153CEDD2@PH7PR21MB3071.namprd21.prod.outlook.com \
--to=longli@microsoft.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=askorichenko@netgate.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=mgsmith@netgate.com \
--cc=samandrew@microsoft.com \
--cc=stephen@networkplumber.org \
--cc=weh@microsoft.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).