* [PATCH net-next 1/1] devlink: Add APIs to publish/unpublish the port parameters.
@ 2019-07-02 15:20 Sudarsana Reddy Kalluru
2019-07-02 16:11 ` Andrew Lunn
0 siblings, 1 reply; 6+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-07-02 15:20 UTC (permalink / raw)
To: davem; +Cc: netdev, mkalderon, aelior, jiri
The patch adds devlink interfaces for drivers to publish/unpublish the
devlink port parameters.
Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
---
include/net/devlink.h | 2 ++
net/core/devlink.c | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 6c51e86..2e2d7fc 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -651,6 +651,8 @@ int devlink_port_params_register(struct devlink_port *devlink_port,
void devlink_port_params_unregister(struct devlink_port *devlink_port,
const struct devlink_param *params,
size_t params_count);
+void devlink_port_params_publish(struct devlink_port *devlink_port);
+void devlink_port_params_unpublish(struct devlink_port *ddevlink_port);
int devlink_param_driverinit_value_get(struct devlink *devlink, u32 param_id,
union devlink_param_value *init_val);
int devlink_param_driverinit_value_set(struct devlink *devlink, u32 param_id,
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 4baf716..c06c23f 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -6378,6 +6378,48 @@ void devlink_port_params_unregister(struct devlink_port *devlink_port,
}
EXPORT_SYMBOL_GPL(devlink_port_params_unregister);
+/**
+ * devlink_port_params_publish - publish port configuration parameters
+ *
+ * @devlink_port: devlink port
+ *
+ * Publish previously registered port configuration parameters.
+ */
+void devlink_port_params_publish(struct devlink_port *devlink_port)
+{
+ struct devlink_param_item *param_item;
+
+ list_for_each_entry(param_item, &devlink_port->param_list, list) {
+ if (param_item->published)
+ continue;
+ param_item->published = true;
+ devlink_param_notify(devlink_port->devlink, devlink_port->index,
+ param_item, DEVLINK_CMD_PORT_PARAM_NEW);
+ }
+}
+EXPORT_SYMBOL_GPL(devlink_port_params_publish);
+
+/**
+ * devlink_port_params_unpublish - unpublish port configuration parameters
+ *
+ * @devlink_port: devlink port
+ *
+ * Unpublish previously registered port configuration parameters.
+ */
+void devlink_port_params_unpublish(struct devlink_port *devlink_port)
+{
+ struct devlink_param_item *param_item;
+
+ list_for_each_entry(param_item, &devlink_port->param_list, list) {
+ if (!param_item->published)
+ continue;
+ param_item->published = false;
+ devlink_param_notify(devlink_port->devlink, devlink_port->index,
+ param_item, DEVLINK_CMD_PORT_PARAM_DEL);
+ }
+}
+EXPORT_SYMBOL_GPL(devlink_port_params_unpublish);
+
static int
__devlink_param_driverinit_value_get(struct list_head *param_list, u32 param_id,
union devlink_param_value *init_val)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 1/1] devlink: Add APIs to publish/unpublish the port parameters.
2019-07-02 15:20 [PATCH net-next 1/1] devlink: Add APIs to publish/unpublish the port parameters Sudarsana Reddy Kalluru
@ 2019-07-02 16:11 ` Andrew Lunn
2019-07-02 16:18 ` Parav Pandit
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2019-07-02 16:11 UTC (permalink / raw)
To: Sudarsana Reddy Kalluru; +Cc: davem, netdev, mkalderon, aelior, jiri
On Tue, Jul 02, 2019 at 08:20:56AM -0700, Sudarsana Reddy Kalluru wrote:
> The patch adds devlink interfaces for drivers to publish/unpublish the
> devlink port parameters.
Hi Sudarsana
A good commit message says more about 'why' than 'what'. I can see the
'what' by reading the code. But the 'why' is often not so clear.
Why would i want to unpublish port parameters?
Thanks
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH net-next 1/1] devlink: Add APIs to publish/unpublish the port parameters.
2019-07-02 16:11 ` Andrew Lunn
@ 2019-07-02 16:18 ` Parav Pandit
2019-07-02 16:48 ` Andrew Lunn
0 siblings, 1 reply; 6+ messages in thread
From: Parav Pandit @ 2019-07-02 16:18 UTC (permalink / raw)
To: Andrew Lunn, Sudarsana Reddy Kalluru
Cc: davem@davemloft.net, netdev@vger.kernel.org,
mkalderon@marvell.com, aelior@marvell.com, jiri@resnulli.us
> -----Original Message-----
> From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> Behalf Of Andrew Lunn
> Sent: Tuesday, July 2, 2019 9:42 PM
> To: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> Cc: davem@davemloft.net; netdev@vger.kernel.org; mkalderon@marvell.com;
> aelior@marvell.com; jiri@resnulli.us
> Subject: Re: [PATCH net-next 1/1] devlink: Add APIs to publish/unpublish the
> port parameters.
>
> On Tue, Jul 02, 2019 at 08:20:56AM -0700, Sudarsana Reddy Kalluru wrote:
> > The patch adds devlink interfaces for drivers to publish/unpublish the
> > devlink port parameters.
>
> Hi Sudarsana
>
> A good commit message says more about 'why' than 'what'. I can see the
> 'what' by reading the code. But the 'why' is often not so clear.
>
> Why would i want to unpublish port parameters?
>
> Thanks
> Andrew
A vendor driver calling these APIs is needed at minimum.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 1/1] devlink: Add APIs to publish/unpublish the port parameters.
2019-07-02 16:18 ` Parav Pandit
@ 2019-07-02 16:48 ` Andrew Lunn
2019-07-02 17:18 ` Parav Pandit
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2019-07-02 16:48 UTC (permalink / raw)
To: Parav Pandit
Cc: Sudarsana Reddy Kalluru, davem@davemloft.net,
netdev@vger.kernel.org, mkalderon@marvell.com, aelior@marvell.com,
jiri@resnulli.us
> A vendor driver calling these APIs is needed at minimum.
Not a vendor driver, but a mainline driver.
But yes, a new API should not be added without at least one user.
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH net-next 1/1] devlink: Add APIs to publish/unpublish the port parameters.
2019-07-02 16:48 ` Andrew Lunn
@ 2019-07-02 17:18 ` Parav Pandit
2019-07-03 2:46 ` Sudarsana Reddy Kalluru
0 siblings, 1 reply; 6+ messages in thread
From: Parav Pandit @ 2019-07-02 17:18 UTC (permalink / raw)
To: Andrew Lunn
Cc: Sudarsana Reddy Kalluru, davem@davemloft.net,
netdev@vger.kernel.org, mkalderon@marvell.com, aelior@marvell.com,
jiri@resnulli.us
> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: Tuesday, July 2, 2019 10:19 PM
> To: Parav Pandit <parav@mellanox.com>
> Cc: Sudarsana Reddy Kalluru <skalluru@marvell.com>; davem@davemloft.net;
> netdev@vger.kernel.org; mkalderon@marvell.com; aelior@marvell.com;
> jiri@resnulli.us
> Subject: Re: [PATCH net-next 1/1] devlink: Add APIs to publish/unpublish the
> port parameters.
>
> > A vendor driver calling these APIs is needed at minimum.
>
> Not a vendor driver, but a mainline driver.
>
My apologies for terminology.
I meant to say that a NIC/hw driver from the kernel tree that created the devlink port should call this API (as user) in the patch.
You said it rightly below. Thanks.
> But yes, a new API should not be added without at least one user.
>
> Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH net-next 1/1] devlink: Add APIs to publish/unpublish the port parameters.
2019-07-02 17:18 ` Parav Pandit
@ 2019-07-03 2:46 ` Sudarsana Reddy Kalluru
0 siblings, 0 replies; 6+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-07-03 2:46 UTC (permalink / raw)
To: Parav Pandit, Andrew Lunn
Cc: davem@davemloft.net, netdev@vger.kernel.org, Michal Kalderon,
Ariel Elior, jiri@resnulli.us
> -----Original Message-----
> From: Parav Pandit <parav@mellanox.com>
> Sent: Tuesday, July 2, 2019 10:49 PM
> To: Andrew Lunn <andrew@lunn.ch>
> Cc: Sudarsana Reddy Kalluru <skalluru@marvell.com>;
> davem@davemloft.net; netdev@vger.kernel.org; Michal Kalderon
> <mkalderon@marvell.com>; Ariel Elior <aelior@marvell.com>;
> jiri@resnulli.us
> Subject: [EXT] RE: [PATCH net-next 1/1] devlink: Add APIs to
> publish/unpublish the port parameters.
>
> External Email
>
> ----------------------------------------------------------------------
>
>
> > -----Original Message-----
> > From: Andrew Lunn <andrew@lunn.ch>
> > Sent: Tuesday, July 2, 2019 10:19 PM
> > To: Parav Pandit <parav@mellanox.com>
> > Cc: Sudarsana Reddy Kalluru <skalluru@marvell.com>;
> > davem@davemloft.net; netdev@vger.kernel.org;
> mkalderon@marvell.com;
> > aelior@marvell.com; jiri@resnulli.us
> > Subject: Re: [PATCH net-next 1/1] devlink: Add APIs to
> > publish/unpublish the port parameters.
> >
> > > A vendor driver calling these APIs is needed at minimum.
> >
> > Not a vendor driver, but a mainline driver.
> >
> My apologies for terminology.
> I meant to say that a NIC/hw driver from the kernel tree that created the
> devlink port should call this API (as user) in the patch.
> You said it rightly below. Thanks.
>
> > But yes, a new API should not be added without at least one user.
> >
> > Andrew
Thanks a lot for your reviews.
Marvell NIC driver has a requirement to support the display/configuration of device attributes. Sent the proposed changes with following 'subject line',
[PATCH net-next 4/4] qed: Add devlink support for configuration attributes.
Have received a comment (from community) suggesting to move some of the attributes to devlink-port interface, which
requires the proposed APIs.
Will update the commit message and send it with the Marvel driver patch series which use this functionality.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-07-03 2:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-02 15:20 [PATCH net-next 1/1] devlink: Add APIs to publish/unpublish the port parameters Sudarsana Reddy Kalluru
2019-07-02 16:11 ` Andrew Lunn
2019-07-02 16:18 ` Parav Pandit
2019-07-02 16:48 ` Andrew Lunn
2019-07-02 17:18 ` Parav Pandit
2019-07-03 2:46 ` Sudarsana Reddy Kalluru
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).