net/iavf: fix driver crash when enable TSO
authorTing Xu <ting.xu@intel.com>
Tue, 16 Jul 2019 16:12:25 +0000 (16:12 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:35 +0000 (14:31 +0200)
The iavf driver crashes when forwarding packets with TSO
enabled. The reason is that the tx context descriptor
configuration is not transferred to tx-ring. This step is
added in this patch.

Fixes: a2b29a7733ef ("net/avf: enable basic Rx Tx")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_rxtx.c

index 2d37c17..d8eb6d2 100644 (file)
@@ -1580,6 +1580,9 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
                        /* Setup TX context descriptor if required */
                        uint64_t cd_type_cmd_tso_mss =
                                IAVF_TX_DESC_DTYPE_CONTEXT;
+                       volatile struct iavf_tx_context_desc *ctx_txd =
+                               (volatile struct iavf_tx_context_desc *)
+                                                       &txr[tx_id];
 
                        txn = &sw_ring[txe->next_id];
                        RTE_MBUF_PREFETCH_TO_FREE(txn->mbuf);
@@ -1593,6 +1596,9 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
                                cd_type_cmd_tso_mss |=
                                        iavf_set_tso_ctx(tx_pkt, tx_offload);
 
+                       ctx_txd->type_cmd_tso_mss =
+                               rte_cpu_to_le_64(cd_type_cmd_tso_mss);
+
                        IAVF_DUMP_TX_DESC(txq, &txr[tx_id], tx_id);
                        txe->last_id = tx_last;
                        tx_id = txe->next_id;