> > + padlen = 0; > > + if (skb->len < 60) > > + padlen = 60 - skb->len; > > Can you use ETH_ZLEN instead of 60 such that it is clear this is padding > to a minimum packet size (minus FCS)? > > > + > > + nskb = alloc_skb(NET_IP_ALIGN + skb->len + padlen + 2, > GFP_ATOMIC); > > Can you also define the "2" at the beginning of the file as being e.g: > TAG_KSZ_LEN? Got it. Will update.
> > + ds = dst->cpu_switch; > > + > > + if (skb_linearize(skb)) > > + return NULL; > > Is that really necessary? I don't think so. Will check it. > > + > > + tag = skb_tail_pointer(skb) - 1; > > + > > + source_port = tag[0] & 7; > > + if (source_port >= ds->num_ports || !ds- > >ports[source_port].netdev) > > + return NULL; > > + > > + pskb_trim_rcsum(skb, skb->len - 1); > > Humm, so we are still keeping tag[1] at the end of the frame? It tags 2 bytes for ingress (ksz_xmit) and 1 byte for egress (ksz_rcv). Put comment at the begin of net/dsa/tag_ksz.c. Thanks. Woojung