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 C7DDF41C42; Wed, 8 Feb 2023 19:31:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CEB04014F; Wed, 8 Feb 2023 19:31:03 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2056.outbound.protection.outlook.com [40.107.102.56]) by mails.dpdk.org (Postfix) with ESMTP id 8F48740141 for ; Wed, 8 Feb 2023 19:31:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gGaxJDLQBmMtzx2AM7O93zAZx0gjT5W9SC6qvW/SrzJM+PzB2Va78Rzk2OmZLDFo8X2cGjk6kgRcAswTyZ4k6E/UAZ0VEcAvxEo48qUePYcOvOBJg1MSh5UYHmxNqllOkWUG3eb1BJfF2RQXkMydx/y7QBo/v3op58qqrwIRUhJ+H1n/LyvxMWNBzRqVwyx44lQaSXZ2cfi7LR0xbwRWYSsy0teDdaoLgRuBIENHopg4TIFG54PfcMwmvclHQ86OfW1PqKTtdpViSK/XJZzusSO2z2ruIuKrD1L3nMjMiOdaVC2R0sGhMBH3VH4ryT8BRj+S19VBwE8Wq2jDzKacvA== 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=hEbhDO1NqUGMdtV+xXIjyzN29ru+TtRnvwPHleRN02k=; b=JxhEspIqJFbFPU8BjjUH3NngUhYXCivfAIdgtrSUdGsHiEyvi4wiN1Dhp2rKH/A0Q6d0LQPsIAM7sRhmfqPL6xJoV1athoYl/peKMTFE6MdjAGp5+3rzXn9bpRkPmp/5Xz9dqBE0Hml5b0EBqRuuWla/PovEe3b3Ik1mbhCsXkofTbUjzilMKQjbXQIS/QfonBv4MU0O3jSHzEkWC5QV7JgxVevo7AQz838hwR9JazHwTiqij5fHXLXYpotjQnD1463wQdWkPva9d1eqaJs5PTWq40fCIRjhUL0PK2iOYSdacBa1YDvTIdxXxra4pGrS+zpvKwHIykvCg3gPHfs9NQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hEbhDO1NqUGMdtV+xXIjyzN29ru+TtRnvwPHleRN02k=; b=suAqV5VzmezjF17Qdib7VIssxcR7qRG3llfMSJubDSr+YejFgrZavyLehSbRBPo5BGXLoBHFdCPzD0wKwi5RC0E3vhpap0fxWkWPeVPF/YPBHXq1V6YuR1M3Fk2BugD7641YohzjojkMIB8X+NX1QdE/E68C+mKEY0WmmgByxlk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DM4PR12MB6088.namprd12.prod.outlook.com (2603:10b6:8:af::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Wed, 8 Feb 2023 18:31:00 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%6]) with mapi id 15.20.6086.017; Wed, 8 Feb 2023 18:31:00 +0000 Message-ID: Date: Wed, 8 Feb 2023 18:30:54 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US To: Shibin Koikkara Reeny , dev@dpdk.org, qi.z.zhang@intel.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, john.mcnamara@intel.com Cc: ciara.loftus@intel.com References: <20230202165513.31012-1-shibin.koikkara.reeny@intel.com> From: Ferruh Yigit Subject: Re: [PATCH v3] net/af_xdp: AF_XDP PMD CNI Integration In-Reply-To: <20230202165513.31012-1-shibin.koikkara.reeny@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P265CA0020.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ff::11) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM4PR12MB6088:EE_ X-MS-Office365-Filtering-Correlation-Id: 13e58c62-aaea-4330-8b85-08db0a02a074 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kbXx3WwtOFOnfgoCB8l4r0tMT3Ee2d3fAqylM2UX+M4DP+uQrBSX0gJj+oEvQGfiSwqzoaaqvpTYdTmXDeua5FZNY5og0IufyaTYreX2xKlulpMyGltiBvlOno6lKj5uplhvNgdG8017ehCEz1pqq6YHHufdH+KMpaKYdw2a8Lnsau9S/TiEx20gSYFMwyF7lE6HhxLVX3+/fVhLCgDwuwbVjoPeNc657n6SU7sT/NREsXE9VSobldqFxyZr9rZOJXAwNCIaI6JGTbngNT6MEyikYXcU5ha0v9UC3dXpPndVOIL1dwN4J9xDynq/WxER2dE3uM17ryQ8mGfapA3EoVdDbGFlmdfxhlNvm/fmmNEPQ6gxcIim+3+fOom9+QAeGlaiv6xkzy3RzPry1+m0c5JV8Y+67anqMKveErN9w8FB4ynRSWSgkwblcaHC1LnBi7amXBRQKVQGwbUZFhXqsYGqbMlfojkhxU5Fie03qDw8wBudzAIieWYMTrm1Vm6i7p6EXWP5aGcEi6RdTH1ZzpQpaqsgw5rznFAm09ABKdqWvr/srVB3QBBAufSU2d1DtQPdjUtbPDLZRPmKzB59DrOVrEO6kYc59TollmfLugvgHQtJeeleGfMQ1LUnD4VgySftLzjDsfWxH7ZhT144NdB7brgtcY8NQPLCVootyYqlgfbRkRPxGRdF6jJazNAHNod2nhN1BzN7cQrbxrSMb68SNbRay15xMSfqaukHnfLzz1/85KmxNwfvs8gOkNjPIIQGAWV2LycimvvQJ2A1BEI2JqTWz2tkERNlJ4pSrEMRlEXYMWSst+vH3s99i8E3 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(366004)(376002)(39860400002)(396003)(136003)(346002)(451199018)(86362001)(31696002)(36756003)(38100700002)(41300700001)(8936002)(66556008)(66946007)(8676002)(186003)(5660300002)(4326008)(316002)(66476007)(44832011)(2906002)(2616005)(966005)(83380400001)(478600001)(6486002)(6666004)(26005)(6506007)(6512007)(53546011)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S1Uxa1lmcFZ2OGlwS0FyaWlLRWJtbDE0Z051aHZ2MUczcGtlN3dwdnpUbGdY?= =?utf-8?B?RXVhNkV3TUlsMDhlUld3bVFndEZTeE1kME42VExxc3dTL1pyU3JqNCszMVd5?= =?utf-8?B?eHBZeWhXMTVnYnN4bFdWa0oyaTRRT2UxQUx0S1NTM1NhUC9MZTgxZ2ZGOWVV?= =?utf-8?B?bThGeUxUSk9USHBNbHZWU05qQ3lrTEtQN0tOaHNaKy8vT0luNkxQcTFUQWlZ?= =?utf-8?B?RnFNQnZnanhW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?B?WFRyenF6R1hxSlMzSWdUVmNPTUhyMHhlVHlFb1ZPTjJVZ09EbEJORzUyWkdw?= =?utf-8?Q?4CH3WVo2uy1wUCv0OAqzy21vM?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13e58c62-aaea-4330-8b85-08db0a02a074 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 18:31:00.4230 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Y/KqOCLQxrFruFVwprnrtsmopt6/++pZgK0sgK6zIj/IaUYg3dd5V7YySIBbN555 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6088 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 On 2/2/2023 4:55 PM, Shibin Koikkara Reeny wrote: > Integrate support for the AF_XDP CNI and device plugin [1] so that the > DPDK AF_XDP PMD can work in an unprivileged container environment. > Part of the AF_XDP PMD initialization process involves loading > an eBPF program onto the given netdev. This operation requires > privileges, which prevents the PMD from being able to work in an > unprivileged container (without root access). The plugin CNI handles > the program loading. CNI open Unix Domain Socket (UDS) and waits > listening for a client to make requests over that UDS. The client(DPDK) > connects and a "handshake" occurs, then the File Descriptor which points > to the XSKMAP associated with the loaded eBPF program is handed over > to the client. The client can then proceed with creating an AF_XDP > socket and inserting the socket into the XSKMAP pointed to by the > FD received on the UDS. > > A new vdev arg "use_cni" is created to indicate user wishes to run > the PMD in unprivileged mode and to receive the XSKMAP FD from the CNI. > When this flag is set, the XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD libbpf flag > should be used when creating the socket, which tells libbpf not to load the > default libbpf program on the netdev. We tell libbpf not to do this because > the loading is handled by the CNI in this scenario. > > Patch include howto doc explain how to configure AF_XDP CNI to > working with DPDK. > I can't able to test this but I will rely on Anatoly's tested-by to proceed. > [1]: https://github.com/intel/afxdp-plugins-for-kubernetes > > Signed-off-by: Shibin Koikkara Reeny > --- > doc/guides/howto/af_xdp_cni.rst | 254 +++++++++++++++++++++ > doc/guides/howto/index.rst | 1 + > drivers/net/af_xdp/rte_eth_af_xdp.c | 337 +++++++++++++++++++++++++++- > 3 files changed, 580 insertions(+), 12 deletions(-) > create mode 100644 doc/guides/howto/af_xdp_cni.rst > > diff --git a/doc/guides/howto/af_xdp_cni.rst b/doc/guides/howto/af_xdp_cni.rst > new file mode 100644 > index 0000000000..1cda08b2c6 > --- /dev/null > +++ b/doc/guides/howto/af_xdp_cni.rst > @@ -0,0 +1,254 @@ > +.. SPDX-License-Identifier: BSD-3-Clause > + Copyright(c) 2020 Intel Corporation. 2023? > + > + > +Using a CNI with the AF_XDP driver > +================================== > + > + > + Is multiple empty lines required? > +Introduction > +------------ > + > +CNI, the Container Network Interface, is a technology for configuring container > +network interfaces and which can be used to setup Kubernetes networking. AF_XDP > +is a Linux socket Address Family that enables an XDP program to redirect packets > +to a memory buffer in userspace. > + > +This document explains how to enable the `AF_XDP Plugin for Kubernetes`_ within > +a DPDK application using the `AF_XDP PMD`_ to connect and use these technologies. > + > +.. _AF_XDP Plugin for Kubernetes: https://github.com/intel/afxdp-plugins-for-kubernetes > + > +Background > +---------- > + > +The standard `AF_XDP PMD`_ initialization process involves loading an eBPF program > +onto the kernel netdev to be used by the PMD. This operation requires root or > +escalated Linux privileges and thus prevents the PMD from working in an > +unprivileged container. The AF_XDP CNI plugin handles this situation by > +providing a device plugin that performs the program loading. > + > +At a technical level the CNI opens a Unix Domain Socket and listens for a client > +to make requests over that socket. A DPDK application acting as a client > +connects and initiates a configuration "handshake". The client then receives a > +file descriptor which points to the XSKMAP associated with the loaded eBPF > +program. 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. > + > +The EAL vdev argument ``use_cni`` is 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 to instruct libbpf not to > +load the default libbpf program on the netdev. Instead the loading is handled by > +the CNI. > + > +.. _AF_XDP PMD: https://doc.dpdk.org/guides/nics/af_xdp.html > + > +.. Note:: > + > + The Unix Domain Socket file path appear in the end user is "/tmp/afxdp.sock". > + @Anatoly, I guess you did a patch in the past to group runtime files in a common folder, it was something like '/tmp/dpdk//'. Does that runtime folder includes the socket files? Also is this fixes socket name a blocker to have multiple primary process (--file-prefix)? (assuming both using af_xdp driver). > +Prerequisites > +------------- > + > +Docker and container prerequisites: > + > +* Set up the device plugin as described in the instructions for `AF_XDP Plugin > + for Kubernetes`_. > + > +* The Docker image should contain the libbpf and libxdp libraries, which > + are dependencies for AF_XDP, and should include support for the ``ethtool`` > + command. > + Is there any specific library version dependency? If so can you please document? <...> > + > + For further reference please use the `config.json`_ > + > + .. _config.json: https://github.com/intel/afxdp-plugins-for-kubernetes/blob/main/test/e2e/config.json > + Should references have a fixed tag instead of a dynamic branch that can change later, like: https://github.com/intel/afxdp-plugins-for-kubernetes/blob/v0.0.2/test/e2e/config.json What do you think? <...> > @@ -81,6 +82,24 @@ RTE_LOG_REGISTER_DEFAULT(af_xdp_logtype, NOTICE); > > #define ETH_AF_XDP_MP_KEY "afxdp_mp_send_fds" > > +#define MAX_LONG_OPT_SZ 64 > +#define UDS_MAX_FD_NUM 2 > +#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" > +#define UDS_VERSION_MSG "/version" > +#define UDS_XSK_MAP_FD_MSG "/xsk_map_fd" > +#define UDS_XSK_SOCKET_MSG "/xsk_socket" > +#define UDS_FD_ACK_MSG "/fd_ack" > +#define UDS_FD_NAK_MSG "/fd_nak" > +#define UDS_FIN_MSG "/fin" > +#define UDS_FIN_ACK_MSG "/fin_ack" > + > + extra empty line > static int afxdp_dev_count; > > /* Message header to synchronize fds via IPC */ > @@ -151,6 +170,7 @@ struct pmd_internals { > char prog_path[PATH_MAX]; > bool custom_prog_configured; > bool force_copy; > + bool use_cni; > struct bpf_map *map; > > struct rte_ether_addr eth_addr; > @@ -170,6 +190,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" > Should document new devarg in driver documentation: doc/guides/nics/af_xdp.rst Also need to add it to 'RTE_PMD_REGISTER_PARAM_STRING' macro for pmdinfo.py. > static const char * const valid_arguments[] = { > ETH_AF_XDP_IFACE_ARG, > @@ -179,8 +200,8 @@ static const char * const valid_arguments[] = { > ETH_AF_XDP_PROG_ARG, > ETH_AF_XDP_BUDGET_ARG, > ETH_AF_XDP_FORCE_COPY_ARG, > - NULL > -}; > + ETH_AF_XDP_USE_CNI_ARG, > + NULL}; > please keep '}' in next line. <...> > +static int > +make_request_cni(int sock, struct sockaddr_un *server, char *request, > + int *req_fd, char *response, int *out_fd) > +{ > + int rval; > + > + AF_XDP_LOG(INFO, "Request: [%s]\n", request); > + Isn't INFO level logging too verbose for log each request and response, what do you think for debug level? <...> > @@ -1584,6 +1865,26 @@ static const struct eth_dev_ops ops = { > .get_monitor_addr = eth_get_monitor_addr, > }; > > +/* 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. > + **/ > +static const struct eth_dev_ops ops_cni = { > + .dev_start = eth_dev_start, > + .dev_stop = eth_dev_stop, > + .dev_close = eth_dev_close, > + .dev_configure = eth_dev_configure, > + .dev_infos_get = eth_dev_info, > + .mtu_set = eth_dev_mtu_set, > + .rx_queue_setup = eth_rx_queue_setup, > + .tx_queue_setup = eth_tx_queue_setup, > + .link_update = eth_link_update, > + .stats_get = eth_stats_get, > + .stats_reset = eth_stats_reset, > + .get_monitor_addr = eth_get_monitor_addr, > +}; > + The customisation is reduced dev_ops, right? Can you please comment which functionality is removed and why (what kind of permission requirement prevents that functionality to be used)? And can you please document in the driver documentation that 'use_cni' will cause reduced functionality and what those dropped functionalities are? > /** parse busy_budget argument */ > static int > parse_budget_arg(const char *key __rte_unused, > @@ -1704,8 +2005,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_queue, > - int *queue_cnt, int *shared_umem, char *prog_path, > - int *busy_budget, int *force_copy) > + int *queue_cnt, int *shared_umem, char *prog_path, > + int *busy_budget, int *force_copy, int *use_cni) At some point need to put these variables for paramters into a struct, instead of keep increasing the parameter list. Feel free to make a preperation patch before this patch if you want.