Thread (7 messages) 7 messages, 2 authors, 2026-05-26

Re: [PATCH net-next v2 3/5] net: dsa: tag_ks8995: Add the KS8995 tag handling

From: Paolo Abeni <pabeni@redhat.com>
Date: 2026-05-26 13:33:17
Also in: linux-devicetree

On 5/22/26 3:21 PM, Linus Walleij wrote:
The KS8995 100Mbit switch can do proper DSA per-port tagging
with the proper set-up. This adds the code to handle ingress
and egress KS8995 tags.

The tag is a modified 0x8100 ethertype tag where a bit in the
last nybble is set for each target port.

Signed-off-by: Linus Walleij <linusw@kernel.org>
Does not apply cleanly to net-next, please rebase and resend.
+static struct sk_buff *ks8995_rcv(struct sk_buff *skb, struct net_device *dev)
+{
+	int portmask;
+	u16 etype;
+
+	/* We are expecting all received packets to have a mangled VLAN
+	 * TPID, so drop anything else. Because of the non-standard TPID,
+	 * don't even bother looking for a tag in the hwaccel area.
+	 *
+	 * We have to inspect the ethertype directly because skb->protocol
+	 * will contain garbage.
+	 */
+	etype = ntohs(*(__be16 *)dsa_etype_header_pos_rx(skb));
+	if ((etype & KS8995M_STPID_STD) != ETH_P_8021Q) {
+		netdev_info(dev, "%s: dropped ethertype 0x%04x\n",
+			    __func__, etype);
While at it, please avoid printk that could be triggered on each
incoming packet.

/P
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help