]> git.droids-corp.org - dpdk.git/commitdiff
net/i40e: remove redundant number of packets check
authorFeifei Wang <feifei.wang2@arm.com>
Thu, 3 Mar 2022 01:53:43 +0000 (01:53 +0000)
committerQi Zhang <qi.z.zhang@intel.com>
Mon, 18 Apr 2022 05:47:18 +0000 (07:47 +0200)
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>
drivers/net/i40e/i40e_rxtx.c
drivers/net/i40e/i40e_rxtx_vec_altivec.c
drivers/net/i40e/i40e_rxtx_vec_avx2.c
drivers/net/i40e/i40e_rxtx_vec_avx512.c
drivers/net/i40e/i40e_rxtx_vec_neon.c
drivers/net/i40e/i40e_rxtx_vec_sse.c

index 25a28ecea22c7f667480f35f30959802b613b143..788ffb51c272ad00a7b76ff486f4765e22a0263d 100644 (file)
@@ -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);
index f78ba994f762f5621ba0b3fb6c32f45ee86a162a..825834c5cd81a5e8b5239c47a14244c351f4b3bb 100644 (file)
@@ -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);
 
index c73b2a321b44eaf1247d5fc90a351f578a3cdfa3..761edb9d20b0d44997a500df5c8dd1766947224e 100644 (file)
@@ -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);
index 2e8a3f0df6fda537e00e7c58e9609664d45e1345..60c97d5331f0357a48d3c8b302f479edb842aafa 100644 (file)
@@ -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);
index fa9e6582c58f3577b8b45428fddd1f4f99950dbd..12e6f1cbcbb4f4f085f3967c7532a3897da36b49 100644 (file)
@@ -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);
 
index 3782e8052fc96f53f2be2264626cfa99d1c2958a..bdc979a8399cf83980c68c0426ed94bf4ed47774 100644 (file)
@@ -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);