DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Chautru, Nicolas" <nicolas.chautru@intel.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"gakhil@marvell.com" <gakhil@marvell.com>
Cc: "david.marchand@redhat.com" <david.marchand@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v3 3/8] baseband/la12xx: add support for multiple modems
Date: Wed, 14 Apr 2021 00:02:18 +0000
Message-ID: <BY5PR11MB4451C6F86ADC7ACDC3E2367CF84E9@BY5PR11MB4451.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210413051715.26430-4-hemant.agrawal@nxp.com>

> -----Original Message-----
> From: Hemant Agrawal <hemant.agrawal@nxp.com>
> Sent: Monday, April 12, 2021 10:17 PM
> 
> This patch add support for multiple modems by assigning a modem id as dev
> args in vdev creation.
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
>  drivers/baseband/la12xx/bbdev_la12xx.c     | 60 ++++++++++++++++++++--
>  drivers/baseband/la12xx/bbdev_la12xx.h     | 56 ++++++++++++++++++++
>  drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 ++++++++
>  3 files changed, 131 insertions(+), 5 deletions(-)  create mode 100644
> drivers/baseband/la12xx/bbdev_la12xx.h
>  create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h
> 
> diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c
> b/drivers/baseband/la12xx/bbdev_la12xx.c
> index 8d3041ce28..7e9be74bb4 100644
> --- a/drivers/baseband/la12xx/bbdev_la12xx.c
> +++ b/drivers/baseband/la12xx/bbdev_la12xx.c
> @@ -14,6 +14,8 @@
>  #include <rte_bbdev_pmd.h>
> 
>  #include <bbdev_la12xx_pmd_logs.h>
> +#include <bbdev_la12xx_ipc.h>
> +#include <bbdev_la12xx.h>
> 
>  #define DRIVER_NAME baseband_la12xx
> 
> @@ -22,18 +24,18 @@ 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 */
> +	int8_t modem_id; /*< LA12xx modem instance id */
>  };
> 
>  #define BBDEV_LA12XX_MAX_NB_QUEUES_ARG  "max_nb_queues"
> +#define BBDEV_LA12XX_VDEV_MODEM_ID_ARG	"modem"
> +#define LA12XX_MAX_MODEM 4

Minor : best to be consistent with prefix used throught the PMD. A bit of a mix and match.

> 
>  static const char * const bbdev_la12xx_valid_params[] = {
>  	BBDEV_LA12XX_MAX_NB_QUEUES_ARG,
> +	BBDEV_LA12XX_VDEV_MODEM_ID_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)  { @@ -
> 52,6 +54,28 @@ parse_u16_arg(const char *key, const char *value, void
> *extra_args)
>  	return 0;
>  }
> 
> +/* Parse integer from integer argument */ static int
> +parse_integer_arg(const char *key __rte_unused,
> +		const char *value, void *extra_args)
> +{
> +	int i;
> +	char *end;
> +
> +	errno = 0;
> +
> +	i = strtol(value, &end, 10);
> +	if (*end != 0 || errno != 0 || i < 0 || i > LA12XX_MAX_MODEM) {
> +		BBDEV_LA12XX_PMD_ERR("Supported Port IDS are 0 to %d",
> +			LA12XX_MAX_MODEM - 1);
> +		return -EINVAL;
> +	}
> +
> +	*((uint32_t *)extra_args) = i;
> +
> +	return 0;
> +}
> +
>  /* Parse parameters used to create device */  static int
> parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, @@ -
> 73,6 +97,16 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params
> *params,
>  		if (ret < 0)
>  			goto exit;
> 
> +		ret = rte_kvargs_process(kvlist,
> +					bbdev_la12xx_valid_params[1],
> +					&parse_integer_arg,
> +					&params->modem_id);
> +
> +		if (params->modem_id >= LA12XX_MAX_MODEM) {
> +			BBDEV_LA12XX_PMD_ERR("Invalid modem id, must
> be < %u",
> +					LA12XX_MAX_MODEM);
> +			goto exit;
> +		}
>  	}
> 
>  exit:
> @@ -88,6 +122,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,  {
>  	struct rte_bbdev *bbdev;
>  	const char *name = rte_vdev_device_name(vdev);
> +	struct bbdev_la12xx_private *priv;
> 
>  	PMD_INIT_FUNC_TRACE();
> 
> @@ -103,6 +138,20 @@ la12xx_bbdev_create(struct rte_vdev_device
> *vdev,
>  		return -ENOMEM;
>  	}
> 
> +	priv = bbdev->data->dev_private;
> +	priv->modem_id = init_params->modem_id;
> +	/* if modem id is not configured */
> +	if (priv->modem_id == -1)
> +		priv->modem_id = bbdev->data->dev_id;
> +
> +	/* Reset Global variables */
> +	priv->num_ldpc_enc_queues = 0;
> +	priv->num_ldpc_dec_queues = 0;
> +	priv->num_valid_queues = 0;
> +	priv->max_nb_queues = init_params->queues_num;
> +
> +	BBDEV_LA12XX_PMD_INFO("Setting Up %s: DevId=%d,
> ModemId=%d",
> +				name, bbdev->data->dev_id, priv-
> >modem_id);
>  	bbdev->dev_ops = NULL;
>  	bbdev->device = &vdev->device;
>  	bbdev->data->socket_id = 0;
> @@ -174,4 +223,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"=<int>");
> +	BBDEV_LA12XX_MAX_NB_QUEUES_ARG"=<int>"
> +	BBDEV_LA12XX_VDEV_MODEM_ID_ARG "=<int> ");
> diff --git a/drivers/baseband/la12xx/bbdev_la12xx.h
> b/drivers/baseband/la12xx/bbdev_la12xx.h
> new file mode 100644
> index 0000000000..5228502331
> --- /dev/null
> +++ b/drivers/baseband/la12xx/bbdev_la12xx.h
> @@ -0,0 +1,56 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright 2020-2021 NXP
> + */
> +
> +#ifndef __BBDEV_LA12XX_H__
> +#define __BBDEV_LA12XX_H__
> +
> +#define BBDEV_IPC_ENC_OP_TYPE	1
> +#define BBDEV_IPC_DEC_OP_TYPE	2
> +
> +#define MAX_LDPC_ENC_FECA_QUEUES	4
> +#define MAX_LDPC_DEC_FECA_QUEUES	4

Minor: What does FECA refers to through the serie? FEC accerator?

For consistency I would rename _ENC_OP_TYPE to _LDPC_ENC_OP_TYPE to distingish with 4G.
Same comment as above from prefix

> +
> +#define MAX_CHANNEL_DEPTH 16
> +/* private data structure */
> +struct bbdev_la12xx_private {
> +	void *ipc_priv;
> +	uint8_t num_valid_queues;
> +	uint8_t max_nb_queues;
> +	uint8_t num_ldpc_enc_queues;
> +	uint8_t num_ldpc_dec_queues;
> +	int8_t modem_id;
> +	struct bbdev_la12xx_q_priv *queues_priv[32]; };
> +
> +struct hugepage_info {
> +	void *vaddr;
> +	phys_addr_t paddr;
> +	size_t len;
> +};

This should be in the next commit I believe.
Notably as this hugepage_info usage is a bit odd.

> +
> +struct bbdev_la12xx_q_priv {
> +	struct bbdev_la12xx_private *bbdev_priv;
> +	uint32_t q_id;	/**< Channel ID */
> +	uint32_t feca_blk_id;	/** FECA block ID for processing */
> +	uint32_t feca_blk_id_be32; /**< FECA Block ID for this queue */
> +	uint8_t en_napi; /* 0: napi disabled, 1: napi enabled */
> +	uint16_t queue_size;	/**< Queue depth */
> +	int32_t eventfd;	/**< Event FD value */
> +	enum rte_bbdev_op_type op_type; /**< Operation type */
> +	uint32_t la12xx_core_id;
> +		/* LA12xx core ID on which this will be scheduled */
> +	struct rte_mempool *mp; /**< Pool from where buffers would be
> cut */
> +	void *bbdev_op[MAX_CHANNEL_DEPTH];
> +			/**< Stores bbdev op for each index */
> +	void *msg_ch_vaddr[MAX_CHANNEL_DEPTH];
> +			/**< Stores msg channel addr for modem->host */
> +	uint32_t host_pi;	/**< Producer_Index for HOST->MODEM */
> +	uint32_t host_ci;	/**< Consumer Index for MODEM->HOST */
> +	host_ipc_params_t *host_params; /**< Host parameters */ };
> +
> +#define lower_32_bits(x) ((uint32_t)((uint64_t)x)) #define
> +upper_32_bits(x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16))
> +
> +#endif
> diff --git a/drivers/baseband/la12xx/bbdev_la12xx_ipc.h
> b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h
> new file mode 100644
> index 0000000000..9aa5562981
> --- /dev/null
> +++ b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h
> @@ -0,0 +1,20 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright 2020-2021 NXP
> + */
> +#ifndef __BBDEV_LA12XX_IPC_H__
> +#define __BBDEV_LA12XX_IPC_H__
> +
> +/** No. of max channel per instance */
> +#define IPC_MAX_DEPTH	(16)
> +
> +/* This shared memory would be on the host side which have copy of some
> + * of the parameters which are also part of Shared BD ring. Read access
> + * of these parameters from the host side would not be over PCI.
> + */
> +typedef struct host_ipc_params {
> +	volatile uint32_t pi;
> +	volatile uint32_t ci;
> +	volatile uint32_t modem_ptr[IPC_MAX_DEPTH]; } __rte_packed
> +host_ipc_params_t;
> +
> +#endif
> --
> 2.17.1


  reply	other threads:[~2021-04-14  0:02 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  6:34 [dpdk-dev] [PATCH 1/6] baseband: introduce NXP LA12xx driver Hemant Agrawal
2021-03-18  6:34 ` [dpdk-dev] [PATCH 2/6] baseband/la12xx: add devargs for max queues Hemant Agrawal
2021-03-18  6:34 ` [dpdk-dev] [PATCH 3/6] baseband/la12xx: add support for multiple modems Hemant Agrawal
2021-03-18  6:34 ` [dpdk-dev] [PATCH 4/6] baseband/la12xx: add queue and modem config support Hemant Agrawal
2021-03-18  6:34 ` [dpdk-dev] [PATCH 5/6] baseband/la12xx: add enqueue and dequeue support Hemant Agrawal
2021-03-18  6:34 ` [dpdk-dev] [PATCH 6/6] baseband/la12xx: add documentation support Hemant Agrawal
2021-03-18 14:53 ` [dpdk-dev] [PATCH 1/6] baseband: introduce NXP LA12xx driver David Marchand
2021-03-19  5:54   ` Hemant Agrawal
2021-04-08  8:55     ` [dpdk-dev] [EXT] " Akhil Goyal
2021-04-08  8:57       ` Hemant Agrawal
2021-04-08 15:29       ` Chautru, Nicolas
2021-04-10 17:02 ` [dpdk-dev] [PATCH v2 0/8] baseband: add " Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 1/8] baseband: introduce " Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 2/8] baseband/la12xx: add devargs for max queues Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 3/8] baseband/la12xx: add support for multiple modems Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 4/8] baseband/la12xx: add queue and modem config support Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 5/8] baseband/la12xx: add enqueue and dequeue support Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 6/8] baseband/la12xx: add documentation support Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 7/8] app/bbdev: add parameter to take input in network order Hemant Agrawal
2021-04-12  7:22     ` David Marchand
2021-04-12  7:29       ` Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 8/8] app/bbdev: add test vectors for transport blocks Hemant Agrawal
2021-04-13  5:17   ` [dpdk-dev] [PATCH v3 0/8] baseband: add NXP LA12xx driver Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 1/8] baseband: introduce " Hemant Agrawal
2021-04-24 10:36       ` [dpdk-dev] [PATCH v4 0/8] baseband: add " Hemant Agrawal
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability Hemant Agrawal
2021-04-24 21:59           ` Chautru, Nicolas
2021-04-25 16:14             ` Thomas Monjalon
2021-04-26 17:01           ` Dave Burley
2021-04-28 13:03             ` Hemant Agrawal
2021-04-28 13:34             ` Hemant Agrawal
2021-04-28 15:19               ` Chautru, Nicolas
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 2/8] baseband: introduce NXP LA12xx driver Hemant Agrawal
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 3/8] baseband/la12xx: add devargs for max queues Hemant Agrawal
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 4/8] baseband/la12xx: add support for multiple modems Hemant Agrawal
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 5/8] baseband/la12xx: add queue and modem config support Hemant Agrawal
2021-04-24 22:12           ` Chautru, Nicolas
2021-05-13 11:01             ` Nipun Gupta
2021-05-13 14:51               ` Chautru, Nicolas
2021-05-17 17:00                 ` Nipun Gupta
2021-05-17 17:53                   ` Chautru, Nicolas
2021-05-19 18:43                     ` Nipun Gupta
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 6/8] baseband/la12xx: add enqueue and dequeue support Hemant Agrawal
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 7/8] app/bbdev: enable la12xx for bbdev Hemant Agrawal
2021-04-24 10:37         ` [dpdk-dev] [PATCH v4 8/8] app/bbdev: add test vectors for transport blocks Hemant Agrawal
2021-04-24 22:05           ` Chautru, Nicolas
2021-05-05 12:31         ` [dpdk-dev] [EXT] [PATCH v4 0/8] baseband: add NXP LA12xx driver Akhil Goyal
2021-06-16 20:35           ` Akhil Goyal
2021-06-26  9:59             ` Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 2/8] baseband/la12xx: add devargs for max queues Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 3/8] baseband/la12xx: add support for multiple modems Hemant Agrawal
2021-04-14  0:02       ` Chautru, Nicolas [this message]
2021-04-14 12:10         ` Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 4/8] baseband/la12xx: add queue and modem config support Hemant Agrawal
2021-04-14  0:41       ` Chautru, Nicolas
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 5/8] baseband/la12xx: add enqueue and dequeue support Hemant Agrawal
2021-04-14  0:53       ` Chautru, Nicolas
2021-04-14 12:06         ` Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 6/8] baseband/la12xx: add documentation support Hemant Agrawal
2021-04-14  0:57       ` Chautru, Nicolas
2021-04-14 11:59         ` Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 7/8] app/bbdev: add parameter to take input in network order Hemant Agrawal
2021-04-14  1:00       ` Chautru, Nicolas
2021-04-14 12:15         ` Nipun Gupta
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 8/8] app/bbdev: add test vectors for transport blocks Hemant Agrawal
2021-04-14  1:09       ` Chautru, Nicolas
2021-04-14 12:16         ` Nipun Gupta
2021-04-14 15:48           ` Chautru, Nicolas
2021-04-13 10:06     ` [dpdk-dev] [EXT] [PATCH v3 0/8] baseband: add NXP LA12xx driver Akhil Goyal
2021-09-12 12:15 ` [dpdk-dev] [PATCH v5 0/9] " Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 1/9] bbdev: add big endian processing data capability Nipun Gupta
2021-09-13 18:39     ` Chautru, Nicolas
2021-09-17  8:30       ` Nipun Gupta
2021-09-17 14:23         ` Chautru, Nicolas
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 2/9] baseband: introduce NXP LA12xx driver Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 3/9] baseband/la12xx: add devargs for max queues Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 4/9] baseband/la12xx: add support for multiple modems Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 5/9] baseband/la12xx: add queue and modem config support Nipun Gupta
2021-09-13 18:56     ` Chautru, Nicolas
2021-09-17  8:33       ` Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 6/9] baseband/la12xx: add enqueue and dequeue support Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 7/9] app/bbdev: enable la12xx for bbdev Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 8/9] app/bbdev: handle endianness of test data Nipun Gupta
2021-09-13 18:45     ` Chautru, Nicolas
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 9/9] app/bbdev: add test vectors for transport blocks Nipun Gupta
2021-09-13 19:01     ` Chautru, Nicolas
2021-09-17  8:37       ` Nipun Gupta
2021-09-17 14:20         ` Chautru, Nicolas
2021-09-24  4:37 ` [dpdk-dev] [PATCH v6 0/9] baseband: add NXP LA12xx driver nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 1/9] bbdev: add big endian processing data processing info nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 2/9] baseband: introduce NXP LA12xx driver nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 3/9] baseband/la12xx: add devargs for max queues nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 4/9] baseband/la12xx: add support for multiple modems nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 5/9] baseband/la12xx: add queue and modem config support nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 6/9] baseband/la12xx: add enqueue and dequeue support nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 7/9] app/bbdev: enable la12xx for bbdev nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 8/9] app/bbdev: handle endianness of test data nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 9/9] app/bbdev: add test vectors for transport blocks nipun.gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BY5PR11MB4451C6F86ADC7ACDC3E2367CF84E9@BY5PR11MB4451.namprd11.prod.outlook.com \
    --to=nicolas.chautru@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hemant.agrawal@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git