From: Andy Lutomirski Date: Fri, 10 May 2013 23:51:33 +0000 (-0700) Subject: sfc: Enable accelerated RFS on vlans X-Git-Tag: upstream/snapshot3+hdmi~4753^2~151^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ea84c5492e19daa478fad42f97b7dda9289e71c;hp=62ebac926b7a5cd7cb6dc02a8d6fa925fa206a23;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git sfc: Enable accelerated RFS on vlans As far as I know, the hardware doesn't support matching on both IP fields and vlan tag, but it can at least match on the IP fields. Signed-off-by: Andy Lutomirski Signed-off-by: Ben Hutchings --- diff --git a/drivers/net/ethernet/sfc/filter.c b/drivers/net/ethernet/sfc/filter.c index 2397f0e..b74a60a 100644 --- a/drivers/net/ethernet/sfc/filter.c +++ b/drivers/net/ethernet/sfc/filter.c @@ -1185,8 +1185,21 @@ int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, nhoff = skb_network_offset(skb); - if (skb->protocol != htons(ETH_P_IP)) + if (skb->protocol == htons(ETH_P_8021Q)) { + EFX_BUG_ON_PARANOID(skb_headlen(skb) < + nhoff + sizeof(struct vlan_hdr)); + if (((const struct vlan_hdr *)skb->data + nhoff)-> + h_vlan_encapsulated_proto != htons(ETH_P_IP)) + return -EPROTONOSUPPORT; + + /* This is IP over 802.1q VLAN. We can't filter on the + * IP 5-tuple and the vlan together, so just strip the + * vlan header and filter on the IP part. + */ + nhoff += sizeof(struct vlan_hdr); + } else if (skb->protocol != htons(ETH_P_IP)) { return -EPROTONOSUPPORT; + } /* RFS must validate the IP header length before calling us */ EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + sizeof(*ip));