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 EB43443410; Thu, 30 Nov 2023 13:14:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EDA242EDB; Thu, 30 Nov 2023 13:14:33 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id DB4EF42E97 for ; Thu, 30 Nov 2023 13:14:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701346472; x=1732882472; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=gFKrq/LunFJJNUUsEGqTqx4D25N6zpZV6Z8y6dl5e5U=; b=PSUKiCDB0QPgs7usjllhJbM/n0unKcpjIiZb00gZ3z9+TybTH9Mv8VdK KhpN/ShR0lVu//PhRq/VDUOXqLd3WOWhuOZKdsQTwJ0r8qjK6M8gr53iZ tKXJb+joPtlDQfXmk1qCwKx3OobrZ/RdARap5GIX9KQJ4H6AkfoyCkcLp xkRtKnjJp6baQAOABUzrF6VZSPoRG/pi4e8DpZyi2MvYtNL9tNo1P9R5K OdNxbzLz0RE/TGkaTo1EIG3il+1nQrfyQuwInajUmDj/PEjflZsIh9APk FDOv+m9ElMVt5Qw6GqhnhOIhPM8nJNH9VUDMfjykRrJnkDbbBwXZHT/t1 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="479516609" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="479516609" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 04:14:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="913178960" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="913178960" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 Nov 2023 04:14:30 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 30 Nov 2023 04:14:30 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 30 Nov 2023 04:14:29 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Thu, 30 Nov 2023 04:14:29 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Thu, 30 Nov 2023 04:14:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B0nhKNhZ7McPb7VmjPDWC9htRiL/nCE3hmvLT8AqeHLkQEAYvm+XtCo6df1CP0BpRtIfWUx9FEgLpOA3EzwlKyk/mCC6nR3LWTcOgUf3vDP4JRSCmQ1SHtF61fEsEeEM8VPPVtZpFSXVCPCvkj4Ua9d3lY/9qsGZEEVfrYm7ISTRg6AQ6PfpiPhDWvsiWkvR7P3ZNAcjoYVeNXC03jEAXRZpkvJhcUzQfGS9L8TsugmMd/lrldK8KM7ztL3g6izXqero8Tcr+4xgZwUhFcxM31jIkJnGEXC5Xg0uGG2mQQCMjqGqCp6aLVBAUVxyoCSJUDMh4mMOpEPtKNU2+jIuCA== 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=HI1nSmkPARaIcoD5xiHYhVkLg/Swb6TURWvJw638GC4=; b=Ceu66wH86n3dgZfgrEfoYDFPmcgqxo6Gi6W1xaDqjOUoa0N6ZBCOiQ9RLVMiLPyb1/0TVJa2uTbvrGTfXnqnI3YMzIwj4xTlxa1UWtVJquY4EQsu+MwiayTg1zndkgEv6/U7NSLezr17bOH39CZ7pmvrefCAkxOjxkocblV3kYfIC2gKhDSRjWagHKXqso71O7rbmqeEORRhqgYJG836rXVxqsgVPX956j6OQPn5sbew20miAnG969d1mCJuW7daQuvwbLM+wWrwAZKWgQYy9bU2F+vLeqlg2TnWARaDsO3uz8FD02W3mjnPHWHKHqCVLDMD5LdAOHPB4k1Arw8Nnw== 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 CY8PR11MB7848.namprd11.prod.outlook.com (2603:10b6:930:6c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24; Thu, 30 Nov 2023 12:14:11 +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.024; Thu, 30 Nov 2023 12:14:11 +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: [v1] net/af_xdp: enable a sock path alongside use_cni Thread-Topic: [v1] net/af_xdp: enable a sock path alongside use_cni Thread-Index: AQHaI22UiKYic4MAX06499Pb1NlPqbCSwTWQ Date: Thu, 30 Nov 2023 12:14:10 +0000 Message-ID: References: <20231130091332.2315572-1-mtahhan@redhat.com> In-Reply-To: <20231130091332.2315572-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_|CY8PR11MB7848:EE_ x-ms-office365-filtering-correlation-id: 4545b1bf-3eb8-4f51-767d-08dbf19ddc30 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: rT1HNgb1owK37tBljRUckJc8+1OJtBIORQZi0ZdnNvRSqbs8gnm1WMVso9u9jFZwhECVzq/O056XOJJLBzpcFJp1X4+KSyakI64bYk1uAs6u3qJRHHO9x+ff3gTsSRzcN42tWmSJT3BgPMrt19rbL7PWc3ImwGbtnwQ4tplXv5C4fqRsccQEUWkef+77//vPG12u6TgkJp3b1NkPJCxL1Lw5S/r5ceoJKbHazwbanyOb6viIwoarV34II5tGxMiuEyXbws5IPq6ifFydTT9x2Yj9DETEs5DhqCT+EMmmV9i7kah2xEAmajuKvU5x7cdLKkHQuvSlAcPE/pnAL8DIhaMUWHe932qtY3WWwpcWxLtM6eVarp28L5BTgOvQkSgSqZXamPDjmNUL3+q4pGk2j32GhVyAouAjuM1XCQs9OFouDQJkrOdcgjIXMZkglBgVNCJTAW9eI5RJVUueIzh3hxdwjOKQrUxv2V4NMlGc0pC3u3SAXUtx9/qWgd4/Sf3O7bln5mFUw/FmKuNLIg5q3pzKArYbg0frYGX5IPb/kgsRSwd97R6yU3Kk5li95DX9hRPe5w+37Vfec7zWgM0aOD7W3p9FC8gk/8x/XQAzz/rpfxRQXs4nGRMw0Bnx9x2lIoM0MUpxAEUcsE0kRgol4A== 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)(346002)(376002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(6506007)(26005)(83380400001)(53546011)(7696005)(9686003)(122000001)(5660300002)(4326008)(8676002)(52536014)(8936002)(41300700001)(30864003)(2906002)(478600001)(316002)(110136005)(71200400001)(54906003)(64756008)(66446008)(66476007)(66556008)(66946007)(76116006)(202311291699003)(33656002)(38100700002)(82960400001)(86362001)(38070700009)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kY4zOboOwKunK8L/mzW1sX1Skv8xYzpnod/pmrpl98DYXK34epvNHyX2tRHe?= =?us-ascii?Q?/pG551r3yHG2mhfm3ZAU4r4n2UMw6wQ/BLe4gsbEeb88lGZ5YcO68o63zqA1?= =?us-ascii?Q?fFerUmHfeuzcrN1DuksbiV+WI7foxJOHQfXullqn7rBR6E6lOAoxDNYAOzNK?= =?us-ascii?Q?vmnlUTybKzuVf/rE0kDnbn18n22vPePO7qJjFHWdn1qIPxQ2D/h9D4e0nGfY?= =?us-ascii?Q?dXU3TWWDTtlwfGhIzoYV6/CHp1IZpMVdzpzAlf11muj+caWxliYjU7VLXFM6?= =?us-ascii?Q?I/COUf+MUqqaz9FOm/VxqnwmYTvVzMR3W6IPeyQC/C65rWcE64rsSb4FQwP0?= =?us-ascii?Q?woTW2pTRy7hksHaPnPNqcCalQxpfN2cpdu/JhDqG/SjubCo7AAHECaGCER16?= =?us-ascii?Q?BnDgdJ+Fe1XiyTh6LUFTiCaYlBBpqwMdSkrFJSi1gFua39uM+WYMoyvAcKGz?= =?us-ascii?Q?Z0rla3Vvk7y4u0rmeIUQqww32hRXpaoiWTPyjV6fvzMPbsUtZDgLV6FDiu8M?= =?us-ascii?Q?nWC8DXWAUohMRxOdGkjEjWLC/KBVp9Baeov3ruArQY+0z0iFHkMReOwjwaJN?= =?us-ascii?Q?I2gQ9NwXGyPd0H1DBna4q+UdVa2GdcMyFRktWmp7mNn9BNMNftSKrCPhkr3Z?= =?us-ascii?Q?bh0vyiWMmLmfPe5SvA4tTj9ENLALuFdiBA9eAWCVEBszpLRGtfGI983UzW7/?= =?us-ascii?Q?Sqd5eVOiuvCWLwQFDYUVbRAjw6P3Cjcj0WNtk+utlazGd/P74xibOqGNbkL6?= =?us-ascii?Q?s54ic3NdX5g0d4nwupqjiEGMMxc9wnm6JRu9bGsiLt3q5wpUKnnNe64cW1AH?= =?us-ascii?Q?CQBE5K9Ie0FbU2gtM+rd6mWzZEhpUtPzquCJAhfsmwbVmqqjtD0e1myOxFZo?= =?us-ascii?Q?V6VrSwBEJiVPHaRymxR+lgb/dWrxbOLkFDFHG0MEwfmxCKYoh8dWpj8iVOds?= =?us-ascii?Q?Wia8zTumuFQt+unTK6ZgqjdoprPRRlUXCwbl8CfUfS9IGwBxbqABMzcAg2jB?= =?us-ascii?Q?6spYpj+L73EjtwhndEbKdWXbmfiuJnEbD6ZgVHaSj38qmla+NKaIWf6Cb9ww?= =?us-ascii?Q?U4y5flSU2gFbZJjN/vrB6UjJ50bTexfydJl9j6iVP8upJQgtgRVtSdNUXxMr?= =?us-ascii?Q?oc7cT7CSwTGhdXxW4zxmZzQvKMQz8izbHXapexLyyO2nArWWQRxCLruBzdto?= =?us-ascii?Q?Yb4OjTsv367aSh5yTFHpL9kcYHdtiGsw7iDkb+kcw1wToAN9VMjRyJQC1aw1?= =?us-ascii?Q?VGFH3Y2npNeD9fWd5BKSp2c7/WqVyH72kMl4guAQ8D5Cb+lZJo5NwoAs4Pj9?= =?us-ascii?Q?37Y99oy9pqm2ZAXsOBnp5+VdD52GC8S/VgGAB6q627FsidMDF/caUJ2ubQRy?= =?us-ascii?Q?wN209Dtk+Heqwiai1YjBFi/QnPL/z9JVP3Wjk/UBKNiVXjmSjvI7w6EFnTNu?= =?us-ascii?Q?1fWxLt73mi1nuTagxfqiVfD/T8ueEVpOmHQAvU63CAaQH+DwKEBmLgTjGiVD?= =?us-ascii?Q?yURnU75KY+OG3OQx2kHkIN4QWg4stAu+XuI1u9BOozlazj7VROVAOfEhevt5?= =?us-ascii?Q?lak1+yigc/rQjKTu6PdYr8Cdl+0Pcft4UhKBK+LTVCxtbuVrwXwsdVjQKO86?= =?us-ascii?Q?Bw=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: 4545b1bf-3eb8-4f51-767d-08dbf19ddc30 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Nov 2023 12:14:10.8786 (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: 6tdPiN0NG6X+riFe2smQlaK2Sr5mBIJyFv8s/cgRIniHiXXwXWaARAhxajncdqOt5u0WO7QtO/ov30ydsrjuo4cnLmAY7d87taOEBqko/mM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7848 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, I have added some suggestion below. Regrads, Shibin > -----Original Message----- > From: Maryam Tahhan > Sent: Thursday, November 30, 2023 9:14 AM > To: ferruh.yigit@amd.com; stephen@networkplumber.org; > lihuisong@huawei.com; fengchengwen@huawei.com; > liuyonglong@huawei.com > Cc: dev@dpdk.org; Tahhan, Maryam > Subject: [v1] 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 > Signed-off-by: Maryam Tahhan > --- > doc/guides/howto/af_xdp_cni.rst | 18 +++++++--- > drivers/net/af_xdp/rte_eth_af_xdp.c | 56 +++++++++++++++++++---------- > 2 files changed, 51 insertions(+), 23 deletions(-) >=20 > 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 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 > +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. >=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 > @@ -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: >=20 > kubectl exec -i --container -- \ > //dpdk-testpmd -l 0,1 --no-pci \ > - --vdev=3Dnet_af_xdp0,use_cni=3D1,iface=3D \ > + --vdev=3Dnet_af_xdp0,use_cni=3D1,iface=3D name>,sock=3D/tmp/afxdp_dp//afxdp.sock \ > + -- --no-mlockall --in-memory > + > +for multiple devices use: > + > + .. code-block:: console > + > + kubectl exec -i --container -- \ > + //dpdk-testpmd -l 0-2 --no-pci \ > + --vdev=3Dnet_af_xdp0,use_cni=3D1,iface=3D name>,sock=3D/tmp/afxdp_dp//afxdp.sock \ > + --vdev=3Dnet_af_xdp1,use_cni=3D1,iface=3D + name>,sock=3D/tmp/afxdp_dp//afxdp.sock \ > -- --no-mlockall --in-memory >=20 > For further reference please use the `e2e`_ test case in `AF_XDP Plugin = for > Kubernetes`_ diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c > b/drivers/net/af_xdp/rte_eth_af_xdp.c > index 353c8688ec..f728dae2f9 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 sock_path[PATH_MAX]; I would recommend using variable name as "uds_path". > 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_SOCK_ARG "sock" To make it clear would recommend using "sock_path" and also ETH_AF_XDP_CNI= _UDS_PATH_ARG or ETH_AF_XDP_SOCK_PATH_ARG. >=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_SOCK_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 *sock_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, sock_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 *sock_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, sock_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 > *sock_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, sock_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 *sock_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, sock_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, > +sock_path) < 0) { Why do we need to pass "sock_path" here as we have already connected the so= ck with sock_path in init_uds_sock()? > 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, > +sock_path) < 0) { Same question as above. > 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, > +sock_path) < 0) { Same question as above. > 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, > +sock_path) < 0) { Same question as above. > AF_XDP_LOG(ERR, "Error in processing cmd [%s]\n", > request); > goto err_close; > } > @@ -1698,7 +1700,7 @@ xsk_configure(struct pmd_internals *internals, > struct pkt_rx_queue *rxq, > int err, fd, 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- > >sock_path); > if (map_fd < 0) { > AF_XDP_LOG(ERR, "Failed to receive CNI plugin > fd\n"); > goto out_xsk; > @@ -2023,7 +2025,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 *sock_path) > { > int ret; >=20 > @@ -2069,6 +2072,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_SOCK_ARG, > + &parse_prog_arg, sock_path); Parse_prog_arg does 2 things copy the sock_arg value and also check the acc= ess to the socket. Checking access here has a chance of causing raise condition so I would rec= ommend to skip this check here as this will be taken care in the init_uds_s= ock(). > + if (ret < 0) > + goto free_kvlist; > + > free_kvlist: > rte_kvargs_free(kvlist); > return ret; > @@ -2108,7 +2116,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 *sock_path) > { > const char *name =3D rte_vdev_device_name(dev); > const unsigned int numa_node =3D dev->device.numa_node; @@ - > 2138,6 +2146,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->sock_path, sock_path, PATH_MAX); >=20 > if (xdp_get_channels_info(if_name, &internals->max_queue_cnt, > &internals->combined_queue_cnt)) { @@ - > 2328,6 +2337,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 sock_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 +2380,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, > sock_path) < 0) { > AF_XDP_LOG(ERR, "Invalid kvargs value\n"); > return -EINVAL; > } > @@ -2387,6 +2397,13 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device > *dev) > return -EINVAL; > } >=20 > + if (use_cni && !strnlen(sock_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_SOCK_ARG); > + return -EINVAL; > + } > + > + > if (strlen(if_name) =3D=3D 0) { > AF_XDP_LOG(ERR, "Network interface must be > specified\n"); > return -EINVAL; > @@ -2410,7 +2427,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, > sock_path); > if (eth_dev =3D=3D NULL) { > AF_XDP_LOG(ERR, "Failed to init internals\n"); > return -1; > @@ -2471,4 +2488,5 @@ > RTE_PMD_REGISTER_PARAM_STRING(net_af_xdp, > "xdp_prog=3D " > "busy_budget=3D " > "force_copy=3D " > - "use_cni=3D "); > + "use_cni=3D " > + "sock=3D "); > -- > 2.41.0