diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-03-13 10:52:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-14 17:00:33 -0400 |
commit | 9b3ef55c6ddbe8c7b76707eae9a77d874fe2cec0 (patch) | |
tree | 82fbd8c2b6dc391f0dc5ebda7b6f2c33c4feb38f /drivers | |
parent | 438627c77b877e445a4b918a50ff910a5ea2a12d (diff) |
netxen: remove old lro code
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 3 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 74 |
2 files changed, 25 insertions, 52 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index f00efe84744f..56fad22fed9a 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -766,9 +766,6 @@ struct netxen_rx_buffer { | |||
766 | u64 dma; | 766 | u64 dma; |
767 | u16 ref_handle; | 767 | u16 ref_handle; |
768 | u16 state; | 768 | u16 state; |
769 | u32 lro_expected_frags; | ||
770 | u32 lro_current_frags; | ||
771 | u32 lro_length; | ||
772 | }; | 769 | }; |
773 | 770 | ||
774 | /* Board types */ | 771 | /* Board types */ |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index d722589b1ce9..1b8f79f7f8ce 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -820,66 +820,37 @@ static struct sk_buff *netxen_process_rxbuf(struct netxen_adapter *adapter, | |||
820 | 820 | ||
821 | no_skb: | 821 | no_skb: |
822 | buffer->state = NETXEN_BUFFER_FREE; | 822 | buffer->state = NETXEN_BUFFER_FREE; |
823 | buffer->lro_current_frags = 0; | ||
824 | buffer->lro_expected_frags = 0; | ||
825 | list_add_tail(&buffer->list, &rds_ring->free_list); | 823 | list_add_tail(&buffer->list, &rds_ring->free_list); |
826 | return skb; | 824 | return skb; |
827 | } | 825 | } |
828 | 826 | ||
829 | static void netxen_process_rcv(struct netxen_adapter *adapter, | 827 | static void |
830 | struct status_desc *desc) | 828 | netxen_process_rcv(struct netxen_adapter *adapter, |
829 | int ring, int index, int length, int cksum, int pkt_offset) | ||
831 | { | 830 | { |
832 | struct net_device *netdev = adapter->netdev; | 831 | struct net_device *netdev = adapter->netdev; |
833 | u64 sts_data = le64_to_cpu(desc->status_desc_data); | ||
834 | int index = netxen_get_sts_refhandle(sts_data); | ||
835 | struct netxen_recv_context *recv_ctx = &adapter->recv_ctx; | 832 | struct netxen_recv_context *recv_ctx = &adapter->recv_ctx; |
836 | struct netxen_rx_buffer *buffer; | 833 | struct netxen_rx_buffer *buffer; |
837 | struct sk_buff *skb; | 834 | struct sk_buff *skb; |
838 | u32 length = netxen_get_sts_totallength(sts_data); | 835 | struct nx_host_rds_ring *rds_ring = &recv_ctx->rds_rings[ring]; |
839 | u32 desc_ctx; | ||
840 | u16 pkt_offset = 0, cksum; | ||
841 | struct nx_host_rds_ring *rds_ring; | ||
842 | 836 | ||
843 | desc_ctx = netxen_get_sts_type(sts_data); | ||
844 | if (unlikely(desc_ctx >= adapter->max_rds_rings)) | ||
845 | return; | ||
846 | |||
847 | rds_ring = &recv_ctx->rds_rings[desc_ctx]; | ||
848 | if (unlikely(index > rds_ring->num_desc)) | 837 | if (unlikely(index > rds_ring->num_desc)) |
849 | return; | 838 | return; |
850 | 839 | ||
851 | buffer = &rds_ring->rx_buf_arr[index]; | 840 | buffer = &rds_ring->rx_buf_arr[index]; |
852 | if (desc_ctx == RCV_RING_LRO) { | ||
853 | buffer->lro_current_frags++; | ||
854 | if (netxen_get_sts_desc_lro_last_frag(desc)) { | ||
855 | buffer->lro_expected_frags = | ||
856 | netxen_get_sts_desc_lro_cnt(desc); | ||
857 | buffer->lro_length = length; | ||
858 | } | ||
859 | if (buffer->lro_current_frags != buffer->lro_expected_frags) { | ||
860 | return; | ||
861 | } | ||
862 | } | ||
863 | |||
864 | cksum = netxen_get_sts_status(sts_data); | ||
865 | 841 | ||
866 | skb = netxen_process_rxbuf(adapter, rds_ring, index, cksum); | 842 | skb = netxen_process_rxbuf(adapter, rds_ring, index, cksum); |
867 | if (!skb) | 843 | if (!skb) |
868 | return; | 844 | return; |
869 | 845 | ||
870 | if (desc_ctx == RCV_RING_LRO) { | 846 | if (length > rds_ring->skb_size) |
871 | /* True length was only available on the last pkt */ | 847 | skb_put(skb, rds_ring->skb_size); |
872 | skb_put(skb, buffer->lro_length); | 848 | else |
873 | } else { | 849 | skb_put(skb, length); |
874 | if (length > rds_ring->skb_size) | ||
875 | skb_put(skb, rds_ring->skb_size); | ||
876 | else | ||
877 | skb_put(skb, length); | ||
878 | 850 | ||
879 | pkt_offset = netxen_get_sts_pkt_offset(sts_data); | 851 | |
880 | if (pkt_offset) | 852 | if (pkt_offset) |
881 | skb_pull(skb, pkt_offset); | 853 | skb_pull(skb, pkt_offset); |
882 | } | ||
883 | 854 | ||
884 | skb->protocol = eth_type_trans(skb, netdev); | 855 | skb->protocol = eth_type_trans(skb, netdev); |
885 | 856 | ||
@@ -896,9 +867,9 @@ netxen_process_rcv_ring(struct netxen_adapter *adapter, int max) | |||
896 | struct status_desc *desc_head = recv_ctx->rcv_status_desc_head; | 867 | struct status_desc *desc_head = recv_ctx->rcv_status_desc_head; |
897 | struct status_desc *desc; | 868 | struct status_desc *desc; |
898 | u32 consumer = recv_ctx->status_rx_consumer; | 869 | u32 consumer = recv_ctx->status_rx_consumer; |
899 | int count = 0, ring; | 870 | int count = 0; |
900 | u64 sts_data; | 871 | u64 sts_data; |
901 | u16 opcode; | 872 | int opcode, ring, index, length, cksum, pkt_offset; |
902 | 873 | ||
903 | while (count < max) { | 874 | while (count < max) { |
904 | desc = &desc_head[consumer]; | 875 | desc = &desc_head[consumer]; |
@@ -907,9 +878,19 @@ netxen_process_rcv_ring(struct netxen_adapter *adapter, int max) | |||
907 | if (!(sts_data & STATUS_OWNER_HOST)) | 878 | if (!(sts_data & STATUS_OWNER_HOST)) |
908 | break; | 879 | break; |
909 | 880 | ||
881 | ring = netxen_get_sts_type(sts_data); | ||
882 | if (ring > RCV_RING_JUMBO) | ||
883 | continue; | ||
884 | |||
910 | opcode = netxen_get_sts_opcode(sts_data); | 885 | opcode = netxen_get_sts_opcode(sts_data); |
911 | 886 | ||
912 | netxen_process_rcv(adapter, desc); | 887 | index = netxen_get_sts_refhandle(sts_data); |
888 | length = netxen_get_sts_totallength(sts_data); | ||
889 | cksum = netxen_get_sts_status(sts_data); | ||
890 | pkt_offset = netxen_get_sts_pkt_offset(sts_data); | ||
891 | |||
892 | netxen_process_rcv(adapter, ring, index, | ||
893 | length, cksum, pkt_offset); | ||
913 | 894 | ||
914 | desc->status_desc_data = cpu_to_le64(STATUS_OWNER_PHANTOM); | 895 | desc->status_desc_data = cpu_to_le64(STATUS_OWNER_PHANTOM); |
915 | 896 | ||
@@ -1019,7 +1000,6 @@ netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid) | |||
1019 | producer = rds_ring->producer; | 1000 | producer = rds_ring->producer; |
1020 | head = &rds_ring->free_list; | 1001 | head = &rds_ring->free_list; |
1021 | 1002 | ||
1022 | /* We can start writing rx descriptors into the phantom memory. */ | ||
1023 | while (!list_empty(head)) { | 1003 | while (!list_empty(head)) { |
1024 | 1004 | ||
1025 | skb = dev_alloc_skb(rds_ring->skb_size); | 1005 | skb = dev_alloc_skb(rds_ring->skb_size); |
@@ -1053,10 +1033,9 @@ netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid) | |||
1053 | 1033 | ||
1054 | producer = get_next_index(producer, rds_ring->num_desc); | 1034 | producer = get_next_index(producer, rds_ring->num_desc); |
1055 | } | 1035 | } |
1056 | /* if we did allocate buffers, then write the count to Phantom */ | 1036 | |
1057 | if (count) { | 1037 | if (count) { |
1058 | rds_ring->producer = producer; | 1038 | rds_ring->producer = producer; |
1059 | /* Window = 1 */ | ||
1060 | adapter->pci_write_normalize(adapter, | 1039 | adapter->pci_write_normalize(adapter, |
1061 | rds_ring->crb_rcv_producer, | 1040 | rds_ring->crb_rcv_producer, |
1062 | (producer-1) & (rds_ring->num_desc-1)); | 1041 | (producer-1) & (rds_ring->num_desc-1)); |
@@ -1099,7 +1078,6 @@ netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, uint32_t ringid) | |||
1099 | 1078 | ||
1100 | producer = rds_ring->producer; | 1079 | producer = rds_ring->producer; |
1101 | head = &rds_ring->free_list; | 1080 | head = &rds_ring->free_list; |
1102 | /* We can start writing rx descriptors into the phantom memory. */ | ||
1103 | while (!list_empty(head)) { | 1081 | while (!list_empty(head)) { |
1104 | 1082 | ||
1105 | skb = dev_alloc_skb(rds_ring->skb_size); | 1083 | skb = dev_alloc_skb(rds_ring->skb_size); |
@@ -1134,10 +1112,8 @@ netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, uint32_t ringid) | |||
1134 | producer = get_next_index(producer, rds_ring->num_desc); | 1112 | producer = get_next_index(producer, rds_ring->num_desc); |
1135 | } | 1113 | } |
1136 | 1114 | ||
1137 | /* if we did allocate buffers, then write the count to Phantom */ | ||
1138 | if (count) { | 1115 | if (count) { |
1139 | rds_ring->producer = producer; | 1116 | rds_ring->producer = producer; |
1140 | /* Window = 1 */ | ||
1141 | adapter->pci_write_normalize(adapter, | 1117 | adapter->pci_write_normalize(adapter, |
1142 | rds_ring->crb_rcv_producer, | 1118 | rds_ring->crb_rcv_producer, |
1143 | (producer - 1) & (rds_ring->num_desc - 1)); | 1119 | (producer - 1) & (rds_ring->num_desc - 1)); |