net/hns3: fix reassembling multiple segment packets in Tx
authorWei Hu (Xavier) <xavier.huwei@huawei.com>
Wed, 1 Jul 2020 11:54:41 +0000 (19:54 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 7 Jul 2020 21:38:26 +0000 (23:38 +0200)
commit6c44219f9907a064049d160d366d98bb840724a6
tree8087f7cf68cdab90df6eda8e437bbf35f43c8d0a
parentdfac40d93edf7dbac8ef41f775daba4e54a39263
net/hns3: fix reassembling multiple segment packets in Tx

Because of the hardware constraints, hns3 network engine doesn't support
sending packets with more than eight fragments. And hns3 pmd driver
tries to reassemble these kind of packets to meet hardware requirements.
Currently, there are two problems:
1) when the input buffer_len * 8 < pkt_len, the packets are impossible
   to be reassembled into 8 Buffer Descriptors. In this case, the
   packets will be passed to hardware, which eventually causes a
   hardware reset.
2) The meta data in origin packets which are required to fill into the
   descriptor haven't been copied into the reassembled pkts.

This patch adds a check for 1) to ensure such packets will be dropped by
driver and copies useful meta data from the origin packets to the
reassembled packets.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
drivers/net/hns3/hns3_rxtx.c