DPDK patches and discussions
 help / color / mirror / Atom feed
From: Srujana Challa <schalla@marvell.com>
To: David Marchand <david.marchand@redhat.com>,
	Jerin Jacob <jerinj@marvell.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
	"chenbox@nvidia.com" <chenbox@nvidia.com>,
	Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>,
	Vamsi Krishna Attunuru <vattunuru@marvell.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@amd.com>
Subject: RE: [EXTERNAL] Re: [PATCH v3 1/3] net/virtio_user: convert cq descriptor IOVA address to Virtual address
Date: Thu, 11 Jul 2024 08:54:29 +0000	[thread overview]
Message-ID: <DS0PR18MB53684B0600C9560B921A99B2A0A52@DS0PR18MB5368.namprd18.prod.outlook.com> (raw)
In-Reply-To: <CAJFAV8zEhvip7iv_8Bk-2iGsoit8LTjBM_t8PTEuC3=+=3TaoA@mail.gmail.com>

> Hello Srujana, Jerin,
> 
> On Wed, Jul 3, 2024 at 12:04 PM Srujana Challa <schalla@marvell.com>
> wrote:
> >
> > This patch modifies the code to convert descriptor buffer IOVA
> > addresses to virtual addresses during the processing of shadow control
> > queue when IOVA mode is PA. This change enables Virtio-user to operate
> > with IOVA as the descriptor buffer address.
> >
> > Signed-off-by: Srujana Challa <schalla@marvell.com>
> 
> This patch triggers a segfault in testpmd when using virtio-user
> (server) + vhost-user (client).
> This was caught in OVS unit tests running in GHA virtual machines.
> In such an env with no iommu, IOVA is forced to PA.
> 
> This can be reproduced with two testpmd in an env without iommu like a vm,
> or alternatively forcing --iova-mode=pa in the cmdline:
> 
> $ rm -f vhost-user; gdb ./build/app/dpdk-testpmd -ex 'run -l 0-2 --in-memory
> --socket-mem=512 --single-file-segments --no-pci --file-prefix virtio
> --vdev=net_virtio_user,path=vhost-user,queues=2,server=1 -- -i'
> ...
> EAL: Selected IOVA mode 'PA'
> ...
> vhost_user_start_server(): (vhost-user) waiting for client connection...
> 
> $ ./build/app/dpdk-testpmd -l 0,3-4 --in-memory --socket-mem=512 --single-
> file-segments --no-pci --file-prefix vhost-user --vdev
> net_vhost,iface=vhost-user,client=1 -- -i ...
> EAL: Selected IOVA mode 'PA'
> ...
> VHOST_CONFIG: (vhost-user) virtio is now ready for processing.
> 
> 
> On the virtio-user side:
> 
> Thread 1 "dpdk-testpmd" received signal SIGSEGV, Segmentation fault.
> 0x0000000002f956ab in virtio_user_handle_ctrl_msg_split
> (dev=0x11a01a8d00, vring=0x11a01a8aa0, idx_hdr=0) at
> ../drivers/net/virtio/virtio_user/virtio_user_dev.c:942
> 942        if (hdr->class == VIRTIO_NET_CTRL_MQ &&
> (gdb) bt
> #0  0x0000000002f956ab in virtio_user_handle_ctrl_msg_split
> (dev=0x11a01a8d00, vring=0x11a01a8aa0, idx_hdr=0) at
> ../drivers/net/virtio/virtio_user/virtio_user_dev.c:942
> #1  0x0000000002f95d06 in virtio_user_handle_cq_split
> (dev=0x11a01a8d00, queue_idx=4) at
> ../drivers/net/virtio/virtio_user/virtio_user_dev.c:1087
> #2  0x0000000002f95dba in virtio_user_handle_cq (dev=0x11a01a8d00,
> queue_idx=4) at
> ../drivers/net/virtio/virtio_user/virtio_user_dev.c:1104
> #3  0x0000000002f79af7 in virtio_user_notify_queue (hw=0x11a01a8d00,
> vq=0x11a0181e00) at ../drivers/net/virtio/virtio_user_ethdev.c:278
> #4  0x0000000002f45408 in virtqueue_notify (vq=0x11a0181e00) at
> ../drivers/net/virtio/virtqueue.h:525
> #5  0x0000000002f45bf0 in virtio_control_queue_notify (vq=0x11a0181e00,
> cookie=0x0) at
> ../drivers/net/virtio/virtio_ethdev.c:227
> #6  0x0000000002f404a5 in virtio_send_command_split
> (cvq=0x11a0181e60, ctrl=0x7fffffffc850, dlen=0x7fffffffc84c, pkt_num=1) at
> ../drivers/net/virtio/virtio_cvq.c:158
> #7  0x0000000002f407a7 in virtio_send_command (cvq=0x11a0181e60,
> ctrl=0x7fffffffc850, dlen=0x7fffffffc84c, pkt_num=1) at
> ../drivers/net/virtio/virtio_cvq.c:224
> #8  0x0000000002f45af7 in virtio_set_multiple_queues_auto
> (dev=0x4624b80 <rte_eth_devices>, nb_queues=1) at
> ../drivers/net/virtio/virtio_ethdev.c:192
> #9  0x0000000002f45b99 in virtio_set_multiple_queues (dev=0x4624b80
> <rte_eth_devices>, nb_queues=1) at
> ../drivers/net/virtio/virtio_ethdev.c:210
> #10 0x0000000002f4ad2d in virtio_dev_start (dev=0x4624b80
> <rte_eth_devices>) at ../drivers/net/virtio/virtio_ethdev.c:2385
> #11 0x0000000000aa4336 in rte_eth_dev_start (port_id=0) at
> ../lib/ethdev/rte_ethdev.c:1752
> #12 0x00000000005984f7 in eth_dev_start_mp (port_id=0) at
> ../app/test-pmd/testpmd.c:642
> #13 0x000000000059ddb7 in start_port (pid=65535) at
> ../app/test-pmd/testpmd.c:3269
> #14 0x00000000005a0eea in main (argc=2, argv=0x7fffffffdfe0) at
> ../app/test-pmd/testpmd.c:4644
> (gdb) l
> 937        /* locate desc for status */
> 938        idx_status = i;
> 939        n_descs++;
> 940
> 941        hdr = virtio_user_iova2virt(vring->desc[idx_hdr].addr);
> 942        if (hdr->class == VIRTIO_NET_CTRL_MQ &&
> 943            hdr->cmd == VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET) {
> 944            uint16_t queues, *addr;
> 945
> 946            addr = virtio_user_iova2virt(vring->desc[idx_data].addr);
> (gdb) p hdr
> $1 = (struct virtio_net_ctrl_hdr *) 0x0
> 
> 
> We need someone from Marvell to fix this issue.
> The next option is to revert the whole series (which was discussed and agreed
> before Maxime went off, in the event this series would trigger any issue).
Sure, we are looking into the issue.

Thanks.
> 
> --
> David Marchand


  reply	other threads:[~2024-07-11  8:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 13:29 [PATCH v2 0/3] net/virtio: support IOVA as PA mode for vDPA backend Srujana Challa
2024-02-29 13:29 ` [PATCH v2 1/3] net/virtio_user: avoid cq descriptor buffer address accessing Srujana Challa
2024-06-28  8:07   ` Maxime Coquelin
2024-07-02 11:09     ` [EXTERNAL] " Srujana Challa
2024-07-02 12:41       ` Maxime Coquelin
2024-07-03 10:03   ` [PATCH v3 0/3] net/virtio: support IOVA as PA mode for vDPA backend Srujana Challa
2024-07-03 10:03     ` [PATCH v3 1/3] net/virtio_user: convert cq descriptor IOVA address to Virtual address Srujana Challa
2024-07-03 10:19       ` Jerin Jacob
2024-07-03 13:28         ` Maxime Coquelin
2024-07-12 11:22         ` David Marchand
2024-07-03 13:40       ` Maxime Coquelin
2024-07-10 15:06       ` David Marchand
2024-07-11  8:54         ` Srujana Challa [this message]
2024-07-03 10:03     ` [PATCH v3 2/3] net/virtio: store desc IOVA address in vring data structure Srujana Challa
2024-07-03 13:41       ` Maxime Coquelin
2024-07-03 10:03     ` [PATCH v3 3/3] net/virtio_user: support sharing vq descriptor IOVA to the backend Srujana Challa
2024-07-03 13:41       ` Maxime Coquelin
2024-07-03 14:34     ` [PATCH v3 0/3] net/virtio: support IOVA as PA mode for vDPA backend Maxime Coquelin
2024-02-29 13:29 ` [PATCH v2 2/3] net/virtio: store desc IOVA address in vring data structure Srujana Challa
2024-02-29 13:29 ` [PATCH v2 3/3] net/virtio_user: support sharing vq descriptor IOVA to the backend Srujana Challa
2024-06-19  9:39 ` [PATCH v2 0/3] net/virtio: support IOVA as PA mode for vDPA backend Srujana Challa
2024-06-28 13:33 ` Maxime Coquelin

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=DS0PR18MB53684B0600C9560B921A99B2A0A52@DS0PR18MB5368.namprd18.prod.outlook.com \
    --to=schalla@marvell.com \
    --cc=chenbox@nvidia.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=jerinj@marvell.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=ndabilpuram@marvell.com \
    --cc=thomas@monjalon.net \
    --cc=vattunuru@marvell.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).