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 049A9436FC; Fri, 15 Dec 2023 10:55:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E77EF40299; Fri, 15 Dec 2023 10:55:55 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 491BA4021F for ; Fri, 15 Dec 2023 10:55:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702634154; x=1734170154; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1uoVGGK1dwz9DFT7kvdWmZQD/GHcrxB5dyv2H0l7Kjk=; b=POCXPVsctAmjskquCXcKIHqMKBeAdUX2rEOHiShW8C2G6kCJ7LTzRnlA G1/mkLDlaJke98b5wFnvRcTzylMWfjhCxbesPZugusQM6O1yCwLM9r9+P Zur6QeUsvSSWSGPrkDVBCa5AJGl4bBzfSYT4hJHUctsD4vcZzdX5WpoJR 7hhy312FKWPZmxTcESanmTMdfc5T7MYGTN7uy/muys3hlbwKhv4YC5Sa8 0hY/gXXVJBv3oNo55+GuM/1tsjGM/4oJdYmQCjb5zHsRB/HPtnnXW+yFI AVIPIRggyRQAo92vZLV5/k/1xMGpz/lecGPqPfO71Dsl2mlkrIXXXTb5Z Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="459575430" X-IronPort-AV: E=Sophos;i="6.04,278,1695711600"; d="scan'208";a="459575430" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 01:55:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="1106070760" X-IronPort-AV: E=Sophos;i="6.04,278,1695711600"; d="scan'208";a="1106070760" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga005.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Dec 2023 01:55:49 -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; Fri, 15 Dec 2023 01:55:48 -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.35 via Frontend Transport; Fri, 15 Dec 2023 01:55:48 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.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.35; Fri, 15 Dec 2023 01:55:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mGrVijvmfm9S80udwtTLNMZN2nn/uwixXsshTNm7hmFK184iJw+H9WClSCtUoqm7hIJmzoauyOoAA/gY4VO+1klytzt3FgWYhyMA8t8OBNe/hPoOk3aTdsIG0uLde5rDt3S0YNU25LxRclm+bF+jt4zItj0Hesgvam75kG0OilrT6nAjtSxgE2S9BYp9aKlqX2Dy2GHRQRmJRpHGwDdwaNsN9cNUrYD/4F3XLHzQSGv3NsrHRwywgb+TlM3SP9Th0kOt7HfBznHaOYOXJtsrFLCr8mrBaEFCiDtKAfnUrfO5X7GjeAfPeKo9oFOcPtkDfFaikMRBrVhNYuP2Kz6D5A== 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=2YQ7sYW/ICB0j7m28mJDO0aVTQ3VQFMdTFu+QIi85Fw=; b=iHwK62yd4ZeEue7VIAoifeI3yuC7O8YXA2mNq6ofEXSKZ7BV54VbHPqB/ccD8As2Ll9x4BZgY+Nz40x1yjuMCbUSTipKX/TtOhUXZMjNmZwH8aPMafVzHsh3Lv8qHMeRLwsGvV+kr3+9UCe4Hzn+rr6B9yIaMXhbtWk9+MKpVIeuSAfVGftyBfZsf1f/ltjN2IYb/YcDhSlSrZqvw6N6jvVRIpeaPUSSOY74escE4YTK//gE3CtVU5Ap5lL9xVpobrZ2YB9T78rqIWtldVTzT3hdidrng9SraWjIb8dqaSqJZPU+/YTSvLC+VlQ56vB46ZKF1oLDG18eF4L4SgPXBA== 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 PH7PR11MB7593.namprd11.prod.outlook.com (2603:10b6:510:27f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.31; Fri, 15 Dec 2023 09:55:45 +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.7091.030; Fri, 15 Dec 2023 09:55:45 +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: [v4] net/af_xdp: enable uds_path instead of use_cni Thread-Topic: [v4] net/af_xdp: enable uds_path instead of use_cni Thread-Index: AQHaLb9hbNo5u4EpFkWNTBpSXlOcurCqG+cA Date: Fri, 15 Dec 2023 09:55:44 +0000 Message-ID: References: <20231213122433.810285-1-mtahhan@redhat.com> In-Reply-To: <20231213122433.810285-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_|PH7PR11MB7593:EE_ x-ms-office365-filtering-correlation-id: 9fda30ef-3910-4fc1-f867-08dbfd5401a9 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: tTDBKmBNNbA8YXcNgQptueXqsfDhifJ639HGqN1IE0rl9xhsUvBhzUTpFOFnCZummNoKJFnC5bzYENj54UVyJaXew/S3if1HDt8Wy6s90oKvzsawUP2DCtL1EUN1Vyiw9grOydhd1Rf+N5HwIW3e7GmiqAhoJanZD+4RobBJ57XTYCsOhwsQ7iQN53UEfdXgtSOrbuW/RQBTCKLrOLwEWe1jw8Cw2huu7RHtz8kqf3ueQILJI362Zj0CyNsw36WaWMD7xn04f0kVMN6uVNiw8Z/hGCgelONrrWxE3QIjq45ovXu1dkyOXLmNWu8jpxxp9YQ+U4/LqY1/KAHm78UXsdOArvpfmCmes2cR9FWmBQAsvw7WKd04qVAHKJy5iEkbYKtYJHYcPxISQosWYEBJ6zNPT0Jl84H5HjBsob42loPEsqd6tsnt4bbJIFSSExaNkoWxjEmOBLynJhXgK9azppNQVBiBadHnQaE23yVGnRdt1GvlMfQX85BIsdulhhaS0mlUSf5A+j+0YF+uabKp99WY1hLsvCzGtHHoJGnNWPClTpDr3Q4lwI3+WPNVtq5x61Jf5OoA7INUxeQsK1B4Jd5/ec2F36WvMu9q84GTSuDuriVTQuzlM8fj+dRb6ZFO 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)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(26005)(6506007)(7696005)(71200400001)(9686003)(83380400001)(5660300002)(52536014)(4326008)(41300700001)(2906002)(30864003)(478600001)(8676002)(8936002)(76116006)(110136005)(66946007)(316002)(6636002)(54906003)(64756008)(66446008)(66476007)(66556008)(82960400001)(33656002)(86362001)(122000001)(38100700002)(38070700009)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?GFjoRm1HcYafanZhohCZTchjhD84rtHCY3NFWLS7UCJH1kodB4BcbIkw8Syy?= =?us-ascii?Q?3gmMLN1YEw53FNnvZhSYsTZj3LfhurpmdWv8bDEJekOjrUYzi3pBZfleUbno?= =?us-ascii?Q?fdOtzAW2GXc/DC/z2bH3RZYvUs8Mphi/2QlDb6lpek1uUZrbArT7Ohq+rMRm?= =?us-ascii?Q?MRgGAh94eEZ1xrlD2skBoJPxJBwqj2j186vxaTkEuaAf5wvuC1RduBBbhGl4?= =?us-ascii?Q?vQjzmNToR1pGdImA0UKrINcJBcvDTmVTkZtWQhnA6VN15t0PVvwuaB812Bo9?= =?us-ascii?Q?OAPMld8h2UcJ22cRcmbS6L74OdWJWfZF92fCWjcn1pSJ5iBrvQyrASwZ4BYi?= =?us-ascii?Q?qC2FOpVzzC0Cap2uzs7t7rMsPFUQsgZY6lC5L3sNDkg9tG84H9bqxVTeuuSZ?= =?us-ascii?Q?afHnllzyjpE9fnTIKGul+xlxCLJM+hpfI7+j40Jgb6FvVHiaRgORw3Jv/r0A?= =?us-ascii?Q?2FolpvFBbopLCFXfqh8UAqNnuJf4X11a51qbBIglec55xUhe73dQiEEcjjhC?= =?us-ascii?Q?UgrNi/zgKzwiZHA2/5p00pd2Vgvd61udmfU1AZHGWNW2yuvGmIksTFBgA0I9?= =?us-ascii?Q?ktOU6FSMk8Lj00b9CfcfMLTZv41azTkSq+udnBs7BB6RVX4VZ92wkbRJC457?= =?us-ascii?Q?AeSzu/i/oJbEubugrcn+AtIGoCTnc8QjNt0ZxFDkENi/SXxgbc0nVeXM2p8K?= =?us-ascii?Q?6Lh7gFjuF8GdXLKlQkZm87mTiIU0lJGD8HZqJabE5z5LH6yWRvASY2snlC20?= =?us-ascii?Q?kFDSa+Bv9P+Am7K0iMbEy1BwWeDcXJcRP0zCBx+V/OMitnBZJJmRaIOx6CLk?= =?us-ascii?Q?5lC42utJYJ3D0pgEjPgaP88eSV9uBFeni4SWYimmDEmTcnYPymT/PLX7d8/r?= =?us-ascii?Q?nQF+Kuk3FnFO5oxd4/Xo5JpQ03RMuiX5Pog+JTcXBzWyR8DkRTdvTjrT8a5M?= =?us-ascii?Q?Jzwk6pBAVtZgnAUVx1stCD7RwdsVjaRsfsmJnQJTF3rJCtfm3PrTJLkEiJQQ?= =?us-ascii?Q?0ITcy+97mqXdcELDA+UUIaoLdfHkpxP+mXBH2EDxe+rPNMoIP8iFpnTE1gq2?= =?us-ascii?Q?f+e+OLrwldEytiEmP5amWbITwCzoOq8gLUtBs1tFN2iCl4XX0v+yvYp+/G89?= =?us-ascii?Q?4yr6R0N6mhe3+EudhooiMjz9TC/gKF3KWqZQ38ApaVF+kXucUMtk4Fd1OPAs?= =?us-ascii?Q?ZLp3lT3UJ0fQjdETwJq37pQzQ/rsDXNa4bfXAUTRHxCbHBbckdNHoxPO9L4Y?= =?us-ascii?Q?5f4jffLIwkQyEITEfAYe12pzYQSTWzOpsfgiWlabS39SYy3oUTP49Jo2vlvU?= =?us-ascii?Q?Uc1tV3bw/3CAPVxA+xlO/tmvN19PdUQaQv6z9dxttjUeFp8SBHxUzkNqZHwl?= =?us-ascii?Q?81P/YFAMgxB4I7/8D2DFHbN6i++oNxjCDOQfFObXLp49PFtyVPNH8uhzlfUI?= =?us-ascii?Q?hA/C/LEVh5PgF4iD3gR5zR9sM8Iewfwpa9E7JcKOrx2mwwtUazryNNCEJm5/?= =?us-ascii?Q?m5shWlyxum3AHg5oiV49TQyt0g1+JOplG6qop8ewtj8h3vkObTpzBFjJhwF0?= =?us-ascii?Q?kZKL3eC0nc9qRcRlOhtWiu4rAvpQJy6wyRRQP6Xm?= 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: 9fda30ef-3910-4fc1-f867-08dbfd5401a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2023 09:55:44.9809 (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: +hlMhYuPDXZwpf5KL2UCf6Yr1jp60jvre5kXbdUlTr8pIM5bPkQsMbr7MhgOH/m/di9e5In4JY6seFe90tENrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB7593 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 Thanks for the latest patch Maryam. I have one minor suggestion inline. Also, there are still some references to "use_cni" in af_xdp.rst which shou= ld be removed/replaced with uds_path. Once that's done I think the patch should be good to go. Perhaps also consi= der adding a note to the release notes mentioning the new functionality. Thanks, Ciara >=20 > With the original 'use_cni' implementation, (using 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 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 using a new vdev param called > 'uds_path' and removing the previous 'use_cni' param. > This patch also fixes incorrect references to the > AF_XDP DP as CNI and updates the documentation with a > working example. This change has been tested with the > AF_XDP DP PR 81, with both single and multiple interfaces. >=20 > v4: > * Rename af_xdp_cni.rst to af_xdp_dp.rst > * Removed all incorrect references to CNI throughout af_xdp > PMD file. > * Fixed Typos in af_xdp_dp.rst >=20 > v3: > * Remove `use_cni` vdev argument as it's no longer needed. > * Update incorrect CNI references for the AF_XDP DP in the > documentation. > * Update the documentation to run a simple example with the > AF_XDP DP plugin in K8s. >=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 | 253 ------------------------- > doc/guides/howto/af_xdp_dp.rst | 278 > ++++++++++++++++++++++++++++ > doc/guides/howto/index.rst | 2 +- > drivers/net/af_xdp/rte_eth_af_xdp.c | 100 +++++----- > 4 files changed, 328 insertions(+), 305 deletions(-) > delete mode 100644 doc/guides/howto/af_xdp_cni.rst > create mode 100644 doc/guides/howto/af_xdp_dp.rst >=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..6caad58e60 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" > @@ -170,7 +169,7 @@ struct pmd_internals { > char prog_path[PATH_MAX]; > 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; > @@ -190,7 +189,7 @@ struct pmd_process_private { > #define ETH_AF_XDP_PROG_ARG "xdp_prog" > #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_DP_UDS_PATH_ARG "uds_path" Use the same alignment for "uds_path" as the strings above it. >=20 > static const char * const valid_arguments[] =3D { > ETH_AF_XDP_IFACE_ARG, > @@ -200,7 +199,7 @@ static const char * const valid_arguments[] =3D { > ETH_AF_XDP_PROG_ARG, > ETH_AF_XDP_BUDGET_ARG, > ETH_AF_XDP_FORCE_COPY_ARG, > - ETH_AF_XDP_USE_CNI_ARG, > + ETH_AF_XDP_USE_DP_UDS_PATH_ARG, > NULL > }; >=20 > @@ -1351,7 +1350,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 +1361,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 +1381,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 +1392,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)); > @@ -1470,8 +1469,8 @@ 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) > +make_request_dp(int sock, struct sockaddr_un *server, char *request, > + int *req_fd, char *response, int *out_fd, const char > *uds_path) > { > int rval; >=20 > @@ -1483,7 +1482,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 +1506,7 @@ check_response(char *response, char *exp_resp, > long size) > } >=20 > static int > -get_cni_fd(char *if_name) > +get_xskmap_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 +1519,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 */ > + /* Initiates handshake to AF_XDP Device Plugin 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_dp(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 +1540,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_dp(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 +1548,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_dp(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 +1570,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_dp(sock, &server, request, NULL, response, > &out_fd, uds_path) < 0) { > AF_XDP_LOG(ERR, "Error in processing cmd [%s]\n", request); > goto err_close; > } > @@ -1640,7 +1639,7 @@ xsk_configure(struct pmd_internals *internals, > struct pkt_rx_queue *rxq, > #endif >=20 > /* Disable libbpf from loading XDP program */ > - if (internals->use_cni) > + if (strnlen(internals->uds_path, PATH_MAX)) > cfg.libbpf_flags |=3D XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD; >=20 > if (strnlen(internals->prog_path, PATH_MAX)) { > @@ -1694,18 +1693,17 @@ xsk_configure(struct pmd_internals *internals, > struct pkt_rx_queue *rxq, > } > } >=20 > - if (internals->use_cni) { > - int err, fd, map_fd; > + if (strnlen(internals->uds_path, PATH_MAX)) { > + int err, map_fd; >=20 > - /* get socket fd from CNI plugin */ > - map_fd =3D get_cni_fd(internals->if_name); > + /* get socket fd from AF_XDP Device plugin */ > + map_fd =3D get_xskmap_fd(internals->if_name, internals- > >uds_path); > if (map_fd < 0) { > - AF_XDP_LOG(ERR, "Failed to receive CNI plugin fd\n"); > + AF_XDP_LOG(ERR, "Failed to receive AF_XDP Device > 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; > @@ -1881,13 +1879,13 @@ static const struct eth_dev_ops ops =3D { > .get_monitor_addr =3D eth_get_monitor_addr, > }; >=20 > -/* CNI option works in unprivileged container environment > - * and ethernet device functionality will be reduced. So > - * additional customiszed eth_dev_ops struct is needed > - * for cni. Promiscuous enable and disable functionality > - * is removed. > - **/ > -static const struct eth_dev_ops ops_cni =3D { > +/* AF_XDP Device Plugin option works in unprivileged > + * container environment and ethernet device functionality > + * will be reduced. So additional customized eth_dev_ops > + * struct is needed for the AF_XDP Device Plugin. Promiscuous > + * enable and disable functionality is removed. > + */ > +static const struct eth_dev_ops ops_afxdp_dp =3D { > .dev_start =3D eth_dev_start, > .dev_stop =3D eth_dev_stop, > .dev_close =3D eth_dev_close, > @@ -1957,7 +1955,7 @@ parse_name_arg(const char *key __rte_unused, >=20 > /** parse xdp prog argument */ > static int > -parse_prog_arg(const char *key __rte_unused, > +parse_path_arg(const char *key __rte_unused, > const char *value, void *extra_args) > { > char *path =3D extra_args; > @@ -2023,7 +2021,7 @@ 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, char *uds_path) > { > int ret; >=20 > @@ -2050,7 +2048,7 @@ parse_parameters(struct rte_kvargs *kvlist, char > *if_name, int *start_queue, > goto free_kvlist; >=20 > ret =3D rte_kvargs_process(kvlist, ETH_AF_XDP_PROG_ARG, > - &parse_prog_arg, prog_path); > + &parse_path_arg, prog_path); > if (ret < 0) > goto free_kvlist; >=20 > @@ -2064,8 +2062,8 @@ 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_ARG, > - &parse_integer_arg, use_cni); > + ret =3D rte_kvargs_process(kvlist, > ETH_AF_XDP_USE_DP_UDS_PATH_ARG, > + &parse_path_arg, uds_path); > if (ret < 0) > goto free_kvlist; >=20 > @@ -2108,7 +2106,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) > + const char *uds_path) > { > const char *name =3D rte_vdev_device_name(dev); > const unsigned int numa_node =3D dev->device.numa_node; > @@ -2137,7 +2135,7 @@ init_internals(struct rte_vdev_device *dev, const > char *if_name, > #endif > 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)) { > @@ -2196,10 +2194,10 @@ init_internals(struct rte_vdev_device *dev, const > char *if_name, > eth_dev->data->dev_link =3D pmd_link; > eth_dev->data->mac_addrs =3D &internals->eth_addr; > eth_dev->data->dev_flags |=3D > RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; > - if (!internals->use_cni) > + if (!strnlen(internals->uds_path, PATH_MAX)) > eth_dev->dev_ops =3D &ops; > else > - eth_dev->dev_ops =3D &ops_cni; > + eth_dev->dev_ops =3D &ops_afxdp_dp; >=20 > eth_dev->rx_pkt_burst =3D eth_af_xdp_rx; > eth_dev->tx_pkt_burst =3D eth_af_xdp_tx; > @@ -2327,7 +2325,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device > *dev) > char prog_path[PATH_MAX] =3D {'\0'}; > 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,20 +2368,20 @@ 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, uds_path) < 0) { > AF_XDP_LOG(ERR, "Invalid kvargs value\n"); > return -EINVAL; > } >=20 > - if (use_cni && busy_budget > 0) { > + if (strnlen(uds_path, PATH_MAX) && busy_budget > 0) { > AF_XDP_LOG(ERR, "When '%s' parameter is used, '%s' > parameter is not valid\n", > - ETH_AF_XDP_USE_CNI_ARG, > ETH_AF_XDP_BUDGET_ARG); > + ETH_AF_XDP_USE_DP_UDS_PATH_ARG, > ETH_AF_XDP_BUDGET_ARG); > return -EINVAL; > } >=20 > - if (use_cni && strnlen(prog_path, PATH_MAX)) { > + if (strnlen(uds_path, PATH_MAX) && strnlen(prog_path, PATH_MAX)) > { > AF_XDP_LOG(ERR, "When '%s' parameter is used, '%s' > parameter is not valid\n", > - ETH_AF_XDP_USE_CNI_ARG, > ETH_AF_XDP_PROG_ARG); > + ETH_AF_XDP_USE_DP_UDS_PATH_ARG, > ETH_AF_XDP_PROG_ARG); > return -EINVAL; > } >=20 > @@ -2410,7 +2408,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, uds_path); > if (eth_dev =3D=3D NULL) { > AF_XDP_LOG(ERR, "Failed to init internals\n"); > return -1; > @@ -2471,4 +2469,4 @@ RTE_PMD_REGISTER_PARAM_STRING(net_af_xdp, > "xdp_prog=3D " > "busy_budget=3D " > "force_copy=3D " > - "use_cni=3D "); > + "uds_path=3D "); > -- > 2.41.0