diff options
author | Jon Mason <jon.mason@exar.com> | 2010-11-10 23:25:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-11 12:30:18 -0500 |
commit | 47f01db44b2470d9517848f6b73c75883ef5fda0 (patch) | |
tree | 1d2e1c89a787c83ce6eabc98730ac994ab00aa1f /drivers/net/vxge/vxge-main.c | |
parent | 0c6202b3278b417444a59cecc59e6e5af04db7fd (diff) |
vxge: enable rxhash
Enable RSS hashing and add ability to pass up the adapter calculated rx
hash up the network stack (if feature is available). Add the ability to
enable/disable feature via ethtool, which requires that the adapter is
not running at the time. Other miscellaneous cleanups and fixes
required to get RSS working.
Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Ram Vepa <ram.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge/vxge-main.c')
-rw-r--r-- | drivers/net/vxge/vxge-main.c | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index 813829f3d024..2f26c377e5d9 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c | |||
@@ -513,6 +513,13 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr, | |||
513 | else | 513 | else |
514 | skb_checksum_none_assert(skb); | 514 | skb_checksum_none_assert(skb); |
515 | 515 | ||
516 | /* rth_hash_type and rth_it_hit are non-zero regardless of | ||
517 | * whether rss is enabled. Only the rth_value is zero/non-zero | ||
518 | * if rss is disabled/enabled, so key off of that. | ||
519 | */ | ||
520 | if (ext_info.rth_value) | ||
521 | skb->rxhash = ext_info.rth_value; | ||
522 | |||
516 | vxge_rx_complete(ring, skb, ext_info.vlan, | 523 | vxge_rx_complete(ring, skb, ext_info.vlan, |
517 | pkt_length, &ext_info); | 524 | pkt_length, &ext_info); |
518 | 525 | ||
@@ -1689,15 +1696,6 @@ static enum vxge_hw_status vxge_rth_configure(struct vxgedev *vdev) | |||
1689 | mtable[index] = index % vdev->no_of_vpath; | 1696 | mtable[index] = index % vdev->no_of_vpath; |
1690 | } | 1697 | } |
1691 | 1698 | ||
1692 | /* Fill RTH hash types */ | ||
1693 | hash_types.hash_type_tcpipv4_en = vdev->config.rth_hash_type_tcpipv4; | ||
1694 | hash_types.hash_type_ipv4_en = vdev->config.rth_hash_type_ipv4; | ||
1695 | hash_types.hash_type_tcpipv6_en = vdev->config.rth_hash_type_tcpipv6; | ||
1696 | hash_types.hash_type_ipv6_en = vdev->config.rth_hash_type_ipv6; | ||
1697 | hash_types.hash_type_tcpipv6ex_en = | ||
1698 | vdev->config.rth_hash_type_tcpipv6ex; | ||
1699 | hash_types.hash_type_ipv6ex_en = vdev->config.rth_hash_type_ipv6ex; | ||
1700 | |||
1701 | /* set indirection table, bucket-to-vpath mapping */ | 1699 | /* set indirection table, bucket-to-vpath mapping */ |
1702 | status = vxge_hw_vpath_rts_rth_itable_set(vdev->vp_handles, | 1700 | status = vxge_hw_vpath_rts_rth_itable_set(vdev->vp_handles, |
1703 | vdev->no_of_vpath, | 1701 | vdev->no_of_vpath, |
@@ -1710,12 +1708,21 @@ static enum vxge_hw_status vxge_rth_configure(struct vxgedev *vdev) | |||
1710 | return status; | 1708 | return status; |
1711 | } | 1709 | } |
1712 | 1710 | ||
1711 | /* Fill RTH hash types */ | ||
1712 | hash_types.hash_type_tcpipv4_en = vdev->config.rth_hash_type_tcpipv4; | ||
1713 | hash_types.hash_type_ipv4_en = vdev->config.rth_hash_type_ipv4; | ||
1714 | hash_types.hash_type_tcpipv6_en = vdev->config.rth_hash_type_tcpipv6; | ||
1715 | hash_types.hash_type_ipv6_en = vdev->config.rth_hash_type_ipv6; | ||
1716 | hash_types.hash_type_tcpipv6ex_en = | ||
1717 | vdev->config.rth_hash_type_tcpipv6ex; | ||
1718 | hash_types.hash_type_ipv6ex_en = vdev->config.rth_hash_type_ipv6ex; | ||
1719 | |||
1713 | /* | 1720 | /* |
1714 | * Because the itable_set() method uses the active_table field | 1721 | * Because the itable_set() method uses the active_table field |
1715 | * for the target virtual path the RTH config should be updated | 1722 | * for the target virtual path the RTH config should be updated |
1716 | * for all VPATHs. The h/w only uses the lowest numbered VPATH | 1723 | * for all VPATHs. The h/w only uses the lowest numbered VPATH |
1717 | * when steering frames. | 1724 | * when steering frames. |
1718 | */ | 1725 | */ |
1719 | for (index = 0; index < vdev->no_of_vpath; index++) { | 1726 | for (index = 0; index < vdev->no_of_vpath; index++) { |
1720 | status = vxge_hw_vpath_rts_rth_set( | 1727 | status = vxge_hw_vpath_rts_rth_set( |
1721 | vdev->vpaths[index].handle, | 1728 | vdev->vpaths[index].handle, |
@@ -2598,6 +2605,8 @@ vxge_open(struct net_device *dev) | |||
2598 | goto out2; | 2605 | goto out2; |
2599 | } | 2606 | } |
2600 | } | 2607 | } |
2608 | printk(KERN_INFO "%s: Receive Hashing Offload %s\n", dev->name, | ||
2609 | hldev->config.rth_en ? "enabled" : "disabled"); | ||
2601 | 2610 | ||
2602 | for (i = 0; i < vdev->no_of_vpath; i++) { | 2611 | for (i = 0; i < vdev->no_of_vpath; i++) { |
2603 | vpath = &vdev->vpaths[i]; | 2612 | vpath = &vdev->vpaths[i]; |
@@ -3178,6 +3187,11 @@ static int __devinit vxge_device_register(struct __vxge_hw_device *hldev, | |||
3178 | 3187 | ||
3179 | vxge_initialize_ethtool_ops(ndev); | 3188 | vxge_initialize_ethtool_ops(ndev); |
3180 | 3189 | ||
3190 | if (vdev->config.rth_steering != NO_STEERING) { | ||
3191 | ndev->features |= NETIF_F_RXHASH; | ||
3192 | hldev->config.rth_en = VXGE_HW_RTH_ENABLE; | ||
3193 | } | ||
3194 | |||
3181 | /* Allocate memory for vpath */ | 3195 | /* Allocate memory for vpath */ |
3182 | vdev->vpaths = kzalloc((sizeof(struct vxge_vpath)) * | 3196 | vdev->vpaths = kzalloc((sizeof(struct vxge_vpath)) * |
3183 | no_of_vpath, GFP_KERNEL); | 3197 | no_of_vpath, GFP_KERNEL); |
@@ -4163,12 +4177,12 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
4163 | ll_config->fifo_indicate_max_pkts = VXGE_FIFO_INDICATE_MAX_PKTS; | 4177 | ll_config->fifo_indicate_max_pkts = VXGE_FIFO_INDICATE_MAX_PKTS; |
4164 | ll_config->addr_learn_en = addr_learn_en; | 4178 | ll_config->addr_learn_en = addr_learn_en; |
4165 | ll_config->rth_algorithm = RTH_ALG_JENKINS; | 4179 | ll_config->rth_algorithm = RTH_ALG_JENKINS; |
4166 | ll_config->rth_hash_type_tcpipv4 = VXGE_HW_RING_HASH_TYPE_TCP_IPV4; | 4180 | ll_config->rth_hash_type_tcpipv4 = 1; |
4167 | ll_config->rth_hash_type_ipv4 = VXGE_HW_RING_HASH_TYPE_NONE; | 4181 | ll_config->rth_hash_type_ipv4 = 0; |
4168 | ll_config->rth_hash_type_tcpipv6 = VXGE_HW_RING_HASH_TYPE_NONE; | 4182 | ll_config->rth_hash_type_tcpipv6 = 0; |
4169 | ll_config->rth_hash_type_ipv6 = VXGE_HW_RING_HASH_TYPE_NONE; | 4183 | ll_config->rth_hash_type_ipv6 = 0; |
4170 | ll_config->rth_hash_type_tcpipv6ex = VXGE_HW_RING_HASH_TYPE_NONE; | 4184 | ll_config->rth_hash_type_tcpipv6ex = 0; |
4171 | ll_config->rth_hash_type_ipv6ex = VXGE_HW_RING_HASH_TYPE_NONE; | 4185 | ll_config->rth_hash_type_ipv6ex = 0; |
4172 | ll_config->rth_bkt_sz = RTH_BUCKET_SIZE; | 4186 | ll_config->rth_bkt_sz = RTH_BUCKET_SIZE; |
4173 | ll_config->tx_pause_enable = VXGE_PAUSE_CTRL_ENABLE; | 4187 | ll_config->tx_pause_enable = VXGE_PAUSE_CTRL_ENABLE; |
4174 | ll_config->rx_pause_enable = VXGE_PAUSE_CTRL_ENABLE; | 4188 | ll_config->rx_pause_enable = VXGE_PAUSE_CTRL_ENABLE; |