diff options
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 47 |
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 | |||
675 | int 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 |