DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: "Gaëtan Rivet" <grive@u256.net>
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: Mon, 15 Jun 2020 11:17:11 +0200	[thread overview]
Message-ID: <db4179f1-e31d-4c4e-9a5a-6f2eee55d711@redhat.com> (raw)
In-Reply-To: <20200612124637.44dw3lpocd6uxv2z@u256.net>



On 6/12/20 2:46 PM, Gaëtan Rivet wrote:
> 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.
> 

Ok, I will change to use rte_pci_addr_cmp() in next revision.

Thanks,
Maxime


  reply	other threads:[~2020-06-15  9:17 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
2020-06-15  9:17     ` Maxime Coquelin [this message]
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=db4179f1-e31d-4c4e-9a5a-6f2eee55d711@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=amorenoz@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=grive@u256.net \
    --cc=hemant.agrawal@nxp.com \
    --cc=matan@mellanox.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).