diff options
author | govindarajulu.v <govindarajulu90@gmail.com> | 2013-09-04 01:47:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-05 12:39:32 -0400 |
commit | bf751ba802fe57f4f3aa5555e1446387912bef9e (patch) | |
tree | 0a5235d40b8235e6835acf12825da34a8ffe15e4 /drivers/net | |
parent | 822473b6c4e207a8af08518afce5dd2f2e13d765 (diff) |
driver/net: enic: record q_number and rss_hash for skb
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/cisco/enic/enic_main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index 1ab3f1809c14..93898baa25db 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, | |||
1034 | 1034 | ||
1035 | skb_put(skb, bytes_written); | 1035 | skb_put(skb, bytes_written); |
1036 | skb->protocol = eth_type_trans(skb, netdev); | 1036 | skb->protocol = eth_type_trans(skb, netdev); |
1037 | skb_record_rx_queue(skb, q_number); | ||
1038 | if (netdev->features & NETIF_F_RXHASH) { | ||
1039 | skb->rxhash = rss_hash; | ||
1040 | if (rss_type & (NIC_CFG_RSS_HASH_TYPE_TCP_IPV6_EX | | ||
1041 | NIC_CFG_RSS_HASH_TYPE_TCP_IPV6 | | ||
1042 | NIC_CFG_RSS_HASH_TYPE_TCP_IPV4)) | ||
1043 | skb->l4_rxhash = true; | ||
1044 | } | ||
1037 | 1045 | ||
1038 | if ((netdev->features & NETIF_F_RXCSUM) && !csum_not_calc) { | 1046 | if ((netdev->features & NETIF_F_RXCSUM) && !csum_not_calc) { |
1039 | skb->csum = htons(checksum); | 1047 | skb->csum = htons(checksum); |
@@ -2209,6 +2217,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2209 | } | 2217 | } |
2210 | 2218 | ||
2211 | netif_set_real_num_tx_queues(netdev, enic->wq_count); | 2219 | netif_set_real_num_tx_queues(netdev, enic->wq_count); |
2220 | netif_set_real_num_rx_queues(netdev, enic->rq_count); | ||
2212 | 2221 | ||
2213 | /* Setup notification timer, HW reset task, and wq locks | 2222 | /* Setup notification timer, HW reset task, and wq locks |
2214 | */ | 2223 | */ |
@@ -2258,6 +2267,8 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2258 | if (ENIC_SETTING(enic, TSO)) | 2267 | if (ENIC_SETTING(enic, TSO)) |
2259 | netdev->hw_features |= NETIF_F_TSO | | 2268 | netdev->hw_features |= NETIF_F_TSO | |
2260 | NETIF_F_TSO6 | NETIF_F_TSO_ECN; | 2269 | NETIF_F_TSO6 | NETIF_F_TSO_ECN; |
2270 | if (ENIC_SETTING(enic, RSS)) | ||
2271 | netdev->hw_features |= NETIF_F_RXHASH; | ||
2261 | if (ENIC_SETTING(enic, RXCSUM)) | 2272 | if (ENIC_SETTING(enic, RXCSUM)) |
2262 | netdev->hw_features |= NETIF_F_RXCSUM; | 2273 | netdev->hw_features |= NETIF_F_RXCSUM; |
2263 | 2274 | ||