aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFaisal Latif <faisal.latif@intel.com>2009-03-06 18:12:11 -0500
committerRoland Dreier <rolandd@cisco.com>2009-03-06 18:12:11 -0500
commit2869975cfbd58dc6591d8c3ba1f171e7f758be28 (patch)
tree5a664309bcef41dbc79fd12eb87c63f06369b181
parentfd87778cb99429f5e2e041213a5c9c564bbe7b78 (diff)
RDMA/nes: Remove LLTX
NETIF_F_LLTX is deprecated. Remove private TX locking from the driver and remove the NETIF_F_LLTX feature flag. This also fixes a warning in some configs that comes from doing skb_linearize() call in the hard_start_xmit method with IRQs disabled (if HIGHMEM is enabled, skb_linearize() may end up enabling BHs, which is a no-no if hard IRQs are disabled in that context). By getting rid of LLTX, we do not disable IRQs when skb_linearize() is called. Remove the sq_lock as it is not needed for non-LLTX. Fix ethtool not to show the counter for sq_lock. Reported-by: aluno3@poczta.onet.pl Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c5
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.h2
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c140
3 files changed, 63 insertions, 84 deletions
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index 1c5e946ce226..9a51f25c6cee 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -1644,7 +1644,6 @@ int nes_init_nic_qp(struct nes_device *nesdev, struct net_device *netdev)
1644 nesvnic->post_cqp_request = nes_post_cqp_request; 1644 nesvnic->post_cqp_request = nes_post_cqp_request;
1645 nesvnic->mcrq_mcast_filter = NULL; 1645 nesvnic->mcrq_mcast_filter = NULL;
1646 1646
1647 spin_lock_init(&nesvnic->nic.sq_lock);
1648 spin_lock_init(&nesvnic->nic.rq_lock); 1647 spin_lock_init(&nesvnic->nic.rq_lock);
1649 1648
1650 /* setup the RQ */ 1649 /* setup the RQ */
@@ -2632,9 +2631,9 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
2632 } else 2631 } else
2633 break; 2632 break;
2634 } 2633 }
2635 if (skb)
2636 dev_kfree_skb_any(skb);
2637 } 2634 }
2635 if (skb)
2636 dev_kfree_skb_any(skb);
2638 nesnic->sq_tail++; 2637 nesnic->sq_tail++;
2639 nesnic->sq_tail &= nesnic->sq_size-1; 2638 nesnic->sq_tail &= nesnic->sq_size-1;
2640 if (sq_cqes > 128) { 2639 if (sq_cqes > 128) {
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h
index bf7ecfa5f976..f41a8710d2a8 100644
--- a/drivers/infiniband/hw/nes/nes_hw.h
+++ b/drivers/infiniband/hw/nes/nes_hw.h
@@ -876,7 +876,6 @@ struct nes_hw_nic {
876 u8 replenishing_rq; 876 u8 replenishing_rq;
877 u8 reserved; 877 u8 reserved;
878 878
879 spinlock_t sq_lock;
880 spinlock_t rq_lock; 879 spinlock_t rq_lock;
881}; 880};
882 881
@@ -1148,7 +1147,6 @@ struct nes_ib_device;
1148struct nes_vnic { 1147struct nes_vnic {
1149 struct nes_ib_device *nesibdev; 1148 struct nes_ib_device *nesibdev;
1150 u64 sq_full; 1149 u64 sq_full;
1151 u64 sq_locked;
1152 u64 tso_requests; 1150 u64 tso_requests;
1153 u64 segmented_tso_requests; 1151 u64 segmented_tso_requests;
1154 u64 linearized_skbs; 1152 u64 linearized_skbs;
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 8e1d073913ec..025ed9f7d9c2 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -400,8 +400,7 @@ static int nes_nic_send(struct sk_buff *skb, struct net_device *netdev)
400 if (skb_headlen(skb) == skb->len) { 400 if (skb_headlen(skb) == skb->len) {
401 if (skb_headlen(skb) <= NES_FIRST_FRAG_SIZE) { 401 if (skb_headlen(skb) <= NES_FIRST_FRAG_SIZE) {
402 nic_sqe->wqe_words[NES_NIC_SQ_WQE_LENGTH_2_1_IDX] = 0; 402 nic_sqe->wqe_words[NES_NIC_SQ_WQE_LENGTH_2_1_IDX] = 0;
403 nesnic->tx_skb[nesnic->sq_head] = NULL; 403 nesnic->tx_skb[nesnic->sq_head] = skb;
404 dev_kfree_skb(skb);
405 } 404 }
406 } else { 405 } else {
407 /* Deal with Fragments */ 406 /* Deal with Fragments */
@@ -453,7 +452,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
453 u32 wqe_count=1; 452 u32 wqe_count=1;
454 u32 send_rc; 453 u32 send_rc;
455 struct iphdr *iph; 454 struct iphdr *iph;
456 unsigned long flags;
457 __le16 *wqe_fragment_length; 455 __le16 *wqe_fragment_length;
458 u32 nr_frags; 456 u32 nr_frags;
459 u32 original_first_length; 457 u32 original_first_length;
@@ -480,13 +478,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
480 if (netif_queue_stopped(netdev)) 478 if (netif_queue_stopped(netdev))
481 return NETDEV_TX_BUSY; 479 return NETDEV_TX_BUSY;
482 480
483 local_irq_save(flags);
484 if (!spin_trylock(&nesnic->sq_lock)) {
485 local_irq_restore(flags);
486 nesvnic->sq_locked++;
487 return NETDEV_TX_LOCKED;
488 }
489
490 /* Check if SQ is full */ 481 /* Check if SQ is full */
491 if ((((nesnic->sq_tail+(nesnic->sq_size*2))-nesnic->sq_head) & (nesnic->sq_size - 1)) == 1) { 482 if ((((nesnic->sq_tail+(nesnic->sq_size*2))-nesnic->sq_head) & (nesnic->sq_size - 1)) == 1) {
492 if (!netif_queue_stopped(netdev)) { 483 if (!netif_queue_stopped(netdev)) {
@@ -498,7 +489,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
498 } 489 }
499 } 490 }
500 nesvnic->sq_full++; 491 nesvnic->sq_full++;
501 spin_unlock_irqrestore(&nesnic->sq_lock, flags);
502 return NETDEV_TX_BUSY; 492 return NETDEV_TX_BUSY;
503 } 493 }
504 494
@@ -531,7 +521,6 @@ sq_no_longer_full:
531 } 521 }
532 } 522 }
533 nesvnic->sq_full++; 523 nesvnic->sq_full++;
534 spin_unlock_irqrestore(&nesnic->sq_lock, flags);
535 nes_debug(NES_DBG_NIC_TX, "%s: HNIC SQ full- TSO request has too many frags!\n", 524 nes_debug(NES_DBG_NIC_TX, "%s: HNIC SQ full- TSO request has too many frags!\n",
536 netdev->name); 525 netdev->name);
537 return NETDEV_TX_BUSY; 526 return NETDEV_TX_BUSY;
@@ -656,17 +645,13 @@ tso_sq_no_longer_full:
656 skb_set_transport_header(skb, hoffset); 645 skb_set_transport_header(skb, hoffset);
657 skb_set_network_header(skb, nhoffset); 646 skb_set_network_header(skb, nhoffset);
658 send_rc = nes_nic_send(skb, netdev); 647 send_rc = nes_nic_send(skb, netdev);
659 if (send_rc != NETDEV_TX_OK) { 648 if (send_rc != NETDEV_TX_OK)
660 spin_unlock_irqrestore(&nesnic->sq_lock, flags);
661 return NETDEV_TX_OK; 649 return NETDEV_TX_OK;
662 }
663 } 650 }
664 } else { 651 } else {
665 send_rc = nes_nic_send(skb, netdev); 652 send_rc = nes_nic_send(skb, netdev);
666 if (send_rc != NETDEV_TX_OK) { 653 if (send_rc != NETDEV_TX_OK)
667 spin_unlock_irqrestore(&nesnic->sq_lock, flags);
668 return NETDEV_TX_OK; 654 return NETDEV_TX_OK;
669 }
670 } 655 }
671 656
672 barrier(); 657 barrier();
@@ -676,7 +661,6 @@ tso_sq_no_longer_full:
676 (wqe_count << 24) | (1 << 23) | nesvnic->nic.qp_id); 661 (wqe_count << 24) | (1 << 23) | nesvnic->nic.qp_id);
677 662
678 netdev->trans_start = jiffies; 663 netdev->trans_start = jiffies;
679 spin_unlock_irqrestore(&nesnic->sq_lock, flags);
680 664
681 return NETDEV_TX_OK; 665 return NETDEV_TX_OK;
682} 666}
@@ -1012,7 +996,6 @@ static const char nes_ethtool_stringset[][ETH_GSTRING_LEN] = {
1012 "Pause Frames Received", 996 "Pause Frames Received",
1013 "Internal Routing Errors", 997 "Internal Routing Errors",
1014 "SQ SW Dropped SKBs", 998 "SQ SW Dropped SKBs",
1015 "SQ Locked",
1016 "SQ Full", 999 "SQ Full",
1017 "Segmented TSO Requests", 1000 "Segmented TSO Requests",
1018 "Rx Symbol Errors", 1001 "Rx Symbol Errors",
@@ -1129,16 +1112,17 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev,
1129 struct nes_device *nesdev = nesvnic->nesdev; 1112 struct nes_device *nesdev = nesvnic->nesdev;
1130 u32 nic_count; 1113 u32 nic_count;
1131 u32 u32temp; 1114 u32 u32temp;
1115 u32 index = 0;
1132 1116
1133 target_ethtool_stats->n_stats = NES_ETHTOOL_STAT_COUNT; 1117 target_ethtool_stats->n_stats = NES_ETHTOOL_STAT_COUNT;
1134 target_stat_values[0] = nesvnic->nesdev->link_status_interrupts; 1118 target_stat_values[index] = nesvnic->nesdev->link_status_interrupts;
1135 target_stat_values[1] = nesvnic->linearized_skbs; 1119 target_stat_values[++index] = nesvnic->linearized_skbs;
1136 target_stat_values[2] = nesvnic->tso_requests; 1120 target_stat_values[++index] = nesvnic->tso_requests;
1137 1121
1138 u32temp = nes_read_indexed(nesdev, 1122 u32temp = nes_read_indexed(nesdev,
1139 NES_IDX_MAC_TX_PAUSE_FRAMES + (nesvnic->nesdev->mac_index*0x200)); 1123 NES_IDX_MAC_TX_PAUSE_FRAMES + (nesvnic->nesdev->mac_index*0x200));
1140 nesvnic->nesdev->mac_pause_frames_sent += u32temp; 1124 nesvnic->nesdev->mac_pause_frames_sent += u32temp;
1141 target_stat_values[3] = nesvnic->nesdev->mac_pause_frames_sent; 1125 target_stat_values[++index] = nesvnic->nesdev->mac_pause_frames_sent;
1142 1126
1143 u32temp = nes_read_indexed(nesdev, 1127 u32temp = nes_read_indexed(nesdev,
1144 NES_IDX_MAC_RX_PAUSE_FRAMES + (nesvnic->nesdev->mac_index*0x200)); 1128 NES_IDX_MAC_RX_PAUSE_FRAMES + (nesvnic->nesdev->mac_index*0x200));
@@ -1209,60 +1193,59 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev,
1209 nesvnic->endnode_ipv4_tcp_retransmits += u32temp; 1193 nesvnic->endnode_ipv4_tcp_retransmits += u32temp;
1210 } 1194 }
1211 1195
1212 target_stat_values[4] = nesvnic->nesdev->mac_pause_frames_received; 1196 target_stat_values[++index] = nesvnic->nesdev->mac_pause_frames_received;
1213 target_stat_values[5] = nesdev->nesadapter->nic_rx_eth_route_err; 1197 target_stat_values[++index] = nesdev->nesadapter->nic_rx_eth_route_err;
1214 target_stat_values[6] = nesvnic->tx_sw_dropped; 1198 target_stat_values[++index] = nesvnic->tx_sw_dropped;
1215 target_stat_values[7] = nesvnic->sq_locked; 1199 target_stat_values[++index] = nesvnic->sq_full;
1216 target_stat_values[8] = nesvnic->sq_full; 1200 target_stat_values[++index] = nesvnic->segmented_tso_requests;
1217 target_stat_values[9] = nesvnic->segmented_tso_requests; 1201 target_stat_values[++index] = nesvnic->nesdev->mac_rx_symbol_err_frames;
1218 target_stat_values[10] = nesvnic->nesdev->mac_rx_symbol_err_frames; 1202 target_stat_values[++index] = nesvnic->nesdev->mac_rx_jabber_frames;
1219 target_stat_values[11] = nesvnic->nesdev->mac_rx_jabber_frames; 1203 target_stat_values[++index] = nesvnic->nesdev->mac_rx_oversized_frames;
1220 target_stat_values[12] = nesvnic->nesdev->mac_rx_oversized_frames; 1204 target_stat_values[++index] = nesvnic->nesdev->mac_rx_short_frames;
1221 target_stat_values[13] = nesvnic->nesdev->mac_rx_short_frames; 1205 target_stat_values[++index] = nesvnic->endnode_nstat_rx_discard;
1222 target_stat_values[14] = nesvnic->endnode_nstat_rx_discard; 1206 target_stat_values[++index] = nesvnic->endnode_nstat_rx_octets;
1223 target_stat_values[15] = nesvnic->endnode_nstat_rx_octets; 1207 target_stat_values[++index] = nesvnic->endnode_nstat_rx_frames;
1224 target_stat_values[16] = nesvnic->endnode_nstat_rx_frames; 1208 target_stat_values[++index] = nesvnic->endnode_nstat_tx_octets;
1225 target_stat_values[17] = nesvnic->endnode_nstat_tx_octets; 1209 target_stat_values[++index] = nesvnic->endnode_nstat_tx_frames;
1226 target_stat_values[18] = nesvnic->endnode_nstat_tx_frames; 1210 target_stat_values[++index] = mh_detected;
1227 target_stat_values[19] = mh_detected; 1211 target_stat_values[++index] = mh_pauses_sent;
1228 target_stat_values[20] = mh_pauses_sent; 1212 target_stat_values[++index] = nesvnic->endnode_ipv4_tcp_retransmits;
1229 target_stat_values[21] = nesvnic->endnode_ipv4_tcp_retransmits; 1213 target_stat_values[++index] = atomic_read(&cm_connects);
1230 target_stat_values[22] = atomic_read(&cm_connects); 1214 target_stat_values[++index] = atomic_read(&cm_accepts);
1231 target_stat_values[23] = atomic_read(&cm_accepts); 1215 target_stat_values[++index] = atomic_read(&cm_disconnects);
1232 target_stat_values[24] = atomic_read(&cm_disconnects); 1216 target_stat_values[++index] = atomic_read(&cm_connecteds);
1233 target_stat_values[25] = atomic_read(&cm_connecteds); 1217 target_stat_values[++index] = atomic_read(&cm_connect_reqs);
1234 target_stat_values[26] = atomic_read(&cm_connect_reqs); 1218 target_stat_values[++index] = atomic_read(&cm_rejects);
1235 target_stat_values[27] = atomic_read(&cm_rejects); 1219 target_stat_values[++index] = atomic_read(&mod_qp_timouts);
1236 target_stat_values[28] = atomic_read(&mod_qp_timouts); 1220 target_stat_values[++index] = atomic_read(&qps_created);
1237 target_stat_values[29] = atomic_read(&qps_created); 1221 target_stat_values[++index] = atomic_read(&sw_qps_destroyed);
1238 target_stat_values[30] = atomic_read(&sw_qps_destroyed); 1222 target_stat_values[++index] = atomic_read(&qps_destroyed);
1239 target_stat_values[31] = atomic_read(&qps_destroyed); 1223 target_stat_values[++index] = atomic_read(&cm_closes);
1240 target_stat_values[32] = atomic_read(&cm_closes); 1224 target_stat_values[++index] = cm_packets_sent;
1241 target_stat_values[33] = cm_packets_sent; 1225 target_stat_values[++index] = cm_packets_bounced;
1242 target_stat_values[34] = cm_packets_bounced; 1226 target_stat_values[++index] = cm_packets_created;
1243 target_stat_values[35] = cm_packets_created; 1227 target_stat_values[++index] = cm_packets_received;
1244 target_stat_values[36] = cm_packets_received; 1228 target_stat_values[++index] = cm_packets_dropped;
1245 target_stat_values[37] = cm_packets_dropped; 1229 target_stat_values[++index] = cm_packets_retrans;
1246 target_stat_values[38] = cm_packets_retrans; 1230 target_stat_values[++index] = cm_listens_created;
1247 target_stat_values[39] = cm_listens_created; 1231 target_stat_values[++index] = cm_listens_destroyed;
1248 target_stat_values[40] = cm_listens_destroyed; 1232 target_stat_values[++index] = cm_backlog_drops;
1249 target_stat_values[41] = cm_backlog_drops; 1233 target_stat_values[++index] = atomic_read(&cm_loopbacks);
1250 target_stat_values[42] = atomic_read(&cm_loopbacks); 1234 target_stat_values[++index] = atomic_read(&cm_nodes_created);
1251 target_stat_values[43] = atomic_read(&cm_nodes_created); 1235 target_stat_values[++index] = atomic_read(&cm_nodes_destroyed);
1252 target_stat_values[44] = atomic_read(&cm_nodes_destroyed); 1236 target_stat_values[++index] = atomic_read(&cm_accel_dropped_pkts);
1253 target_stat_values[45] = atomic_read(&cm_accel_dropped_pkts); 1237 target_stat_values[++index] = atomic_read(&cm_resets_recvd);
1254 target_stat_values[46] = atomic_read(&cm_resets_recvd); 1238 target_stat_values[++index] = int_mod_timer_init;
1255 target_stat_values[47] = int_mod_timer_init; 1239 target_stat_values[++index] = int_mod_cq_depth_1;
1256 target_stat_values[48] = int_mod_cq_depth_1; 1240 target_stat_values[++index] = int_mod_cq_depth_4;
1257 target_stat_values[49] = int_mod_cq_depth_4; 1241 target_stat_values[++index] = int_mod_cq_depth_16;
1258 target_stat_values[50] = int_mod_cq_depth_16; 1242 target_stat_values[++index] = int_mod_cq_depth_24;
1259 target_stat_values[51] = int_mod_cq_depth_24; 1243 target_stat_values[++index] = int_mod_cq_depth_32;
1260 target_stat_values[52] = int_mod_cq_depth_32; 1244 target_stat_values[++index] = int_mod_cq_depth_128;
1261 target_stat_values[53] = int_mod_cq_depth_128; 1245 target_stat_values[++index] = int_mod_cq_depth_256;
1262 target_stat_values[54] = int_mod_cq_depth_256; 1246 target_stat_values[++index] = nesvnic->lro_mgr.stats.aggregated;
1263 target_stat_values[55] = nesvnic->lro_mgr.stats.aggregated; 1247 target_stat_values[++index] = nesvnic->lro_mgr.stats.flushed;
1264 target_stat_values[56] = nesvnic->lro_mgr.stats.flushed; 1248 target_stat_values[++index] = nesvnic->lro_mgr.stats.no_desc;
1265 target_stat_values[57] = nesvnic->lro_mgr.stats.no_desc;
1266 1249
1267} 1250}
1268 1251
@@ -1616,7 +1599,6 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1616 nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n"); 1599 nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n");
1617 netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 1600 netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1618 netdev->vlan_rx_register = nes_netdev_vlan_rx_register; 1601 netdev->vlan_rx_register = nes_netdev_vlan_rx_register;
1619 netdev->features |= NETIF_F_LLTX;
1620 1602
1621 /* Fill in the port structure */ 1603 /* Fill in the port structure */
1622 nesvnic->netdev = netdev; 1604 nesvnic->netdev = netdev;