DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gaëtan Rivet <grive@u256.net>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, matan@mellanox.com, xiao.w.wang@intel.com,
	zhihong.wang@intel.com, xiaolong.ye@intel.com,
	chenbo.xia@intel.com, david.marchand@redhat.com,
	amorenoz@redhat.com, shreyansh.jain@nxp.com,
	viacheslavo@mellanox.com, hemant.agrawal@nxp.com,
	sachin.saxena@nxp.com
Subject: Re: [dpdk-dev] [PATCH 04/14] vhost: make vDPA framework bus agnostic
Date: Fri, 12 Jun 2020 14:46:37 +0200
Message-ID: <20200612124637.44dw3lpocd6uxv2z@u256.net> (raw)
In-Reply-To: <20200611213748.1967029-5-maxime.coquelin@redhat.com>

On 11/06/20 23:37 +0200, Maxime Coquelin wrote:
> This patch makes the vDPA framework to no more
> support only PCI devices, but any devices by relying
> on the generic device name as identifier.
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  drivers/vdpa/ifc/ifcvf_vdpa.c          |  6 +-
>  drivers/vdpa/mlx5/mlx5_vdpa.c          |  8 +--
>  drivers/vdpa/mlx5/mlx5_vdpa.h          |  2 +-
>  examples/vdpa/main.c                   | 49 ++++++++--------
>  lib/librte_vhost/rte_vdpa.h            | 42 +++++++-------
>  lib/librte_vhost/rte_vhost_version.map |  1 +
>  lib/librte_vhost/vdpa.c                | 79 +++++++++++---------------
>  7 files changed, 85 insertions(+), 102 deletions(-)
> 

[...]

> diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
> index 1113d6cef0..e8255c7d7e 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
> @@ -501,14 +501,13 @@ mlx5_vdpa_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
>  	priv->caps = attr.vdpa;
>  	priv->log_max_rqt_size = attr.log_max_rqt_size;
>  	priv->ctx = ctx;
> -	priv->dev_addr.pci_addr = pci_dev->addr;
> -	priv->dev_addr.type = VDPA_ADDR_PCI;
> +	priv->pci_dev = pci_dev;
>  	priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
>  	if (!priv->var) {
>  		DRV_LOG(ERR, "Failed to allocate VAR %u.\n", errno);
>  		goto error;
>  	}
> -	priv->id = rte_vdpa_register_device(&priv->dev_addr, &mlx5_vdpa_ops);
> +	priv->id = rte_vdpa_register_device(&pci_dev->device, &mlx5_vdpa_ops);
>  	if (priv->id < 0) {
>  		DRV_LOG(ERR, "Failed to register vDPA device.");
>  		rte_errno = rte_errno ? rte_errno : EINVAL;
> @@ -550,8 +549,7 @@ mlx5_vdpa_pci_remove(struct rte_pci_device *pci_dev)
>  
>  	pthread_mutex_lock(&priv_list_lock);
>  	TAILQ_FOREACH(priv, &priv_list, next) {
> -		if (memcmp(&priv->dev_addr.pci_addr, &pci_dev->addr,
> -			   sizeof(pci_dev->addr)) == 0) {
> +		if (priv->pci_dev == pci_dev) {

Assignment is ok I think but comparison is not, rte_pci_addr_cmp()
should be used here instead. (memcmp was not correct either.)

The structure can be padded depending on arch.

Everything else seems ok to me.

-- 
Gaëtan

  reply	other threads:[~2020-06-12 12:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 21:37 [dpdk-dev] [PATCH 00/14] vDPA API and framework rework Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 01/14] bus/dpaa: fix null pointer dereference Maxime Coquelin
2020-06-12  9:48   ` Gaëtan Rivet
2020-06-11 21:37 ` [dpdk-dev] [PATCH 02/14] bus/fslmc: " Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 03/14] vhost: introduce vDPA devices class Maxime Coquelin
2020-06-12 12:37   ` Gaëtan Rivet
2020-06-15  9:15     ` Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 04/14] vhost: make vDPA framework bus agnostic Maxime Coquelin
2020-06-12 12:46   ` Gaëtan Rivet [this message]
2020-06-15  9:17     ` Maxime Coquelin
2020-06-19 11:14   ` Adrian Moreno
2020-06-19 15:11     ` Maxime Coquelin
2020-06-22  9:49       ` Adrian Moreno
2020-06-22 12:34         ` Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 05/14] vhost: replace device ID in vDPA ops Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 06/14] vhost: replace vDPA device ID in Vhost Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 07/14] vhost: replace device ID in applications Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 08/14] vhost: remove useless vDPA API Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 09/14] vhost: use linked-list for vDPA devices Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 10/14] vhost: introduce wrappers for some vDPA ops Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 11/14] examples/vdpa: use new wrappers instead of ops Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 12/14] examples/vdpa: remove useless device count Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 13/14] vhost: remove vDPA device count API Maxime Coquelin
2020-06-11 21:37 ` [dpdk-dev] [PATCH 14/14] vhost: split vDPA header file Maxime Coquelin
2020-06-12  9:38 ` [dpdk-dev] [PATCH 00/14] vDPA API and framework rework Gaëtan Rivet

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=20200612124637.44dw3lpocd6uxv2z@u256.net \
    --to=grive@u256.net \
    --cc=amorenoz@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=matan@mellanox.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=sachin.saxena@nxp.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=viacheslavo@mellanox.com \
    --cc=xiao.w.wang@intel.com \
    --cc=xiaolong.ye@intel.com \
    --cc=zhihong.wang@intel.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