aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_hw.c
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2009-03-13 10:52:05 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-14 17:00:33 -0400
commitd8b100c5da003b6f8c410453e1e6e74ced8d1cc1 (patch)
tree75d895254bb70859ef5c3b4cab2d5da313af8e87 /drivers/net/netxen/netxen_nic_hw.c
parent9b3ef55c6ddbe8c7b76707eae9a77d874fe2cec0 (diff)
netxen: add receive side scaling (rss) support
This patch enables the load balancing capability of firmware and hardware to spray traffic into different cpus through separate rx msix interrupts. The feature is being enabled for NX3031, NX2031 (old) will be enabled later. This depends on msi-x and compatibility with msi and legacy is maintained by enabling single rx ring. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index cea7300426b..c89c791e281 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -670,6 +670,53 @@ int netxen_config_intr_coalesce(struct netxen_adapter *adapter)
670 return rv; 670 return rv;
671} 671}
672 672
673#define RSS_HASHTYPE_IP_TCP 0x3
674
675int netxen_config_rss(struct netxen_adapter *adapter, int enable)
676{
677 nx_nic_req_t req;
678 u64 word;
679 int i, rv;
680
681 u64 key[] = { 0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL,
682 0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL,
683 0x255b0ec26d5a56daULL };
684
685
686 memset(&req, 0, sizeof(nx_nic_req_t));
687 req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23);
688
689 word = NX_NIC_H2C_OPCODE_CONFIG_RSS | ((u64)adapter->portnum << 16);
690 req.req_hdr = cpu_to_le64(word);
691
692 /*
693 * RSS request:
694 * bits 3-0: hash_method
695 * 5-4: hash_type_ipv4
696 * 7-6: hash_type_ipv6
697 * 8: enable
698 * 9: use indirection table
699 * 47-10: reserved
700 * 63-48: indirection table mask
701 */
702 word = ((u64)(RSS_HASHTYPE_IP_TCP & 0x3) << 4) |
703 ((u64)(RSS_HASHTYPE_IP_TCP & 0x3) << 6) |
704 ((u64)(enable & 0x1) << 8) |
705 ((0x7ULL) << 48);
706 req.words[0] = cpu_to_le64(word);
707 for (i = 0; i < 5; i++)
708 req.words[i+1] = cpu_to_le64(key[i]);
709
710
711 rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
712 if (rv != 0) {
713 printk(KERN_ERR "%s: could not configure RSS\n",
714 adapter->netdev->name);
715 }
716
717 return rv;
718}
719
673/* 720/*
674 * netxen_nic_change_mtu - Change the Maximum Transfer Unit 721 * netxen_nic_change_mtu - Change the Maximum Transfer Unit
675 * @returns 0 on success, negative on failure 722 * @returns 0 on success, negative on failure