Skip to contentSkip to conversation

net: dsa: yt921x: Add DCB/priority support

PATCH Superseded David Yang 2 participants 4 messages Jan 19 – Jan 22

Subsystems (4)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

David Yang

author maintainer
#0 lore raw

cover net: dsa: yt921x: Add DCB/priority support

This series add DCB/priority support to the driver.

David Yang (2):
net: dsa: tag_yt921x: fix priority support
net: dsa: yt921x: Add DCB/priority support

 drivers/net/dsa/Kconfig  |   2 +
 drivers/net/dsa/yt921x.c | 232 +++++++++++++++++++++++++++++++++++++++
 drivers/net/dsa/yt921x.h |  54 +++++++--
 net/dsa/tag_yt921x.c     |   8 +-
 4 files changed, 284 insertions(+), 12 deletions(-)

--
2.51.0

author maintainer
#1 lore raw

PATCH 1/2 net: dsa: tag_yt921x: fix priority support

The packet priority is embedded in the rx tag. It defaults to 0, but adding DCB support to the switch driver will break the tag driver by setting it to non-zero.

---
 net/dsa/tag_yt921x.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
net/dsa/tag_yt921x.c +6 -2
index 6bbfd42dc5df..b93715a057c7 100644
@@ -17,7 +17,8 @@
  *   2: Rx Port
  *     15b: Rx Port Valid
  *     14b-11b: Rx Port
- *     10b-0b: Cmd?
+ *     10b-8b: Priority
+ *     7b-0b: Cmd
  *   2: Tx Port(s)
  *     15b: Tx Port(s) Valid
  *     10b-0b: Tx Port(s) Mask
@@ -33,7 +34,8 @@
 
 #define YT921X_TAG_PORT_EN		BIT(15)
 #define YT921X_TAG_RX_PORT_M		GENMASK(14, 11)
-#define YT921X_TAG_RX_CMD_M		GENMASK(10, 0)
+#define YT921X_TAG_RX_PRIO_M		GENMASK(10, 8)
+#define YT921X_TAG_RX_CMD_M		GENMASK(7, 0)
 #define  YT921X_TAG_RX_CMD(x)			FIELD_PREP(YT921X_TAG_RX_CMD_M, (x))
 #define  YT921X_TAG_RX_CMD_FORWARDED		0x80
 #define  YT921X_TAG_RX_CMD_UNK_UCAST		0xb2
@@ -98,6 +100,8 @@ yt921x_tag_rcv(struct sk_buff *skb, struct net_device *netdev)
 		return NULL;
 	}
 
+	skb->priority = FIELD_GET(YT921X_TAG_RX_PRIO_M, rx);
+
 	cmd = FIELD_GET(YT921X_TAG_RX_CMD_M, rx);
 	switch (cmd) {
 	case YT921X_TAG_RX_CMD_FORWARDED:
Signature · 1 line
2.51.0
author maintainer
#2 lore raw

PATCH 2/2 net: dsa: yt921x: Add DCB/priority support

In reply to David Yang

Set up global DSCP/PCP priority mappings and add related DSA methods.

---
 drivers/net/dsa/Kconfig  |   2 +
 drivers/net/dsa/yt921x.c | 232 +++++++++++++++++++++++++++++++++++++++
 drivers/net/dsa/yt921x.h |  54 +++++++--
 3 files changed, 278 insertions(+), 10 deletions(-)
drivers/net/dsa/Kconfig +2 -0
index 7eb301fd987d..d73d7fa7f7d2 100644
@@ -158,6 +158,8 @@ config NET_DSA_VITESSE_VSC73XX_PLATFORM
 config NET_DSA_YT921X
 	tristate "Motorcomm YT9215 ethernet switch chip support"
 	select NET_DSA_TAG_YT921X
+	select NET_IEEE8021Q_HELPERS
+	select DCB
 	help
 	  This enables support for the Motorcomm YT9215 ethernet switch
 	  chip.
drivers/net/dsa/yt921x.c +232 -0

268 lines not on this page · raw message

drivers/net/dsa/yt921x.h +44 -10

94 lines not on this page · raw message

Signature · 1 line
2.51.0
maintainer
#3 lore raw
Quoted 3 lines · David Yang

Set up global DSCP/PCP priority mappings and add related DSA methods.

Don't apply cleanly anymore on top of the LAG changes. Please rebase and repost. You should keep a single series in flight touching the same code, or this problem will happen again.

Thanks,

Paolo