Skip to content

Commit 13d5231

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2019-09-11 This series contains fixes to ixgbe. Alex fixes up the adaptive ITR scheme for ixgbe which could result in a value that was either 0 or something less than 10 which was causing issues with hardware features, like RSC, that do not function well with ITR values that low. Ilya Maximets fixes the ixgbe driver to limit the number of transmit descriptors to clean by the number of transmit descriptors used in the transmit ring, so that the driver does not try to "double" clean the same descriptors. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents af38d07 + bf280c0 commit 13d5231

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2621,7 +2621,7 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector,
26212621
/* 16K ints/sec to 9.2K ints/sec */
26222622
avg_wire_size *= 15;
26232623
avg_wire_size += 11452;
2624-
} else if (avg_wire_size <= 1980) {
2624+
} else if (avg_wire_size < 1968) {
26252625
/* 9.2K ints/sec to 8K ints/sec */
26262626
avg_wire_size *= 5;
26272627
avg_wire_size += 22420;
@@ -2654,6 +2654,8 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector,
26542654
case IXGBE_LINK_SPEED_2_5GB_FULL:
26552655
case IXGBE_LINK_SPEED_1GB_FULL:
26562656
case IXGBE_LINK_SPEED_10_FULL:
2657+
if (avg_wire_size > 8064)
2658+
avg_wire_size = 8064;
26572659
itr += DIV_ROUND_UP(avg_wire_size,
26582660
IXGBE_ITR_ADAPTIVE_MIN_INC * 64) *
26592661
IXGBE_ITR_ADAPTIVE_MIN_INC;

drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -633,19 +633,17 @@ static void ixgbe_clean_xdp_tx_buffer(struct ixgbe_ring *tx_ring,
633633
bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector,
634634
struct ixgbe_ring *tx_ring, int napi_budget)
635635
{
636+
u16 ntc = tx_ring->next_to_clean, ntu = tx_ring->next_to_use;
636637
unsigned int total_packets = 0, total_bytes = 0;
637-
u32 i = tx_ring->next_to_clean, xsk_frames = 0;
638-
unsigned int budget = q_vector->tx.work_limit;
639638
struct xdp_umem *umem = tx_ring->xsk_umem;
640639
union ixgbe_adv_tx_desc *tx_desc;
641640
struct ixgbe_tx_buffer *tx_bi;
642-
bool xmit_done;
641+
u32 xsk_frames = 0;
643642

644-
tx_bi = &tx_ring->tx_buffer_info[i];
645-
tx_desc = IXGBE_TX_DESC(tx_ring, i);
646-
i -= tx_ring->count;
643+
tx_bi = &tx_ring->tx_buffer_info[ntc];
644+
tx_desc = IXGBE_TX_DESC(tx_ring, ntc);
647645

648-
do {
646+
while (ntc != ntu) {
649647
if (!(tx_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD)))
650648
break;
651649

@@ -661,22 +659,18 @@ bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector,
661659

662660
tx_bi++;
663661
tx_desc++;
664-
i++;
665-
if (unlikely(!i)) {
666-
i -= tx_ring->count;
662+
ntc++;
663+
if (unlikely(ntc == tx_ring->count)) {
664+
ntc = 0;
667665
tx_bi = tx_ring->tx_buffer_info;
668666
tx_desc = IXGBE_TX_DESC(tx_ring, 0);
669667
}
670668

671669
/* issue prefetch for next Tx descriptor */
672670
prefetch(tx_desc);
671+
}
673672

674-
/* update budget accounting */
675-
budget--;
676-
} while (likely(budget));
677-
678-
i += tx_ring->count;
679-
tx_ring->next_to_clean = i;
673+
tx_ring->next_to_clean = ntc;
680674

681675
u64_stats_update_begin(&tx_ring->syncp);
682676
tx_ring->stats.bytes += total_bytes;
@@ -688,8 +682,7 @@ bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector,
688682
if (xsk_frames)
689683
xsk_umem_complete_tx(umem, xsk_frames);
690684

691-
xmit_done = ixgbe_xmit_zc(tx_ring, q_vector->tx.work_limit);
692-
return budget > 0 && xmit_done;
685+
return ixgbe_xmit_zc(tx_ring, q_vector->tx.work_limit);
693686
}
694687

695688
int ixgbe_xsk_async_xmit(struct net_device *dev, u32 qid)

0 commit comments

Comments
 (0)