diff options
author | Ajit Khaparde <ajit.khaparde@emulex.com> | 2011-04-06 14:07:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-07 18:04:44 -0400 |
commit | 4b97291429bf59c09a969184a7d2ebde7287e7eb (patch) | |
tree | 21314d74a38638dde44cacce29dba2c84e445b92 /drivers/net/benet/be_main.c | |
parent | c1e48efc701b79ee4367c9a1a4e8bbc7c3586e02 (diff) |
be2net: add rxhash support
Add rxhash support,
Based on initial work by Eric Dumazet.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r-- | drivers/net/benet/be_main.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 2c3685389485..d762c2a3dd9b 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -116,11 +116,6 @@ static char *ue_status_hi_desc[] = { | |||
116 | "Unknown" | 116 | "Unknown" |
117 | }; | 117 | }; |
118 | 118 | ||
119 | static inline bool be_multi_rxq(struct be_adapter *adapter) | ||
120 | { | ||
121 | return (adapter->num_rx_qs > 1); | ||
122 | } | ||
123 | |||
124 | static void be_queue_free(struct be_adapter *adapter, struct be_queue_info *q) | 119 | static void be_queue_free(struct be_adapter *adapter, struct be_queue_info *q) |
125 | { | 120 | { |
126 | struct be_dma_mem *mem = &q->dma_mem; | 121 | struct be_dma_mem *mem = &q->dma_mem; |
@@ -1012,6 +1007,9 @@ static void be_rx_compl_process(struct be_adapter *adapter, | |||
1012 | 1007 | ||
1013 | skb->truesize = skb->len + sizeof(struct sk_buff); | 1008 | skb->truesize = skb->len + sizeof(struct sk_buff); |
1014 | skb->protocol = eth_type_trans(skb, adapter->netdev); | 1009 | skb->protocol = eth_type_trans(skb, adapter->netdev); |
1010 | if (adapter->netdev->features & NETIF_F_RXHASH) | ||
1011 | skb->rxhash = rxcp->rss_hash; | ||
1012 | |||
1015 | 1013 | ||
1016 | if (unlikely(rxcp->vlanf)) { | 1014 | if (unlikely(rxcp->vlanf)) { |
1017 | if (!adapter->vlan_grp || adapter->vlans_added == 0) { | 1015 | if (!adapter->vlan_grp || adapter->vlans_added == 0) { |
@@ -1072,6 +1070,8 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, | |||
1072 | skb->data_len = rxcp->pkt_size; | 1070 | skb->data_len = rxcp->pkt_size; |
1073 | skb->truesize += rxcp->pkt_size; | 1071 | skb->truesize += rxcp->pkt_size; |
1074 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1072 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1073 | if (adapter->netdev->features & NETIF_F_RXHASH) | ||
1074 | skb->rxhash = rxcp->rss_hash; | ||
1075 | 1075 | ||
1076 | if (likely(!rxcp->vlanf)) | 1076 | if (likely(!rxcp->vlanf)) |
1077 | napi_gro_frags(&eq_obj->napi); | 1077 | napi_gro_frags(&eq_obj->napi); |
@@ -1101,6 +1101,8 @@ static void be_parse_rx_compl_v1(struct be_adapter *adapter, | |||
1101 | AMAP_GET_BITS(struct amap_eth_rx_compl_v1, numfrags, compl); | 1101 | AMAP_GET_BITS(struct amap_eth_rx_compl_v1, numfrags, compl); |
1102 | rxcp->pkt_type = | 1102 | rxcp->pkt_type = |
1103 | AMAP_GET_BITS(struct amap_eth_rx_compl_v1, cast_enc, compl); | 1103 | AMAP_GET_BITS(struct amap_eth_rx_compl_v1, cast_enc, compl); |
1104 | rxcp->rss_hash = | ||
1105 | AMAP_GET_BITS(struct amap_eth_rx_compl_v1, rsshash, rxcp); | ||
1104 | if (rxcp->vlanf) { | 1106 | if (rxcp->vlanf) { |
1105 | rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vtm, | 1107 | rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vtm, |
1106 | compl); | 1108 | compl); |
@@ -1131,6 +1133,8 @@ static void be_parse_rx_compl_v0(struct be_adapter *adapter, | |||
1131 | AMAP_GET_BITS(struct amap_eth_rx_compl_v0, numfrags, compl); | 1133 | AMAP_GET_BITS(struct amap_eth_rx_compl_v0, numfrags, compl); |
1132 | rxcp->pkt_type = | 1134 | rxcp->pkt_type = |
1133 | AMAP_GET_BITS(struct amap_eth_rx_compl_v0, cast_enc, compl); | 1135 | AMAP_GET_BITS(struct amap_eth_rx_compl_v0, cast_enc, compl); |
1136 | rxcp->rss_hash = | ||
1137 | AMAP_GET_BITS(struct amap_eth_rx_compl_v0, rsshash, rxcp); | ||
1134 | if (rxcp->vlanf) { | 1138 | if (rxcp->vlanf) { |
1135 | rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vtm, | 1139 | rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vtm, |
1136 | compl); | 1140 | compl); |
@@ -2615,6 +2619,9 @@ static void be_netdev_init(struct net_device *netdev) | |||
2615 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 2619 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
2616 | NETIF_F_GRO | NETIF_F_TSO6; | 2620 | NETIF_F_GRO | NETIF_F_TSO6; |
2617 | 2621 | ||
2622 | if (be_multi_rxq(adapter)) | ||
2623 | netdev->features |= NETIF_F_RXHASH; | ||
2624 | |||
2618 | netdev->vlan_features |= NETIF_F_SG | NETIF_F_TSO | | 2625 | netdev->vlan_features |= NETIF_F_SG | NETIF_F_TSO | |
2619 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | 2626 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
2620 | 2627 | ||