netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Govindarajulu Varadarajan <govindarajulu90@gmail.com>
To: davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: benve@cisco.com, ssujith@cisco.com, nistrive@cisco.com,
	umalhi@cisco.com,
	Govindarajulu Varadarajan <govindarajulu90@gmail.com>
Subject: [PATCH net-next 2/5] driver/net: enic: record q_number and rss_hash for skb
Date: Wed,  4 Sep 2013 11:17:15 +0530	[thread overview]
Message-ID: <1378273638-7780-3-git-send-email-govindarajulu90@gmail.com> (raw)
In-Reply-To: <1378273638-7780-1-git-send-email-govindarajulu90@gmail.com>

The following patch sets the skb->rxhash and skb->q_number.
This is used by RPS and RFS. Kernel can make use of hw provided hash
instead of calculating the hash.

Signed-off-by: Govindarajulu Varadarajan <govindarajulu90@gmail.com>
Signed-off-by: Nishank Trivedi <nistrive@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
 drivers/net/ethernet/cisco/enic/enic_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 1ab3f18..93898ba 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1034,6 +1034,14 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,
 
 		skb_put(skb, bytes_written);
 		skb->protocol = eth_type_trans(skb, netdev);
+		skb_record_rx_queue(skb, q_number);
+		if (netdev->features & NETIF_F_RXHASH) {
+			skb->rxhash = rss_hash;
+			if (rss_type & (NIC_CFG_RSS_HASH_TYPE_TCP_IPV6_EX |
+					NIC_CFG_RSS_HASH_TYPE_TCP_IPV6 |
+					NIC_CFG_RSS_HASH_TYPE_TCP_IPV4))
+				skb->l4_rxhash = true;
+		}
 
 		if ((netdev->features & NETIF_F_RXCSUM) && !csum_not_calc) {
 			skb->csum = htons(checksum);
@@ -2209,6 +2217,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	netif_set_real_num_tx_queues(netdev, enic->wq_count);
+	netif_set_real_num_rx_queues(netdev, enic->rq_count);
 
 	/* Setup notification timer, HW reset task, and wq locks
 	 */
@@ -2258,6 +2267,8 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ENIC_SETTING(enic, TSO))
 		netdev->hw_features |= NETIF_F_TSO |
 			NETIF_F_TSO6 | NETIF_F_TSO_ECN;
+	if (ENIC_SETTING(enic, RSS))
+		netdev->hw_features |= NETIF_F_RXHASH;
 	if (ENIC_SETTING(enic, RXCSUM))
 		netdev->hw_features |= NETIF_F_RXCSUM;
 
-- 
1.8.4

  parent reply	other threads:[~2013-09-04  5:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04  5:47 [PATCH net-next 0/5] driver/net: enic: enic driver updates Govindarajulu Varadarajan
2013-09-04  5:47 ` [PATCH net-next 1/5] driver/net: enic: Add multi tx support for enic Govindarajulu Varadarajan
2013-09-04  5:47 ` Govindarajulu Varadarajan [this message]
2013-09-04  5:47 ` [PATCH net-next 3/5] driver/net: enic: Try DMA 64 first, then failover to DMA Govindarajulu Varadarajan
2013-09-04  6:01   ` Govindarajulu Varadarajan
2013-09-04  5:47 ` [PATCH net-next 4/5] driver/net: enic: Exposing symbols for Cisco's low latency driver Govindarajulu Varadarajan
2013-09-04 14:52   ` Ben Hutchings
2013-09-04 16:32     ` Christian Benvenuti (benve)
2013-09-04  5:47 ` [PATCH net-next 5/5] driver/net: enic: update enic maintainers and driver Govindarajulu Varadarajan
2013-09-05 16:40 ` [PATCH net-next 0/5] driver/net: enic: enic driver updates 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=1378273638-7780-3-git-send-email-govindarajulu90@gmail.com \
    --to=govindarajulu90@gmail.com \
    --cc=benve@cisco.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nistrive@cisco.com \
    --cc=ssujith@cisco.com \
    --cc=umalhi@cisco.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).