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 11CE541CEC; Mon, 20 Feb 2023 15:54:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EEF0B4306B; Mon, 20 Feb 2023 15:54:13 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2083.outbound.protection.outlook.com [40.107.93.83]) by mails.dpdk.org (Postfix) with ESMTP id F29CF43069 for ; Mon, 20 Feb 2023 15:54:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VtGBiicHiV6gXB182JWTy+sUGUIfQom8LPjdaT/RIcdzJIJ/KmlnzM3PNeSYMfnwkKdVIapRQAK8bw18hV3PvCcZ0Ua0mHP0dhB4guH+xUnSXgTImGePj86ihIeKhA05aVdgAnZJR7kkZGItj19RuZuOrwW0QGyo6u6TD5MPslhHPq3pKd9qWA6YZGOTxiDG92fpd8fHcGmZub/VAhGWnXBcEv3kkSqeMnatiGOxy9SmWUmnZclX8FSrRiHYNi6KwNJ3jUd5cw6CjYwqld/ypSbOrrTBO7iQvigC7u8PSD156CLR4Hep7p2aAqfOfqi041Rs8Vhud3NPfZ+TNGAFKg== 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=0TxPfvUxAiVxFcebMdLMAAzi3qolJXbZbHXHSVgQpmY=; b=BoroJJVVMKUVJjO1WJSCvAXMbzfOQNo9gQvIvpSjD+01uXl/C5KF4gclY9YyuKJ6AsDZpfnYPgPrFjfM+WnxxpblGl8X/tUZBW/XjUGjiZsC82G/nFeq1PPaYjRhMK7z7NLA/qP5lvkpcY0Stbrf5X0oPXkJ3mPZgmClrVDOuWtvLUF3iRncsgroqtb87XK1svDIYF8nZnkTJVPt+lLEKZGsY/yOGWzi7ucs4GP6BR7AVQNGefjwZp+0GOjvNrvuumgIUir/vlA2XPQHDaIk2VagTFeQRR/vt/O2EOBG/YOmzPwfbWzwbuhGcwHMQ6KsIis3/VLakj3f4fA6I/TZdg== 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=0TxPfvUxAiVxFcebMdLMAAzi3qolJXbZbHXHSVgQpmY=; b=v6jXda+7B2M3NjGmrNZTvQUR8Gov4yIfzCC3fUYHtrNpt9xdsXv4DmCclJSV46Tdyy89UH4Qhac8mOvNqTufmFxyWY8ppI6PWx1so5iRirMkXdIqrCepn04ip4GaKH3eqFBldh1ujmGmYIXalcYYhSXo2zOWZYoiIsnc335bMYI= 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 BY5PR12MB4273.namprd12.prod.outlook.com (2603:10b6:a03:212::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20; Mon, 20 Feb 2023 14:54:10 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%8]) with mapi id 15.20.6111.020; Mon, 20 Feb 2023 14:54:10 +0000 Message-ID: <390a5b75-175d-3c03-a690-b062ff5de43b@amd.com> Date: Mon, 20 Feb 2023 14:54:04 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Ed Czeck , dev@dpdk.org Cc: stephen@networkplumber.org, Shepard Siegel , John Miller References: <20230217160039.2487085-1-ed.czeck@atomicrules.com> <20230217215923.2561685-1-ed.czeck@atomicrules.com> <20230217215923.2561685-2-ed.czeck@atomicrules.com> From: Ferruh Yigit Subject: Re: [PATCH v2 2/3] net/ark: support for single function with multiple port In-Reply-To: <20230217215923.2561685-2-ed.czeck@atomicrules.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0676.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:351::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|BY5PR12MB4273:EE_ X-MS-Office365-Filtering-Correlation-Id: df93941e-b363-4db0-d9e3-08db135252ae X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1w9UImnnCnCzI3n2X2NdEIFngUfvyz2kV2eTjGJZWAQrnQnYM/9T8JAu1Lltwjr7Uo0vDqLErIyjPvOZLtP00j0IXGWhWj2CqLg3lUbTNUOEFUMjqnbAi+YefHA2xr8s6K5OjumY4yHuq+VgdVBvgNedYL0eRsLuakutD53MFzvC7ertvMSNXy6jJxCwCglRMceES+mflfXxoxmocbc3zzQezqY9QaP7aXaUhSkRgziu/ebU2nkG2B7U2W2/7R8dDbVWIBD3vz/XmNdqkVF2B5rC6tD5aLS+xG0SVbqNqdEQXdGC8ZEMD5bqEqDdCQUKwngRnhj8PA6wkA0i98+23Di2RBEvdTQUFkH5eUzdYRQwtYyHgZ0HZdIqApPAjBioZYGbScmsLeCsh4alXXyYc0cWB0DCuHcvihi2GOpGNzEy+nF/juFDtsYFkcKOmHZiMRTucZ6yIOp/6oCp0fAUWS6acKruM0vM2Cm3MJROSOGwRzL2SxQYtjZmHOxoNuS6syzad59rCPVpfYPwt6G3VLfw15zW4CFp6XDe29qOrzGnhFxkrnxwZkk/XuKuY1dkQQJ85vTQGx31R65ctzkC42+StIjPGW85ZKVAHvXrUOMsVQBrVjZ9X1Vvh4MpFLqCsSnU/zyVSXr+NcrHtD/iiijCw6sdiEJCbbD2mzDBxVzdeN+nY7uV59tQz+KMV5//pGY7A9EG3v/sPnzzTJgj3C066ikSZICOrMUKIT0FiXU= 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)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199018)(38100700002)(36756003)(86362001)(31696002)(66476007)(8676002)(5660300002)(44832011)(2906002)(66556008)(4326008)(66946007)(8936002)(6666004)(186003)(2616005)(26005)(83380400001)(6512007)(53546011)(54906003)(316002)(41300700001)(6486002)(478600001)(6506007)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WU5XN00ydHNiMmJEUDVkekwvU3ZUVlNjR3hycEZ2dmFoa3R3Y3BER3hvSE0v?= =?utf-8?B?a2RmVlNMTm5GMzlmTE1rTGZycW0xczIxSC81Qk9ZblJIcjgvc3dRV0FXdktC?= =?utf-8?B?MWFhVThpQ01KY0dhemY4d1dPZm1vSjYxcm8xN2FSMTZNSWVYU0pWTlNCMEQw?= =?utf-8?B?OCtCMmwrUDB1SjNOMkp5Vy91Q1M1b0FBZEpFMW8wQjNQMEZtR3ZURXJKY0NZ?= =?utf-8?B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dFJWTHczUi9aT09Fdk5h?= =?utf-8?B?S1IyMUZ6TGp0WGhUdURPNmYrN1JKZ24zeThhY0dnY0F6VFhsTm9na3BlM3hG?= =?utf-8?Q?n7EFvvUNqYRwBXqgbys1bB6CS?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: df93941e-b363-4db0-d9e3-08db135252ae X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2023 14:54:10.1318 (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: flgFFjTMkh/kpSZxHoleGDhVMAOqJLwqEEmS226QuqM78SLdsKAADjGska1naXqr X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4273 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/17/2023 9:59 PM, Ed Czeck wrote: > allows the creation of multiple ports from one ark device via > the use of ark pmd extension, though the splitting of queues Hi Ed, As far as I can see "single function with multiple port" support was already there but this commit is fixing queue index usage for it, if correct can you please update commit log accordingly? (with fixes line etc..) This also helps the fix to be backported to LTS versions. btw, how this feature was working until now, when queue ids "0 to ark_api_num_queues_per_port()" used for each port? Was it not tested at all, or is there something changed in FW causing this issue, if so is there any FW version dependency to this change? > > Add unique dev_private data for each port > Please check comment below related to this one. > > Signed-off-by: Ed Czeck > --- > drivers/net/ark/ark_ethdev.c | 14 +++++++++++++- > drivers/net/ark/ark_ethdev_rx.c | 6 +++--- > drivers/net/ark/ark_ethdev_tx.c | 2 +- > drivers/net/ark/ark_global.h | 4 ++++ > 4 files changed, 21 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c > index d237e80cf4..96d0c2b0f0 100644 > --- a/drivers/net/ark/ark_ethdev.c > +++ b/drivers/net/ark/ark_ethdev.c > @@ -432,6 +432,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) > ark->user_ext.dev_get_port_count(dev, > ark->user_data[dev->data->port_id]); > ark->num_ports = port_count; > + ark->num_queues = ark_api_num_queues_per_port(ark->mpurx.v, port_count); > > for (p = 0; p < port_count; p++) { > struct rte_eth_dev *eth_dev; > @@ -457,7 +458,18 @@ eth_ark_dev_init(struct rte_eth_dev *dev) > } > > eth_dev->device = &pci_dev->device; > - eth_dev->data->dev_private = ark; > + /* Device requires new dev_private data */ > + eth_dev->data->dev_private = > + rte_zmalloc_socket(name, > + sizeof(struct ark_adapter), > + RTE_CACHE_LINE_SIZE, > + rte_socket_id()); > + > + memcpy(eth_dev->data->dev_private, ark, > + sizeof(struct ark_adapter))> + ark = eth_dev->data->dev_private; > + ark->qbase = p * ark->num_queues; > + These each are a new eth_dev, so nothing wrong for each to allocate device private data, but if the only difference in private data is 'ark->qbase', it is possible to use 'eth_dev->process_private' for it, which is per eth_dev. It is up to you. Btw, how there are handled in the secondary process? (previous patch) Since this code just creates new eth_dev, shouldn't secondary process needs some code to find and re-use them? > eth_dev->dev_ops = ark->eth_dev->dev_ops; > eth_dev->tx_pkt_burst = ark->eth_dev->tx_pkt_burst; > eth_dev->rx_pkt_burst = ark->eth_dev->rx_pkt_burst; > diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c > index cbc0416bc2..38bc69dff4 100644 > --- a/drivers/net/ark/ark_ethdev_rx.c > +++ b/drivers/net/ark/ark_ethdev_rx.c > @@ -68,7 +68,7 @@ struct ark_rx_queue { > static int > eth_ark_rx_hw_setup(struct rte_eth_dev *dev, > struct ark_rx_queue *queue, > - uint16_t rx_queue_id __rte_unused, uint16_t rx_queue_idx) > + uint16_t rx_queue_idx) > { > rte_iova_t queue_base; > rte_iova_t phys_addr_q_base; > @@ -124,7 +124,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, > uint32_t i; > int status; > > - int qidx = queue_idx; > + int qidx = ark->qbase + queue_idx; > > /* We may already be setup, free memory prior to re-allocation */ > if (dev->data->rx_queues[queue_idx] != NULL) { > @@ -215,7 +215,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, > } > /* MPU Setup */ > if (status == 0) > - status = eth_ark_rx_hw_setup(dev, queue, qidx, queue_idx); > + status = eth_ark_rx_hw_setup(dev, queue, queue_idx); > > if (unlikely(status != 0)) { > struct rte_mbuf **mbuf; > diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c > index 5940a592a2..4792754f19 100644 > --- a/drivers/net/ark/ark_ethdev_tx.c > +++ b/drivers/net/ark/ark_ethdev_tx.c > @@ -229,7 +229,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev, > struct ark_tx_queue *queue; > int status; > > - int qidx = queue_idx; > + int qidx = ark->qbase + queue_idx; > > if (!rte_is_power_of_2(nb_desc)) { > ARK_PMD_LOG(ERR, > diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h > index 71d0b53e03..176fbcda17 100644 > --- a/drivers/net/ark/ark_global.h > +++ b/drivers/net/ark/ark_global.h > @@ -112,7 +112,11 @@ struct ark_adapter { > ark_pkt_chkr_t pc; > ark_pkt_dir_t pd; > > + /* For single function, multiple ports */ > int num_ports; > + uint16_t qbase; > + uint16_t num_queues; it looks like 'num_queues' only used locally and not needed to be part of device data, unless there is some more usage planned for future. > + > bool isvf; > > /* Packet generator/checker args */