net/intel: use rte_validate_tx_offload function correctly for i40e/iavf/ice drivers
PATCH 1/1 net/intel: use rte_validate_tx_offload function correctly for i40e/iavf/ice drivers
rte_validate_tx_offload() returns 0 on success.
The i40e, iavf and ice drivers treat any non-zero
return as an error and drop the packet, causing valid packets to be dropped when Tx offload checking is enabled via EAL, e.g.:
-a 81:00.0,mbuf_check=offload
Only reject the packet when the return value is not 0.
--- drivers/net/intel/i40e/i40e_rxtx.c | 2 +- drivers/net/intel/iavf/iavf_rxtx.c | 2 +- drivers/net/intel/ice/ice_rxtx.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/intel/i40e/i40e_rxtx.c +1 -1
@@ -1194,7 +1194,7 @@ i40e_xmit_pkts_check(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pktsbreak ; } -if (!rte_validate_tx_offload (mb)) { +if (rte_validate_tx_offload (mb) !=0 ) {PMD_TX_LOG (ERR ,"INVALID mbuf: TX offload setup error" ); pkt_error = true;break ;
drivers/net/intel/iavf/iavf_rxtx.c +1 -1
@@ -3813,7 +3813,7 @@ iavf_xmit_pkts_check(void *tx_queue, struct rte_mbuf **tx_pkts,break ; } -if (!rte_validate_tx_offload (mb)) { +if (rte_validate_tx_offload (mb) !=0 ) {PMD_TX_LOG (ERR ,"INVALID mbuf: TX offload setup error" ); pkt_error = true;break ;
drivers/net/intel/ice/ice_rxtx.c +1 -1
@@ -3669,7 +3669,7 @@ ice_xmit_pkts_check(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)break ; } -if (!rte_validate_tx_offload (mb)) { +if (rte_validate_tx_offload (mb) !=0 ) {PMD_TX_LOG (ERR ,"INVALID mbuf: TX offload setup error" ); pkt_error = true;break ;
Signature · 1 line
2.54.0
Quoted 2 lines · Omar Munchaev
rte_validate_tx_offload()returns 0 on success.
The i40e, iavf and ice drivers treat any non-zero
s/any non-zero/a zero/
Quoted 7 lines
return as an error and drop the packet, causing valid packets to be dropped when Tx offload checking is enabled via EAL, e.g.:
-a 81:00.0,mbuf_check=offloadOnly reject the packet when the return value is not 0.
Quoted 1 line
Signed-off-by Omar Munchaev <[email protected]>
Fixes look correct to me.
Quoted 48 lines
--- drivers/net/intel/i40e/i40e_rxtx.c | 2 +- drivers/net/intel/iavf/iavf_rxtx.c | 2 +- drivers/net/intel/ice/ice_rxtx.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)drivers/net/intel/i40e/i40e_rxtx.c +1
-1@@ -1194,7 +1194,7 @@ i40e_xmit_pkts_check(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pktsbreak ; } -if (!rte_validate_tx_offload (mb)) { +if (rte_validate_tx_offload (mb) !=0 ) {PMD_TX_LOG (ERR ,"INVALID mbuf: TX offload setup error" ); pkt_error = true;break ;drivers/net/intel/iavf/iavf_rxtx.c +1
-1@@ -3813,7 +3813,7 @@ iavf_xmit_pkts_check(void *tx_queue, struct rte_mbuf **tx_pkts,break ; } -if (!rte_validate_tx_offload (mb)) { +if (rte_validate_tx_offload (mb) !=0 ) {PMD_TX_LOG (ERR ,"INVALID mbuf: TX offload setup error" ); pkt_error = true;break ;drivers/net/intel/ice/ice_rxtx.c +1
-1@@ -3669,7 +3669,7 @@ ice_xmit_pkts_check(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)break ; } -if (!rte_validate_tx_offload (mb)) { +if (rte_validate_tx_offload (mb) !=0 ) {PMD_TX_LOG (ERR ,"INVALID mbuf: TX offload setup error" ); pkt_error = true;break ;Signature · 1 line
2.54.0
Quoted 55 lines · Omar Munchaev
rte_validate_tx_offload()returns 0 on success.
The i40e, iavf and ice drivers treat any non-zero
return as an error and drop the packet, causing valid packets to be dropped when Tx offload checking is enabled via EAL, e.g.:-a 81:00.0,mbuf_check=offloadOnly reject the packet when the return value is not 0.
Signed-off-by Omar Munchaev <[email protected]>--- drivers/net/intel/i40e/i40e_rxtx.c | 2 +- drivers/net/intel/iavf/iavf_rxtx.c | 2 +- drivers/net/intel/ice/ice_rxtx.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)drivers/net/intel/i40e/i40e_rxtx.c +1
-1@@ -1194,7 +1194,7 @@ i40e_xmit_pkts_check(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pktsbreak ; } -if (!rte_validate_tx_offload (mb)) { +if (rte_validate_tx_offload (mb) !=0 ) {PMD_TX_LOG (ERR ,"INVALID mbuf: TX offload setup error" ); pkt_error = true;break ;drivers/net/intel/iavf/iavf_rxtx.c +1
-1@@ -3813,7 +3813,7 @@ iavf_xmit_pkts_check(void *tx_queue, struct rte_mbuf **tx_pkts,break ; } -if (!rte_validate_tx_offload (mb)) { +if (rte_validate_tx_offload (mb) !=0 ) {PMD_TX_LOG (ERR ,"INVALID mbuf: TX offload setup error" ); pkt_error = true;break ;drivers/net/intel/ice/ice_rxtx.c +1
-1@@ -3669,7 +3669,7 @@ ice_xmit_pkts_check(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)break ; } -if (!rte_validate_tx_offload (mb)) { +if (rte_validate_tx_offload (mb) !=0 ) {PMD_TX_LOG (ERR ,"INVALID mbuf: TX offload setup error" ); pkt_error = true;break ;
Signature · 2 lines
Regards, Vladimir