From: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
To: "Xueming(Steven) Li" <xuemingl@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH v1 1/2] net/mlx5: change eth device reference for secondary process
Date: Fri, 25 Aug 2017 09:32:31 +0200 [thread overview]
Message-ID: <20170825073231.GT4544@autoinstall.dev.6wind.com> (raw)
In-Reply-To: <DB3PR05MB29772D4B90F0B5DEEE5EC4AAC9B0@DB3PR05MB297.eurprd05.prod.outlook.com>
On Fri, Aug 25, 2017 at 07:15:50AM +0000, Xueming(Steven) Li wrote:
> Nelio, thanks, comments inline.
>[...]
> > > static int
> > > -priv_set_link(struct priv *priv, int up)
> > > +mlx5_dev_set_link(struct rte_eth_dev *dev, int up)
> > > {
> > > - struct rte_eth_dev *dev = priv->dev;
> > > + struct priv *priv = dev->data->dev_private;
> > > int err;
> > >
> >
> > This function should lock/unclock priv.
> This is a static function, caller function do the lock/unlock.
> Is there naming convention here? Mlx5_* is outpost interfaces that normally
> require lock/unlock priv?
Yes there is a naming convention following the patterns:
- priv_...(struct *priv priv, ...): no locks inside.
- priv_dev_...(struct *priv priv, struct rte_eth_dev *dev, ...): no locks
inside.
- mlx5_...(struct rte_eth_dev *dev, ...): should lock any access to struct priv
and to priv_*().
> > > if (up) {
> > > err = priv_set_flags(priv, ~IFF_UP, IFF_UP);
> > > if (err)
> > > return err;
> > > - priv_select_tx_function(priv);
> > > - priv_select_rx_function(priv);
> > > + mlx5_dev_select_tx_function(dev);
> > > + mlx5_dev_select_rx_function(dev);
> >
> > This also induce that those function mlx5_dev_select_rx/tx_function() should
> > be renamed to:
> > priv_dev_select_rx/tx_function(struct *priv, struct rte_eth_dev *dev, ...)
> >
> > this will avoid the multiple lock/unlocks inside the functions.
> So priv_* are lock-free functions?
priv_*() assume the lock have been done by the caller.
Hope it helps.
Thanks,
--
Nélio Laranjeiro
6WIND
next prev parent reply other threads:[~2017-08-25 7:32 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 14:03 [PATCH v1 1/2] net/mlx5: change eth device reference for secondary process Xueming Li
2017-08-24 14:03 ` [PATCH v1 2/2] net/mlx5: add multiple process support Xueming Li
2017-08-25 7:27 ` Nélio Laranjeiro
2017-08-25 6:52 ` [PATCH v1 1/2] net/mlx5: change eth device reference for secondary process Nélio Laranjeiro
2017-08-25 7:15 ` Xueming(Steven) Li
2017-08-25 7:32 ` Nélio Laranjeiro [this message]
2017-09-15 15:59 ` [PATCH v2 1/6] " Xueming Li
2017-09-15 15:59 ` [PATCH v2 2/6] net/mlx5: install a socket to exchange a file descriptor Xueming Li
2017-09-15 15:59 ` [PATCH v2 3/6] net/mlx5: allocate verbs object into shared memory Xueming Li
2017-09-15 15:59 ` [PATCH v2 4/6] net/mlx5: remove verbs fork check Xueming Li
2017-09-15 15:59 ` [PATCH v2 5/6] net/mlx5: add operations for secondary process Xueming Li
2017-09-15 16:00 ` [PATCH v2 6/6] net/mlx5: multi-process document update Xueming Li
2017-09-18 14:36 ` [PATCH v3 0/6] net/mlx5 multi-process support Xueming Li
2017-09-18 14:36 ` [PATCH v3 1/6] net/mlx5: change eth device reference for secondary process Xueming Li
2017-09-18 14:36 ` [PATCH v3 2/6] net/mlx5: install a socket to exchange a file descriptor Xueming Li
2017-09-18 14:36 ` [PATCH v3 3/6] net/mlx5: allocate verbs object into shared memory Xueming Li
2017-09-18 14:36 ` [PATCH v3 4/6] net/mlx5: remove verbs fork check Xueming Li
2017-09-18 14:36 ` [PATCH v3 5/6] net/mlx5: add operations for secondary process Xueming Li
2017-09-18 14:36 ` [PATCH v3 6/6] net/mlx5: multi-process document update Xueming Li
2017-09-18 18:47 ` Mcnamara, John
2017-09-19 14:31 ` [PATCH v4 0/5] net/mlx5 multi-process support Xueming Li
2017-09-19 14:41 ` Nélio Laranjeiro
2017-09-19 14:48 ` Ferruh Yigit
2017-09-19 15:02 ` Xueming(Steven) Li
2017-09-20 8:07 ` Nélio Laranjeiro
2017-10-05 0:17 ` Ferruh Yigit
2017-10-06 15:52 ` Xueming(Steven) Li
2017-09-19 14:31 ` [PATCH v4 1/5] net/mlx5: change eth device reference for secondary process Xueming Li
2017-09-19 14:31 ` [PATCH v4 2/5] net/mlx5: install a socket to exchange a file descriptor Xueming Li
2017-09-19 14:31 ` [PATCH v4 3/5] net/mlx5: allocate verbs object into shared memory Xueming Li
2017-09-19 14:31 ` [PATCH v4 4/5] net/mlx5: add operations for secondary process Xueming Li
2017-09-19 14:31 ` [PATCH v4 5/5] net/mlx5: multi-process document update Xueming Li
2017-09-19 16:16 ` Mcnamara, John
2017-10-06 15:45 ` [PATCH v5 0/5] net/mlx5 multi-process support Xueming Li
2017-10-06 18:21 ` Ferruh Yigit
2017-10-06 15:45 ` [PATCH v5 1/5] net/mlx5: change eth device reference for secondary process Xueming Li
2017-10-06 15:45 ` [PATCH v5 2/5] net/mlx5: install a socket to exchange a file descriptor Xueming Li
2017-10-06 18:21 ` Ferruh Yigit
2017-10-06 15:45 ` [PATCH v5 3/5] net/mlx5: allocate verbs object into shared memory Xueming Li
2017-10-06 15:45 ` [PATCH v5 4/5] net/mlx5: add operations for secondary process Xueming Li
2017-10-06 15:45 ` [PATCH v5 5/5] net/mlx5: multi-process document update Xueming Li
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=20170825073231.GT4544@autoinstall.dev.6wind.com \
--to=nelio.laranjeiro@6wind.com \
--cc=dev@dpdk.org \
--cc=xuemingl@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.