@@ -67,8 +67,6 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
67
67
68
68
inline_thold = min (inline_thold , MAX_INLINE );
69
69
70
- spin_lock_init (& ring -> comp_lock );
71
-
72
70
tmp = size * sizeof (struct mlx4_en_tx_info );
73
71
ring -> tx_info = vmalloc (tmp );
74
72
if (!ring -> tx_info )
@@ -377,41 +375,12 @@ void mlx4_en_tx_irq(struct mlx4_cq *mcq)
377
375
{
378
376
struct mlx4_en_cq * cq = container_of (mcq , struct mlx4_en_cq , mcq );
379
377
struct mlx4_en_priv * priv = netdev_priv (cq -> dev );
380
- struct mlx4_en_tx_ring * ring = & priv -> tx_ring [cq -> ring ];
381
378
382
- if (!spin_trylock (& ring -> comp_lock ))
383
- return ;
384
379
mlx4_en_process_tx_cq (cq -> dev , cq );
385
- mod_timer (& cq -> timer , jiffies + 1 );
386
- spin_unlock (& ring -> comp_lock );
380
+ mlx4_en_arm_cq (priv , cq );
387
381
}
388
382
389
383
390
- void mlx4_en_poll_tx_cq (unsigned long data )
391
- {
392
- struct mlx4_en_cq * cq = (struct mlx4_en_cq * ) data ;
393
- struct mlx4_en_priv * priv = netdev_priv (cq -> dev );
394
- struct mlx4_en_tx_ring * ring = & priv -> tx_ring [cq -> ring ];
395
- u32 inflight ;
396
-
397
- INC_PERF_COUNTER (priv -> pstats .tx_poll );
398
-
399
- if (!spin_trylock_irq (& ring -> comp_lock )) {
400
- mod_timer (& cq -> timer , jiffies + MLX4_EN_TX_POLL_TIMEOUT );
401
- return ;
402
- }
403
- mlx4_en_process_tx_cq (cq -> dev , cq );
404
- inflight = (u32 ) (ring -> prod - ring -> cons - ring -> last_nr_txbb );
405
-
406
- /* If there are still packets in flight and the timer has not already
407
- * been scheduled by the Tx routine then schedule it here to guarantee
408
- * completion processing of these packets */
409
- if (inflight && priv -> port_up )
410
- mod_timer (& cq -> timer , jiffies + MLX4_EN_TX_POLL_TIMEOUT );
411
-
412
- spin_unlock_irq (& ring -> comp_lock );
413
- }
414
-
415
384
static struct mlx4_en_tx_desc * mlx4_en_bounce_to_desc (struct mlx4_en_priv * priv ,
416
385
struct mlx4_en_tx_ring * ring ,
417
386
u32 index ,
@@ -440,25 +409,6 @@ static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv,
440
409
return ring -> buf + index * TXBB_SIZE ;
441
410
}
442
411
443
- static inline void mlx4_en_xmit_poll (struct mlx4_en_priv * priv , int tx_ind )
444
- {
445
- struct mlx4_en_cq * cq = & priv -> tx_cq [tx_ind ];
446
- struct mlx4_en_tx_ring * ring = & priv -> tx_ring [tx_ind ];
447
- unsigned long flags ;
448
-
449
- /* If we don't have a pending timer, set one up to catch our recent
450
- post in case the interface becomes idle */
451
- if (!timer_pending (& cq -> timer ))
452
- mod_timer (& cq -> timer , jiffies + MLX4_EN_TX_POLL_TIMEOUT );
453
-
454
- /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */
455
- if ((++ ring -> poll_cnt & (MLX4_EN_TX_POLL_MODER - 1 )) == 0 )
456
- if (spin_trylock_irqsave (& ring -> comp_lock , flags )) {
457
- mlx4_en_process_tx_cq (priv -> dev , cq );
458
- spin_unlock_irqrestore (& ring -> comp_lock , flags );
459
- }
460
- }
461
-
462
412
static int is_inline (struct sk_buff * skb , void * * pfrag )
463
413
{
464
414
void * ptr ;
@@ -590,7 +540,6 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
590
540
struct mlx4_en_priv * priv = netdev_priv (dev );
591
541
struct mlx4_en_dev * mdev = priv -> mdev ;
592
542
struct mlx4_en_tx_ring * ring ;
593
- struct mlx4_en_cq * cq ;
594
543
struct mlx4_en_tx_desc * tx_desc ;
595
544
struct mlx4_wqe_data_seg * data ;
596
545
struct skb_frag_struct * frag ;
@@ -638,9 +587,6 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
638
587
ring -> blocked = 1 ;
639
588
priv -> port_stats .queue_stopped ++ ;
640
589
641
- /* Use interrupts to find out when queue opened */
642
- cq = & priv -> tx_cq [tx_ind ];
643
- mlx4_en_arm_cq (priv , cq );
644
590
return NETDEV_TX_BUSY ;
645
591
}
646
592
@@ -788,9 +734,6 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
788
734
iowrite32be (ring -> doorbell_qpn , ring -> bf .uar -> map + MLX4_SEND_DOORBELL );
789
735
}
790
736
791
- /* Poll CQ here */
792
- mlx4_en_xmit_poll (priv , tx_ind );
793
-
794
737
return NETDEV_TX_OK ;
795
738
796
739
tx_drop :
0 commit comments