Thread (17 messages) flat view 17 messages, 3 authors, 2021-01-20

RE: [net-next V7 03/14] devlink: Support add and delete devlink port

From: Parav Pandit <hidden>
Date: 2021-01-20 03:39:07
Also in: linux-rdma

From: Jakub Kicinski <kuba@kernel.org>
Sent: Wednesday, January 20, 2021 8:58 AM

On Mon, 18 Jan 2021 12:12:20 -0800 Saeed Mahameed wrote:
quoted
From: Parav Pandit <redacted>
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.
quoted
@@ -1362,6 +1373,33 @@ struct devlink_ops {
 	int (*port_function_hw_addr_set)(struct devlink *devlink, struct
devlink_port *port,
quoted
 					 const u8 *hw_addr, int
hw_addr_len,
quoted
 					 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.
 
quoted
+	 * Driver must return -EOPNOTSUPP if it doesn't support port
addition
quoted
+	 * 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
quoted
+	 * 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
quoted
+	 * Driver must return -EOPNOTSUPP if it doesn't support port
deletion.
quoted
+	 * 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);
 };
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help