[dpdk-dev] [PATCH] net/i40e: fix mbuf resource leakage problem

2021-08-21 Thread chenqiming_huawei
From: Qiming Chen 

In the i40evf_dev_rx_queue_start function, when the function
i40evf_switch_queue returns failed, the previously requested mbuf resource
is not released.

Fixes: 74b7496b0cb3 ("net/i40e: remove redundant queue id checks")
Cc: sta...@dpdk.org

Signed-off-by: Qiming Chen 
---
 drivers/net/i40e/i40e_ethdev_vf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c 
b/drivers/net/i40e/i40e_ethdev_vf.c
index 0cfe13b7b2..003d41373b 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1822,6 +1822,7 @@ i40evf_dev_rx_queue_start(struct rte_eth_dev *dev, 
uint16_t rx_queue_id)
/* Ready to switch the queue on */
err = i40evf_switch_queue(dev, TRUE, rx_queue_id, TRUE);
if (err) {
+   i40e_rx_queue_release_mbufs(rxq);
PMD_DRV_LOG(ERR, "Failed to switch RX queue %u on",
rx_queue_id);
return err;
-- 
2.30.1.windows.1



[dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem

2021-08-21 Thread chenqiming_huawei
From: Qiming Chen 

In the i40evf_dev_init function, when the MAC memory alloc fails, the
previously initialized vf resource is not released, resulting in leakage.
The patch calls the i40evf_uninit_vf function in the abnormal branch to
release resources.

Fixes: 5c9222058df7 ("i40e: move to drivers/net/")
Cc: sta...@dpdk.org

Signed-off-by: Qiming Chen 
---
 drivers/net/i40e/i40e_ethdev_vf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c 
b/drivers/net/i40e/i40e_ethdev_vf.c
index 003d41373b..f64db72e9a 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1622,6 +1622,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to"
" store MAC addresses",
RTE_ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX);
+   (void)i40evf_uninit_vf(eth_dev);
return -ENOMEM;
}
rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
-- 
2.30.1.windows.1



[dpdk-dev] [PATCH] net/i40e: fix dev startup resource release problem

2021-08-21 Thread chenqiming_huawei
From: Qiming Chen 

In the eth_i40e_dev_init function, the tunnel and ehtertype hash table
resource release interface should be rte_hash_free instead of rte_free,
and the previously registered interrupt handling function also needs to
be removed from the interrupt list. The patch is amended to use the
correct interface to release the hash table resource and release the
interrupt handling function at the same time.

Fixes: 425c3325f0b0 ("net/i40e: store tunnel filter")
5c53c82c8174 ("net/i40e: store flow director filter")
Cc: sta...@dpdk.org

Signed-off-by: Qiming Chen 
---
 drivers/net/i40e/i40e_ethdev.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7b230e2ed1..7a2a8281d2 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1760,12 +1760,14 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void 
*init_params __rte_unused)
return 0;
 
 err_init_fdir_filter_list:
-   rte_free(pf->tunnel.hash_table);
+   rte_hash_free(pf->tunnel.hash_table);
rte_free(pf->tunnel.hash_map);
 err_init_tunnel_filter_list:
-   rte_free(pf->ethertype.hash_table);
+   rte_hash_free(pf->ethertype.hash_table);
rte_free(pf->ethertype.hash_map);
 err_init_ethtype_filter_list:
+   rte_intr_callback_unregister(intr_handle,
+   i40e_dev_interrupt_handler, dev);
rte_free(dev->data->mac_addrs);
dev->data->mac_addrs = NULL;
 err_mac_alloc:
-- 
2.30.1.windows.1



[dpdk-dev] [PATCH] net/i40e: fix dev startup resource release problem

2021-08-21 Thread chenqiming_huawei
From: Qiming Chen 

In the eth_i40e_dev_init function, the tunnel and ehtertype hash table
resource release interface should be rte_hash_free instead of rte_free,
and the previously registered interrupt handling function also needs to
be removed from the interrupt list. The patch is amended to use the
correct interface to release the hash table resource and release the
interrupt handling function at the same time.

Fixes: 425c3325f0b0 ("net/i40e: store tunnel filter")
Fixes: 5c53c82c8174 ("net/i40e: store flow director filter")
Cc: sta...@dpdk.org

Signed-off-by: Qiming Chen 
---
 drivers/net/i40e/i40e_ethdev.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7b230e2ed1..7a2a8281d2 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1760,12 +1760,14 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void 
*init_params __rte_unused)
return 0;
 
 err_init_fdir_filter_list:
-   rte_free(pf->tunnel.hash_table);
+   rte_hash_free(pf->tunnel.hash_table);
rte_free(pf->tunnel.hash_map);
 err_init_tunnel_filter_list:
-   rte_free(pf->ethertype.hash_table);
+   rte_hash_free(pf->ethertype.hash_table);
rte_free(pf->ethertype.hash_map);
 err_init_ethtype_filter_list:
+   rte_intr_callback_unregister(intr_handle,
+   i40e_dev_interrupt_handler, dev);
rte_free(dev->data->mac_addrs);
dev->data->mac_addrs = NULL;
 err_mac_alloc:
-- 
2.30.1.windows.1



Re: [dpdk-dev] [PATCH 21.11 v2 0/3] octeontx build only on 64-bit Linux

2021-08-21 Thread Pavan Nikhilesh Bhagavatula
>On Thu, Mar 25, 2021 at 3:52 PM Thomas Monjalon
> wrote:
>>
>> This is a reorg of the patches from Pavan.
>> It has been discussed that it should wait for DPDK 21.11
>> for ABI compatibility reason.
>>
>> Pavan Nikhilesh (3):
>>   net/thunderx: enable build only on 64-bit Linux
>>   common/octeontx: enable build only on 64-bit Linux
>>   common/octeontx2: enable build only on 64-bit Linux
>>
>>  drivers/common/octeontx/meson.build   |  6 ++
>>  drivers/common/octeontx2/meson.build  |  4 ++--
>>  drivers/compress/octeontx/meson.build |  6 ++
>>  drivers/crypto/octeontx/meson.build   |  7 +--
>>  drivers/event/octeontx/meson.build|  6 ++
>>  drivers/event/octeontx2/meson.build   |  4 ++--
>>  drivers/mempool/octeontx/meson.build  |  5 +++--
>>  drivers/mempool/octeontx2/meson.build |  9 ++---
>>  drivers/net/octeontx/meson.build  |  4 ++--
>>  drivers/net/octeontx2/meson.build | 10 ++
>>  drivers/net/thunderx/meson.build  |  4 ++--
>>  drivers/raw/octeontx2_dma/meson.build | 10 ++
>>  12 files changed, 44 insertions(+), 31 deletions(-)
>
>There were a couple of cleanups (indent etc..) and changes in meson
>files.
>This series does not apply cleanly on the main branch.
>Could you rebase it?

Ack l will rebase it.

>
>I noticed that the net/cnxk driver does not have this check, but it is
>disabled anyway since it depends on common/cnxk.
>Is it worth adding the check for consistency?

Sure I will add checks to cnxk driver family.

Thanks,
Pavan.

>
>
>--
>David Marchand



Re: [dpdk-dev] [DPDK] net/ipn3ke: change function label from EXPERIMENTAL to INTERNAL

2021-08-21 Thread Xu, Rosen
Thanks a lot Ray.

> -Original Message-
> From: Kinsella, Ray 
> Sent: Friday, August 20, 2021 23:39
> To: Yigit, Ferruh ; Xu, Rosen ;
> dev@dpdk.org
> Cc: tho...@monjalon.net; Zhang, Tianfei ; Huang,
> Wei 
> Subject: Re: [DPDK] net/ipn3ke: change function label from EXPERIMENTAL
> to INTERNAL
> 
> 
> 
> On 20/08/2021 14:13, Ferruh Yigit wrote:
> > On 8/19/2021 7:05 AM, Rosen Xu wrote:
> >> 'ipn3ke_bridge_func' is a global variable and it used in net & raw drivers.
> >> It's only used for drivers, so change it from EXPERIMENTAL to INTERNAL.
> >>
> >> Signed-off-by: Rosen Xu 
> >
> > Acked-by: Ferruh Yigit 
> >
> 
> Acked-by: Ray Kinsella