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 EF500A0542; Tue, 4 Oct 2022 19:47:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D289D40DFB; Tue, 4 Oct 2022 19:47:11 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2085.outbound.protection.outlook.com [40.107.223.85]) by mails.dpdk.org (Postfix) with ESMTP id 6CA0D40DDC for ; Tue, 4 Oct 2022 19:47:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q7ZwGn5g2bLMm+C1WA9Zz7qhdRkoY7OEKTwPtVC5emTdEhKG2jpuOtrNtkGSoeCxwFv0bMONQMDvhYTkXfU+9t6BP2Mu4vK62Owvh0LKpRWDkM1kMrf70ddxa8EPQ77uWdlsbaOzYj3l2yAkHE9mH2nMt1yygQHLzRvDV0LKeQuw7c1C4RIVXJAQ4N/5DpaBxmRjGmMW1Ni0296Rh8W9GatnX+lsn+71WhZvDoqETz3NHYlA3s0/vHinP/HZPOO2zjI+XlfProZf7SEkuolY84j7Tr1gIm6JSVQOpsGU1FBR3+/EQE4s9n2/5DErSLDiqo0QokEUgvecC926c78yPQ== 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=cOihdyRXr9eWcW42/ogrM9fq+p1Q5MnfASwCGV/+uv8=; b=NcyMKj0c3aroJXtf1WG4I6dvnRTyj/GyltucsWzfBzr87UdiL/BB3SZGbwldLval4LXlt64aOy1xD4orKvVfHacK0Y+oKxflkanSSK2jqPwH7hzxXujbQoJoVaAUZpwwUWR6vnr31DyMw4vm4jyU+jVkn8vI9qGXf1LvZFIUUd48LWLD6g9SNxD02kJPrV/0uGhtpdtbAj8lS3C/uU4CVuCMQmUhAlKXXgWFWTf9PqUq0NBD5DmxRiYp3v7qV5ZIcMzDPDrRHF2mB0VnjDowrEbfHaVomb7UgIAnO6QWKMJH89J7TjSIMlMGTRcsi0qpAjl07gQlPxCXMMrbXmFRzQ== 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=cOihdyRXr9eWcW42/ogrM9fq+p1Q5MnfASwCGV/+uv8=; b=Ui8OCtC7ev6sgQmstZJph+H89GBYZK8OiU5p7eQsrIpbiqDfQiMPU8Jx0s904fGZJUR3AU61xpahLpixZW0Qe2WMvUs6v7OSMll55ydSw46b1iBfdMU5PjLNXpxgzmJ6Kd8FZUGDN1ScJfErynHQOqDqcFPNRYTUYrO57SL6jqk= 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 MW3PR12MB4425.namprd12.prod.outlook.com (2603:10b6:303:5e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17; Tue, 4 Oct 2022 17:47:08 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::d07a:463f:6f93:337f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::d07a:463f:6f93:337f%7]) with mapi id 15.20.5676.031; Tue, 4 Oct 2022 17:47:08 +0000 Message-ID: <975755ac-fa32-0160-6836-b7eae14573ef@amd.com> Date: Tue, 4 Oct 2022 18:47:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [Patch v9 01/18] net/mana: add basic driver with build environment and doc Content-Language: en-US To: longli@microsoft.com Cc: dev@dpdk.org, Ajay Sharma , Stephen Hemminger References: <1662674189-29524-1-git-send-email-longli@linuxonhyperv.com> <1663987546-15982-1-git-send-email-longli@linuxonhyperv.com> <1663987546-15982-2-git-send-email-longli@linuxonhyperv.com> From: Ferruh Yigit In-Reply-To: <1663987546-15982-2-git-send-email-longli@linuxonhyperv.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0133.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9f::25) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MW3PR12MB4425:EE_ X-MS-Office365-Filtering-Correlation-Id: f4a4a8c5-8c92-4d65-ba07-08daa63074ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IPpEjV0svyYCHEotLugqq+kAvBUrbUF/3Ubr14wA3R2rr7faxkDnkxSTnu7z7uiq3zy3TxfUjDjwJ8qFLT3SQejCXlZI2qbsl0vluYwe9TGDTp/2n/AX/pLJr+COZy56CkmavR+3djKMsF9rBJ8uyK6IeUFItisp65QjBYBlwKNYuRNyQrmSuOWOT3CkS/9J4fZkeEMtfwgKQ4yR/SdQ26rxyrpHev4kEoKRltFLlOYofFVQVsER7JlUYtJSdZ36AMkEvWwRf9KwTb9hoVfftVxI2kC51SGdSfE6zWrPqGeswe1iqzMB7MXePI2tV6X5DCaf9FRUVJfP4CHi7o8AAHXAvUNs73//KHbgpriwq9HUTtdU5mDLuIdSWriX5XbuAlNJ/81aquenfSodAKgZAEmwZLFSs6tMbKojSvS0ipqcMfS2UPhOHqQub6MJ5tdBhL5nL2+jBAG43IJeOPrR0IrV+w7OCy/dpUktTgiYjvnvyJhL/07gXyVK2yQUVVvmGdwt+wvFF0OM7dgh60+W5XowohVAKPcfFAfVvRD3/6jLiQLYtJWHe1FLOGBZREUqTgsg1+PNkHHOLT7TIA1Zz8xkzDK6GKZXPAPlSkv4J628OXnxd/ih6keGB+uBLvxjngvw9poYWGoEGRVrGBQYprm+jx3QTNjK+yn+9HcMOsIWJXsmircm/xMedZtdHTjQxwR4Nrn0bhSqsLJ0Hbj+VKDEqrzb0E1iNaI7DjvsokOg2I2Bg29NtJkZDMUD2SFtce6BpHchEiL6WCrEzG8MDeg3LcSADG0Pda3N0TquvME= 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:(13230022)(4636009)(136003)(396003)(366004)(346002)(39860400002)(376002)(451199015)(8936002)(26005)(5660300002)(6512007)(66946007)(4326008)(6666004)(66476007)(66556008)(53546011)(41300700001)(83380400001)(44832011)(186003)(6506007)(38100700002)(2906002)(36756003)(2616005)(31686004)(86362001)(31696002)(6486002)(45080400002)(478600001)(8676002)(6916009)(316002)(54906003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RVFzUHMvQ0ZuWjRhcVpWSjd6Ty94T1VDUzhwdnFuUlNzUzljNTVqZmJVVTVE?= =?utf-8?B?UzZPODJHTkN5blZuaTZLSG1aVjFhaERVTlpCMUhuc09oa213M0ZsSkZtUDcy?= =?utf-8?B?Y2doUGVNNVNYUGNXWHFsTFc3Q2dnL0RtRSs1NWZmT3A1cU55Y0gzTU1vWGl6?= =?utf-8?B?TU90WkVqeS85M1lhU0J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KamYwWndr?= =?utf-8?B?RktpdTFKblc0OFpMa3NhS2t2anJGb25VcGFZczliV0tjYjlqSzNoVnJ5VjNT?= =?utf-8?B?TGlibUpOUjNpUG5NRCtnS1d0M0hpYXI3VE50MXdEYkQwc3dpQ1VQTU1aVDZi?= =?utf-8?Q?CIjdHQJmCBnypsxQ8d/O6Y9xV?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4a4a8c5-8c92-4d65-ba07-08daa63074ed X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 17:47:07.9692 (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: lcxqF116k1NNv+43VZe81gWdCioTIMlIm6fEZtT5oVbiZ6H4oUFYal54SEO8azub X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4425 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 9/24/2022 3:45 AM, longli@linuxonhyperv.com wrote: > > From: Long Li > > MANA is a PCI device. It uses IB verbs to access hardware through the > kernel RDMA layer. This patch introduces build environment and basic > device probe functions. > > Signed-off-by: Long Li <...> > +++ b/doc/guides/nics/mana.rst > @@ -0,0 +1,69 @@ > +.. SPDX-License-Identifier: BSD-3-Clause > + Copyright 2022 Microsoft Corporation > + > +MANA poll mode driver library > +============================= > + > +The MANA poll mode driver library (**librte_net_mana**) implements support > +for Microsoft Azure Network Adapter VF in SR-IOV context. > + > +Features > +-------- > + > +Features of the MANA Ethdev PMD are: > + > +Prerequisites > +------------- > + > +This driver relies on external libraries and kernel drivers for resources > +allocations and initialization. The following dependencies are not part of > +DPDK and must be installed separately: > + > +- **libibverbs** (provided by rdma-core package) > + Does it make sense to provide rdma-core git repo link? <...> > + > +static const char * const mana_init_args[] = { > + "mac", It is better to define a macro for the devarg string to be able to reuse it in 'RTE_PMD_REGISTER_PARAM_STRING' (please see below). #define ETH_MANA_MAC_ARG "mac" static const char * const mana_init_args[] = { ETH_MANA_MAC_ARG, NULL, }; <...> > + > +/* > + * Goes through the IB device list to look for the IB port matching the > + * mac_addr. If found, create a rte_eth_dev for it. > + */ > +static int > +mana_pci_probe_mac(struct rte_pci_device *pci_dev, > + struct rte_ether_addr *mac_addr) > +{ > + struct ibv_device **ibv_list; > + int ibv_idx; > + struct ibv_context *ctx; > + struct ibv_device_attr_ex dev_attr; > + int num_devices; > + int ret = 0; > + uint8_t port; > + struct mana_priv *priv = NULL; > + struct rte_eth_dev *eth_dev = NULL; > + bool found_port; > + > + ibv_list = ibv_get_device_list(&num_devices); > + for (ibv_idx = 0; ibv_idx < num_devices; ibv_idx++) { > + struct ibv_device *ibdev = ibv_list[ibv_idx]; > + struct rte_pci_addr pci_addr; > + > + DRV_LOG(INFO, "Probe device name %s dev_name %s ibdev_path %s", > + ibdev->name, ibdev->dev_name, ibdev->ibdev_path); > + > + if (mana_ibv_device_to_pci_addr(ibdev, &pci_addr)) > + continue; > + > + /* Ignore if this IB device is not this PCI device */ > + if (pci_dev->addr.domain != pci_addr.domain || > + pci_dev->addr.bus != pci_addr.bus || > + pci_dev->addr.devid != pci_addr.devid || > + pci_dev->addr.function != pci_addr.function) > + continue; > + > + ctx = ibv_open_device(ibdev); > + if (!ctx) { > + DRV_LOG(ERR, "Failed to open IB device %s", > + ibdev->name); > + continue; > + } > + > + ret = ibv_query_device_ex(ctx, NULL, &dev_attr); > + DRV_LOG(INFO, "dev_attr.orig_attr.phys_port_cnt %u", > + dev_attr.orig_attr.phys_port_cnt); > + found_port = false; > + > + for (port = 1; port <= dev_attr.orig_attr.phys_port_cnt; > + port++) { > + struct ibv_parent_domain_init_attr attr = {0}; > + struct rte_ether_addr addr; > + char address[64]; > + char name[RTE_ETH_NAME_MAX_LEN]; > + > + ret = get_port_mac(ibdev, port, &addr); > + if (ret) > + continue; > + > + if (mac_addr && !rte_is_same_ether_addr(&addr, mac_addr)) > + continue; > + > + rte_ether_format_addr(address, sizeof(address), &addr); > + DRV_LOG(INFO, "device located port %u address %s", > + port, address); > + found_port = true; > + > + priv = rte_zmalloc_socket(NULL, sizeof(*priv), > + RTE_CACHE_LINE_SIZE, > + SOCKET_ID_ANY); > + if (!priv) { > + ret = -ENOMEM; > + goto failed; > + } > + > + snprintf(name, sizeof(name), "%s_port%d", > + pci_dev->device.name, port); > + > + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { > + int fd; > + > + eth_dev = rte_eth_dev_attach_secondary(name); > + if (!eth_dev) { > + DRV_LOG(ERR, "Can't attach to dev %s", > + name); > + ret = -ENOMEM; > + goto failed; > + } > + > + eth_dev->device = &pci_dev->device; > + eth_dev->dev_ops = &mana_dev_secondary_ops; > + ret = mana_proc_priv_init(eth_dev); > + if (ret) > + goto failed; > + priv->process_priv = eth_dev->process_private; > + > + /* Get the IB FD from the primary process */ > + fd = mana_mp_req_verbs_cmd_fd(eth_dev); > + if (fd < 0) { > + DRV_LOG(ERR, "Failed to get FD %d", fd); > + ret = -ENODEV; > + goto failed; > + } > + > + ret = mana_map_doorbell_secondary(eth_dev, fd); > + if (ret) { > + DRV_LOG(ERR, "Failed secondary map %d", > + fd); The indentation level (and lenght) of this functions hints that some part of it can be seprated as function, like probe one 'ibv_device' can be on its own function. Can you refactor the function, to increase readability? It is control path, so there is no restriction to have function calls. > + goto failed; > + } > + > + /* fd is no not used after mapping doorbell */ > + close(fd); > + > + rte_spinlock_lock(&mana_shared_data->lock); > + mana_shared_data->secondary_cnt++; > + mana_local_data.secondary_cnt++; > + rte_spinlock_unlock(&mana_shared_data->lock); > + > + rte_eth_copy_pci_info(eth_dev, pci_dev); > + rte_eth_dev_probing_finish(eth_dev); > + > + /* Impossible to have more than one port > + * matching a MAC address > + */ > + continue; > + } > + > + eth_dev = rte_eth_dev_allocate(name); > + if (!eth_dev) { > + ret = -ENOMEM; > + goto failed; > + } > + > + eth_dev->data->mac_addrs = > + rte_calloc("mana_mac", 1, > + sizeof(struct rte_ether_addr), 0); > + if (!eth_dev->data->mac_addrs) { > + ret = -ENOMEM; > + goto failed; > + } > + > + rte_ether_addr_copy(&addr, eth_dev->data->mac_addrs); > + > + priv->ib_pd = ibv_alloc_pd(ctx); > + if (!priv->ib_pd) { > + DRV_LOG(ERR, "ibv_alloc_pd failed port %d", port); > + ret = -ENOMEM; > + goto failed; > + } > + > + /* Create a parent domain with the port number */ > + attr.pd = priv->ib_pd; > + attr.comp_mask = IBV_PARENT_DOMAIN_INIT_ATTR_PD_CONTEXT; > + attr.pd_context = (void *)(uint64_t)port; > + priv->ib_parent_pd = ibv_alloc_parent_domain(ctx, &attr); > + if (!priv->ib_parent_pd) { > + DRV_LOG(ERR, > + "ibv_alloc_parent_domain failed port %d", > + port); > + ret = -ENOMEM; > + goto failed; > + } > + > + priv->ib_ctx = ctx; > + priv->port_id = eth_dev->data->port_id; > + priv->dev_port = port; > + eth_dev->data->dev_private = priv; > + priv->dev_data = eth_dev->data; > + > + priv->max_rx_queues = dev_attr.orig_attr.max_qp; > + priv->max_tx_queues = dev_attr.orig_attr.max_qp; > + > + priv->max_rx_desc = > + RTE_MIN(dev_attr.orig_attr.max_qp_wr, > + dev_attr.orig_attr.max_cqe); > + priv->max_tx_desc = > + RTE_MIN(dev_attr.orig_attr.max_qp_wr, > + dev_attr.orig_attr.max_cqe); > + > + priv->max_send_sge = dev_attr.orig_attr.max_sge; > + priv->max_recv_sge = dev_attr.orig_attr.max_sge; > + > + priv->max_mr = dev_attr.orig_attr.max_mr; > + priv->max_mr_size = dev_attr.orig_attr.max_mr_size; > + > + DRV_LOG(INFO, "dev %s max queues %d desc %d sge %d", > + name, priv->max_rx_queues, priv->max_rx_desc, > + priv->max_send_sge); > + > + rte_spinlock_lock(&mana_shared_data->lock); > + mana_shared_data->primary_cnt++; > + rte_spinlock_unlock(&mana_shared_data->lock); > + > + eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_RMV; > + This assignment already done by 'rte_eth_copy_pci_info()' when 'RTE_PCI_DRV_INTR_RMV' driver flag set which this PMD sets, so assignment is redundant. <...> > + > +RTE_PMD_REGISTER_PCI(net_mana, mana_pci_driver); > +RTE_PMD_REGISTER_PCI_TABLE(net_mana, mana_pci_id_map); > +RTE_PMD_REGISTER_KMOD_DEP(net_mana, "* ib_uverbs & mana_ib"); > +RTE_LOG_REGISTER_SUFFIX(mana_logtype_init, init, NOTICE); > +RTE_LOG_REGISTER_SUFFIX(mana_logtype_driver, driver, NOTICE); Can you please add 'RTE_PMD_REGISTER_PARAM_STRING' macro for 'mac' devarg? > diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h > new file mode 100644 > index 0000000000..a2021ceb4a > --- /dev/null > +++ b/drivers/net/mana/mana.h > @@ -0,0 +1,102 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2022 Microsoft Corporation > + */ > + > +#ifndef __MANA_H__ > +#define __MANA_H__ > + > +enum { > + PCI_VENDOR_ID_MICROSOFT = 0x1414, > +}; > + > +enum { > + PCI_DEVICE_ID_MICROSOFT_MANA = 0x00ba, > +}; There is a common guidance to prefer enums against define BUT, I tend to use enums for related cases, or when underneath numerical value doesn't matter. For PCI IDs I would use #define, although both works same, what do you think to update them to define?