patches for DPDK stable branches
 help / color / mirror / Atom feed
* [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

end of thread, other threads:[~2020-05-14  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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 ` [dpdk-stable] [PATCH v1 2/4] net/hinic: the pkt len updates of mbuf fixes Xiaoyun wang

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git