All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Kubecek <mkubecek@suse.cz>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: davem@davemloft.net, jiri@resnulli.us, andrew@lunn.ch,
	f.fainelli@gmail.com, netdev@vger.kernel.org,
	oss-drivers@netronome.com
Subject: Re: [PATCH net-next 3/5] devlink: create a special NDO for getting the devlink instance
Date: Fri, 22 Feb 2019 10:51:31 +0100	[thread overview]
Message-ID: <20190222095131.GQ23151@unicorn.suse.cz> (raw)
In-Reply-To: <20190221174620.12144-4-jakub.kicinski@netronome.com>

On Thu, Feb 21, 2019 at 09:46:18AM -0800, Jakub Kicinski wrote:
> Instead of iterating over all devlink ports add a NDO which
> will return the devlink instance from the driver.
> 
> Suggested-by: Jiri Pirko <jiri@resnulli.us>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> ---
>  include/linux/netdevice.h |  6 ++++
>  net/core/devlink.c        | 62 +++++++++++++--------------------------
>  2 files changed, 26 insertions(+), 42 deletions(-)
> 
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index aab4d9f6613d..eebcef6b8191 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -940,6 +940,8 @@ struct dev_ifalias {
>  	char ifalias[];
>  };
>  
> +struct devlink;
> +
>  /*
>   * This structure defines the management hooks for network devices.
>   * The following hooks can be defined; unless noted otherwise, they are
> @@ -1248,6 +1250,9 @@ struct dev_ifalias {
>   *	that got dropped are freed/returned via xdp_return_frame().
>   *	Returns negative number, means general error invoking ndo, meaning
>   *	no frames were xmit'ed and core-caller will free all frames.
> + * struct devlink *(*ndo_get_devlink)(struct net_device *dev);
> + *	Get devlink instance associated with a given netdev.
> + *	Called with a reference on the device only, rtnl_lock is not held.

The formulation is a bit ambiguous. Do I understand correctly that what
it says is that device reference is sufficient and rtnl_lock is not
necessary (but there is no harm if caller holds rtnl_lock)?

Michal

  reply	other threads:[~2019-02-22  9:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 17:46 [PATCH net-next 0/5] devlink: make ethtool compat reliable Jakub Kicinski
2019-02-21 17:46 ` [PATCH net-next 1/5] net: devlink: turn devlink into a built-in Jakub Kicinski
2019-02-21 17:46 ` [PATCH net-next 2/5] ethtool: hold a reference to the netdevice around devlink compat Jakub Kicinski
2019-02-21 17:46 ` [PATCH net-next 3/5] devlink: create a special NDO for getting the devlink instance Jakub Kicinski
2019-02-22  9:51   ` Michal Kubecek [this message]
2019-02-22 16:56     ` Jakub Kicinski
2019-02-21 17:46 ` [PATCH net-next 4/5] nfp: add .ndo_get_devlink Jakub Kicinski
2019-02-22 10:04   ` Michal Kubecek
2019-02-22 17:02     ` Jakub Kicinski
2019-02-22 17:27       ` Michal Kubecek
2019-02-22 18:53         ` Jakub Kicinski
2019-02-21 17:46 ` [PATCH net-next 5/5] nfp: remove ethtool flashing fallback Jakub Kicinski

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=20190222095131.GQ23151@unicorn.suse.cz \
    --to=mkubecek@suse.cz \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.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.