From: Sriharsha Basavapatna <[email protected]>

The function checks if the iova is in the valid range. But this check
is not relevant to external memory; avoid it when external memory is
in use.

Signed-off-by: Sriharsha Basavapatna <[email protected]>
Reviewed-by: Andy Gospodarek <[email protected]>
Reviewed-by: Ajit Khaparde <[email protected]>
Reviewed-by: Ning Wang <[email protected]>
Reviewed-by: Kalesh AP <[email protected]>
Reviewed-by: Somnath Kotur <[email protected]>
---
 drivers/net/bnxt/bnxt_txr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index f88e214790..27758898b0 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -221,8 +221,9 @@ static int bnxt_invalid_mbuf(struct rte_mbuf *mbuf)
        if (unlikely(rte_mbuf_check(mbuf, 1, &reason)))
                return -EINVAL;
 
-       if (unlikely(mbuf->buf_iova < mbuf_size ||
-                    (mbuf->buf_iova != rte_mempool_virt2iova(mbuf) + 
mbuf_size)))
+       if (unlikely(!(mbuf->ol_flags & RTE_MBUF_F_EXTERNAL) &&
+                    (mbuf->buf_iova < mbuf_size ||
+                     (mbuf->buf_iova != rte_mempool_virt2iova(mbuf) + 
mbuf_size))))
                return -EINVAL;
 
        return 0;
-- 
2.39.5 (Apple Git-154)

Reply via email to