From patchwork Tue Apr 13 05:17:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 420179 Delivered-To: patch@linaro.org Received: by 2002:a02:c4d2:0:0:0:0:0 with SMTP id h18csp2314504jaj; Mon, 12 Apr 2021 22:18:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPRZJDs/gbho6Mf0NS0PN0HBrhXHu+zYYTs5WfEnGKDsaSCcSS9dlBfqhZ9WOt88Wx/mLC X-Received: by 2002:adf:ce0c:: with SMTP id p12mr2730415wrn.59.1618291123828; Mon, 12 Apr 2021 22:18:43 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id a8si1508687wme.152.2021.04.12.22.18.43; Mon, 12 Apr 2021 22:18:43 -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=G2LVx1F3; 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 54E26160B1E; Tue, 13 Apr 2021 07:18:38 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40065.outbound.protection.outlook.com [40.107.4.65]) by mails.dpdk.org (Postfix) with ESMTP id 5D24E160B16 for ; Tue, 13 Apr 2021 07:18:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PZtEXhnruYRSGmmo0RoufwR9GmdfDGujex5hbDYuKqKovA/DHQ5qgyblC6UyiXJ3E6shGe7WAf17NhF6TlY34sf/HxwpE2nXCocS/IUbCCFoegit63CA6DUnHflrf/nRmCfAJsfmEBOLDs3QitVfxxMz/R3/66UtYuhLpNXIRpckjW2003Q1MPbVmroUuyJgnv4+uZI8cbXe2OVj5wOIfjvXkCPFImnchCwUc6rjk48Ji/AK4Q6sI2+EJqQehDY8IugtMc3TQyj4Cdace4MgWbOSWiHfxaDGMh2Jri7o1u9TkoWN6r2SUxSdm1BDhf2gx8h0qTJ7zz3m8i/tdriC1w== 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=WDKXevkyzpwBQRqOCyqAewemsZnKlZOqF3VTlCrjmBM=; b=md5KqdbnAcs1I/LQpSIHCLj1lyR/ihK5DwMUNt+e8tm1nLL8zy+8NhzucofNeoSYn3Ic35rye1lw/VMt0Ds418RYEEJEOxUDWibxJzMHxeVzrQyct8hyn0jtrsc+EkBAB+FNXGggYrBq1NqDKjh6xy9oFi2U1J8IG6hDkeXKztI02fw2Lszn2pFcRWavurchbfzorKy15vd3gVSXLPId934VvRbotjaxyW3oCiHcSvRq4MeyZmsv0Jk68x8NlIQXx5twkSE7dE7n1egRJeEgCQqkN7NIrc+YsOjJQ9VpocHygtyukoq5SNXbnJh8WmB22Qy8dgmfXplCAes13tPBhA== 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=WDKXevkyzpwBQRqOCyqAewemsZnKlZOqF3VTlCrjmBM=; b=G2LVx1F3xwTiQTE+/RjZVEk5WlzYhZB1btEVXGlMBG4+zeN2xtzSb1BzdIFZjSoEiHEqSYIncMFMpiawIh9G26k5pUikB7s8jRblwIheIIXVdrUfc+OUeZu92ox3qfC3RQMQhvOvuP8ceMs3OeL8fWfnSMJbVhM33Ib9sZuUQlM= 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 AM5PR04MB3250.eurprd04.prod.outlook.com (2603:10a6:206:b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Tue, 13 Apr 2021 05:18: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%7]) with mapi id 15.20.4020.022; Tue, 13 Apr 2021 05:18: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: Tue, 13 Apr 2021 10:47:09 +0530 Message-Id: <20210413051715.26430-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210413051715.26430-1-hemant.agrawal@nxp.com> References: <20210410170252.4587-1-hemant.agrawal@nxp.com> <20210413051715.26430-1-hemant.agrawal@nxp.com> X-Originating-IP: [92.120.0.67] X-ClientProxiedBy: HK2PR03CA0059.apcprd03.prod.outlook.com (2603:1096:202:17::29) 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 HK2PR03CA0059.apcprd03.prod.outlook.com (2603:1096:202:17::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.6 via Frontend Transport; Tue, 13 Apr 2021 05:18:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9d12872-7226-4665-1981-08d8fe3b9673 X-MS-TrafficTypeDiagnostic: AM5PR04MB3250: 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: ix9u6ZWvJE6YUC1fA2onQUqx+0ZZ/GLxXMtYLVrQ3uj1qMiM9BI7Jff1WdKpsTaux2bGIaOlxEB2qEyb8/XhHVnSSfdVy21m1Tqaho7DPS9E867YvBilmIhbM7hq8S6sWMTgJk6DVRKvBW1KxhRGZbjZbp3s7SKtusDkzozvu76TtKioogrpggAYwR0TpivKPhiTdnEB2lWIwfQ/GoX0lcY2TcAcxeYk+ObUp4jfUp87GDo4wrLHz41LN2cZ6FUfbQXnOfg2XtSGH3IgOUvCwkd61GM8nC7M8WkSlp8QybaKsnBIPCYumpj1lm9eqFQig/cqWO5dPBbnMU9RuLq/ZxNnRZib/SabjAnNT2VMhjRIHy/HJUHGCrcC5tRR1P5TUJxolqSNeAjU4cNgTt0f6NoES3H8tkdNmgjD+r7AyMglQF2eqaX/RYLuGmO1etMiZNsT/E/cfYTBtWT2M6/Fo1tUjOjuL2vDtb1ojmmVYrqTCo9QGiBileMC4zxmF727NRkV3/AKOQzxqV5G3/e9PLmsdDl6vJtErlydQoM7bjpyw2gbH3voYNID6u6bRQlq+dnCSVEhK/XMDfiX5VVNzc3BRdoqZMkdws78vybkOmdmaWmUak9p0k5aMHLdLUZx619b5WcmOdLyoSSfdqdTDKSyNXVVsTLxeFZ9VG5GLI4= 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)(346002)(396003)(39860400002)(366004)(136003)(376002)(83380400001)(16526019)(186003)(26005)(54906003)(38350700002)(38100700002)(316002)(66556008)(66946007)(66476007)(6512007)(2616005)(956004)(478600001)(4326008)(44832011)(36756003)(6486002)(6506007)(5660300002)(2906002)(52116002)(1076003)(86362001)(8936002)(6666004)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: QO7/qYsCyftOfPGIZFx51O37ZUPZ2r5aeqSi1R9Nwp/6Kv5v+rAOXvAlaKXI8LobJ6YuthVC5QJGCpRqSCdoYJuD80L8/HWdIdVPBSznqpxUl1Er29/yx21GUFho3N0NkSNzzaGre8lKPxOFYkMfmhHSrV61Nsb5ofmXkj0abUB6HP25uWYOO1bD7yzzVMI8JpNLVY9UEGmERJfHxpdHxR0TEs76jAiQgxox+ntWSHMJnsJOSX+YCSVcmtZQz5j7pTw2MT4QiwIhPGnElaga/9t9AeQDkyaR9ckXlTmsGjZ9LMNmq60L54UZtNuNDhdRe1kCnm0EfXwkSrxDhVZdamsstvUkF2AEuVbQENMkU2sR0jJixG1DpaW6RPGZV4nhdMr+NFcVO4C+Axmnt2J2Y7YT7rQTxYIH1U4uMNWRF6kzQq/VB6GrbEgCyein8s8Bik9d++TSrBIzDIs6TgoRcffrq/hv8RaNYP7DYVUwk3i17bpaJa3NQ0yYhiibqzUL2UzbXF5o06Z35L1tbglkdWPTyYdngAslu1wVVQNGF8dGormXA6US1sMavsBWnWPfeU/bKmj4qR3O3C6mjjfUuYvtRu9fVTIAy0jRfLDvugNH4j6xOL5eXt5FUVHkA6ezr4ERMx7TOXI41/cKqJ6uCvlOlcT1VfKuc1dIW9I95H53++H1ihdRKFNkoCF9T3Vgov5icI91HXZv9v2pyYKHlf7OCsnjX+wQDCVDq2Nc+pqYx186YKxoBZEfw2m8Q8Ki/3fNswzIAAAvmZCec2/++mTb+L413V1SoAqpEo5m788FyzjMXM7dNzRabR7vEzBFRJxWGvMxAXixhR2sk7VQRa7gcLVgaCHaM00vnogpQ5APWXxY2xQ3clY4YcaEfI+AwmOmz4i6VNjvxo8OIg/R3m5kKtrfoa8Ng4rl2uukTNIMUc51IV7aM0rLyjW53FjwEoaUev+Xvq/SxJH/pFUg7wNsp6wUrIvYLBlnL5vyBwE8zcm9jY1i+0RIpRannxpAOBhw87lGbL2kePbWPIC1VoDal5FAwlwidtTJAJCb7G+rwBZwE3Rs/AqgP+Zd9NBEmLKZEiYRPjia0j6KxEhFAA3pzYm/x5pKLgGdRyrtGHUdYFdOdqWIaMSZdNW9ZbtkouIBSs4sODSvJUqB2SmeFa/8VV/7JCe8FN7dIDEtrfOLfUM0KoYJxzEWILWnxtzycxQ27ikW3EVi3X6LlInksnNB9oIavD0P4LFdOtecb6qf6otTx5ASfCpUdgNhAWybXwbiCYzi5YUDC6mYYsT9tqHo/0FuFpubfSgCaOB+qJolKC3NgXqGmT37JVo1MGJB X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9d12872-7226-4665-1981-08d8fe3b9673 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2021 05:18:35.5725 (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: BvjBlHUaDPopMtZTgNgtsrSUDZlqBKROF8+C+sttqfnNb4I4NOsO08BGoNa0YK6pApZylN+dhrDeBUj8FmTXPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR04MB3250 Subject: [dpdk-dev] [PATCH v3 2/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..8d3041ce28 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 BBDEV_LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" + +static const char * const bbdev_la12xx_valid_params[] = { + BBDEV_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)) { + BBDEV_LA12XX_PMD_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) { 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, -1, + }; 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, + BBDEV_LA12XX_MAX_NB_QUEUES_ARG"=");