From patchwork Sat Apr 24 10:36:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 426814 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2062309jao; Sat, 24 Apr 2021 03:38:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/enW7QM6ODiSFjG0ci85oREmR+G9V79Hm/pmMGXGwjR22El5hgV6itI4/kh/rtMyEFwJl X-Received: by 2002:a05:6000:118c:: with SMTP id g12mr10250537wrx.241.1619260729984; Sat, 24 Apr 2021 03:38:49 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id i10si9495878wry.161.2021.04.24.03.38.49; Sat, 24 Apr 2021 03:38:49 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=szgtEVjO; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9275410FC; Sat, 24 Apr 2021 12:38:40 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150058.outbound.protection.outlook.com [40.107.15.58]) by mails.dpdk.org (Postfix) with ESMTP id B8EBB4111C for ; Sat, 24 Apr 2021 12:38:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cBqOM/OQAYJmVOwA+TZkNOF5KyDib+SIlRKdfqs+4Z3ztdtmuPhEpNV+tv+8lcJD8BZPHbj32mGIdgAqTWKlqjAy/3mka6HqUAY2imfPpiOvclmNIrrlquwRFN9r1iLZYRe8A+++wH/PqQhlq7jXXYXd/1qUCWnWz/sXS82bJKALkgXZfMGbQTtvhxoqulADD/7eA/jWTZBIvcjoodq6JeGjC9ewJqqEnyKPqNC7hm75jjoN+WudjlCsv85cKS63b41Pea/1DB0fQt/wYgq4NfnkeFB/2xwpzeS53sw5WdHKn3+uG0qCMEK8t8XECfJCtIc6nBG1yf/4ZuP8KvH2ww== 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-SenderADCheck; bh=vQ3CJw47U2MeVNjyk0zhM/h0j5Bcapxe3iBgYzRgzIs=; b=Vkd0xuUyST1rHSGc8NwZsfzN+YzR5UKMLspvZm+aupTh1Rj+AHnn3fgODfnBoHejuDOl2e6b+Nrhn9Fqsbdv5q6yw8t+deGprwoe1ISPA9P0OAT39rdnQGrYv1dVDL45f/TmXAWgsZ3reFqcDido0c0fugLiC1Ze83nYy0gpXF6LvSJtBedDgy3xJW+uGcrITGVu6DC8znGi8Lsvt1kgkkR074DZ9f2A2hUhMOJVFPRoN1efacVRgFNwCJzo/CoqCpggeFqgER840ZRqsMVb1bqPjHmLdxUu6X+IdbzDg7lbJtP1lxTZg4qFeP4tbxkugaLlNZi5cY8nH1MAbziK+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vQ3CJw47U2MeVNjyk0zhM/h0j5Bcapxe3iBgYzRgzIs=; b=szgtEVjO27jgHz6ouhiFFVcgFFfBlCH8qVxbiX0cPz6XVM99OnhnpAGB2QcMMpOcEJX0iZRcW2/6C0OG7DfdU0C8w8Zh2Bbql4AcpY/s7pgRO74GnF9UCd4eZZO3dZUVO9f3MfieWNQNUlf10HjE5zgdNeIoRa8tPUGQsMoymXM= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM6PR0402MB3895.eurprd04.prod.outlook.com (2603:10a6:209:1a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.25; Sat, 24 Apr 2021 10:38:35 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55%6]) with mapi id 15.20.4065.023; Sat, 24 Apr 2021 10:38:35 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, Hemant Agrawal , Nipun Gupta Date: Sat, 24 Apr 2021 16:06:55 +0530 Message-Id: <20210424103700.8098-4-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210424103700.8098-1-hemant.agrawal@nxp.com> References: <20210413051715.26430-2-hemant.agrawal@nxp.com> <20210424103700.8098-1-hemant.agrawal@nxp.com> X-Originating-IP: [92.120.0.67] X-ClientProxiedBy: HK2PR04CA0088.apcprd04.prod.outlook.com (2603:1096:202:15::32) To AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by HK2PR04CA0088.apcprd04.prod.outlook.com (2603:1096:202:15::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Sat, 24 Apr 2021 10:38:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 08ee7cb7-6651-4391-2aed-08d9070d1cb5 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3895: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9H8azO3Sok0YzBAbOR1A2vKbFyk5xAJ4ForOGOzoZZ6THUjxmgf8/pCPqMcTi2M/6tsKkI8igCfXgUkfKqSRF5xA6fvOvWYGUYBCvXzdOQ2J7v4J3SPr/vZuzSQEe3DBaSjDqb1ZhFtkkXuKe4P5rJQJZ/L58u0t9VfNWMT23EgdKtVIe0VZxjCiRBjZDvGY5joUNSg1+tDBgvCfqvBDN9lPyGMM8yR3SoeXPByjr/H39uUifSATG6v5tbdqpU1aogosRb6/qZA0+3Z0HodjItFyMTsiEhNuVgyMWEDbHDaj6SvjKVO6mIZiwNtXqv/RcF8HrBiys76yyrih30buUNAHt0aZtKukwWcUSYte8hjDxCoD2Q05tk2/fvwqMKulA7I9ziCdWiF1yhHWzKHLn0Th5cAzeKklxdtdBu5zpJStYrR8TqnWBMZQIFHhOUR+HeEURPSS9CRKFStM+5NFOT5BGK09HvnYpIOW3deKBWxmyzcRdwVPIW2OLd3Wc2xJSvJ0mKVNzXdAM96uUL1mO842r6b3+bUcXVN+akLDYwT0zihijtHXYb7UqmSLDJ61EOOiWB25NS13cVhBA3GmaD9MB8NeB9lxUXSh5rr/wDnB66OJA+YO2JhhMICmQom5KnjPj4DimX+6AlH921PETXWLPi2+dww+iP8VmkzZLgk= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4456.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(136003)(376002)(366004)(346002)(8936002)(5660300002)(316002)(1076003)(54906003)(8676002)(6512007)(86362001)(478600001)(38100700002)(2906002)(956004)(2616005)(38350700002)(36756003)(6666004)(186003)(83380400001)(26005)(4326008)(16526019)(6506007)(52116002)(6486002)(44832011)(66476007)(66556008)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 26VwVQALY48sF4KF39RiP6tsDQi9P+EnGeflnR+kvEsuhamkcsTAoPnYhKgtay6moHMbxQeafo3/oQQ3YyOvTAr9CXnBbOOZCWEhr+JJp/fdvXZU2JyttUtnLO9A1O9IXUG5l+ETSfD4QrG6UsNBsy4a0x8mQ6uI0RUfnsNEBS59l1gJCISsAf2f/wcFyycJW0gDW5v853bENSQvgjVb3fk/zC0sagbDuAVxpJ8lVPs5/aYZIGP67xq9Fyx0Uj8ajjYKSEt4DO/f3uTFi/gC5hS12P+7iGIZ2X0tWGWdlZD1pXb2qUBJYtxdO+KYjcyVw3o+oXqlERHh0KCtb/DRZh9hjil2K6TIdV7diA14HHXzcIN9UqlqqFZl8wXn8Oza5cL+fcpCm7ESaeiw2K2mT1UeheWuW/yRfbfeeDTnBtI28xkTiUhR4Y+SS9ng/NudWDGIjvQIybSMKRyCYaFFt6B6T8+W2RsElFqDjf9kwBmfYtj2d/jgMEGGHNsC5Z/q09117pv/AazWJPcL+geZvL26NaY9CJe+9kkglJ1m67TMZ1jRDJMzHON3PYD8GQDi9M6yVNt2V20uM74B3I1h2AsU90XnrFBr0224fDIGAq/T7XPbvQMSmLDP1BhWPqFO4T12aOlDK0WJOu1MCWe6VCj8GOSkiJfMMgiSyFcmU/WWc/e9kHKeTn/iQxu25ZXGmWxS3qHRoP/hjDzTRHbpQuU9jFkftKn2SBGWPNn6bIGg64JORPZPM0KLYtry9ICbvyzZx1PdifSKcGdpaZOmHgQDawhVUksRdUk0GNTvtvYbuhz5scb9R3v+8xPTqb7TAR2qAS/bzTZrcWPZXIpuO8IAT8ktJ8woTixnd+fEY28NvZ2wfoBPfyAcSMIdUO7M29a3RCWvv4u6pKj9I6ZAVxKBOZxmdKULFdJ7+h+E5glWmKkcDEfXK7hVgpF7ER39Vckwt0hge/SKjnHYPCQA7hvrXWyW/3kIBcpvPM36bIhTpxXGMDN2SPTuR1SNHKSMwF5zdtoohXy4IP36HH2Qd1gXijQkT8zlwgovaMn/9kAlgkzVygvVz1IOzwD5jbJM78xI9u47IdI8fpmMmRZliTST8SSUB+X++34wuk+uc8bVuUeBxJ8uP32CfoceeFVWuPX3l2dDrxLLOYFulz6B4x2zg5P7OBTnl3QUBDq/rWrt/X6jD5MS7eia91KPA5XSCVgMAcqhkyfmvDQeXM6GO9cqE4XYg0na8sd+QkGam9FQLSbZRyoHk7nJYviKSjycUjQR624SabKfpE+TcYhvSQaO8Z+be2wDHwSZaVK8O8L9lDPqNTrkr7+3pwnOoxXi X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08ee7cb7-6651-4391-2aed-08d9070d1cb5 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2021 10:38:34.9308 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1a/GAd3+JJpIBZqDsIrW2S50h5AW6hF5mllzeIyW0vTHp6WcKeoRio7UQ2ah9/KVNX7TEUT9W8OwL1H5qe6cbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3895 Subject: [dpdk-dev] [PATCH v4 3/8] baseband/la12xx: add devargs for max queues 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 Sender: "dev" This patch adds dev args to take max queues as input Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 72 +++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 7050b17728..8886b35429 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -19,13 +19,72 @@ RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); +/* Initialisation params structure that can be used by LA12xx BBDEV driver */ +struct bbdev_la12xx_params { + uint8_t queues_num; /*< LA12xx BBDEV queues number */ +}; + +#define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" + +static const char * const bbdev_la12xx_valid_params[] = { + LA12XX_MAX_NB_QUEUES_ARG, +}; + /* private data structure */ struct bbdev_la12xx_private { unsigned int max_nb_queues; /**< Max number of queues */ }; +static inline int +parse_u16_arg(const char *key, const char *value, void *extra_args) +{ + uint16_t *u16 = extra_args; + + unsigned int long result; + if ((value == NULL) || (extra_args == NULL)) + return -EINVAL; + errno = 0; + result = strtoul(value, NULL, 0); + if ((result >= (1 << 16)) || (errno != 0)) { + rte_bbdev_log(ERR, "Invalid value %lu for %s", result, key); + return -ERANGE; + } + *u16 = (uint16_t)result; + return 0; +} + +/* Parse parameters used to create device */ +static int +parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, + const char *input_args) +{ + struct rte_kvargs *kvlist = NULL; + int ret = 0; + + if (params == NULL) + return -EINVAL; + if (input_args) { + kvlist = rte_kvargs_parse(input_args, + bbdev_la12xx_valid_params); + if (kvlist == NULL) + return -EFAULT; + + ret = rte_kvargs_process(kvlist, bbdev_la12xx_valid_params[0], + &parse_u16_arg, ¶ms->queues_num); + if (ret < 0) + goto exit; + + } + +exit: + if (kvlist) + rte_kvargs_free(kvlist); + return ret; +} + /* Create device */ static int -la12xx_bbdev_create(struct rte_vdev_device *vdev) +la12xx_bbdev_create(struct rte_vdev_device *vdev, + struct bbdev_la12xx_params *init_params __rte_unused) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); @@ -62,7 +121,11 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev) static int la12xx_bbdev_probe(struct rte_vdev_device *vdev) { + struct bbdev_la12xx_params init_params = { + 8 + }; const char *name; + const char *input_args; PMD_INIT_FUNC_TRACE(); @@ -73,7 +136,10 @@ la12xx_bbdev_probe(struct rte_vdev_device *vdev) if (name == NULL) return -EINVAL; - return la12xx_bbdev_create(vdev); + input_args = rte_vdev_device_args(vdev); + parse_bbdev_la12xx_params(&init_params, input_args); + + return la12xx_bbdev_create(vdev, &init_params); } /* Uninitialise device */ @@ -107,3 +173,5 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { }; RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, + LA12XX_MAX_NB_QUEUES_ARG"=");