net/i40e: remove redundant number of packets check
For i40e_xmit_pkts_vec_xx function, it checks nb_pkts to ensure nb_pkts does not cross rs_thresh. However, in i40e_xmit_fixed_burst_vec_xx function, this check will be performed again. To improve code, delete this redundant check. Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Signed-off-by: Feifei Wang <feifei.wang2@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
This commit is contained in:
parent
070ef4e6c8
commit
1b73c2d1a1
@ -1523,6 +1523,7 @@ i40e_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
while (nb_pkts) {
|
||||
uint16_t ret, num;
|
||||
|
||||
/* cross rs_thresh boundary is not allowed */
|
||||
num = (uint16_t)RTE_MIN(nb_pkts, txq->tx_rs_thresh);
|
||||
ret = i40e_xmit_fixed_burst_vec(tx_queue, &tx_pkts[nb_tx],
|
||||
num);
|
||||
|
@ -560,9 +560,6 @@ i40e_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
uint64_t rs = I40E_TX_DESC_CMD_RS | I40E_TD_CMD;
|
||||
int i;
|
||||
|
||||
/* cross rx_thresh boundary is not allowed */
|
||||
nb_pkts = RTE_MIN(nb_pkts, txq->tx_rs_thresh);
|
||||
|
||||
if (txq->nb_tx_free < txq->tx_free_thresh)
|
||||
i40e_tx_free_bufs(txq);
|
||||
|
||||
|
@ -766,9 +766,6 @@ i40e_xmit_fixed_burst_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
uint64_t flags = I40E_TD_CMD;
|
||||
uint64_t rs = I40E_TX_DESC_CMD_RS | I40E_TD_CMD;
|
||||
|
||||
/* cross rx_thresh boundary is not allowed */
|
||||
nb_pkts = RTE_MIN(nb_pkts, txq->tx_rs_thresh);
|
||||
|
||||
if (txq->nb_tx_free < txq->tx_free_thresh)
|
||||
i40e_tx_free_bufs(txq);
|
||||
|
||||
@ -832,6 +829,7 @@ i40e_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
while (nb_pkts) {
|
||||
uint16_t ret, num;
|
||||
|
||||
/* cross rs_thresh boundary is not allowed */
|
||||
num = (uint16_t)RTE_MIN(nb_pkts, txq->tx_rs_thresh);
|
||||
ret = i40e_xmit_fixed_burst_vec_avx2(tx_queue, &tx_pkts[nb_tx],
|
||||
num);
|
||||
|
@ -1060,9 +1060,6 @@ i40e_xmit_fixed_burst_vec_avx512(void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
uint64_t flags = I40E_TD_CMD;
|
||||
uint64_t rs = I40E_TX_DESC_CMD_RS | I40E_TD_CMD;
|
||||
|
||||
/* cross rx_thresh boundary is not allowed */
|
||||
nb_pkts = RTE_MIN(nb_pkts, txq->tx_rs_thresh);
|
||||
|
||||
if (txq->nb_tx_free < txq->tx_free_thresh)
|
||||
i40e_tx_free_bufs_avx512(txq);
|
||||
|
||||
@ -1127,6 +1124,7 @@ i40e_xmit_pkts_vec_avx512(void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
while (nb_pkts) {
|
||||
uint16_t ret, num;
|
||||
|
||||
/* cross rs_thresh boundary is not allowed */
|
||||
num = (uint16_t)RTE_MIN(nb_pkts, txq->tx_rs_thresh);
|
||||
ret = i40e_xmit_fixed_burst_vec_avx512
|
||||
(tx_queue, &tx_pkts[nb_tx], num);
|
||||
|
@ -686,9 +686,6 @@ i40e_xmit_fixed_burst_vec(void *__rte_restrict tx_queue,
|
||||
uint64_t rs = I40E_TX_DESC_CMD_RS | I40E_TD_CMD;
|
||||
int i;
|
||||
|
||||
/* cross rx_thresh boundary is not allowed */
|
||||
nb_pkts = RTE_MIN(nb_pkts, txq->tx_rs_thresh);
|
||||
|
||||
if (txq->nb_tx_free < txq->tx_free_thresh)
|
||||
i40e_tx_free_bufs(txq);
|
||||
|
||||
|
@ -709,9 +709,6 @@ i40e_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
uint64_t rs = I40E_TX_DESC_CMD_RS | I40E_TD_CMD;
|
||||
int i;
|
||||
|
||||
/* cross rx_thresh boundary is not allowed */
|
||||
nb_pkts = RTE_MIN(nb_pkts, txq->tx_rs_thresh);
|
||||
|
||||
if (txq->nb_tx_free < txq->tx_free_thresh)
|
||||
i40e_tx_free_bufs(txq);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user