Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ea84c54 authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Ben Hutchings
Browse files

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: default avatarAndy Lutomirski <luto@amacapital.net>
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
parent 62ebac92
Loading
Loading
Loading
Loading
+14 −1
Original line number Original line Diff line number Diff line
@@ -1185,9 +1185,22 @@ int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,


	nhoff = skb_network_offset(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;
			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 */
	/* RFS must validate the IP header length before calling us */
	EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + sizeof(*ip));
	EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + sizeof(*ip));
	ip = (const struct iphdr *)(skb->data + nhoff);
	ip = (const struct iphdr *)(skb->data + nhoff);