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 DAD2FA0C4B; Sun, 12 Sep 2021 14:16:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3733410FC; Sun, 12 Sep 2021 14:15:45 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60064.outbound.protection.outlook.com [40.107.6.64]) by mails.dpdk.org (Postfix) with ESMTP id 972E3410FA for ; Sun, 12 Sep 2021 14:15:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QTmJQhoFPcyn9IPVXvKF6PVxCK9S8iQMZzOzT+V1WUj80RDFHEZMnmtM8F/8hyv6dl7qbarZRLiqV2mU3cdJ4dvcW8dXXXxDl8+HhWOe8ECVeXyos04seA+SUZN5dkVfGFL6cR1QX8AcsJtop2UUC4tRzcjawR6LcDE+QqjZBMmY2ocCtt9RLmq4zDu16z81Np2XISC5nivUTK+xvI+dmEeQZeCgXgfRC0V1RLaxAJl/Y4RqH0hUoTrrMBn012MHlgW3FE4togZE7L3PFZuzbHc33A7Jj8VkzocwljZdvRWYRs9pU8I0QEc1Gyw8AcTsOHbCX13ZnkP9NbYTDAR/rA== 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; bh=FvJL9IiWYUgBs97JOpP4njxSSv71FW1SSjl87BEMbdc=; b=JdeN/a3Gs0+KXQzGDagu1K0kpZcM2AjRFFxeBONtmvMWNXD4rnOw6ul/aLf+8BhgcWKa37Aquo3vkyIygkxz2dOcjqIsFXJ6ol5T4Ckv6wtkC1ICRX0/hzA141bvie9EO6z0t+HtBTPeN+khdHgNu6nUv0+eF7SzkYPCBXqHqnieeADut6/i+w35bojfwRCWnmxUOiZAVMwLeD/V25UiQoUjOneUFn17HH5DGdxvA3sG0EJatjBRvw2rzRCpgzjCWtJ+Ygl+jiKgRfPhqV9zt5WFy9JpJkfUI+D2d6Vp06LdFfeLTsxLdBTWVfVSjg5mep6p5RSYY456MPr4pbudYw== 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=FvJL9IiWYUgBs97JOpP4njxSSv71FW1SSjl87BEMbdc=; b=BLLFK0AkuUzJyuslemZo5Hl+4CYWzTE7FEbuW9HE996C7gN0cTOS/ApGvrv3eS9dx2EiijnoNsinv5XgCi+LYvRyU0o9asotR46xX8yb0aWwppgiDn+5pJYLlZDb+TokaLGKDmfafid6NJfwXcbrrLPP7Rj3dIW1epz4vmFql9I= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB7PR04MB4778.eurprd04.prod.outlook.com (2603:10a6:10:18::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Sun, 12 Sep 2021 12:15:42 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:42 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Sun, 12 Sep 2021 17:45:04 +0530 Message-Id: <20210912121510.22699-4-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3d9f952a-3776-4f40-2233-08d975e70a77 X-MS-TrafficTypeDiagnostic: DB7PR04MB4778: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ophhfBLyiCae6/i/R9xRZkN2Z1qr2jTOjdLXrjw08BTRH8XMucOkzwDaZ3C8cGKQpAwCguNZwuCf9lTzqhKbvYUgZZz169LrsO8b97K4tA8ZUcPnjYek5LTVLQkLMAnx4zJohJ1Xvy+efxXpfFEMDSs/f65tU3286/86jKFhprK1P3rTeFacn1f3y5ju3zQCliR9EK81eD6mDKBoGw6z3LkcnyDbgfCTL7olA2nX4DbfhN5QjbNdXeDAurUfB7JIQqQ5L8uQHp9GIp86AjgNgKYN1uc6GiYZo/FwI0FeZ+DDb4ocVSual9kVDY6HnEwHgSXxpTc/OjjUPeric+iDkMORsKrNqwnvzotHG2rGzEBDvYOIPqX+yOzKoBXxWVjUH+ANPZl/slOCRznlx2DZ74T2agPtw+4WH4m4Pn5XcIOpCr6Q44nm6EHFCdboIVsjQrlc2jq97ZEJ00qU1aIY52OCHyZBzPap+YIB/PXDHo1/GG4p3XWvsiHHlKg86hiFLXeuY+ojxU1UF7hvgYAc50zzVElOixCoYqFOCK5OmX9letcqLfzs+6Nv3BjwaVU8ISp1K9G0eXrLICa0lghDmvNlGMejYstoJ3b6ctAdQw/iKBxRhZqrADjBQ7b6fuDN5fLOfa9XZfUa7b20jbvsBTYaSV5FtIozvJcGs4IksA1GPDxidLdCBz+gnFkzLPMArPyndGoSmm3ivTImiRWUhAafFi9OcqscLbPtuwMFu36tkhGmoOUoVhTFiJCmmpGU X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(66946007)(36756003)(1076003)(66556008)(38350700002)(38100700002)(8676002)(8936002)(186003)(4326008)(956004)(2616005)(52116002)(6486002)(316002)(55236004)(86362001)(5660300002)(44832011)(478600001)(1006002)(6666004)(83380400001)(7696005)(2906002)(26005)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/4CqrRbFbliP2DdR13fC/dmNCq4Rk+Gtx+6SOb10IziMsikTULUXq8lSU468?= =?us-ascii?Q?swr+KlnP7iAvIRNbZ1z8V1UdQ7lZgfyFhSa47lJGaaQ8mjPMPIoLhrcBX6/J?= =?us-ascii?Q?OIMSl29mfwTwW0hcqg4mAjJpwlvEP75ufB9cnl4tpozJrRImGUpQWbwJFgV6?= =?us-ascii?Q?aaf5dyi3LACjElQoIkZYSYJJP+M6i0GG6ospLJ6sUrdp7Jxn1CQv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lbH5CbuMiJjWW8pjO7x7zdN4cV+Nl0k13lv?= =?us-ascii?Q?CGevAZTTWluQeFQf7LLy9cu76oghEQJfmv+uEv8fSrDVk9ZVP9VVJdWqy6BU?= =?us-ascii?Q?lc745b2+QRtHCRHgHUH/Q1uTW0Sg9GIPJUM2YDAeKWjFPi8+hnin5TqUN9Hb?= =?us-ascii?Q?NVjOogB3vnTB+L7PLiZ3kJrLW9+0dBYBCxPKT4krpBLXuYFg0fwNiXfkwIaL?= =?us-ascii?Q?IQ382mhG8y6qBchPX1o13MhU?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d9f952a-3776-4f40-2233-08d975e70a77 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:42.4479 (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: 7O0polKa8XacGEpMDYB6nZt6pli3NPgdj/08LX5NlXzLd9xGiYGrmLlCPU1HuGFMW5WNIj8APJKAEvM7xUJHPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4778 Subject: [dpdk-dev] [PATCH v5 3/9] 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" From: Hemant Agrawal 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(-) 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"="); -- 2.17.1