From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Fan Du <fan.du@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 11/14] ixgbe: Specify Rx hash type WRT Rx desc RSS type
Date: Fri, 17 Jul 2015 07:25:20 -0700 [thread overview]
Message-ID: <1437143123-5031-12-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1437143123-5031-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Fan Du <fan.du@intel.com>
RSS could be leveraged by taking account L4 src/dst ports
as ingredients, thus ingress skb Rx hash type should honor
such the real configuration.
Signed-off-by: Fan Du <fan.du@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 9aa6104..3e6a931 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1360,14 +1360,31 @@ static int __ixgbe_notify_dca(struct device *dev, void *data)
}
#endif /* CONFIG_IXGBE_DCA */
+
+#define IXGBE_RSS_L4_TYPES_MASK \
+ ((1ul << IXGBE_RXDADV_RSSTYPE_IPV4_TCP) | \
+ (1ul << IXGBE_RXDADV_RSSTYPE_IPV4_UDP) | \
+ (1ul << IXGBE_RXDADV_RSSTYPE_IPV6_TCP) | \
+ (1ul << IXGBE_RXDADV_RSSTYPE_IPV6_UDP))
+
static inline void ixgbe_rx_hash(struct ixgbe_ring *ring,
union ixgbe_adv_rx_desc *rx_desc,
struct sk_buff *skb)
{
- if (ring->netdev->features & NETIF_F_RXHASH)
- skb_set_hash(skb,
- le32_to_cpu(rx_desc->wb.lower.hi_dword.rss),
- PKT_HASH_TYPE_L3);
+ u16 rss_type;
+
+ if (!(ring->netdev->features & NETIF_F_RXHASH))
+ return;
+
+ rss_type = le16_to_cpu(rx_desc->wb.lower.lo_dword.hs_rss.pkt_info) &
+ IXGBE_RXDADV_RSSTYPE_MASK;
+
+ if (!rss_type)
+ return;
+
+ skb_set_hash(skb, le32_to_cpu(rx_desc->wb.lower.hi_dword.rss),
+ (IXGBE_RSS_L4_TYPES_MASK & (1ul << rss_type)) ?
+ PKT_HASH_TYPE_L4 : PKT_HASH_TYPE_L3);
}
#ifdef IXGBE_FCOE
--
2.4.3
next prev parent reply other threads:[~2015-07-17 14:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-17 14:25 [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2015-07-17 Jeff Kirsher
2015-07-17 14:25 ` [net-next 01/14] clarify implementation of ethtool's get_ts_info op Jeff Kirsher
2015-07-17 19:17 ` Richard Cochran
2015-07-17 14:25 ` [net-next 02/14] freescale: remove incorrect copied comment Jeff Kirsher
2015-07-17 14:25 ` [net-next 03/14] bnx2x: only report most generic filters in get_ts_info Jeff Kirsher
2015-07-17 14:25 ` [net-next 04/14] i40e: only report " Jeff Kirsher
2015-07-17 14:25 ` [net-next 05/14] igb: " Jeff Kirsher
2015-07-17 14:25 ` [net-next 06/14] ixgbe: " Jeff Kirsher
2015-07-17 14:25 ` [net-next 07/14] siena: " Jeff Kirsher
2015-07-17 14:25 ` [net-next 08/14] dp83640: only report generic filters in ts_info Jeff Kirsher
2015-07-17 14:25 ` [net-next 09/14] igb: Pull timestamp from fragment before adding it to skb Jeff Kirsher
2015-07-17 14:25 ` [net-next 10/14] ixgbevf: fold ixgbevf_pull_tail into ixgbevf_add_rx_frag Jeff Kirsher
2015-07-17 14:25 ` Jeff Kirsher [this message]
2015-07-17 14:25 ` [net-next 12/14] ixgbevf: Set Rx hash type for ingress packets Jeff Kirsher
2015-07-17 14:25 ` [net-next 13/14] ixgbe: Don't report flow director filter's status Jeff Kirsher
2015-07-17 14:25 ` [net-next 14/14] igb: Fix i354 88E1112 PHY on RCC boards using AutoMediaDetect Jeff Kirsher
2015-07-21 3:50 ` [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2015-07-17 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=1437143123-5031-12-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=fan.du@intel.com \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
/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).