Skip to content

Commit 30065e6

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
ixgbe: Simplify transmit cleanup path
This patch helps to simplify the work being done by the transmit path by removing the unnecessary compares between count and the work limit. Instead we can simplify this by just adding a budget value that will act as a count down from the work limit value. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 471a76d commit 30065e6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -804,13 +804,13 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
804804
struct ixgbe_tx_buffer *tx_buffer;
805805
union ixgbe_adv_tx_desc *tx_desc;
806806
unsigned int total_bytes = 0, total_packets = 0;
807+
u16 budget = q_vector->tx.work_limit;
807808
u16 i = tx_ring->next_to_clean;
808-
u16 count;
809809

810810
tx_buffer = &tx_ring->tx_buffer_info[i];
811811
tx_desc = IXGBE_TX_DESC_ADV(tx_ring, i);
812812

813-
for (count = 0; count < q_vector->tx.work_limit; count++) {
813+
for (; budget; budget--) {
814814
union ixgbe_adv_tx_desc *eop_desc = tx_buffer->next_to_watch;
815815

816816
/* if next_to_watch is not set then there is no work pending */
@@ -891,11 +891,11 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
891891
ixgbe_tx_timeout_reset(adapter);
892892

893893
/* the adapter is about to reset, no point in enabling stuff */
894-
return true;
894+
return budget;
895895
}
896896

897897
#define TX_WAKE_THRESHOLD (DESC_NEEDED * 2)
898-
if (unlikely(count && netif_carrier_ok(tx_ring->netdev) &&
898+
if (unlikely(total_packets && netif_carrier_ok(tx_ring->netdev) &&
899899
(ixgbe_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD))) {
900900
/* Make sure that anybody stopping the queue after this
901901
* sees the new next_to_clean.
@@ -908,7 +908,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
908908
}
909909
}
910910

911-
return count < q_vector->tx.work_limit;
911+
return budget;
912912
}
913913

914914
#ifdef CONFIG_IXGBE_DCA

0 commit comments

Comments
 (0)