net/dpaa: check multi-segment external buffers
authorHemant Agrawal <hemant.agrawal@nxp.com>
Fri, 19 Jul 2019 10:06:08 +0000 (15:36 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:36 +0000 (14:31 +0200)
This patch add check to return error as the handling
for external buffer packets with SG is currently missing.

Fixes: 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
drivers/net/dpaa/dpaa_rxtx.c

index f16b7e0..30b1836 100644 (file)
@@ -957,6 +957,16 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
                                        goto send_pkts;
                                }
                        } else {
+                               /* TODO not supporting sg for external bufs*/
+                               if (unlikely(mbuf->nb_segs > 1)) {
+                                       /* Set frames_to_send & nb_bufs so
+                                        * that packets are transmitted till
+                                        * previous frame.
+                                        */
+                                       frames_to_send = loop;
+                                       nb_bufs = loop;
+                                       goto send_pkts;
+                               }
                                state = tx_on_external_pool(q, mbuf,
                                                            &fd_arr[loop]);
                                if (unlikely(state)) {