diff options
author | Narender Kumar <narender.kumar@qlogic.com> | 2009-08-23 04:35:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-23 22:00:20 -0400 |
commit | 1bb482f8a46000f77577948ff1c350275bba7dc9 (patch) | |
tree | 3003df5a4414af44af0756f670531d9445bad397 /drivers/net/netxen/netxen_nic_hw.c | |
parent | 8fea0f0db87a4aaed41a93eed147af61cc5f9e3f (diff) |
netxen: ethtool statistics and control for LRO
Add ethtool -K knob to control LRO in firmware.
LRO path is completely separated from GRO, LRO packets
are still fed with netif_receive_skb().
Also fix ethtool statistics to include LRO packets.
Also use correct message type while configuring interrupt coalescing.
Signed-off-by: Narender Kumar <narender.kumar@qlogic.com>
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.c | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 673dcf5ea53d..965f783d39f2 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -643,7 +643,7 @@ int netxen_config_intr_coalesce(struct netxen_adapter *adapter) | |||
643 | 643 | ||
644 | memset(&req, 0, sizeof(nx_nic_req_t)); | 644 | memset(&req, 0, sizeof(nx_nic_req_t)); |
645 | 645 | ||
646 | req.qhdr = cpu_to_le64(NX_NIC_REQUEST << 23); | 646 | req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23); |
647 | 647 | ||
648 | word = NETXEN_CONFIG_INTR_COALESCE | ((u64)adapter->portnum << 16); | 648 | word = NETXEN_CONFIG_INTR_COALESCE | ((u64)adapter->portnum << 16); |
649 | req.req_hdr = cpu_to_le64(word); | 649 | req.req_hdr = cpu_to_le64(word); |
@@ -659,6 +659,35 @@ int netxen_config_intr_coalesce(struct netxen_adapter *adapter) | |||
659 | return rv; | 659 | return rv; |
660 | } | 660 | } |
661 | 661 | ||
662 | int netxen_config_hw_lro(struct netxen_adapter *adapter, int enable) | ||
663 | { | ||
664 | nx_nic_req_t req; | ||
665 | u64 word; | ||
666 | int rv = 0; | ||
667 | |||
668 | if ((adapter->flags & NETXEN_NIC_LRO_ENABLED) == enable) | ||
669 | return 0; | ||
670 | |||
671 | memset(&req, 0, sizeof(nx_nic_req_t)); | ||
672 | |||
673 | req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23); | ||
674 | |||
675 | word = NX_NIC_H2C_OPCODE_CONFIG_HW_LRO | ((u64)adapter->portnum << 16); | ||
676 | req.req_hdr = cpu_to_le64(word); | ||
677 | |||
678 | req.words[0] = cpu_to_le64(enable); | ||
679 | |||
680 | rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); | ||
681 | if (rv != 0) { | ||
682 | printk(KERN_ERR "ERROR. Could not send " | ||
683 | "configure hw lro request\n"); | ||
684 | } | ||
685 | |||
686 | adapter->flags ^= NETXEN_NIC_LRO_ENABLED; | ||
687 | |||
688 | return rv; | ||
689 | } | ||
690 | |||
662 | #define RSS_HASHTYPE_IP_TCP 0x3 | 691 | #define RSS_HASHTYPE_IP_TCP 0x3 |
663 | 692 | ||
664 | int netxen_config_rss(struct netxen_adapter *adapter, int enable) | 693 | int netxen_config_rss(struct netxen_adapter *adapter, int enable) |
@@ -752,6 +781,29 @@ int netxen_linkevent_request(struct netxen_adapter *adapter, int enable) | |||
752 | return rv; | 781 | return rv; |
753 | } | 782 | } |
754 | 783 | ||
784 | int netxen_send_lro_cleanup(struct netxen_adapter *adapter) | ||
785 | { | ||
786 | nx_nic_req_t req; | ||
787 | u64 word; | ||
788 | int rv; | ||
789 | |||
790 | memset(&req, 0, sizeof(nx_nic_req_t)); | ||
791 | req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23); | ||
792 | |||
793 | word = NX_NIC_H2C_OPCODE_LRO_REQUEST | | ||
794 | ((u64)adapter->portnum << 16) | | ||
795 | ((u64)NX_NIC_LRO_REQUEST_CLEANUP << 56) ; | ||
796 | |||
797 | req.req_hdr = cpu_to_le64(word); | ||
798 | |||
799 | rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); | ||
800 | if (rv != 0) { | ||
801 | printk(KERN_ERR "%s: could not cleanup lro flows\n", | ||
802 | adapter->netdev->name); | ||
803 | } | ||
804 | return rv; | ||
805 | } | ||
806 | |||
755 | /* | 807 | /* |
756 | * netxen_nic_change_mtu - Change the Maximum Transfer Unit | 808 | * netxen_nic_change_mtu - Change the Maximum Transfer Unit |
757 | * @returns 0 on success, negative on failure | 809 | * @returns 0 on success, negative on failure |
@@ -2066,6 +2118,8 @@ void netxen_nic_get_firmware_info(struct netxen_adapter *adapter) | |||
2066 | 2118 | ||
2067 | if (adapter->fw_version >= NETXEN_VERSION_CODE(4, 0, 222)) | 2119 | if (adapter->fw_version >= NETXEN_VERSION_CODE(4, 0, 222)) |
2068 | adapter->capabilities = NXRD32(adapter, CRB_FW_CAPABILITIES_1); | 2120 | adapter->capabilities = NXRD32(adapter, CRB_FW_CAPABILITIES_1); |
2121 | |||
2122 | adapter->flags &= ~NETXEN_NIC_LRO_ENABLED; | ||
2069 | } | 2123 | } |
2070 | 2124 | ||
2071 | int | 2125 | int |