[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BY5PR12MB4322FA7F1F55F6E8450A33AADCA20@BY5PR12MB4322.namprd12.prod.outlook.com>
Date: Wed, 20 Jan 2021 03:37:35 +0000
From: Parav Pandit <parav@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>, Saeed Mahameed <saeed@...nel.org>
CC: "David S. Miller" <davem@...emloft.net>,
Jason Gunthorpe <jgg@...dia.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
Vu Pham <vuhuong@...dia.com>,
Saeed Mahameed <saeedm@...dia.com>
Subject: RE: [net-next V7 03/14] devlink: Support add and delete devlink port
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: Wednesday, January 20, 2021 8:58 AM
>
> On Mon, 18 Jan 2021 12:12:20 -0800 Saeed Mahameed wrote:
> > From: Parav Pandit <parav@...dia.com>
>
> Saeed, this is closed to being merged - when you post the next version please
> make sure to CC appropriate folks, in particular anyone who ever
> commented on previous versions. Alex, DSA, Edwin, at a quick look but
> maybe more.
>
> > @@ -1362,6 +1373,33 @@ struct devlink_ops {
> > int (*port_function_hw_addr_set)(struct devlink *devlink, struct
> devlink_port *port,
> > const u8 *hw_addr, int
> hw_addr_len,
> > struct netlink_ext_ack *extack);
> > + /**
> > + * @port_new: Port add function.
> > + *
> > + * Should be used by device driver to let caller add new port of a
> > + * specified flavour with optional attributes.
>
> I think you missed my suggestion from v5, please replace this sentence
> with:
>
> Add a new port of a specified flavor with optional attributes.
>
> Saying that the callback is used by the callee doesn't sound right.
>
Ok.
> Same below, and also in patch 4.
>
"let caller add .." words are not present in patch 4.
So I think patch 4 is fine.
> > + * Driver must return -EOPNOTSUPP if it doesn't support port
> addition
> > + * of a specified flavour or specified attributes. Driver should set
> > + * extack error message in case of failure. Driver callback is called
> > + * without holding the devlink instance lock. Driver must ensure
> > + * synchronization when adding or deleting a port. Driver must
> register
> > + * a port with devlink core.
> > + */
> > + int (*port_new)(struct devlink *devlink,
> > + const struct devlink_port_new_attrs *attrs,
> > + struct netlink_ext_ack *extack,
> > + unsigned int *new_port_index);
> > + /**
> > + * @port_del: Port delete function.
> > + *
> > + * Should be used by device driver to let caller delete port which was
> > + * previously created using port_new() callback.
>
> ditto
>
> > + * Driver must return -EOPNOTSUPP if it doesn't support port
> deletion.
> > + * Driver should set extack error message in case of failure. Driver
> > + * callback is called without holding the devlink instance lock.
> > + */
> > + int (*port_del)(struct devlink *devlink, unsigned int port_index,
> > + struct netlink_ext_ack *extack);
> > };
Powered by blists - more mailing lists