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 5D56B4366C; Mon, 4 Dec 2023 18:18:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00180402AB; Mon, 4 Dec 2023 18:18:55 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id E9B76400EF for ; Mon, 4 Dec 2023 18:18:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701710334; x=1733246334; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=6P3SYGwiU4CniAhOn+R+T4CxgVIM5kU8rOSALHTMtys=; b=mrORUvbiaHcK0LNEVLRGDPTRnBeieBOAZR05+uXS6byOQqP5b3KIwQN3 BvZrr09Pr5P/+MM/QdpvXbUoc5JpKil14PdNhThk/Qy9XVia8LzKuMqqX ayBLkdKJuFWcTXOUAUB2eyj7SG3f9xh3kCqtTxVvHKMxmCEfnoVPnEWB2 FkvnmWSE0TZgnikHlVzEMZ9bGHL907n/71hamxXD16gkr0ghmVhB8Bh4N lNmCmt0xJHW2mKztaIr6bHc3olm/NP9eEFObtcA1sDAsfJgv882z9h6HF 6HXj/OXxXjEks/tbWn+8dmXuXavjYYSZrEDT+EAxmyjIHK1RUd9P9QRJq w==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="479960480" X-IronPort-AV: E=Sophos;i="6.04,250,1695711600"; d="scan'208";a="479960480" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 09:18:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="1017921474" X-IronPort-AV: E=Sophos;i="6.04,250,1695711600"; d="scan'208";a="1017921474" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga006.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Dec 2023 09:18:50 -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; Mon, 4 Dec 2023 09:18:49 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.34 via Frontend Transport; Mon, 4 Dec 2023 09:18:49 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Mon, 4 Dec 2023 09:18:49 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lLhqHWw8AU+l8BC5KUUi7YIZopuGQrjsEM6gP7pDyPS3Cx4N4a9ky8b03Y62zNrF+v9Mqgsq9ootrgqboc11wOEL/YmnCL8+APjNYn791pUlH4Spr5PW1iecJoocFigExIMD03pNfoLiIDc+EF9e1X4RPqnZIWdVZXaLQG1Y+JNsGg+FN4Bb9LQLrCGfC4sDjyZyb756Ej7TtMSoyr9IHZ/PGAtEgePczT/wjxFyGiVVxAQGq0wOgV+/BmW/hkme8WNf2elsK0bcT0rMsWqbSaYATOdr0sTtWls3RqnQADXiqrfPLT86LKBFX3NJ920dqbt5JUJ/lLmbMr07DHiVkA== 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=22rbbSJAAhaoqvez3rGTtnlclxqNCI/GM6YV6d7sIeg=; b=jwlpDVU9M5FFhy655B9eOCLQ9ZGwF9pI6jakNyM9GqntRa/TX677HewA5L/1oRxQzzKO0fxjO6dYQQ8ezydIuZymlVpUcdQUuDJEi8n10g/qDxOjJasHm8s4xyXlaFQNxo+nn3zELQM77Zk+J8mYAAEENBAmMVSJWLPizA3HKuqwWAqX+fGS/xBzA7pmYQ+0JGerhfSuf8lOcEnAgVzGY46OpwpEs1MAn+cy1WuJ3WvNH1c8G7l0ZOdiYsBBGa/7VZuMWGbiiEdv/ZHw4/tCjHwqcqn7qvyRYLTJST0POMPQqq03hekCeD3le9pWIWHod2sgCs/iFVI7w8AhA7v+CQ== 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 DM6PR11MB3995.namprd11.prod.outlook.com (2603:10b6:5:6::12) by CO1PR11MB4836.namprd11.prod.outlook.com (2603:10b6:303:9d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.33; Mon, 4 Dec 2023 17:18:44 +0000 Received: from DM6PR11MB3995.namprd11.prod.outlook.com ([fe80::7c33:4ba9:947f:d875]) by DM6PR11MB3995.namprd11.prod.outlook.com ([fe80::7c33:4ba9:947f:d875%4]) with mapi id 15.20.7046.033; Mon, 4 Dec 2023 17:18:44 +0000 From: "Koikkara Reeny, Shibin" To: "Tahhan, Maryam" , "ferruh.yigit@amd.com" , "stephen@networkplumber.org" , "lihuisong@huawei.com" , "fengchengwen@huawei.com" , "liuyonglong@huawei.com" 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: AQHaJp0GR9CpZNAYC0qo+JjZO5acUbCZTlmw Date: Mon, 4 Dec 2023 17:18:44 +0000 Message-ID: References: <20231204103101.2124374-1-mtahhan@redhat.com> In-Reply-To: <20231204103101.2124374-1-mtahhan@redhat.com> Accept-Language: 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: DM6PR11MB3995:EE_|CO1PR11MB4836:EE_ x-ms-office365-filtering-correlation-id: 733456e3-aafb-4f14-92e2-08dbf4ed11eb 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: DQx8L2rPSh+IP7qhvA8LpauIyfbf9u6cgSZ7iNMJEnt/48vmQyCKIRHPWpvgKwlOW2QnBW80nXPCewoYNQpW9FkQar3yIMr4wY1Ucu5rQHOpD97Y7iUejIFDU9FmBTgUF8XvjYlqadvAdVyiBno/Wy9AYjBuhWvLuWWjE2Rf23PsnqAFyeN/KlP2741DVInjAfpbv1U+TkJ76d9GWzolBlZTaIDS7AREENPlRZEn0OuFEGXaUsRdGW1cUXhrBMYlRfWbX8Y6Grt0fxS/DH0XKbbUoCNR21OxHoCN/HQ5zT8Pp/hng98kNaqANzrByQNpQja4rLH8vnyWvolOB2FSUrrRM4svloAgzj2DsaNC4Rhe/8hlJmxsCP94NKV4ItGTceVm024989FlZ3EbTo8saUEOugjeMhXq+1x20RNldVDk/Ju4NOmSyF725VRnm5l0zr0NZ4p1ayZyfd+RrlG0WgzyoJdbHCC5sZ2LFT7kP+i6yumgknKH1PESae8XqZwPFcla3choHqll+KJ0UGvCWP6na/BTCTSr9tq2BKLL/oI8naxlUmBoNpAmZvhA5n1YldX+ZHvtMaZPsbIxuGJg/NgIdB6nUg1R42m+2MtsTvmEAu6woOHZlZAy0io3J8aNvmTDAL5D5U+CbuQzkO7rmw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3995.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(136003)(366004)(396003)(376002)(346002)(230922051799003)(186009)(451199024)(64100799003)(1800799012)(66946007)(316002)(54906003)(110136005)(66446008)(76116006)(66476007)(64756008)(66556008)(71200400001)(966005)(478600001)(5660300002)(38070700009)(41300700001)(33656002)(2906002)(30864003)(52536014)(4326008)(8676002)(8936002)(86362001)(83380400001)(55016003)(122000001)(26005)(82960400001)(7696005)(38100700002)(6506007)(53546011)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?R1IULKjW3IkUKkyz9Ch6wXntTYC0qKaEcVZYVqzLX8kqycU5UnJq+iXRZ9PK?= =?us-ascii?Q?sST9g36+M7gY0UfA41XQp6gzeTJ8JomCUVawPdE40psW4jCG0dbbF2frCiHE?= =?us-ascii?Q?rqQfRnoB6zt/l+wUagJWr9wKC5mEoOZbGF95SzbSXcIIAizymRDswlDFfsou?= =?us-ascii?Q?WbPQAVYr+oNS+NKO1phjIcoWgc5BDdk+x1ZjGzFDUsn0VUWgG0Y3ksSoOKDt?= =?us-ascii?Q?9lpD0yFZRoWEucvLhsch8EPtcVkw+Ai0PfLc2odqtb3kT3qlq2GnWua9ITG+?= =?us-ascii?Q?4TRfkDgjEQdRAWzajbJRiPccmpBmpf2YhKLAbIbecQg5RaUde1Tpm/VILPbl?= =?us-ascii?Q?lm7rbaqXn5GycQPxrvHQooJs31+vTbRqoBLlqUK7FbkwYPpajVV1NMNO05zu?= =?us-ascii?Q?hZfx/CEuchQ7+9VwyAPrsjZgYfv+niJcbENCStOzPN0Ezbuv0OnBAjrrpdWr?= =?us-ascii?Q?ToH0bkOos4RZ57NQli6q0xs5CiMniO46wsVcKY7ueWNYVMHP4uNI/Cnu9SvF?= =?us-ascii?Q?w9MDc5wNLQRcfXDLV/EyHDTef/rkcjtlloFylIrQuDaHqsWqD9TmWxNxi16j?= =?us-ascii?Q?OQBxJ1jHkAV/SIiWm9T9qc81lKFg8+lfakehdLICYbPcQkEyFtXoSRxrzOrd?= =?us-ascii?Q?9NQAr03aMpDNvhQiSZHlWolwm+SstU+7JnE5l14oQX2w/hG3/BkzR72yfXG7?= =?us-ascii?Q?4eYu6GFZbNPHaETJi3Eb1gWu8PFIW9iE+pN/XeQk+TMJT0U3/ZwBh/fpxC66?= =?us-ascii?Q?l8BLVuTKdpwpZLKqn22oO/vaatQmHrAs3J+EfPJl+Ujq+te0U93LOFmGEIVx?= =?us-ascii?Q?8uBTHfGzZ7d0xs1WD7nyJ+4kESaDlYNJwp8Titc1N++HWWp3SBaxyaYGPjEp?= =?us-ascii?Q?Dd6eet2Shk6rvtvrF63UsA1iHJf3i1gdIC57cVhysujOSSfD9nm/nNH+GNE/?= =?us-ascii?Q?zK1XebXDx3YlUOruPl+x2SD4kkNv8D0mJWHHnfP7qL35RLwlyiDNq7VcgNoO?= =?us-ascii?Q?htsMmE8cU4hcqCsTsk45F+hirhXd7i1HBA0KaCv3AU2j1qof10VldKIv5Xxh?= =?us-ascii?Q?x27d5UEVcOooeoWzGVUNfNBdgvxZc2CD6FypHHMVvvLmm+xcP3/Xx2j/lwfV?= =?us-ascii?Q?bsYNKH6+pcTIykpFTt7ZUUCafWkkOdOMyRnUcYdcqGKzY+ABt35FtNGWXMFT?= =?us-ascii?Q?xz5K1MvvtH+y/oicR22afkDsABepYP2Ig8Ugcu4Iotr2t5mDY5qS4v4taSpg?= =?us-ascii?Q?M7evA2vdk7Ql5MbNmv+pvMGWfeCuy4mfTbQEjF+ZrlZ9tHHP4paAKhCbMh1b?= =?us-ascii?Q?E9hN8P6iFoxXdw+OooBA+iB+UezaNlP9LbX0y6fbd+DcJIEhsekRxqH2oNp+?= =?us-ascii?Q?HuWvrLMZvpoCGQ1ZwMvMnPuluxZOQ2xyY7YC/MgBZZcuLd+OHCcH7kwNhj5x?= =?us-ascii?Q?s7m6HM5hiNESAuZ0BDcg8hcZWN8B5AotmJhTr5A8V4fCGCnj47+ybuljcqqy?= =?us-ascii?Q?6t/oh7yE8zB+ZmSBNxQ/yybO9X4SzM52M6BrsxSipJW+cFg9pY2dK94LOWRt?= =?us-ascii?Q?XHci99yPKbdGNrZ/b98/NM7tOjtlb2JGFmBHp9GOW0J7jZGI8TkAjYFbUkiD?= =?us-ascii?Q?jA=3D=3D?= 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: DM6PR11MB3995.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 733456e3-aafb-4f14-92e2-08dbf4ed11eb X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Dec 2023 17:18:44.8065 (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: Ck/FSs0GqTogOXNadvCapkFv1Vv8VJzMhhfyK1YqGBv2TcPG+taFCW1eISSusMWu8Qz4bwqm6QWh6PN6lPLseM7UH1ykaRz/wQolWcBgaFU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4836 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 Hi Maryam, Apologies for asking this question bit late.=20 The UDS sock name will be afxdp.sock only and addition director is created = between the sock name and the uds filepath (/tmp/afxdp_dp//= afxdp.sock). As per the command " --vdev net_af_xdp0,iface=3D,use_cni=3D= 1,uds_path=3D/tmp/afxdp_dp//afxdp.sock" We are already passing the interface name(iface=3D . So can= 't we create the uds_path inside the program uds_path=3D"/tmp/afxdp_dp/"+ i= face + "afxdp.sock" If you check the code afxdp-plugins-for-kubernetes constants.go [1] they st= ill have the constants and also they are using these constants to create th= e path [2] [1] https://github.com/intel/afxdp-plugins-for-kubernetes/blob/main/constan= ts/constants.go#L84=20 [2] https://github.com/intel/afxdp-plugins-for-kubernetes/blob/main/interna= l/deviceplugin/poolManager_test.go#L78 If we are able to create path in the program then user won't have to pass a= long argument value. Regards, Shibin > -----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 rat= her > than a configurable one), if a single pod is requesting multiple net devi= ces > and these devices are from different pools, then the container attempts t= o > 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. T= his > patch addresses this by making the socket parameter configurable alongsid= e > 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 insertin= g > 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 Need to update the 1.3. Prerequisites. > 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 There is a typo " iface=3De \ > + -- -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, cha= r > *if_name, int *start_queue, > 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", > + 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