Thread (13 messages) flat view 13 messages, 2 authors, 2021-01-08

Re: [PATCH v2 net-next 03/10] net: dsa: add ops for devlink-sb

From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-01-07 23:36:17

+static struct dsa_port *devlink_to_dsa_port(struct devlink_port *dlp)
+{
+	return container_of(dlp, struct dsa_port, devlink_port);
+}
I wonder if this should be moved to include/net/dsa.h next to the
other little helpers used to convert between devlink structures and
DSA structures?
+
+static int dsa_devlink_sb_pool_get(struct devlink *dl,
+				   unsigned int sb_index, u16 pool_index,
+				   struct devlink_sb_pool_info *pool_info)
+{
+	struct dsa_devlink_priv *dl_priv = devlink_priv(dl);
+	struct dsa_switch *ds = dl_priv->ds;
dsa_devlink_to_ds()
+
+	if (!ds->ops->devlink_sb_pool_get)
+		return -EOPNOTSUPP;
+
+	return ds->ops->devlink_sb_pool_get(ds, sb_index, pool_index,
+					    pool_info);
+}
+
	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help