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 7B7324341B; Fri, 1 Dec 2023 11:31:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6AC24402B9; Fri, 1 Dec 2023 11:31:48 +0100 (CET) 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 11559402B6 for ; Fri, 1 Dec 2023 11:31:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701426706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3wB4RNiSQpKxFoUrhzHIV2NZkGsx5uYXHBGMpoLlNt0=; b=GDqszYp9APA5THOVBzDXpLSHsmKRnOyZKDodtQ42DLKd8MKGjhtpCvnsZq4c8F8GoSCY2F jllDf4Q08sbR1ukvfzu4VC8Sv0X39ZBVXhHYNX+o4Xm1Q8RBPVbYPqyNd0kbmrY3mcasER CtgQZ9aRcEWYmT7ulLq7kTJjlWQQx5A= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-Eo96jL6bOeOjvWyC9ke7tA-1; Fri, 01 Dec 2023 05:31:43 -0500 X-MC-Unique: Eo96jL6bOeOjvWyC9ke7tA-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-40a4c765d3bso12928885e9.0 for ; Fri, 01 Dec 2023 02:31:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701426702; x=1702031502; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=3wB4RNiSQpKxFoUrhzHIV2NZkGsx5uYXHBGMpoLlNt0=; b=mnBN1r9/7gNs6FJgD6ZCPIkd2qKPj/AeZpUYTdUXXGAwYTibyRYiqzmCBWMZ87yXKJ SnyMZynBt4H4yKUTog1kO6B0WqlOY158e2dZESh0SQBSgyDBPPuunbfnOiA0HZRZYzC/ 8qg+E1LDWbDOl8cU9YyfLEc0za7Ky2C9o4PmqNEqYCGQVnygR2ksxXYdqT1aoc/CB7tT 5TOL4nszV3cL40DyvVhEb7At0nhMbTT4ktFx0on3qxixyh0iFIF+SRs8RYf5aQU5ErGu O8M+I9GI2aBrObPWDNoUoxxcc+9IM3HBledEmiG2V7Wk7N9oHizatv1W9l+ZdaDI9Pms mBVQ== X-Gm-Message-State: AOJu0YxNlTPQwtM4Wv+NvY1fwPuzXJhksoyew3Id+wb00C7tvtTDzzw5 HCLkNktEWb6roEaCR9uv0cHv1Hf7ZnPVdhtaKeqW5QIZgzb7qihv40fo0uOeeekJXcjy3o3QqlR nL4k= X-Received: by 2002:a05:600c:3115:b0:40b:5e4a:233e with SMTP id g21-20020a05600c311500b0040b5e4a233emr493970wmo.64.1701426702070; Fri, 01 Dec 2023 02:31:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IErS5t4yb5K6j2eImnWcnyn4aQE3TaxjISUs+FLbI4iMfe/cajV49kyTp0/q9YyoZW+qIFbMA== X-Received: by 2002:a05:600c:3115:b0:40b:5e4a:233e with SMTP id g21-20020a05600c311500b0040b5e4a233emr493963wmo.64.1701426701733; Fri, 01 Dec 2023 02:31:41 -0800 (PST) Received: from [192.168.0.12] ([78.18.22.228]) by smtp.gmail.com with ESMTPSA id m8-20020a05600c4f4800b0040b37f107c4sm4956773wmq.16.2023.12.01.02.31.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Dec 2023 02:31:41 -0800 (PST) Message-ID: <5c1d1ed6-cd5b-441e-acbc-6a151f97f148@redhat.com> Date: Fri, 1 Dec 2023 10:31:40 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [v1] net/af_xdp: enable a sock path alongside use_cni To: David Marchand Cc: ferruh.yigit@amd.com, stephen@networkplumber.org, lihuisong@huawei.com, fengchengwen@huawei.com, liuyonglong@huawei.com, dev@dpdk.org References: <20231130091332.2315572-1-mtahhan@redhat.com> From: Maryam Tahhan In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="------------JNgeBWwOd34f1KbcJNKf5jb3" 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. --------------JNgeBWwOd34f1KbcJNKf5jb3 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 01/12/2023 10:26, David Marchand wrote: > Hello, > > On Thu, Nov 30, 2023 at 10:13 AM Maryam Tahhan wrote: > [snip] >> diff --git a/doc/guides/howto/af_xdp_cni.rst b/doc/guides/howto/af_xdp_cni.rst >> index a1a6d5b99c..a2d90c665d 100644 >> --- a/doc/guides/howto/af_xdp_cni.rst >> +++ b/doc/guides/howto/af_xdp_cni.rst >> @@ -38,9 +38,10 @@ The XSKMAP is a BPF map of AF_XDP sockets (XSK). >> The client can then proceed with creating an AF_XDP socket >> and inserting that socket into the XSKMAP pointed to by the descriptor. >> >> -The EAL vdev argument ``use_cni`` is used to indicate that the user wishes >> +The EAL vdev arguments ``use_cni`` and ``sock`` are used to indicate that the user wishes >> to run the PMD in unprivileged mode and to receive the XSKMAP file descriptor >> from the CNI. >> + >> When this flag is set, >> the ``XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD`` libbpf flag >> should be used when creating the socket >> @@ -49,7 +50,7 @@ Instead the loading is handled by the CNI. >> >> .. note:: >> >> - The Unix Domain Socket file path appear in the end user is "/tmp/afxdp.sock". >> + The Unix Domain Socket file path appears to the end user at "/tmp/afxdp_dp//afxdp.sock". >> >> >> Prerequisites >> @@ -224,7 +225,6 @@ Howto run dpdk-testpmd with CNI plugin: >> capabilities: >> add: >> - CAP_NET_RAW >> - - CAP_BPF >> resources: >> requests: >> hugepages-2Mi: 2Gi >> @@ -245,7 +245,17 @@ Howto run dpdk-testpmd with CNI plugin: >> >> kubectl exec -i --container -- \ >> //dpdk-testpmd -l 0,1 --no-pci \ >> - --vdev=net_af_xdp0,use_cni=1,iface= \ >> + --vdev=net_af_xdp0,use_cni=1,iface=,sock=/tmp/afxdp_dp//afxdp.sock \ >> + -- --no-mlockall --in-memory > Quick look at the doc update. > - is this hunk related to $subject? > - --in-memory is not a testpmd level option, but an EAL one. > > Yeah - I actually will remove the `--no-mlockall --in-memory` in the v2 respin (it's a typo). I'm only interested in showing the multiple af_xdp device (vdev) arguments. I think it's useful for anyone who is looking for a quick reference on how to do it. --------------JNgeBWwOd34f1KbcJNKf5jb3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 01/12/2023 10:26, David Marchand wrote:
Hello,

On Thu, Nov 30, 2023 at 10:13 AM Maryam Tahhan <mtahhan@redhat.com> wrote:
[snip]
diff --git a/doc/guides/howto/af_xdp_cni.rst b/doc/guides/howto/af_xdp_cni.rst
index a1a6d5b99c..a2d90c665d 100644
--- a/doc/guides/howto/af_xdp_cni.rst
+++ b/doc/guides/howto/af_xdp_cni.rst
@@ -38,9 +38,10 @@ The XSKMAP is a BPF map of AF_XDP sockets (XSK).
 The client can then proceed with creating an AF_XDP socket
 and inserting that socket into the XSKMAP pointed to by the descriptor.

-The EAL vdev argument ``use_cni`` is used to indicate that the user wishes
+The EAL vdev arguments ``use_cni`` and ``sock`` are used to indicate that the user wishes
 to run the PMD in unprivileged mode and to receive the XSKMAP file descriptor
 from the CNI.
+
 When this flag is set,
 the ``XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD`` libbpf flag
 should be used when creating the socket
@@ -49,7 +50,7 @@ Instead the loading is handled by the CNI.

 .. note::

-   The Unix Domain Socket file path appear in the end user is "/tmp/afxdp.sock".
+   The Unix Domain Socket file path appears to the end user at "/tmp/afxdp_dp/<netdev>/afxdp.sock".


 Prerequisites
@@ -224,7 +225,6 @@ Howto run dpdk-testpmd with CNI plugin:
           capabilities:
              add:
                - CAP_NET_RAW
-               - CAP_BPF
          resources:
            requests:
              hugepages-2Mi: 2Gi
@@ -245,7 +245,17 @@ Howto run dpdk-testpmd with CNI plugin:

      kubectl exec -i <Pod name> --container <containers name> -- \
            /<Path>/dpdk-testpmd -l 0,1 --no-pci \
-           --vdev=net_af_xdp0,use_cni=1,iface=<interface name> \
+           --vdev=net_af_xdp0,use_cni=1,iface=<interface name>,sock=/tmp/afxdp_dp/<interface name>/afxdp.sock \
+           -- --no-mlockall --in-memory
Quick look at the doc update.
- is this hunk related to $subject?
- --in-memory is not a testpmd level option, but an EAL one.


Yeah - I actually will remove the `--no-mlockall --in-memory` in the v2 respin (it's a typo). I'm only interested in showing the multiple af_xdp device (vdev) arguments. I think it's useful for anyone who is looking for a quick reference on how to do it.


--------------JNgeBWwOd34f1KbcJNKf5jb3--