* [dpdk-stable] [PATCH v1 1/4] net/hinic: the queues resource free problem fixes
[not found] <cover.1589442278.git.cloud.wangxiaoyun@huawei.com>
@ 2020-05-14 9:29 ` Xiaoyun wang
2020-05-14 9:29 ` [dpdk-stable] [PATCH v1 2/4] net/hinic: the pkt len updates of mbuf fixes Xiaoyun wang
1 sibling, 0 replies; 2+ messages in thread
From: Xiaoyun wang @ 2020-05-14 9:29 UTC (permalink / raw)
To: dev
Cc: ferruh.yigit, bluca, luoxianjun, luoxingyu, zhouguoyang,
shahar.belkar, yin.yinshi, david.yangxiaoliang, zhaohui8,
zhengjingzhou, Xiaoyun wang, stable
Adds tx_queues and rx_queues non-null judgment before free tx or
rx resources, because some app may set tx_queues or rx_queues to
be null before call free resource interfaces, which may cause
a segfault.
Fixes: 64727024d2fd ("net/hinic: add device initialization")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
---
drivers/net/hinic/hinic_pmd_rx.c | 3 ++-
drivers/net/hinic/hinic_pmd_tx.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/hinic/hinic_pmd_rx.c b/drivers/net/hinic/hinic_pmd_rx.c
index 4ca74f0..a49769a 100644
--- a/drivers/net/hinic/hinic_pmd_rx.c
+++ b/drivers/net/hinic/hinic_pmd_rx.c
@@ -413,7 +413,8 @@ void hinic_free_all_rx_resources(struct rte_eth_dev *eth_dev)
HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
for (q_id = 0; q_id < nic_dev->num_rq; q_id++) {
- eth_dev->data->rx_queues[q_id] = NULL;
+ if (eth_dev->data->rx_queues != NULL)
+ eth_dev->data->rx_queues[q_id] = NULL;
if (nic_dev->rxqs[q_id] == NULL)
continue;
diff --git a/drivers/net/hinic/hinic_pmd_tx.c b/drivers/net/hinic/hinic_pmd_tx.c
index 258f2c1..996e0b2 100644
--- a/drivers/net/hinic/hinic_pmd_tx.c
+++ b/drivers/net/hinic/hinic_pmd_tx.c
@@ -1217,7 +1217,8 @@ void hinic_free_all_tx_resources(struct rte_eth_dev *eth_dev)
HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
for (q_id = 0; q_id < nic_dev->num_sq; q_id++) {
- eth_dev->data->tx_queues[q_id] = NULL;
+ if (eth_dev->data->tx_queues != NULL)
+ eth_dev->data->tx_queues[q_id] = NULL;
if (nic_dev->txqs[q_id] == NULL)
continue;
--
1.8.3.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [dpdk-stable] [PATCH v1 2/4] net/hinic: the pkt len updates of mbuf fixes
[not found] <cover.1589442278.git.cloud.wangxiaoyun@huawei.com>
2020-05-14 9:29 ` [dpdk-stable] [PATCH v1 1/4] net/hinic: the queues resource free problem fixes Xiaoyun wang
@ 2020-05-14 9:29 ` Xiaoyun wang
1 sibling, 0 replies; 2+ messages in thread
From: Xiaoyun wang @ 2020-05-14 9:29 UTC (permalink / raw)
To: dev
Cc: ferruh.yigit, bluca, luoxianjun, luoxingyu, zhouguoyang,
shahar.belkar, yin.yinshi, david.yangxiaoliang, zhaohui8,
zhengjingzhou, Xiaoyun wang, stable
When copy a mbuf to a new dst_mbuf, the pkt_len member of
dst_mbuf needs to be updated.
Fixes: 076221c8fe1d ("net/hinic: add Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
---
drivers/net/hinic/hinic_pmd_tx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/hinic/hinic_pmd_tx.c b/drivers/net/hinic/hinic_pmd_tx.c
index 996e0b2..bd39f93 100644
--- a/drivers/net/hinic/hinic_pmd_tx.c
+++ b/drivers/net/hinic/hinic_pmd_tx.c
@@ -313,6 +313,8 @@ static inline struct rte_mbuf *hinic_copy_tx_mbuf(struct hinic_nic_dev *nic_dev,
mbuf = mbuf->next;
}
+ dst_mbuf->pkt_len = dst_mbuf->data_len;
+
return dst_mbuf;
}
--
1.8.3.1
^ permalink raw reply [flat|nested] 2+ messages in thread