From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4DE045BC0; Thu, 24 Oct 2024 11:16:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A45EF43396; Thu, 24 Oct 2024 11:16:41 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 4C31C4003C for ; Thu, 24 Oct 2024 11:16:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729761398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m5wK75xYNIYGi2dJZ9nIsJAjf5YbYabOhcEx8Dji0IQ=; b=i+6R9zq/fINFXPeAXGIPFnUg+638QwznNJzdFG3mjKCRUXxMqFwsNqXhNVKyAyMCdr6ogQ BJ5KqkwKMOr9Rw6bgdKl5Zmz+ArfOnpwUiFs+1jE9a67jiHoX+VMjmCvZQIjYy8SwJ2HFO y6Pz/ANBfPzxvSr4QV3qH5zjjlQZm9k= Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-640-nyEdrVdWPOKhDYlVFT2NMQ-1; Thu, 24 Oct 2024 05:16:31 -0400 X-MC-Unique: nyEdrVdWPOKhDYlVFT2NMQ-1 Received: by mail-yb1-f200.google.com with SMTP id 3f1490d57ef6-e2e3321aae0so1295414276.1 for ; Thu, 24 Oct 2024 02:16:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729761391; x=1730366191; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=m5wK75xYNIYGi2dJZ9nIsJAjf5YbYabOhcEx8Dji0IQ=; b=YjCHzw6NwZEaXmhX6RXX4K7Pv0qX0+YoJAP0Sx8GuAzHCgPUnLwaUk0IHiPXwv6rJH 6UQrq3HYY/0kyUWqYFOQBTAQd+EhMmsWf53LujVqxbuwVw2tq+xB8Qz/psN/NHQSgnGA GO4qSrHVHlw1WJus1nYjgnaX3llRTbQjBaC6dUVvwe1sPLRFb/TQdJnab3D9Y3xUVnrg PeHSOdvERJODwJSt1j8EhMkKvPLXdX4CHI/nOs5SFMINyXsjaQCbxLwgyF/NvUkdsr+w ubCEOR6poaF0Oj1+fCV4FjDrUribEW/EFcA+/IDPF31QkN2dQRaw0fhaC1wx616tR1jb Y/SQ== X-Gm-Message-State: AOJu0Yy2h8WnJE4gTRgQlkg7C18mCICST4m6thVGtKvXzhLYpii7N/Kd 2XZfZiwOqFq5kiK9EygphxtJ/ixGq1/ne3z4YikQsuCRpH2Heh8ippG0xLiRPOji7TYwxIzx+ON bpEwXAQJqELSc2su98qaxcd04tBYg5zNW86IpIOHPFS0CXkm91s4fA+MUjV1ZphdqelZ2bl+F2b R7kMvpdyvSzGM6XTRJjkI9P0I= X-Received: by 2002:a05:6902:919:b0:e28:a4f9:c2ff with SMTP id 3f1490d57ef6-e2e3a6e5cdbmr4495855276.55.1729761391125; Thu, 24 Oct 2024 02:16:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3zHfdn9GkhJwwPvYB7jvpXfDWjPBuZh8VvSNHGZ6YDqGTJI0MXKdHJsZPHB/IMZXRs056lQ== X-Received: by 2002:a05:6902:919:b0:e28:a4f9:c2ff with SMTP id 3f1490d57ef6-e2e3a6e5cdbmr4495832276.55.1729761390424; Thu, 24 Oct 2024 02:16:30 -0700 (PDT) Received: from [192.168.0.12] ([78.17.184.51]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-460d3dc5facsm48919551cf.96.2024.10.24.02.16.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Oct 2024 02:16:29 -0700 (PDT) Message-ID: Date: Thu, 24 Oct 2024 10:16:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Can DPDK AF_XDP PMD support macvlan driver in container? To: dev@dpdk.org References: From: Maryam Tahhan In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="------------nkI09tIxxNKaRbuD4Yo1dhGV" Content-Language: en-US X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This is a multi-part message in MIME format. --------------nkI09tIxxNKaRbuD4Yo1dhGV Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 23/10/2024 07:07, Xiaohua Wang wrote: > > Hi, > > dpdk-testpmd with AF_XDP PMD can't work on p1p1 (macvlan) interface, > but can work on eth0 (veth) interface. > > And is there a method to enable AF_XDP PMD to work in XDP SKB mode? Or > add one option to set “SKB mode” in AF_XDP Options > ? > [MT] I believe this is what the `force_copy=1` option does. But I'm not sure this will fix your issue as the log below says that it does try SKB mode. It could be a limitation of the Kernel driver. > ===============can't work on p1p1 (macvlan) interface==================== > > 5p8j4:/tmp # ./dpdk-testpmd --log-level=pmd.net.af_xdp:debug --no-huge > --no-pci --no-telemetry --vdev net_af_xdp,iface=p1p1 -- > --total-num-mbufs 8192 > > EAL: Detected CPU lcores: 40 > > EAL: Detected NUMA nodes: 1 > > EAL: Static memory layout is selected, amount of reserved memory can > be adjusted with -m or --socket-mem > > EAL: Detected static linkage of DPDK > > EAL: Multi-process socket /var/run/dpdk/rte/mp_socket > > EAL: Selected IOVA mode 'VA' > > EAL: VFIO support initialized > > rte_pmd_af_xdp_probe(): Initializing pmd_af_xdp for net_af_xdp > > init_internals(): Zero copy between umem and mbuf enabled. > > testpmd: create a new mbuf pool : n=8192, size=2176, socket=0 > > testpmd: preferred mempool ops selected: ring_mp_mc > > Warning! port-topology=paired and odd forward ports number, the last > port will pair with itself. > > Configuring Port 0 (socket 0) > > eth_rx_queue_setup(): Set up rx queue, rx queue id: 0, xsk queue id: 0 > > libbpf: elf: skipping unrecognized data section(8) .xdp_run_config > > libbpf: elf: skipping unrecognized data section(9) xdp_metadata > > libbpf: elf: skipping unrecognized data section(7) xdp_metadata > > libbpf: prog 'xdp_pass': BPF program load failed: Invalid argument > > libbpf: prog 'xdp_pass': failed to load: -22 > > libbpf: failed to load object '/usr/lib64/bpf/xdp-dispatcher.o' > > libbpf: elf: skipping unrecognized data section(7) xdp_metadata > > libbpf: elf: skipping unrecognized data section(7) xdp_metadata > > libbpf: elf: skipping unrecognized data section(7) xdp_metadata > > libbpf: Kernel error message: Underlying driver does not support XDP > in native mode > > libxdp: Error attaching XDP program to ifindex 5: Operation not supported > > libxdp: XDP mode not supported; try using SKB mode > [MT] Here it attempts SKB mode, then fails > xsk_configure(): Failed to create xsk socket. > > eth_rx_queue_setup(): Failed to configure xdp socket > > Fail to configure port 0 rx queues > > rte_pmd_af_xdp_remove(): Removing AF_XDP ethdev on numa socket 0 > > eth_dev_close(): Closing AF_XDP ethdev on numa socket 0 > > Port 0 is closed > > EAL: Error - exiting with code: 1 > > Cause: Start ports failed > > EAL: Already called cleanup > --------------nkI09tIxxNKaRbuD4Yo1dhGV Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 23/10/2024 07:07, Xiaohua Wang wrote:

Hi,

 

dpdk-testpmd with AF_XDP PMD can't work on p1p1 (macvlan) interface, but can work on eth0 (veth) interface.

 

And is there a method to enable AF_XDP PMD to work in XDP SKB mode? Or add one option to set “SKB mode” in AF_XDP Options ?


[MT] I believe this is what the `force_copy=1` option does. But I'm not sure this will fix your issue as the log below says that it does try SKB mode. It could be a limitation of the Kernel driver.


 

===============can't work on p1p1 (macvlan) interface====================

 

5p8j4:/tmp # ./dpdk-testpmd --log-level=pmd.net.af_xdp:debug --no-huge --no-pci --no-telemetry --vdev net_af_xdp,iface=p1p1 -- --total-num-mbufs 8192

EAL: Detected CPU lcores: 40

EAL: Detected NUMA nodes: 1

EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem

EAL: Detected static linkage of DPDK

EAL: Multi-process socket /var/run/dpdk/rte/mp_socket

EAL: Selected IOVA mode 'VA'

EAL: VFIO support initialized

rte_pmd_af_xdp_probe(): Initializing pmd_af_xdp for net_af_xdp

init_internals(): Zero copy between umem and mbuf enabled.

testpmd: create a new mbuf pool <mb_pool_0>: n=8192, size=2176, socket=0

testpmd: preferred mempool ops selected: ring_mp_mc

 

Warning! port-topology=paired and odd forward ports number, the last port will pair with itself.

 

Configuring Port 0 (socket 0)

eth_rx_queue_setup(): Set up rx queue, rx queue id: 0, xsk queue id: 0

libbpf: elf: skipping unrecognized data section(8) .xdp_run_config

libbpf: elf: skipping unrecognized data section(9) xdp_metadata

libbpf: elf: skipping unrecognized data section(7) xdp_metadata

libbpf: prog 'xdp_pass': BPF program load failed: Invalid argument

libbpf: prog 'xdp_pass': failed to load: -22

libbpf: failed to load object '/usr/lib64/bpf/xdp-dispatcher.o'

libbpf: elf: skipping unrecognized data section(7) xdp_metadata

libbpf: elf: skipping unrecognized data section(7) xdp_metadata

libbpf: elf: skipping unrecognized data section(7) xdp_metadata

libbpf: Kernel error message: Underlying driver does not support XDP in native mode

libxdp: Error attaching XDP program to ifindex 5: Operation not supported

libxdp: XDP mode not supported; try using SKB mode

[MT] Here it attempts SKB mode, then fails

xsk_configure(): Failed to create xsk socket.

eth_rx_queue_setup(): Failed to configure xdp socket

Fail to configure port 0 rx queues

rte_pmd_af_xdp_remove(): Removing AF_XDP ethdev on numa socket 0

eth_dev_close(): Closing AF_XDP ethdev on numa socket 0

Port 0 is closed

EAL: Error - exiting with code: 1

Cause: Start ports failed

EAL: Already called cleanup

 

--------------nkI09tIxxNKaRbuD4Yo1dhGV--