@@ -1707,9 +1707,6 @@ rtl8125_tx_clean(struct rtl_hw *hw, struct rtl_tx_queue *txq)
17071707 uint32_t tx_left ;
17081708 uint32_t tx_desc_closed ;
17091709
1710- if (!txq )
1711- return ;
1712-
17131710 if (enable_tx_no_close ) {
17141711 txq -> NextHwDesCloPtr = rtl_get_hw_clo_ptr (txq );
17151712 tx_desc_closed = rtl_fast_mod_mask (txq -> NextHwDesCloPtr -
@@ -1755,9 +1752,6 @@ rtl8168_tx_clean(struct rtl_hw *hw __rte_unused, struct rtl_tx_queue *txq)
17551752 int head = txq -> tx_head ;
17561753 uint16_t desc_freed = 0 ;
17571754
1758- if (!txq )
1759- return ;
1760-
17611755 while (1 ) {
17621756 txd = & txq -> hw_ring [head ];
17631757
@@ -1794,13 +1788,13 @@ static int
17941788rtl8125_tx_done_cleanup (void * tx_queue , uint32_t free_cnt )
17951789{
17961790 struct rtl_tx_queue * txq = tx_queue ;
1797- struct rtl_hw * hw = txq -> hw ;
1798- struct rtl_tx_entry * sw_ring = txq -> sw_ring ;
1791+ struct rtl_hw * hw ;
1792+ struct rtl_tx_entry * sw_ring ;
17991793 struct rtl_tx_entry * txe ;
18001794 struct rtl_tx_desc * txd ;
1801- const uint8_t enable_tx_no_close = hw -> EnableTxNoClose ;
1802- const uint16_t nb_tx_desc = txq -> nb_tx_desc ;
1803- uint16_t head = txq -> tx_head ;
1795+ uint8_t enable_tx_no_close ;
1796+ uint16_t nb_tx_desc ;
1797+ uint16_t head ;
18041798 uint16_t desc_freed = 0 ;
18051799 uint32_t tx_left ;
18061800 uint32_t count = 0 ;
@@ -1810,6 +1804,12 @@ rtl8125_tx_done_cleanup(void *tx_queue, uint32_t free_cnt)
18101804 if (!txq )
18111805 return - ENODEV ;
18121806
1807+ hw = txq -> hw ;
1808+ enable_tx_no_close = hw -> EnableTxNoClose ;
1809+ sw_ring = txq -> sw_ring ;
1810+ nb_tx_desc = txq -> nb_tx_desc ;
1811+ head = txq -> tx_head ;
1812+
18131813 if (enable_tx_no_close ) {
18141814 txq -> NextHwDesCloPtr = rtl_get_hw_clo_ptr (txq );
18151815 tx_desc_closed = rtl_fast_mod_mask (txq -> NextHwDesCloPtr -
@@ -1860,19 +1860,24 @@ static int
18601860rtl8168_tx_done_cleanup (void * tx_queue , uint32_t free_cnt )
18611861{
18621862 struct rtl_tx_queue * txq = tx_queue ;
1863- struct rtl_tx_entry * sw_ring = txq -> sw_ring ;
1863+ struct rtl_tx_entry * sw_ring ;
18641864 struct rtl_tx_entry * txe ;
18651865 struct rtl_tx_desc * txd ;
1866- const uint16_t nb_tx_desc = txq -> nb_tx_desc ;
1867- const int tx_tail = txq -> tx_tail % nb_tx_desc ;
1868- int head = txq -> tx_head ;
1866+ uint16_t nb_tx_desc ;
18691867 uint16_t desc_freed = 0 ;
1870- int count = 0 ;
18711868 uint32_t status ;
1869+ int tx_tail ;
1870+ int head ;
1871+ int count = 0 ;
18721872
18731873 if (!txq )
18741874 return - ENODEV ;
18751875
1876+ sw_ring = txq -> sw_ring ;
1877+ nb_tx_desc = txq -> nb_tx_desc ;
1878+ tx_tail = txq -> tx_tail % nb_tx_desc ;
1879+ head = txq -> tx_head ;
1880+
18761881 while (1 ) {
18771882 txd = & txq -> hw_ring [head ];
18781883
0 commit comments