All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Cc: Jiri Pirko <jiri@nvidia.com>,
	netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] net: devlink: devlink_nl_info_fill: populate default information
Date: Tue, 22 Nov 2022 20:12:46 -0800	[thread overview]
Message-ID: <20221122201246.0276680f@kernel.org> (raw)
In-Reply-To: <20221122154934.13937-1-mailhol.vincent@wanadoo.fr>

On Wed, 23 Nov 2022 00:49:34 +0900 Vincent Mailhol wrote:
>  static int
>  devlink_nl_info_fill(struct sk_buff *msg, struct devlink *devlink,
>  		     enum devlink_command cmd, u32 portid,
>  		     u32 seq, int flags, struct netlink_ext_ack *extack)
>  {
>  	struct devlink_info_req req = {};
> +	struct device *dev = devlink_to_dev(devlink);

nit: longest to shortest lines

>  	void *hdr;
>  	int err;
>  
> @@ -6707,6 +6733,16 @@ devlink_nl_info_fill(struct sk_buff *msg, struct devlink *devlink,
>  	if (err)
>  		goto err_cancel_msg;
>  
> +	err = devlink_nl_driver_info_get(dev->driver, &req);
> +	if (err)
> +		goto err_cancel_msg;

won't this result in repeated attributes, potentially?
Unlike ethtool which copies data into a struct devlink
adds an attribute each time you request. It does not override.
So we need to extend req with some tracking of whether driver
already put in the info in question

> +	if (!strcmp(dev->parent->type->name, "usb_device")) {
> +		err = devlink_nl_usb_info_get(to_usb_device(dev->parent), &req);
> +		if (err)
> +			goto err_cancel_msg;
> +	}

  reply	other threads:[~2022-11-23  4:13 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 15:49 [RFC PATCH] net: devlink: devlink_nl_info_fill: populate default information Vincent Mailhol
2022-11-23  4:12 ` Jakub Kicinski [this message]
2022-11-23  9:42   ` Vincent MAILHOL
2022-11-24  3:06     ` Jakub Kicinski
2022-11-24  5:33       ` Vincent MAILHOL
2022-11-24  8:53         ` Jiri Pirko
2022-11-28 18:43         ` Jakub Kicinski
2022-11-28 23:14           ` Vincent MAILHOL
2022-11-23  9:46 ` Jiri Pirko
2022-11-23 11:00   ` Vincent MAILHOL
2022-11-23 12:10     ` Jiri Pirko
2022-11-23 16:08       ` Vincent MAILHOL
2022-11-23 16:26         ` Jiri Pirko
2022-11-24 16:20       ` Vincent MAILHOL
2022-11-27  8:15 ` [PATCH net-next v2 0/5] net: devlink: return the driver name in devlink_nl_info_fill Vincent Mailhol
2022-11-27  8:15   ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27  8:16   ` [PATCH net-next v2 1/5] mlxsw: minimal: fix mlxsw_m_module_get_drvinfo() to correctly report driver name Vincent Mailhol
2022-11-27  8:16     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27  8:16   ` [PATCH net-next v2 2/5] mlxsw: core: fix mlxsw_devlink_info_get() " Vincent Mailhol
2022-11-27  8:16     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27  8:16   ` [PATCH net-next v2 3/5] net: devlink: let the core report the driver name instead of the drivers Vincent Mailhol
2022-11-27  8:16     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27  8:16   ` [PATCH net-next v2 4/5] net: devlink: remove devlink_info_driver_name_put() Vincent Mailhol
2022-11-27  8:16     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 12:01     ` kernel test robot
2022-11-27 12:11     ` kernel test robot
2022-11-27  8:16   ` [PATCH net-next v2 5/5] net: devlink: make the devlink_ops::info_get() callback optional Vincent Mailhol
2022-11-27  8:16     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 13:09 ` [PATCH net-next v3 0/5] net: devlink: return the driver name in devlink_nl_info_fill Vincent Mailhol
2022-11-27 13:09   ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 13:09   ` [PATCH net-next v3 1/5] mlxsw: minimal: fix mlxsw_m_module_get_drvinfo() to correctly report driver name Vincent Mailhol
2022-11-27 13:09     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 16:14     ` Ido Schimmel
2022-11-27 16:14       ` [Intel-wired-lan] " Ido Schimmel
2022-11-27 13:09   ` [PATCH net-next v3 2/5] mlxsw: core: fix mlxsw_devlink_info_get() " Vincent Mailhol
2022-11-27 13:09     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 16:17     ` Ido Schimmel
2022-11-27 16:17       ` [Intel-wired-lan] " Ido Schimmel
2022-11-28  1:42       ` Vincent MAILHOL
2022-11-28  1:42         ` [Intel-wired-lan] " Vincent MAILHOL
2022-11-27 13:09   ` [PATCH net-next v3 3/5] net: devlink: let the core report the driver name instead of the drivers Vincent Mailhol
2022-11-27 13:09     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 13:09   ` [PATCH net-next v3 4/5] net: devlink: remove devlink_info_driver_name_put() Vincent Mailhol
2022-11-27 13:09     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 13:09   ` [PATCH net-next v3 5/5] net: devlink: make the devlink_ops::info_get() callback optional Vincent Mailhol
2022-11-27 13:09     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-28  4:15 ` [PATCH net-next v4 0/3] net: devlink: return the driver name in devlink_nl_info_fill Vincent Mailhol
2022-11-28  4:15   ` [Intel-wired-lan] " Vincent Mailhol
2022-11-28  4:15   ` [PATCH net-next v4 1/3] net: devlink: let the core report the driver name instead of the drivers Vincent Mailhol
2022-11-28  4:15     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-28 11:49     ` Ido Schimmel
2022-11-28 11:49       ` [Intel-wired-lan] " Ido Schimmel
2022-11-28  4:15   ` [PATCH net-next v4 2/3] net: devlink: remove devlink_info_driver_name_put() Vincent Mailhol
2022-11-28  4:15     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-28  4:15   ` [PATCH net-next v4 3/3] net: devlink: make the devlink_ops::info_get() callback optional Vincent Mailhol
2022-11-28  4:15     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-28 18:42     ` Jakub Kicinski
2022-11-28 18:42       ` [Intel-wired-lan] " 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=20221122201246.0276680f@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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.