[v9 2/3] net/af_xdp: fix multi interface support for K8s
Ferruh Yigit
ferruh.yigit at amd.com
Wed Feb 28 18:32:36 CET 2024
On 2/22/2024 1:46 PM, Loftus, Ciara wrote:
>> Subject: [v9 2/3] net/af_xdp: fix multi interface support for K8s
>>
>> The original 'use_cni' implementation, was added
>> to enable support for the AF_XDP PMD in a K8s env
>> without any escalated privileges.
>> However 'use_cni' used a hardcoded socket rather
>> than a configurable one. If a DPDK pod is requesting
>> multiple net devices and these devices are from
>> different pools, then the AF_XDP PMD attempts to
>> mount all the netdev UDSes in the pod as /tmp/afxdp.sock.
>> Which means that at best only 1 netdev will handshake
>> correctly with the AF_XDP DP. This patch addresses
>> this by making the socket parameter configurable using
>> a new vdev param called 'dp_path' alongside the
>> original 'use_cni' param. If the 'dp_path' parameter
>> is not set alongside the 'use_cni' parameter, then
>> it's configured inside the AF_XDP PMD (transparently
>> to the user). This change has been tested
>> with the AF_XDP DP PR 81[1], with both single and
> [1] does not point to any reference.
>
>> multiple interfaces.
>>
>> Fixes: 7fc6ae50369d ("net/af_xdp: support CNI Integration")
>> Cc: stable at dpdk.org
>>
>> Signed-off-by: Maryam Tahhan <mtahhan at redhat.com>
>> ---
>> doc/guides/howto/af_xdp_dp.rst | 43 ++++++++++--
>> doc/guides/nics/af_xdp.rst | 14 ++++
>> doc/guides/rel_notes/release_24_03.rst | 7 ++
>> drivers/net/af_xdp/rte_eth_af_xdp.c | 94 ++++++++++++++++----------
>> 4 files changed, 116 insertions(+), 42 deletions(-)
>>
>> diff --git a/doc/guides/howto/af_xdp_dp.rst
>> b/doc/guides/howto/af_xdp_dp.rst
>> index 657fc8d52c..8a64ec5599 100644
>> --- a/doc/guides/howto/af_xdp_dp.rst
>> +++ b/doc/guides/howto/af_xdp_dp.rst
>> @@ -52,13 +52,18 @@ should be used when creating the socket
>> to instruct libbpf not to load the default libbpf program on the netdev.
>> Instead the loading is handled by the AF_XDP Device Plugin.
>>
>> +The EAL vdev argument ``dp_path`` is used alongside the ``use_cni``
>> argument
>> +to explicitly tell the AF_XDP PMD where to find the UDS to interact with the
>> +AF_XDP Device Plugin. If this argument is not passed alongside the ``use_cni``
>> +argument then the AF_XDP PMD configures it internally.
>> +
>> Limitations
>> -----------
>>
>> For DPDK versions <= v23.11 the Unix Domain Socket file path appears in
>> the pod at "/tmp/afxdp.sock". The handshake implementation in the AF_XDP
>> PMD
>> -is only compatible with the AF_XDP Device Plugin up to commit id `38317c2`_
>> -and the pod is limited to a single netdev.
>> +is only compatible with the `AF_XDP Device Plugin for Kubernetes`_ up to
>> +commit id `38317c2`_ and the pod is limited to a single netdev.
>>
>> .. note::
>>
>> @@ -75,6 +80,14 @@ in the PMD alongside the `use_cni` parameter.
>>
>> .. _38317c2: https://github.com/intel/afxdp-plugins-for-
>> kubernetes/commit/38317c256b5c7dfb39e013a0f76010c2ded03669
>>
>> +.. note::
>> +
>> + The introduction of the ``dp_path`` EAL vdev argument fixes the limitation
>> above. If a
>> + user doesn't explicitly set the ``dp_path``parameter when using ``use_cni``
>> then that
>> + path is transparently configured in the AF_XDP PMD to the default
>> + `AF_XDP Device Plugin for Kubernetes`_ mount point path. This is
>> compatible with the latest
>> + AF_XDP Device Plugin. For backwards compatibility with versions of the
>> AF_XDP DP <= commit
>> + id `38317c2`_ please explicitly set ``dp_path`` to ``/tmp/afxdp.sock``.
> I think instead of adding a note here we can just simply remove the limitation. When the user has this patch, they most likely will not care about limitations that were previously present.
> Just make sure that the information about the behaviour when dp_path is not set and how to set dp_path to be backwards compatible is still captured in the docs somewhere.
> I just think it's confusing to state a limitation followed by a note that it is resolved.
>
> The remainder of the changes in this series LGTM.
>
> Thanks,
> Ciara
>
Hi Maryam,
It would be nice to have the patch for -rc2, otherwise there will be
small time for anyone test the new feature (or existing `use_cni` one),
do you think can the comment be addressed before -rc2?
More information about the stable
mailing list