DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
To: Yongseok Koh <yskoh@mellanox.com>
Cc: adrien.mazarguil@6wind.com, dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix device reference in secondary process
Date: Wed, 2 May 2018 08:53:40 +0200	[thread overview]
Message-ID: <20180502065340.cxwx4ahdm67nu4av@laranjeiro-vm.dev.6wind.com> (raw)
In-Reply-To: <20180502061320.6675-1-yskoh@mellanox.com>

On Tue, May 01, 2018 at 11:13:20PM -0700, Yongseok Koh wrote:
> rte_eth_devices[] is not shared between primary and secondary process, but
> a static array to each process. The backward pointer of device (priv->dev)
> must be reset when a secondary process attaches to a device.
> 
> Fixes: f8b9a3bad467 ("net/mlx5: install a socket to exchange a file descriptor")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> ---
>  drivers/net/mlx5/mlx5.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
> index 8f983061a..f606e3dd4 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -799,6 +799,12 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
>  			}
>  			eth_dev->device = &pci_dev->device;
>  			eth_dev->dev_ops = &mlx5_dev_sec_ops;
> +			/*
> +			 * rte_eth_devices[] is not shared but static to each
> +			 * process. The backward pointer should be reset.
> +			 */
> +			priv = eth_dev->data->dev_private;
> +			priv->dev = eth_dev;
>  			err = mlx5_uar_init_secondary(eth_dev);
>  			if (err)
>  				goto error;
> -- 
> 2.11.0
> 

-- 
Nélio Laranjeiro
6WIND

  reply	other threads:[~2018-05-02  6:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02  6:13 Yongseok Koh
2018-05-02  6:53 ` Nélio Laranjeiro [this message]
2018-05-02  7:12   ` Yongseok Koh
2018-05-02 23:10 ` [dpdk-dev] [PATCH v2] net/mlx5: change device reference for " Yongseok Koh
2018-05-06  6:25   ` Shahaf Shuler
2018-05-07  6:46     ` Yongseok Koh
2018-05-09 11:04 ` [dpdk-dev] [PATCH v3] " Yongseok Koh
2018-05-09 11:30   ` Shahaf Shuler

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=20180502065340.cxwx4ahdm67nu4av@laranjeiro-vm.dev.6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=yskoh@mellanox.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).