netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@solarflare.com>,
	"Andy Lutomirski" <luto@amacapital.net>
Subject: [PATCH net-next 5/9] sfc: Enable accelerated RFS on vlans
Date: Mon, 24 Jun 2013 21:14:04 +0100	[thread overview]
Message-ID: <1372104844.1896.34.camel@bwh-desktop.uk.level5networks.com> (raw)
In-Reply-To: <1372104708.1896.29.camel@bwh-desktop.uk.level5networks.com>

From: Andy Lutomirski <luto@amacapital.net>

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 <luto@amacapital.net>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/ethernet/sfc/filter.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

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));


-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

  parent reply	other threads:[~2013-06-24 20:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24 20:11 Pull request: sfc-next 2013-06-24 Ben Hutchings
2013-06-24 20:12 ` [PATCH net-next 1/9] sfc: Fix EEH with legacy interrupts Ben Hutchings
2013-06-24 20:13 ` [PATCH net-next 2/9] sfc: Enable RX checksum offload for packets not handled by GRO Ben Hutchings
2013-06-24 20:13 ` [PATCH net-next 3/9] sfc: Increase size of RX SKB header area Ben Hutchings
2013-07-16 17:33   ` Eric Dumazet
2013-07-16 17:53     ` Ben Hutchings
2013-07-16 20:22       ` Eric Dumazet
2013-07-16 20:57         ` Ben Hutchings
2013-06-24 20:13 ` [PATCH net-next 4/9] sfc: Report software timestamping capabilities Ben Hutchings
2013-06-24 20:14 ` Ben Hutchings [this message]
2013-06-24 20:14 ` [PATCH net-next 6/9] sfc: Define and set RX buffer flag for packets parsed as TCP Ben Hutchings
2013-06-24 20:14 ` [PATCH net-next 7/9] sfc: Do not pass non-TCP packets into GRO code Ben Hutchings
2013-06-24 20:15 ` [PATCH net-next 8/9] sfc: Fix IRQ cleanup in case of a probe failure Ben Hutchings
2013-06-24 20:15 ` [PATCH net-next 9/9] sfc: Improve test for IOMMU in use Ben Hutchings
2013-06-25 23:12 ` Pull request: sfc-next 2013-06-24 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372104844.1896.34.camel@bwh-desktop.uk.level5networks.com \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --cc=luto@amacapital.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).