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 2B160A04A3; Wed, 26 Jan 2022 17:46:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3BB14273A; Wed, 26 Jan 2022 17:45:59 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id BC80C42738 for ; Wed, 26 Jan 2022 17:45:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643215558; x=1674751558; h=message-id:date:to:references:from:subject:in-reply-to: content-transfer-encoding:mime-version; bh=2lN0WeKNqmhz/ie6envCleBKCOxiPDoJRE2z+PbTd4c=; b=PjoGhBn3WsO88/ERTcbpII5aqLTMAVXSwJ+I3QcLBYagOAG1NlapGKkf DiFX+o8e9sr1CXmqYVeZtDHzysLy/w332vG8WEXtKm7KVUUK3ICAeSm5g TgEvuw5eFC4VwKakPDNgOCNyOK4gzyQdoKu8W7jfHL5fCfypffKyBddSs 898e8ve0c2G1WZZGoHya4DjZhcWoTt3sB0JkVlKctxTHPp1iOelxEg3gp S9QGULoKZCP/Gm3VC73z/VZC8bJNx41mpuuhJufvCnc5jjFRl/1yXucWA 6NikSJ4M3PKVDxqcuySGuMlme3Uo+op8s3GSOrh1WEOwTbYQnaXiimlEH g==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="246368956" X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208";a="246368956" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 08:45:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208";a="597513825" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 26 Jan 2022 08:45:56 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 26 Jan 2022 08:45:56 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 26 Jan 2022 08:45:56 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 26 Jan 2022 08:45:56 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.174) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 26 Jan 2022 08:45:55 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HPIiXjpRhQZbuxQIiwTCKQIC1TyTUIJ9RiGv8yG1ZYBvvXg3ASfUz+9U0iAa8xhUNUuKDIsWmZP5g0kOolregckHuiLi/4vv3puAMdgRSGyZytrr2DCeObdzKRRRYXA1UP9DgqoyeC0khqNno85lYtEqVRlBbEPmvwkwnkq4dJYpvLgNskeNYc8+FqQD3uoAFlJ4X9xY6B7rd1RSXpJawie8J9phqV04Jf9b76vypmbFcboOzE93UCPL7hp8jUwtrZJFiVqXdlLi4wvLg9/+r7G7bDH935Vf/KI+7KZSkJ7ZmKQ0WumDDYdVR9wkiWHmuwYy9z59uikIuUxSfiBvXQ== 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=MVHx/TdvY0k33d4GnGSmr2FQH1jRGR2kdCGpF+C+vX8=; b=R6lNDxjbNOyWcgjUTJUMQD/97+H/nFw5SexqI3LHozLEOl/o+SHlSx9EeJPV/HVnQqj16XEBqznqUrhTfXc8kqKNo01xzXCJ2oMuME7WtDUhj9J8mXUAaoA1gR0QRoRWmjatQ8dvW7IDcgFBeht3JldWYQ0E6PQcqZeXK9wasHqO0K0R6C70oEuQrv+p6iHNc7Wdr61o8gG+lXyaNzpnXGvQDJPXxJkq/TzJTixic9DA7abjZ52RoJ2Z4fVogvKpt+bKnP61DH8qrSYWxkMTWaXU28rOdx6pb9dsa7smRxtp0C8iPFirkbmKxk6uoSlic7nsX9l0rUnvScyuAwlUsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by MWHPR11MB1712.namprd11.prod.outlook.com (2603:10b6:300:29::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 16:45:53 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4909.019; Wed, 26 Jan 2022 16:45:53 +0000 Message-ID: <770f9da5-fa68-8c47-5794-e5d99548a4c2@intel.com> Date: Wed, 26 Jan 2022 16:45:48 +0000 Content-Language: en-US To: John Miller , References: <20220119191255.273988-1-john.miller@atomicrules.com> From: Ferruh Yigit Subject: Re: [PATCH 1/4] net/ark: add device capabilities record X-User: ferruhy In-Reply-To: <20220119191255.273988-1-john.miller@atomicrules.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB8PR06CA0064.eurprd06.prod.outlook.com (2603:10a6:10:120::38) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15ac4e30-fead-4a7e-a94d-08d9e0eb510e X-MS-TrafficTypeDiagnostic: MWHPR11MB1712:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LOLQsPhmOj04U8AMgTAR0i3pL9Z/CdtRpTKniqp7vp2eHSGas9Le6Ekh9Ovq52PP3gEpJ13W6+bKorN87T+NWNfgSEqp/LsisihmW+tN6D8b8H53mubQ5le/WkZNPTARIrSiOHTkSBkL5smtYplmb2rnvFXbFsQECVb3Eboh31UjvOvCbPWxFXVBIYrcdMHRAdZ4OoKruEhGK0BzxDmgk+KFk5XAgJJawFNi5/9KYB2c7sFDt9St1By8xL88A/aX1lX0l/SWxcOI4aJXRNtpnnM3JvWPoYY9lkn7d4zu5PmzIr1kzMyyKZHhKotQexlEFgGhWeMvExseILgRdvhEVjskOHlXu9oDLLqYFZzJTjlLTFAITVfIipNC+yzaRXsnut1b6pJGr+V9JZ3hYIMoN+8eQF4/q5VrNMtdvz+pQoSmCfxphs1Y66dU8Y+S1Nl6BDyjVvfB8iu/MVORawEvNkFRMz1IjrcSnB6l4L05DZzqqOUX978sTL9O5+810SBs7NduK2j9KX3nRZRSEsASAcaldOuBmt2D2wOXjNDc94yCqqahY6SjWXOh4BkYK8GmhcXNSeHAa03OQ+wM+sDOdmNWF+KaHoUH+aeUqRIhQOfg/bXRiORqrIHEMhYPB4OKlv9EbYLZAv5d7tKStW8rHJcACgJMlnJAAq3pS84tAWXuT5sk8dSrVtiMaIyvv+NBU/4rVOIzJ3ro25XvSn75zg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(6506007)(508600001)(53546011)(6666004)(31696002)(6486002)(86362001)(2616005)(83380400001)(26005)(186003)(2906002)(38100700002)(31686004)(6512007)(5660300002)(82960400001)(36756003)(44832011)(8676002)(66476007)(66556008)(66946007)(316002)(8936002)(45980500001)(20210929001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Lzc1bHBFS3p1NVQxTjdOb1o2UHJDM0xhMi9pRmc1NG5VZDk5NCtYT1dFZDZ4?= =?utf-8?B?dkM5d3h3Qll1Y1pkZTBvcytiamJnendZVUZLK3dtbDdRUXE5NVNhZ3BwSlJU?= =?utf-8?B?Sk9PYnVVS1V5WGpkMEo2V0t0ZElrdWo0TmZxbEZiOWxkNDBnZVphVmZNZ0Jv?= =?utf-8?B?U2NFZTZmUWNlMitMYnU0OXpGZTMyTENlT3lxL0s2OUpEbXE0ZTNBRVE0MHE1?= =?utf-8?B?VVZWVjlOcGJVMTFkc1k0KytkVGpmT0kvTW1yam0wT0k2R1B2bUhJSlRKak12?= =?utf-8?B?T2dJam1DdDNPUktMS3BPc3lQMUtXM0J2bVplVjRHRno0cjZzRTYyeENNNXd6?= =?utf-8?B?akpVMHFnWkZPM0h2bmJvRWJPUHBsT3AxeVNKc1BIcktaVko1b2tqWk1ZNElm?= =?utf-8?B?UllBNWZkNmpZVXVEZVRk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message-Id: 15ac4e30-fead-4a7e-a94d-08d9e0eb510e X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 16:45:53.4143 (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: IrFkbNQK9rhCpDLxl+0c7R7wEvg/cS7lratz4nr4toQDHnce+DMXmBGg4Y7mQ13vvpgcbArrg4AsdvDXrEGfAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1712 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 On 1/19/2022 7:12 PM, John Miller wrote: > Add static record of supported device capabilities. > > Signed-off-by: John Miller > --- > drivers/net/ark/ark_ethdev.c | 58 +++++++++++++++++++++++++++++------- > 1 file changed, 48 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c > index b618cba3f0..0414c78bb5 100644 > --- a/drivers/net/ark/ark_ethdev.c > +++ b/drivers/net/ark/ark_ethdev.c > @@ -96,6 +96,26 @@ static const struct rte_pci_id pci_id_ark_map[] = { > {.vendor_id = 0, /* sentinel */ }, > }; > > +struct ark_caps { > + bool rqpacing; Can you please put some comment that what this 'rqpacing' capability is? Either to commit log, or as a comment to the code, or both. > +}; > +struct ark_dev_caps { > + uint32_t device_id; > + struct ark_caps caps; > +}; > +static const struct ark_dev_caps > +ark_device_caps[] = { > + {0x100d, {.rqpacing = true} }, > + {0x100e, {.rqpacing = true} }, > + {0x100f, {.rqpacing = true} }, > + {0x1010, {.rqpacing = false} }, > + {0x1017, {.rqpacing = true} }, > + {0x1018, {.rqpacing = true} }, > + {0x1019, {.rqpacing = true} }, > + {0x101e, {.rqpacing = false} }, This device, 0x101e, even not probed, it looks odd to keep capability for it. And it will increase the readability if you can use macros for device/vendor ID. > + {.device_id = 0,} > +}; > + > static int > eth_ark_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > struct rte_pci_device *pci_dev) > @@ -256,6 +276,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) > int ret; > int port_count = 1; > int p; > + bool rqpacing = false; > > ark->eth_dev = dev; > > @@ -270,6 +291,15 @@ eth_ark_dev_init(struct rte_eth_dev *dev) > rte_eth_copy_pci_info(dev, pci_dev); > dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; > > + p = 0; > + while (ark_device_caps[p].device_id != 0) { > + if (pci_dev->id.device_id == ark_device_caps[p].device_id) { > + rqpacing = ark_device_caps[p].caps.rqpacing; > + break; > + } > + p++; > + } > + > /* Use dummy function until setup */ > dev->rx_pkt_burst = ð_ark_recv_pkts_noop; > dev->tx_pkt_burst = ð_ark_xmit_pkts_noop; > @@ -288,8 +318,12 @@ eth_ark_dev_init(struct rte_eth_dev *dev) > ark->pktgen.v = (void *)&ark->bar0[ARK_PKTGEN_BASE]; > ark->pktchkr.v = (void *)&ark->bar0[ARK_PKTCHKR_BASE]; > > - ark->rqpacing = > - (struct ark_rqpace_t *)(ark->bar0 + ARK_RCPACING_BASE); > + if (rqpacing) { > + ark->rqpacing = > + (struct ark_rqpace_t *)(ark->bar0 + ARK_RCPACING_BASE); > + } else { > + ark->rqpacing = NULL; > + } > ark->started = 0; > ark->pkt_dir_v = ARK_PKT_DIR_INIT_VAL; > > @@ -309,13 +343,15 @@ eth_ark_dev_init(struct rte_eth_dev *dev) > return -1; > } > if (ark->sysctrl.t32[3] != 0) { > - if (ark_rqp_lasped(ark->rqpacing)) { > - ARK_PMD_LOG(ERR, "Arkville Evaluation System - " > - "Timer has Expired\n"); > - return -1; > + if (ark->rqpacing) { > + if (ark_rqp_lasped(ark->rqpacing)) { > + ARK_PMD_LOG(ERR, "Arkville Evaluation System - " > + "Timer has Expired\n"); > + return -1; > + } > + ARK_PMD_LOG(WARNING, "Arkville Evaluation System - " > + "Timer is Running\n"); > } > - ARK_PMD_LOG(WARNING, "Arkville Evaluation System - " > - "Timer is Running\n"); > } > > ARK_PMD_LOG(DEBUG, > @@ -499,7 +535,8 @@ ark_config_device(struct rte_eth_dev *dev) > ark_ddm_stats_reset(ark->ddm.v); > > ark_ddm_stop(ark->ddm.v, 0); > - ark_rqp_stats_reset(ark->rqpacing); > + if (ark->rqpacing) > + ark_rqp_stats_reset(ark->rqpacing); > > return 0; > } > @@ -695,7 +732,8 @@ eth_ark_dev_close(struct rte_eth_dev *dev) > /* > * TODO This should only be called once for the device during shutdown > */ > - ark_rqp_dump(ark->rqpacing); > + if (ark->rqpacing) > + ark_rqp_dump(ark->rqpacing); > > for (i = 0; i < dev->data->nb_tx_queues; i++) { > eth_ark_tx_queue_release(dev->data->tx_queues[i]);