netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Cc: davem@davemloft.net, michael.chan@broadcom.com,
	jiri@mellanox.com, jakub.kicinski@netronome.com,
	mkubecek@suse.cz, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v7 1/8] devlink: Add devlink_param for port register and unregister
Date: Wed, 23 Jan 2019 09:25:13 +0100	[thread overview]
Message-ID: <20190123082513.GA2191@nanopsycho> (raw)
In-Reply-To: <1547795385-12354-2-git-send-email-vasundhara-v.volam@broadcom.com>

Fri, Jan 18, 2019 at 08:09:38AM CET, vasundhara-v.volam@broadcom.com wrote:
>Add functions to register and unregister for the driver supported
>configuration parameters table per port.
>
>v2->v3:
>- Add a helper __devlink_params_register() with common code used by
>  both devlink_params_register() and devlink_port_params_register().
>

[...]	
	
	
>+
>+static int __devlink_params_register(struct devlink *devlink,
>+				     struct list_head *param_list,
>+				     const struct devlink_param *params,
>+				     size_t params_count)
> {
> 	const struct devlink_param *param = params;
> 	int i;
>@@ -4490,20 +4493,11 @@ int devlink_params_register(struct devlink *devlink,
> 
> 	mutex_lock(&devlink->lock);
> 	for (i = 0; i < params_count; i++, param++) {
>-		if (!param || !param->name || !param->supported_cmodes) {
>-			err = -EINVAL;
>+		err = devlink_param_verify(param);
>+		if (err)
> 			goto rollback;
>-		}
>-		if (param->generic) {
>-			err = devlink_param_generic_verify(param);
>-			if (err)
>-				goto rollback;
>-		} else {
>-			err = devlink_param_driver_verify(param);
>-			if (err)
>-				goto rollback;
>-		}
>-		err = devlink_param_register_one(devlink, param);
>+
>+		err = devlink_param_register_one(devlink, param_list, param);
> 		if (err)
> 			goto rollback;
> 	}
>@@ -4515,31 +4509,57 @@ int devlink_params_register(struct devlink *devlink,
> 	if (!i)
> 		goto unlock;
> 	for (param--; i > 0; i--, param--)
>-		devlink_param_unregister_one(devlink, param);
>+		devlink_param_unregister_one(devlink, param_list, param);
> unlock:
> 	mutex_unlock(&devlink->lock);
> 	return err;
> }
>-EXPORT_SYMBOL_GPL(devlink_params_register);
> 
> /**
>- *	devlink_params_unregister - unregister configuration parameters
>+ *	devlink_params_register - register configuration parameters
>+ *
>  *	@devlink: devlink
>- *	@params: configuration parameters to unregister
>+ *	@params: configuration parameters array
>  *	@params_count: number of parameters provided
>+ *
>+ *	Register the configuration parameters supported by the driver.
>  */
>-void devlink_params_unregister(struct devlink *devlink,
>-			       const struct devlink_param *params,
>-			       size_t params_count)
>+int devlink_params_register(struct devlink *devlink,

The order of the functions should be:
__devlink_params_register
__devlink_params_unregister
devlink_params_register
devlink_params_unregister
devlink_port_params_register
devlink_port_params_unregister

Your order is a bit confusing.

Other than that:
Acked-by: Jiri Pirko <jiri@mellanox.com>


[...]

  reply	other threads:[~2019-01-23  8:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18  7:09 [PATCH net-next v7 0/8] devlink: Add configuration parameters support for devlink_port Vasundhara Volam
2019-01-18  7:09 ` [PATCH net-next v7 1/8] devlink: Add devlink_param for port register and unregister Vasundhara Volam
2019-01-23  8:25   ` Jiri Pirko [this message]
2019-01-23  9:13     ` Vasundhara Volam
2019-01-18  7:09 ` [PATCH net-next v7 2/8] devlink: Add port param get command Vasundhara Volam
2019-01-23  8:53   ` Jiri Pirko
2019-01-18  7:09 ` [PATCH net-next v7 3/8] devlink: Add port param set command Vasundhara Volam
2019-01-23 11:03   ` Jiri Pirko
2019-01-18  7:09 ` [PATCH net-next v7 4/8] devlink: Add support for driverinit get value for devlink_port Vasundhara Volam
2019-01-23 11:08   ` Jiri Pirko
2019-01-23 11:36     ` Vasundhara Volam
2019-01-18  7:09 ` [PATCH net-next v7 5/8] devlink: Add support for driverinit set " Vasundhara Volam
2019-01-18  7:09 ` [PATCH net-next v7 6/8] devlink: Add devlink notifications support for port params Vasundhara Volam
2019-01-18  7:09 ` [PATCH net-next v7 7/8] devlink: Add a generic wake_on_lan port parameter Vasundhara Volam
2019-01-18  7:09 ` [PATCH net-next v7 8/8] bnxt_en: Add bnxt_en initial port params table and register it Vasundhara Volam
2019-01-18 14:33 ` [PATCH net-next v7 0/8] devlink: Add configuration parameters support for devlink_port Michal Kubecek
2019-01-22 22:18   ` Jakub Kicinski
2019-01-24  9:46     ` Vasundhara Volam
2019-01-24 18:50       ` Jakub Kicinski
2019-01-27 23:07     ` Michal Kubecek
2019-01-28  3:45       ` David Miller
2019-02-04  6:55     ` Vasundhara Volam
2019-02-05  2:56       ` Jakub Kicinski
2019-02-05  4:23         ` Vasundhara Volam
2019-02-05 16:51           ` Michal Kubecek
2019-02-06 10:13             ` Vasundhara Volam
2019-01-24  9:42   ` Vasundhara Volam

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=20190123082513.GA2191@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jiri@mellanox.com \
    --cc=michael.chan@broadcom.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=vasundhara-v.volam@broadcom.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).