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 6AE1743678; Tue, 5 Dec 2023 14:43:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F66A42E42; Tue, 5 Dec 2023 14:43:36 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id ECBA440297 for ; Tue, 5 Dec 2023 14:43:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701783814; x=1733319814; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=0xS467GX9HMBuwh85Qg4Yi8kQkn0EPu1HRSeUJXE2R0=; b=UI5zHhFFiRQPFCJ1rIQUJq5Deq3wlgl4zuZB3lgA9DaiR0qMuFfMBZa/ okPC3YuBW8mU8po6a4NpBvtPMS7tYG2GMtd5eUx68AqLv8QjXGHHwh5uu q+RQDM0sljQCPdlEjfh89hsccNhm2udluYoraGTLyu+EaKEKhVPoSwfQr 6zJn6it/VR3kA16dijDPd1PKH7GhCe6U239H0ifBBMhY37a33F5bm8Rfb zok3TumhNE01wQOPB+Lgk4MZuRTEPueaX5ysk7fbKLrFejI/fmjAyrnPu VSs3WDBe8zoxRKK0UPZ2fNJ3QLZtlW68B9qtVInWTjJI+HOGg/i6DDksp Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="12610862" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="12610862" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 05:43:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="720702207" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="720702207" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Dec 2023 05:43:32 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 5 Dec 2023 05:43:32 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Tue, 5 Dec 2023 05:43:32 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Tue, 5 Dec 2023 05:43:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R1LpoA20t+mkDlzz5YTPQn6EKXQcN8PPpa1D0mb9ZtGhHSUnoN5Wq7j7hPsIx1AwDpfdnD+U9qTba8oyoz6et380/WUHKb/87sbb9l8jqVvdow5UIvdX0n/rimMJtIPzLDcj3oTWeKCt1gED/4i0LsE3m+95Gms6aVf1CYu0i+KKI/vF4b+GGEJCfjRcXw1gbMMAp+VOe3gwAZZd6ArcGXdkXcmdcpCcKYBTPUiVjnXC7MxPi5VoVhmrbzQMnp+v+8hrFlWEroGLTWalS5Fpbcogz6VYWtJMhAkAEYy4vWYwTb5nrhvvuYuM7WRi/E/E9NA1JcDVElymYHVI0NVcaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VDhZBnsyx4khr5N4dKYPlX7dCdmS66nvWJG5JpADqpc=; b=O0cIbvUf6nydEUcKeEjr3ARNykFyj0WjejC1zWfeq4dEgx7kQIc3+jYwjeRwU7GmeDWZ2jUAaaGqtweqZuHptfqNInLOhRn3oy5GNq69mNmoEvw+2Fvt2DHoSKX7WJV+p2DCeLCVec2eQbXCmNrfp3OX+zh/8h00Dxi8R5zicOAN1H9cazrhsz+8nX1iQ09sJCjqYVUUon0sy5Gbw9L/gYzWrqE4krfCrN7H8+O0dGmlxXvp9sqb0XK8pSDCuTqpVJL1ZBMHiohI1Hk58Pdk7SdLWbS/6zdT+BAoUrQQmwAj7tS3qR+I04zRiv40Uy2Lbl3+T6gwWenwnxfGMxTsyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by SA1PR11MB6616.namprd11.prod.outlook.com (2603:10b6:806:257::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.22; Tue, 5 Dec 2023 13:43:29 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::2f2f:41ab:b556:7257]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::2f2f:41ab:b556:7257%3]) with mapi id 15.20.7046.034; Tue, 5 Dec 2023 13:43:29 +0000 From: "Loftus, Ciara" To: "Tahhan, Maryam" , "ferruh.yigit@amd.com" , "stephen@networkplumber.org" , "lihuisong@huawei.com" , "fengchengwen@huawei.com" , "liuyonglong@huawei.com" , "Koikkara Reeny, Shibin" CC: "dev@dpdk.org" , "Tahhan, Maryam" Subject: RE: [v2] net/af_xdp: enable a sock path alongside use_cni Thread-Topic: [v2] net/af_xdp: enable a sock path alongside use_cni Thread-Index: AQHaJp0OdMvQtmlzjEK1wOpO/cmER7CatAjg Date: Tue, 5 Dec 2023 13:43:29 +0000 Message-ID: References: <20231204103101.2124374-1-mtahhan@redhat.com> In-Reply-To: <20231204103101.2124374-1-mtahhan@redhat.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|SA1PR11MB6616:EE_ x-ms-office365-filtering-correlation-id: 88ae4136-a9ed-484c-7f5a-08dbf5982a18 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yVgL10EgHjtyjuuQZMvxJuHmmz8PDOSPaTbkpf7dtwG8fuSKS5Fmo/ZNx0FTE3KthHPbEWyFApwETKDvnowXxq5J6kQZCBf1WeYPhxtW3fv4tShNLWihev7RwNqM6qkNdRAJG3Bcybmrx1eEU9CoZ3RNDJYFmxNxTN5RyrTh6ngCybxmA1u0By+/fMS8jsafg/2NGUoU1I8hYk39+lj2K4uyHqE1zrl626c8j5Ehy+E1PGD0BYIhzLq/JaWttTk5Sk/7uySd+pNTwCtHmDd3GoQxEBJt9HBhlgmyeEh2Yd84VVj7IxQ6jNrvAgjihatAh07uCb8OlZCzPZZbZrMN4/rt8hfg9NnkOqDPUKLUY3O/44XIyLXlDKoh9saJmGk8UAZd4ZFFTbjP2FH06lugbJnjc/N/BgkOv94qnlhN7YX3wJD0d36fcaZLwmOycUH4sQ6NZwedYfIKuewd04oMBC7yxx+7EasREGzZG/o2MVEzfh3nG63PdlS34jZbayVldt0B+l64DCACflMyMzkG3k10ic9thg6uMicg/bG6cBIjrbS2QFSSv6ugZ6qtDw25jTTh4oZNjjpHTKa3kBaTRIAW0/t5dJYYBCGY9kaX1yo= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR11MB5872.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(396003)(39860400002)(366004)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(316002)(83380400001)(71200400001)(52536014)(7696005)(6506007)(64756008)(6636002)(86362001)(66476007)(66946007)(26005)(55016003)(66446008)(110136005)(54906003)(76116006)(4326008)(8676002)(8936002)(966005)(478600001)(53546011)(9686003)(66556008)(5660300002)(38100700002)(82960400001)(122000001)(30864003)(41300700001)(38070700009)(33656002)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qGztizYM/ooUTwsatcAAkpdLzJvhWV326nPQ2BzVC4UdD50yAKIPTVnFFQvY?= =?us-ascii?Q?Pc1dWcIpYc3PwJk79M/LoaDhG7YbC+YC4k7FIrGj5+G50nStmac66TDFgnRM?= =?us-ascii?Q?cimxhUchaYz2kAYrHRc95v/2tKI28w0IPzMljo6xSuH7L+w5t1+/+nJ0U6eY?= =?us-ascii?Q?TAaXoqfLGnF9n8f+BKUbtUxaf/v3lxiVwoIVoFfbKTIGT14UofNvyitfYxey?= =?us-ascii?Q?TG6CaX1ijLWVF68nuGakXJQSNRip6gTywo2/fkpOSxmQ1W7VWWG4DZZUkPKz?= =?us-ascii?Q?Q6RH5OoQgfKiPH7tzgq97iYEmzxITPirtEpFCl7bCdk0YznDnjwxZo8wTAMB?= =?us-ascii?Q?ZdFaERbvvHqko6VioKeyMUbxDvUg2dzMCcP8Z/KAeFcdB30OQpicmBJVPHS3?= =?us-ascii?Q?FL7LZomFLQLKmnXI9zPehais3lMDIkg7fOZkQN2vsGgIBMjdeL9SvntxI3++?= =?us-ascii?Q?O9PVM6PYQNI7jew7DIc3ab/Hzh1SQ98IHEyLC85qgsXzWKHiVWJthXqujxaR?= =?us-ascii?Q?cyrE3vicBXYSHaXzm1BmyLWpV9JzbfWQhNMwvolcuXKYsNLeXZEQiD7ZxZWa?= =?us-ascii?Q?sEj0nEAIDYtR+JRQ8qGeZXQ3dH7qDlILSXnl80ZMbZDbmy4jto5Oc5X3zTtk?= =?us-ascii?Q?waRe+vSrH12VgW3is6vF+2/x7uOlD4ZYCYSN8FIXTrqtdQltz0gYxPvlNtNg?= =?us-ascii?Q?cdx0crm7BbZr9Pi5ikBV4OeNdaxVhq52CD0tYCFseUFPLq0hkvVi47Rnv3ks?= =?us-ascii?Q?Dn00H36m3tsuNwOROXcuIBUv+/2avwK0SAqkbm9WHAtdz5LGDe0BlrpEJv2b?= =?us-ascii?Q?6BNhVcukizDqG7Mgl8xwD9wUFVsBOECZIyof4kI5n7qhuI775FDWYhmWzOTB?= =?us-ascii?Q?+W21OSpJBbWnyM0JULJTSLcpYZOKxsJdoFsbPLEAv4k0+vksME4QTVX+AIVI?= =?us-ascii?Q?l5u7pcAAHxYnajiasrrpogpg1MWCPbSYlm89Pez9ifHDljW1c00K4kz5njBP?= =?us-ascii?Q?sRJgmlQU29VwiZ4ivqyQYI47ubgRyeIVKg6Igo7Uy96nKFQic5mP4ulOYynf?= =?us-ascii?Q?WsouhsBAlkfvZ0HA63YVZ1T0LOs0698mDZL7U6uGSxqUS1H5El+7178AkKq3?= =?us-ascii?Q?oRmhrL+1CCsEg/Xlk3oLqQw8ioIKW553dEi1N7JWrwUlpWCfno575UBtYIjm?= =?us-ascii?Q?oPh88EumppCO+onPh818T9DkzyhMyYbaIc7xtp+/Umjgd4KI0HjTgEGuhcj+?= =?us-ascii?Q?vT6UHJJYESMNemitxzsD4wvUuisGpX3duA/Xj5D4zH3bAr28yeieSM2MNAQR?= =?us-ascii?Q?s8K9UgH7NGoTF4HL26YctC2S+BYN5a9N5QTVHMCDw0U1gV0kNlp142e6gnpg?= =?us-ascii?Q?Qvw/AtaMlXKzayjGhumQTSvu9B6OZ89QR+Hs5d44dmk/CxIW80Mp6hZtXi/7?= =?us-ascii?Q?/82lpZGfY3S6Q24yAuHb4WrKsm1nvwjv40U0KyPPKPSJJSqQpgxR2rhO2AMX?= =?us-ascii?Q?dpjGwRiXN3aRdZAqqQP0wFCcvznB2UROJJFxXQ+tMw/8yUDS1f7soeYSZsve?= =?us-ascii?Q?f0IbRFhXkqHdBvS4lLVfW75LLiEJSjXGJ7YHdVz/?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88ae4136-a9ed-484c-7f5a-08dbf5982a18 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2023 13:43:29.2711 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7Poj7OcVxsrJU1Ilbe0qsC67gAqLolfPC/kBKPvsq7KjNsXvMEWqEIx1jvmXZDFub1+4nbUOzbrO4O41Epn9vQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6616 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Maryam Tahhan > Sent: Monday, December 4, 2023 10:31 AM > To: ferruh.yigit@amd.com; stephen@networkplumber.org; > lihuisong@huawei.com; fengchengwen@huawei.com; > liuyonglong@huawei.com; Koikkara Reeny, Shibin > > Cc: dev@dpdk.org; Tahhan, Maryam > Subject: [v2] net/af_xdp: enable a sock path alongside use_cni >=20 > With the original 'use_cni' implementation, (using a > hardcoded socket rather than a configurable one), > if a single pod is requesting multiple net devices > and these devices are from different pools, then > the container 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 alongside the 'use_cni' param. > Tested with the AF_XDP DP CNI PR 81. >=20 > v2: > * Rename sock_path to uds_path. > * Update documentation to reflect when CAP_BPF is needed. > * Fix testpmd arguments in the provided example for Pods. > * Use AF_XDP API to update the xskmap entry. >=20 > Signed-off-by: Maryam Tahhan > --- > doc/guides/howto/af_xdp_cni.rst | 24 ++++++----- > drivers/net/af_xdp/rte_eth_af_xdp.c | 62 ++++++++++++++++++----------- > 2 files changed, 54 insertions(+), 32 deletions(-) >=20 > diff --git a/doc/guides/howto/af_xdp_cni.rst > b/doc/guides/howto/af_xdp_cni.rst > index a1a6d5b99c..7829526b40 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. >=20 > -The EAL vdev argument ``use_cni`` is used to indicate that the user wish= es > -to run the PMD in unprivileged mode and to receive the XSKMAP file > descriptor > -from the CNI. > +The EAL vdev arguments ``use_cni`` and ``uds_path`` 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. >=20 > .. note:: >=20 > - 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". >=20 >=20 > Prerequisites > @@ -223,8 +224,7 @@ Howto run dpdk-testpmd with CNI plugin: > securityContext: > capabilities: > add: > - - CAP_NET_RAW > - - CAP_BPF > + - NET_RAW > resources: > requests: > hugepages-2Mi: 2Gi > @@ -239,14 +239,20 @@ Howto run dpdk-testpmd with CNI plugin: >=20 > .. _pod.yaml: https://github.com/intel/afxdp-plugins-for- > kubernetes/blob/v0.0.2/test/e2e/pod-1c1d.yaml >=20 > +.. note:: > + > + For Kernel versions older than 5.19 `CAP_BPF` is also required in > + the container capabilities stanza. > + > * Run DPDK with a command like the following: >=20 > .. code-block:: console >=20 > kubectl exec -i --container -- \ > - //dpdk-testpmd -l 0,1 --no-pci \ > - --vdev=3Dnet_af_xdp0,use_cni=3D1,iface=3D \ > - -- --no-mlockall --in-memory > + //dpdk-testpmd -l 0-2 --no-pci --main-lcore=3D2 \ > + --vdev net_af_xdp0,iface=3D name>,use_cni=3D1,uds_path=3D/tmp/afxdp_dp//afxdp.sock \ > + --vdev net_af_xdp1,iface=3De name>,use_cni=3D1,uds_path=3D/tmp/afxdp_dp//afxdp.sock \ > + -- -i --a --nb-cores=3D2 --rxq=3D1 --txq=3D1 --forward-mode= =3Dmacswap; >=20 > For further reference please use the `e2e`_ test case in `AF_XDP Plugin = for > Kubernetes`_ >=20 > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c > b/drivers/net/af_xdp/rte_eth_af_xdp.c > index 353c8688ec..505ed6cf1e 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > @@ -88,7 +88,6 @@ RTE_LOG_REGISTER_DEFAULT(af_xdp_logtype, NOTICE); > #define UDS_MAX_CMD_LEN 64 > #define UDS_MAX_CMD_RESP 128 > #define UDS_XSK_MAP_FD_MSG "/xsk_map_fd" > -#define UDS_SOCK "/tmp/afxdp.sock" > #define UDS_CONNECT_MSG "/connect" > #define UDS_HOST_OK_MSG "/host_ok" > #define UDS_HOST_NAK_MSG "/host_nak" > @@ -171,6 +170,7 @@ struct pmd_internals { > bool custom_prog_configured; > bool force_copy; > bool use_cni; > + char uds_path[PATH_MAX]; > struct bpf_map *map; >=20 > struct rte_ether_addr eth_addr; > @@ -191,6 +191,7 @@ struct pmd_process_private { > #define ETH_AF_XDP_BUDGET_ARG "busy_budget" > #define ETH_AF_XDP_FORCE_COPY_ARG "force_copy" > #define ETH_AF_XDP_USE_CNI_ARG "use_cni" > +#define ETH_AF_XDP_USE_CNI_UDS_PATH_ARG "uds_path" >=20 > static const char * const valid_arguments[] =3D { > ETH_AF_XDP_IFACE_ARG, > @@ -201,6 +202,7 @@ static const char * const valid_arguments[] =3D { > ETH_AF_XDP_BUDGET_ARG, > ETH_AF_XDP_FORCE_COPY_ARG, > ETH_AF_XDP_USE_CNI_ARG, > + ETH_AF_XDP_USE_CNI_UDS_PATH_ARG, > NULL > }; >=20 > @@ -1351,7 +1353,7 @@ configure_preferred_busy_poll(struct > pkt_rx_queue *rxq) > } >=20 > static int > -init_uds_sock(struct sockaddr_un *server) > +init_uds_sock(struct sockaddr_un *server, const char *uds_path) > { > int sock; >=20 > @@ -1362,7 +1364,7 @@ init_uds_sock(struct sockaddr_un *server) > } >=20 > server->sun_family =3D AF_UNIX; > - strlcpy(server->sun_path, UDS_SOCK, sizeof(server->sun_path)); > + strlcpy(server->sun_path, uds_path, sizeof(server->sun_path)); >=20 > if (connect(sock, (struct sockaddr *)server, sizeof(struct > sockaddr_un)) < 0) { > close(sock); > @@ -1382,7 +1384,7 @@ struct msg_internal { > }; >=20 > static int > -send_msg(int sock, char *request, int *fd) > +send_msg(int sock, char *request, int *fd, const char *uds_path) > { > int snd; > struct iovec iov; > @@ -1393,7 +1395,7 @@ send_msg(int sock, char *request, int *fd) >=20 > memset(&dst, 0, sizeof(dst)); > dst.sun_family =3D AF_UNIX; > - strlcpy(dst.sun_path, UDS_SOCK, sizeof(dst.sun_path)); > + strlcpy(dst.sun_path, uds_path, sizeof(dst.sun_path)); >=20 > /* Initialize message header structure */ > memset(&msgh, 0, sizeof(msgh)); > @@ -1471,7 +1473,7 @@ read_msg(int sock, char *response, struct > sockaddr_un *s, int *fd) >=20 > static int > make_request_cni(int sock, struct sockaddr_un *server, char *request, > - int *req_fd, char *response, int *out_fd) > + int *req_fd, char *response, int *out_fd, const char > *uds_path) > { > int rval; >=20 > @@ -1483,7 +1485,7 @@ make_request_cni(int sock, struct sockaddr_un > *server, char *request, > if (req_fd =3D=3D NULL) > rval =3D write(sock, request, strlen(request)); > else > - rval =3D send_msg(sock, request, req_fd); > + rval =3D send_msg(sock, request, req_fd, uds_path); >=20 > if (rval < 0) { > AF_XDP_LOG(ERR, "Write error %s\n", strerror(errno)); > @@ -1507,7 +1509,7 @@ check_response(char *response, char *exp_resp, > long size) > } >=20 > static int > -get_cni_fd(char *if_name) > +get_cni_fd(char *if_name, const char *uds_path) > { > char request[UDS_MAX_CMD_LEN], > response[UDS_MAX_CMD_RESP]; > char hostname[MAX_LONG_OPT_SZ], > exp_resp[UDS_MAX_CMD_RESP]; > @@ -1520,14 +1522,14 @@ get_cni_fd(char *if_name) > return -1; >=20 > memset(&server, 0, sizeof(server)); > - sock =3D init_uds_sock(&server); > + sock =3D init_uds_sock(&server, uds_path); > if (sock < 0) > return -1; >=20 > /* Initiates handshake to CNI send: /connect,hostname */ > snprintf(request, sizeof(request), "%s,%s", UDS_CONNECT_MSG, > hostname); > memset(response, 0, sizeof(response)); > - if (make_request_cni(sock, &server, request, NULL, response, > &out_fd) < 0) { > + if (make_request_cni(sock, &server, request, NULL, response, > &out_fd, uds_path) < 0) { > AF_XDP_LOG(ERR, "Error in processing cmd [%s]\n", request); > goto err_close; > } > @@ -1541,7 +1543,7 @@ get_cni_fd(char *if_name) > /* Request for "/version" */ > strlcpy(request, UDS_VERSION_MSG, UDS_MAX_CMD_LEN); > memset(response, 0, sizeof(response)); > - if (make_request_cni(sock, &server, request, NULL, response, > &out_fd) < 0) { > + if (make_request_cni(sock, &server, request, NULL, response, > &out_fd, uds_path) < 0) { > AF_XDP_LOG(ERR, "Error in processing cmd [%s]\n", request); > goto err_close; > } > @@ -1549,7 +1551,7 @@ get_cni_fd(char *if_name) > /* Request for file descriptor for netdev name*/ > snprintf(request, sizeof(request), "%s,%s", UDS_XSK_MAP_FD_MSG, > if_name); > memset(response, 0, sizeof(response)); > - if (make_request_cni(sock, &server, request, NULL, response, > &out_fd) < 0) { > + if (make_request_cni(sock, &server, request, NULL, response, > &out_fd, uds_path) < 0) { > AF_XDP_LOG(ERR, "Error in processing cmd [%s]\n", request); > goto err_close; > } > @@ -1571,7 +1573,7 @@ get_cni_fd(char *if_name) > /* Initiate close connection */ > strlcpy(request, UDS_FIN_MSG, UDS_MAX_CMD_LEN); > memset(response, 0, sizeof(response)); > - if (make_request_cni(sock, &server, request, NULL, response, > &out_fd) < 0) { > + if (make_request_cni(sock, &server, request, NULL, response, > &out_fd, uds_path) < 0) { > AF_XDP_LOG(ERR, "Error in processing cmd [%s]\n", request); > goto err_close; > } > @@ -1695,17 +1697,16 @@ xsk_configure(struct pmd_internals *internals, > struct pkt_rx_queue *rxq, > } >=20 > if (internals->use_cni) { > - int err, fd, map_fd; > + int err, map_fd; >=20 > /* get socket fd from CNI plugin */ > - map_fd =3D get_cni_fd(internals->if_name); > + map_fd =3D get_cni_fd(internals->if_name, internals- > >uds_path); > if (map_fd < 0) { > AF_XDP_LOG(ERR, "Failed to receive CNI plugin fd\n"); > goto out_xsk; > } > - /* get socket fd */ > - fd =3D xsk_socket__fd(rxq->xsk); > - err =3D bpf_map_update_elem(map_fd, &rxq->xsk_queue_idx, > &fd, 0); > + > + err =3D xsk_socket__update_xskmap(rxq->xsk, map_fd); > if (err) { > AF_XDP_LOG(ERR, "Failed to insert unprivileged xsk in > map.\n"); > goto out_xsk; > @@ -2023,7 +2024,8 @@ xdp_get_channels_info(const char *if_name, int > *max_queues, > static int > parse_parameters(struct rte_kvargs *kvlist, char *if_name, int *start_qu= eue, > int *queue_cnt, int *shared_umem, char *prog_path, > - int *busy_budget, int *force_copy, int *use_cni) > + int *busy_budget, int *force_copy, int *use_cni, > + char *uds_path) > { > int ret; >=20 > @@ -2069,6 +2071,11 @@ parse_parameters(struct rte_kvargs *kvlist, char > *if_name, int *start_queue, > if (ret < 0) > goto free_kvlist; >=20 > + ret =3D rte_kvargs_process(kvlist, > ETH_AF_XDP_USE_CNI_UDS_PATH_ARG, > + &parse_prog_arg, uds_path); > + if (ret < 0) > + goto free_kvlist; > + > free_kvlist: > rte_kvargs_free(kvlist); > return ret; > @@ -2108,7 +2115,7 @@ static struct rte_eth_dev * > init_internals(struct rte_vdev_device *dev, const char *if_name, > int start_queue_idx, int queue_cnt, int shared_umem, > const char *prog_path, int busy_budget, int force_copy, > - int use_cni) > + int use_cni, const char *uds_path) > { > const char *name =3D rte_vdev_device_name(dev); > const unsigned int numa_node =3D dev->device.numa_node; > @@ -2138,6 +2145,7 @@ init_internals(struct rte_vdev_device *dev, const > char *if_name, > internals->shared_umem =3D shared_umem; > internals->force_copy =3D force_copy; > internals->use_cni =3D use_cni; > + strlcpy(internals->uds_path, uds_path, PATH_MAX); >=20 > if (xdp_get_channels_info(if_name, &internals->max_queue_cnt, > &internals->combined_queue_cnt)) { > @@ -2328,6 +2336,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device > *dev) > int busy_budget =3D -1, ret; > int force_copy =3D 0; > int use_cni =3D 0; > + char uds_path[PATH_MAX] =3D {'\0'}; > struct rte_eth_dev *eth_dev =3D NULL; > const char *name =3D rte_vdev_device_name(dev); >=20 > @@ -2370,7 +2379,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device > *dev) >=20 > if (parse_parameters(kvlist, if_name, &xsk_start_queue_idx, > &xsk_queue_cnt, &shared_umem, prog_path, > - &busy_budget, &force_copy, &use_cni) < 0) { > + &busy_budget, &force_copy, &use_cni, > uds_path) < 0) { > AF_XDP_LOG(ERR, "Invalid kvargs value\n"); > return -EINVAL; > } > @@ -2387,6 +2396,12 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device > *dev) > return -EINVAL; > } >=20 > + if (use_cni && !strnlen(uds_path, PATH_MAX)) { > + AF_XDP_LOG(ERR, "When '%s' parameter is used, '%s' must > also be provided\n", Thanks for the patch Maryam. Do we really need the use_cni devarg anymore if we must also always pair it= with a uds_path string? I am in favour of removing it if both yourself and Shibin think that makes = sense too. Ciara > + ETH_AF_XDP_USE_CNI_ARG, > ETH_AF_XDP_USE_CNI_UDS_PATH_ARG); > + return -EINVAL; > + } > + > if (strlen(if_name) =3D=3D 0) { > AF_XDP_LOG(ERR, "Network interface must be specified\n"); > return -EINVAL; > @@ -2410,7 +2425,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device > *dev) >=20 > eth_dev =3D init_internals(dev, if_name, xsk_start_queue_idx, > xsk_queue_cnt, shared_umem, prog_path, > - busy_budget, force_copy, use_cni); > + busy_budget, force_copy, use_cni, > uds_path); > if (eth_dev =3D=3D NULL) { > AF_XDP_LOG(ERR, "Failed to init internals\n"); > return -1; > @@ -2471,4 +2486,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_af_xdp, > "xdp_prog=3D " > "busy_budget=3D " > "force_copy=3D " > - "use_cni=3D "); > + "use_cni=3D " > + "uds_path=3D "); > -- > 2.41.0