diff options
author | Michael Chan <mchan@broadcom.com> | 2010-07-03 16:42:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-04 14:44:00 -0400 |
commit | fdc8541d693a04ba3d6c335dace19b8362ac4e83 (patch) | |
tree | 562c2b0bb62f52d21ca98d0d8a3e05fb325bf8af | |
parent | 3d5f3a7bbd06065b06c7f65f948437ded40255ec (diff) |
bnx2: Add support for skb->rxhash.
Add skb->rxhash support for TCP packets only because the bnx2 RSS hash
does not hash UDP ports.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bnx2.c | 15 | ||||
-rw-r--r-- | drivers/net/bnx2.h | 3 |
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 0614ca0b15fe..1450c75bc19d 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -3219,6 +3219,10 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) | |||
3219 | L2_FHDR_ERRORS_UDP_XSUM)) == 0)) | 3219 | L2_FHDR_ERRORS_UDP_XSUM)) == 0)) |
3220 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 3220 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
3221 | } | 3221 | } |
3222 | if ((bp->dev->features & NETIF_F_RXHASH) && | ||
3223 | ((status & L2_FHDR_STATUS_USE_RXHASH) == | ||
3224 | L2_FHDR_STATUS_USE_RXHASH)) | ||
3225 | skb->rxhash = rx_hdr->l2_fhdr_hash; | ||
3222 | 3226 | ||
3223 | skb_record_rx_queue(skb, bnapi - &bp->bnx2_napi[0]); | 3227 | skb_record_rx_queue(skb, bnapi - &bp->bnx2_napi[0]); |
3224 | 3228 | ||
@@ -7558,6 +7562,12 @@ bnx2_set_tx_csum(struct net_device *dev, u32 data) | |||
7558 | return (ethtool_op_set_tx_csum(dev, data)); | 7562 | return (ethtool_op_set_tx_csum(dev, data)); |
7559 | } | 7563 | } |
7560 | 7564 | ||
7565 | static int | ||
7566 | bnx2_set_flags(struct net_device *dev, u32 data) | ||
7567 | { | ||
7568 | return ethtool_op_set_flags(dev, data, ETH_FLAG_RXHASH); | ||
7569 | } | ||
7570 | |||
7561 | static const struct ethtool_ops bnx2_ethtool_ops = { | 7571 | static const struct ethtool_ops bnx2_ethtool_ops = { |
7562 | .get_settings = bnx2_get_settings, | 7572 | .get_settings = bnx2_get_settings, |
7563 | .set_settings = bnx2_set_settings, | 7573 | .set_settings = bnx2_set_settings, |
@@ -7587,6 +7597,8 @@ static const struct ethtool_ops bnx2_ethtool_ops = { | |||
7587 | .phys_id = bnx2_phys_id, | 7597 | .phys_id = bnx2_phys_id, |
7588 | .get_ethtool_stats = bnx2_get_ethtool_stats, | 7598 | .get_ethtool_stats = bnx2_get_ethtool_stats, |
7589 | .get_sset_count = bnx2_get_sset_count, | 7599 | .get_sset_count = bnx2_get_sset_count, |
7600 | .set_flags = bnx2_set_flags, | ||
7601 | .get_flags = ethtool_op_get_flags, | ||
7590 | }; | 7602 | }; |
7591 | 7603 | ||
7592 | /* Called with rtnl_lock */ | 7604 | /* Called with rtnl_lock */ |
@@ -8333,7 +8345,8 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
8333 | memcpy(dev->dev_addr, bp->mac_addr, 6); | 8345 | memcpy(dev->dev_addr, bp->mac_addr, 6); |
8334 | memcpy(dev->perm_addr, bp->mac_addr, 6); | 8346 | memcpy(dev->perm_addr, bp->mac_addr, 6); |
8335 | 8347 | ||
8336 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_GRO; | 8348 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_GRO | |
8349 | NETIF_F_RXHASH; | ||
8337 | vlan_features_add(dev, NETIF_F_IP_CSUM | NETIF_F_SG); | 8350 | vlan_features_add(dev, NETIF_F_IP_CSUM | NETIF_F_SG); |
8338 | if (CHIP_NUM(bp) == CHIP_NUM_5709) { | 8351 | if (CHIP_NUM(bp) == CHIP_NUM_5709) { |
8339 | dev->features |= NETIF_F_IPV6_CSUM; | 8352 | dev->features |= NETIF_F_IPV6_CSUM; |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index ddaa3fc99876..b9af6bcef894 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
@@ -295,6 +295,9 @@ struct l2_fhdr { | |||
295 | #define L2_FHDR_ERRORS_TCP_XSUM (1<<28) | 295 | #define L2_FHDR_ERRORS_TCP_XSUM (1<<28) |
296 | #define L2_FHDR_ERRORS_UDP_XSUM (1<<31) | 296 | #define L2_FHDR_ERRORS_UDP_XSUM (1<<31) |
297 | 297 | ||
298 | #define L2_FHDR_STATUS_USE_RXHASH \ | ||
299 | (L2_FHDR_STATUS_TCP_SEGMENT | L2_FHDR_STATUS_RSS_HASH) | ||
300 | |||
298 | u32 l2_fhdr_hash; | 301 | u32 l2_fhdr_hash; |
299 | #if defined(__BIG_ENDIAN) | 302 | #if defined(__BIG_ENDIAN) |
300 | u16 l2_fhdr_pkt_len; | 303 | u16 l2_fhdr_pkt_len; |