diff options
Diffstat (limited to 'drivers/net/netxen/netxen_nic_init.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 37589265297e..485ff9398910 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -1070,16 +1070,17 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | |||
1070 | { | 1070 | { |
1071 | struct pci_dev *pdev = adapter->pdev; | 1071 | struct pci_dev *pdev = adapter->pdev; |
1072 | struct net_device *netdev = adapter->netdev; | 1072 | struct net_device *netdev = adapter->netdev; |
1073 | int index = netxen_get_sts_refhandle(desc); | 1073 | u64 sts_data = le64_to_cpu(desc->status_desc_data); |
1074 | int index = netxen_get_sts_refhandle(sts_data); | ||
1074 | struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]); | 1075 | struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]); |
1075 | struct netxen_rx_buffer *buffer; | 1076 | struct netxen_rx_buffer *buffer; |
1076 | struct sk_buff *skb; | 1077 | struct sk_buff *skb; |
1077 | u32 length = netxen_get_sts_totallength(desc); | 1078 | u32 length = netxen_get_sts_totallength(sts_data); |
1078 | u32 desc_ctx; | 1079 | u32 desc_ctx; |
1079 | struct netxen_rcv_desc_ctx *rcv_desc; | 1080 | struct netxen_rcv_desc_ctx *rcv_desc; |
1080 | int ret; | 1081 | int ret; |
1081 | 1082 | ||
1082 | desc_ctx = netxen_get_sts_type(desc); | 1083 | desc_ctx = netxen_get_sts_type(sts_data); |
1083 | if (unlikely(desc_ctx >= NUM_RCV_DESC_RINGS)) { | 1084 | if (unlikely(desc_ctx >= NUM_RCV_DESC_RINGS)) { |
1084 | printk("%s: %s Bad Rcv descriptor ring\n", | 1085 | printk("%s: %s Bad Rcv descriptor ring\n", |
1085 | netxen_nic_driver_name, netdev->name); | 1086 | netxen_nic_driver_name, netdev->name); |
@@ -1119,7 +1120,7 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | |||
1119 | skb = (struct sk_buff *)buffer->skb; | 1120 | skb = (struct sk_buff *)buffer->skb; |
1120 | 1121 | ||
1121 | if (likely(adapter->rx_csum && | 1122 | if (likely(adapter->rx_csum && |
1122 | netxen_get_sts_status(desc) == STATUS_CKSUM_OK)) { | 1123 | netxen_get_sts_status(sts_data) == STATUS_CKSUM_OK)) { |
1123 | adapter->stats.csummed++; | 1124 | adapter->stats.csummed++; |
1124 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1125 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1125 | } else | 1126 | } else |
@@ -1209,7 +1210,6 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max) | |||
1209 | break; | 1210 | break; |
1210 | } | 1211 | } |
1211 | netxen_process_rcv(adapter, ctxid, desc); | 1212 | netxen_process_rcv(adapter, ctxid, desc); |
1212 | netxen_clear_sts_owner(desc); | ||
1213 | netxen_set_sts_owner(desc, STATUS_OWNER_PHANTOM); | 1213 | netxen_set_sts_owner(desc, STATUS_OWNER_PHANTOM); |
1214 | consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); | 1214 | consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); |
1215 | count++; | 1215 | count++; |
@@ -1248,7 +1248,6 @@ int netxen_process_cmd_ring(unsigned long data) | |||
1248 | struct pci_dev *pdev; | 1248 | struct pci_dev *pdev; |
1249 | struct netxen_skb_frag *frag; | 1249 | struct netxen_skb_frag *frag; |
1250 | u32 i; | 1250 | u32 i; |
1251 | struct sk_buff *skb = NULL; | ||
1252 | int done; | 1251 | int done; |
1253 | 1252 | ||
1254 | spin_lock(&adapter->tx_lock); | 1253 | spin_lock(&adapter->tx_lock); |
@@ -1278,9 +1277,8 @@ int netxen_process_cmd_ring(unsigned long data) | |||
1278 | while ((last_consumer != consumer) && (count1 < MAX_STATUS_HANDLE)) { | 1277 | while ((last_consumer != consumer) && (count1 < MAX_STATUS_HANDLE)) { |
1279 | buffer = &adapter->cmd_buf_arr[last_consumer]; | 1278 | buffer = &adapter->cmd_buf_arr[last_consumer]; |
1280 | pdev = adapter->pdev; | 1279 | pdev = adapter->pdev; |
1281 | frag = &buffer->frag_array[0]; | 1280 | if (buffer->skb) { |
1282 | skb = buffer->skb; | 1281 | frag = &buffer->frag_array[0]; |
1283 | if (skb && (cmpxchg(&buffer->skb, skb, 0) == skb)) { | ||
1284 | pci_unmap_single(pdev, frag->dma, frag->length, | 1282 | pci_unmap_single(pdev, frag->dma, frag->length, |
1285 | PCI_DMA_TODEVICE); | 1283 | PCI_DMA_TODEVICE); |
1286 | frag->dma = 0ULL; | 1284 | frag->dma = 0ULL; |
@@ -1293,8 +1291,8 @@ int netxen_process_cmd_ring(unsigned long data) | |||
1293 | } | 1291 | } |
1294 | 1292 | ||
1295 | adapter->stats.skbfreed++; | 1293 | adapter->stats.skbfreed++; |
1296 | dev_kfree_skb_any(skb); | 1294 | dev_kfree_skb_any(buffer->skb); |
1297 | skb = NULL; | 1295 | buffer->skb = NULL; |
1298 | } else if (adapter->proc_cmd_buf_counter == 1) { | 1296 | } else if (adapter->proc_cmd_buf_counter == 1) { |
1299 | adapter->stats.txnullskb++; | 1297 | adapter->stats.txnullskb++; |
1300 | } | 1298 | } |