net/iavf: remove extra check in vector Tx
authorKathleen Capella <kathleen.capella@arm.com>
Tue, 22 Feb 2022 22:48:18 +0000 (22:48 +0000)
committerQi Zhang <qi.z.zhang@intel.com>
Tue, 1 Mar 2022 19:54:53 +0000 (20:54 +0100)
In the vector Tx path, the function iavf_xmit_pkts_vec_xxx compares
nb_pkts and the txq->rs_thresh and passes the minimum of these as an
argument to iavf_xmit_fixed_burst_vec_xxx.
Inside iavf_xmit_fixed_burst_vec_xxx, the same check is performed again.

This patch removes the redundant check from the
iavf_xmit_fixed_burst_vec_xxx function.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_rxtx_vec_avx2.c
drivers/net/iavf/iavf_rxtx_vec_avx512.c
drivers/net/iavf/iavf_rxtx_vec_sse.c

index b6ef1ae..d6243b9 100644 (file)
@@ -1450,9 +1450,6 @@ iavf_xmit_fixed_burst_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
        uint64_t flags = IAVF_TX_DESC_CMD_EOP | IAVF_TX_DESC_CMD_ICRC;
        uint64_t rs = IAVF_TX_DESC_CMD_RS | flags;
 
-       /* cross rx_thresh boundary is not allowed */
-       nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh);
-
        if (txq->nb_free < txq->free_thresh)
                iavf_tx_free_bufs(txq);
 
@@ -1516,6 +1513,7 @@ iavf_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->rs_thresh);
                ret = iavf_xmit_fixed_burst_vec_avx2(tx_queue, &tx_pkts[nb_tx],
                                                     num);
index 6ff38ac..7319d4c 100644 (file)
@@ -1907,9 +1907,6 @@ iavf_xmit_fixed_burst_vec_avx512(void *tx_queue, struct rte_mbuf **tx_pkts,
        uint64_t flags = IAVF_TX_DESC_CMD_EOP | IAVF_TX_DESC_CMD_ICRC;
        uint64_t rs = IAVF_TX_DESC_CMD_RS | flags;
 
-       /* cross rx_thresh boundary is not allowed */
-       nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh);
-
        if (txq->nb_free < txq->free_thresh)
                iavf_tx_free_bufs_avx512(txq);
 
@@ -1975,6 +1972,7 @@ iavf_xmit_pkts_vec_avx512_cmn(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->rs_thresh);
                ret = iavf_xmit_fixed_burst_vec_avx512(tx_queue, &tx_pkts[nb_tx],
                                                       num, offload);
index d582a36..717a227 100644 (file)
@@ -1120,9 +1120,6 @@ iavf_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
        uint64_t rs = IAVF_TX_DESC_CMD_RS | flags;
        int i;
 
-       /* cross rx_thresh boundary is not allowed */
-       nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh);
-
        if (txq->nb_free < txq->free_thresh)
                iavf_tx_free_bufs(txq);
 
@@ -1189,6 +1186,7 @@ iavf_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->rs_thresh);
                ret = iavf_xmit_fixed_burst_vec(tx_queue, &tx_pkts[nb_tx], num);
                nb_tx += ret;