[dpdk-test-report] |SUCCESS| pw38395 [PATCH] lib/librte_ip_frag:fix ip frag process log [PATCH v3 1/3] net/i40e: add null point check and fix mem leak++Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>+---+v2:+* Fix code style warning.+---+ drivers/net/i40e/i40e_ethdev.c | 32 +++++++++++++++++++++++++++++++++ drivers/net/i40e/i40e_fdir.c | 7 ++++++++ 2 files changed 39 insertions(+)++diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c+index c4df65d..277c1a8 100644+--- a/drivers/net/i40e/i40e_ethdev.c++++ b/drivers/net/i40e/i40e_ethdev.c+@@ -7188 11 +7188 13 @@ struct i40e_tunnel_filter *+ node = i40e_sw_tunnel_filter_lookup(tunnel_rule &check_filter.input); + if (add && node) {+ PMD_DRV_LOG(ERR "Conflict with existing tunnel rules!"); ++ rte_free(cld_filter); + return -EINVAL; + }+ + if (!add && !node) {+ PMD_DRV_LOG(ERR "There's no corresponding tunnel filter!"); ++ rte_free(cld_filter); + return -EINVAL; + }+ +@@ -7201 16 +7203 26 @@ struct i40e_tunnel_filter *+ vsi->seid &cld_filter->element 1); + if (ret < 0) {+ PMD_DRV_LOG(ERR "Failed to add a tunnel filter."); ++ rte_free(cld_filter); + return -ENOTSUP; + }+ tunnel = rte_zmalloc("tunnel_filter" sizeof(*tunnel) 0); ++ if (tunnel == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory."); ++ rte_free(cld_filter); ++ return -ENOMEM; ++ }+++ rte_memcpy(tunnel &check_filter sizeof(check_filter)); + ret = i40e_sw_tunnel_filter_insert(pf tunnel); ++ if (ret < 0)++ rte_free(tunnel); + } else {+ ret = i40e_aq_remove_cloud_filters(hw vsi->seid + &cld_filter->element 1); + if (ret < 0) {+ PMD_DRV_LOG(ERR "Failed to delete a tunnel filter."); ++ rte_free(cld_filter); + return -ENOTSUP; + }+ ret = i40e_sw_tunnel_filter_del(pf &node->input); +@@ -7639 6 +7651 7 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)+ else {+ if (tunnel_filter->vf_id >= pf->vf_num) {+ PMD_DRV_LOG(ERR "Invalid argument."); ++ rte_free(cld_filter); + return -EINVAL; + }+ vf = &pf->vfs[tunnel_filter->vf_id]; +@@ -7653 11 +7666 13 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)+ node = i40e_sw_tunnel_filter_lookup(tunnel_rule &check_filter.input); + if (add && node) {+ PMD_DRV_LOG(ERR "Conflict with existing tunnel rules!"); ++ rte_free(cld_filter); + return -EINVAL; + }+ + if (!add && !node) {+ PMD_DRV_LOG(ERR "There's no corresponding tunnel filter!"); ++ rte_free(cld_filter); + return -EINVAL; + }+ +@@ -7670 11 +7685 20 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)+ vsi->seid &cld_filter->element 1); + if (ret < 0) {+ PMD_DRV_LOG(ERR "Failed to add a tunnel filter."); ++ rte_free(cld_filter); + return -ENOTSUP; + }+ tunnel = rte_zmalloc("tunnel_filter" sizeof(*tunnel) 0); ++ if (tunnel == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory."); ++ rte_free(cld_filter); ++ return -ENOMEM; ++ }+++ rte_memcpy(tunnel &check_filter sizeof(check_filter)); + ret = i40e_sw_tunnel_filter_insert(pf tunnel); ++ if (ret < 0)++ rte_free(tunnel); + } else {+ if (big_buffer)+ ret = i40e_aq_remove_cloud_filters_big_buffer(+@@ -7684 6 +7708 7 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)+ &cld_filter->element 1); + if (ret < 0) {+ PMD_DRV_LOG(ERR "Failed to delete a tunnel filter."); ++ rte_free(cld_filter); + return -ENOTSUP; + }+ ret = i40e_sw_tunnel_filter_del(pf &node->input); +@@ -9295 9 +9320 16 @@ struct i40e_ethertype_filter *+ if (add) {+ ethertype_filter = rte_zmalloc("ethertype_filter" + sizeof(*ethertype_filter) 0); ++ if (ethertype_filter == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory."); ++ return -ENOMEM; ++ }+++ rte_memcpy(ethertype_filter &check_filter + sizeof(check_filter)); + ret = i40e_sw_ethertype_filter_insert(pf ethertype_filter); ++ if (ret < 0)++ rte_free(ethertype_filter); + } else {+ ret = i40e_sw_ethertype_filter_del(pf &node->input); + }+diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c+index a4320b1..c392dc4 100644+--- a/drivers/net/i40e/i40e_fdir.c++++ b/drivers/net/i40e/i40e_fdir.c+@@ -1595 8 +1595 15 @@ static int i40e_sw_fdir_filter_insert(struct i40e_pf *pf + if (add) {+ fdir_filter = rte_zmalloc("fdir_filter" + sizeof(*fdir_filter) 0); ++ if (fdir_filter == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory."); ++ return -ENOMEM; ++ }+++ rte_memcpy(fdir_filter &check_filter sizeof(check_filter)); + ret = i40e_sw_fdir_filter_insert(pf fdir_filter); ++ if (ret < 0)++ rte_free(fdir_filter); + } else {+ ret = i40e_sw_fdir_filter_del(pf &node->fdir.input); + }+-- +1.8.3.1+diff --git a/v3-0002-net-e1000-add-null-point-check-for-rte_zmalloc.patch b/v3-0002-net-e1000-add-null-point-check-for-rte_zmalloc.patchnew file mode 100644index 0000000..75499b5--- /dev/null+++ b/v3-0002-net-e1000-add-null-point-check-for-rte_zmalloc.patch@@ -0 0 +1 65 @@+From 52be687c63ba0b44fa9a9ddc172e44525279fe8b Mon Sep 17 00:00:00 2001+ [PATCH v3 2/3] net/e1000: add null point check for rte_zmalloc++Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>+---+ drivers/net/e1000/igb_flow.c | 20 +++++++++++++++++++++ 1 file changed 20 insertions(+)++diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c+index d98bdc8..a142759 100644+--- a/drivers/net/e1000/igb_flow.c++++ b/drivers/net/e1000/igb_flow.c+@@ -1413 6 +1413 11 @@+ if (!ret) {+ ntuple_filter_ptr = rte_zmalloc("igb_ntuple_filter" + sizeof(struct igb_ntuple_filter_ele) 0); ++ if (!ntuple_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&ntuple_filter_ptr->filter_info + &ntuple_filter + sizeof(struct rte_eth_ntuple_filter)); +@@ -1435 6 +1440 11 @@+ ethertype_filter_ptr = rte_zmalloc(+ "igb_ethertype_filter" + sizeof(struct igb_ethertype_filter_ele) 0); ++ if (!ethertype_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(ðertype_filter_ptr->filter_info + ðertype_filter + sizeof(struct rte_eth_ethertype_filter)); +@@ -1455 6 +1465 11 @@+ if (!ret) {+ syn_filter_ptr = rte_zmalloc("igb_syn_filter" + sizeof(struct igb_eth_syn_filter_ele) 0); ++ if (!syn_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&syn_filter_ptr->filter_info + &syn_filter + sizeof(struct rte_eth_syn_filter)); +@@ -1476 6 +1491 11 @@+ if (!ret) {+ flex_filter_ptr = rte_zmalloc("igb_flex_filter" + sizeof(struct igb_flex_filter_ele) 0); ++ if (!flex_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&flex_filter_ptr->filter_info + &flex_filter + sizeof(struct rte_eth_flex_filter)); +-- +1.8.3.1+diff --git a/v3-0003-crypto-qat-add-null-point-check-and-fix-mem-leak.patch b/v3-0003-crypto-qat-add-null-point-check-and-fix-mem-leak.patchnew file mode 100644index 0000000..f04d485--- /dev/null+++ b/v3-0003-crypto-qat-add-null-point-check-and-fix-mem-leak.patch@@ -0 0 +1 84 @@+From 492fbb9d1c0afecb7736f360fe278751cfd1b0fc Mon Sep 17 00:00:00 2001+ [PATCH v3 3/3] crypto/qat: add null point check and fix mem leak++There are several func calls to rte_zmalloc() which don't do null+point check on the return value. And before return the memory is not+freed. Fix it by adding null point check and rte_free().++Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>+---+v3:+* Rebase on master and modify again.+v2:+* Fix code style warning.+---+ drivers/crypto/qat/qat_adf/qat_algs_build_desc.c | 10 +++++++++++ drivers/crypto/qat/qat_qp.c | 8 +++++++-+ 2 files changed 17 insertions(+) 1 deletion(-)++diff --git a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c+index db6c9a3..26f854c 100644+--- a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c++++ b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c+@@ -359 6 +359 11 @@ static int qat_alg_do_precomputes(enum icp_qat_hw_auth_algo hash_alg + + in = rte_zmalloc("working mem for key" + ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ 16); ++ if (in == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory"); ++ return -ENOMEM; ++ }+++ rte_memcpy(in qat_aes_xcbc_key_seed + ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ); + for (x = 0; x < HASH_XCBC_PRECOMP_KEY_NUM; x++) {+@@ -389 6 +394 11 @@ static int qat_alg_do_precomputes(enum icp_qat_hw_auth_algo hash_alg + ICP_QAT_HW_GALOIS_E_CTR0_SZ); + in = rte_zmalloc("working mem for key" + ICP_QAT_HW_GALOIS_H_SZ 16); ++ if (in == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory"); ++ return -ENOMEM; ++ }+++ memset(in 0 ICP_QAT_HW_GALOIS_H_SZ); + if (AES_set_encrypt_key(auth_key auth_keylen << 3 + &enc_key) != 0) {+diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c+index 0941a58..812dce9 100644+--- a/drivers/crypto/qat/qat_qp.c++++ b/drivers/crypto/qat/qat_qp.c+@@ -151 6 +151 11 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + qp->op_cookies = rte_zmalloc("qat PMD op cookie pointer" + qp_conf->nb_descriptors * sizeof(*qp->op_cookies) + RTE_CACHE_LINE_SIZE); ++ if (qp->op_cookies == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc mem for cookie"); ++ rte_free(qp); ++ return -ENOMEM; ++ }+ + qp->mmap_bar_addr = pci_dev->mem_resource[0].addr; + qp->inflights16 = 0; +@@ -192 7 +197 7 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + for (i = 0; i < qp->nb_descriptors; i++) {+ if (rte_mempool_get(qp->op_cookie_pool &qp->op_cookies[i])) {+ PMD_DRV_LOG(ERR "QAT PMD Cannot get op_cookie"); +- return -EFAULT; ++ goto create_err; + }+ + struct qat_crypto_op_cookie *sql_cookie =+@@ -217 6 +222 7 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + return 0; + + create_err:++ rte_free(qp->op_cookies); + rte_free(qp); + return -EFAULT; + }+-- +1.8.3.1+diff --git a/v4-0001-crypto-qat-add-null-point-check-and-fix-mem-leak.patch b/v4-0001-crypto-qat-add-null-point-check-and-fix-mem-leak.patchnew file mode 100644index 0000000..2e2dc2c--- /dev/null+++ b/v4-0001-crypto-qat-add-null-point-check-and-fix-mem-leak.patch@@ -0 0 +1 92 @@+From 50a235000e02d5e1135ae9ed82809b62027f2fb2 Mon Sep 17 00:00:00 2001+ [PATCH v4] crypto/qat: add null point check and fix mem leak++There are several func calls to rte_zmalloc() which don't do null+point check on the return value. And before return the memory is not+freed. Fix it by adding null point check and rte_free().++Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")+Fixes: e09231eaa2af ("crypto/qat: add SGL capability")++Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>+---+v4:+* Cover errors that happen after the rte_mempool_create.+* Add fix information.+v3:+* Rebase on master and modify again.+v2:+* Fix code style warning.+---+ drivers/crypto/qat/qat_adf/qat_algs_build_desc.c | 10 +++++++++++ drivers/crypto/qat/qat_qp.c | 10 +++++++++-+ 2 files changed 19 insertions(+) 1 deletion(-)++diff --git a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c+index db6c9a3..26f854c 100644+--- a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c++++ b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c+@@ -359 6 +359 11 @@ static int qat_alg_do_precomputes(enum icp_qat_hw_auth_algo hash_alg + + in = rte_zmalloc("working mem for key" + ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ 16); ++ if (in == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory"); ++ return -ENOMEM; ++ }+++ rte_memcpy(in qat_aes_xcbc_key_seed + ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ); + for (x = 0; x < HASH_XCBC_PRECOMP_KEY_NUM; x++) {+@@ -389 6 +394 11 @@ static int qat_alg_do_precomputes(enum icp_qat_hw_auth_algo hash_alg + ICP_QAT_HW_GALOIS_E_CTR0_SZ); + in = rte_zmalloc("working mem for key" + ICP_QAT_HW_GALOIS_H_SZ 16); ++ if (in == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory"); ++ return -ENOMEM; ++ }+++ memset(in 0 ICP_QAT_HW_GALOIS_H_SZ); + if (AES_set_encrypt_key(auth_key auth_keylen << 3 + &enc_key) != 0) {+diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c+index 0941a58..87b9ce0 100644+--- a/drivers/crypto/qat/qat_qp.c++++ b/drivers/crypto/qat/qat_qp.c+@@ -151 6 +151 11 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + qp->op_cookies = rte_zmalloc("qat PMD op cookie pointer" + qp_conf->nb_descriptors * sizeof(*qp->op_cookies) + RTE_CACHE_LINE_SIZE); ++ if (qp->op_cookies == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc mem for cookie"); ++ rte_free(qp); ++ return -ENOMEM; ++ }+ + qp->mmap_bar_addr = pci_dev->mem_resource[0].addr; + qp->inflights16 = 0; +@@ -192 7 +197 7 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + for (i = 0; i < qp->nb_descriptors; i++) {+ if (rte_mempool_get(qp->op_cookie_pool &qp->op_cookies[i])) {+ PMD_DRV_LOG(ERR "QAT PMD Cannot get op_cookie"); +- return -EFAULT; ++ goto create_err; + }+ + struct qat_crypto_op_cookie *sql_cookie =+@@ -217 6 +222 9 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + return 0; + + create_err:++ if (qp->op_cookie_pool)++ rte_mempool_free(qp->op_cookie_pool); ++ rte_free(qp->op_cookies); + rte_free(qp); + return -EFAULT; + }+-- +1.8.3.1+diff --git a/v4-0001-net-e1000-add-null-point-check-for-rte_zmalloc.patch b/v4-0001-net-e1000-add-null-point-check-for-rte_zmalloc.patchnew file mode 100644index 0000000..6f43da0--- /dev/null+++ b/v4-0001-net-e1000-add-null-point-check-for-rte_zmalloc.patch@@ -0 0 +1 77 @@+From be7c61f3b6b580b9c83bde2b4016fda38be2057a Mon Sep 17 00:00:00 2001+ [PATCH v4] net/e1000: add null point check for rte_zmalloc++There are several func calls to rte_zmalloc() which don't do null+point check on the return value. Fix it by adding null point check.++Fixes: 22bb13410cb2 ("net/igb: create consistent filter")++Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>+---+v4:+* Add description and fix information.+v3:+* Rebase on master and modify again.+v2:+* Fix code style warning.+---+ drivers/net/e1000/igb_flow.c | 20 +++++++++++++++++++++ 1 file changed 20 insertions(+)++diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c+index d98bdc8..a142759 100644+--- a/drivers/net/e1000/igb_flow.c++++ b/drivers/net/e1000/igb_flow.c+@@ -1413 6 +1413 11 @@+ if (!ret) {+ ntuple_filter_ptr = rte_zmalloc("igb_ntuple_filter" + sizeof(struct igb_ntuple_filter_ele) 0); ++ if (!ntuple_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&ntuple_filter_ptr->filter_info + &ntuple_filter + sizeof(struct rte_eth_ntuple_filter)); +@@ -1435 6 +1440 11 @@+ ethertype_filter_ptr = rte_zmalloc(+ "igb_ethertype_filter" + sizeof(struct igb_ethertype_filter_ele) 0); ++ if (!ethertype_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(ðertype_filter_ptr->filter_info + ðertype_filter + sizeof(struct rte_eth_ethertype_filter)); +@@ -1455 6 +1465 11 @@+ if (!ret) {+ syn_filter_ptr = rte_zmalloc("igb_syn_filter" + sizeof(struct igb_eth_syn_filter_ele) 0); ++ if (!syn_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&syn_filter_ptr->filter_info + &syn_filter + sizeof(struct rte_eth_syn_filter)); +@@ -1476 6 +1491 11 @@+ if (!ret) {+ flex_filter_ptr = rte_zmalloc("igb_flex_filter" + sizeof(struct igb_flex_filter_ele) 0); ++ if (!flex_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&flex_filter_ptr->filter_info + &flex_filter + sizeof(struct rte_eth_flex_filter)); +-- +1.8.3.1+diff --git a/v4-0001-net-i40e-add-null-point-check-and-fix-mem-leak.patch b/v4-0001-net-i40e-add-null-point-check-and-fix-mem-leak.patchnew file mode 100644index 0000000..a96d952--- /dev/null+++ b/v4-0001-net-i40e-add-null-point-check-and-fix-mem-leak.patch@@ -0 0 +1 163 @@+From 8624ca94b94a0f222ca64a93af33d977ea0a004d Mon Sep 17 00:00:00 2001+ - sys_stv From: sys_stv@intel.com
To: test-report@dpdk.org
Subject: [dpdk-test-report] |SUCCESS| pw38395 [PATCH] lib/librte_ip_frag:fix ip frag process log [PATCH v3 1/3] net/i40e: add null point check and fix mem leak++Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>+---+v2:+* Fix code style warning.+---+ drivers/net/i40e/i40e_ethdev.c | 32 +++++++++++++++++++++++++++++++++ drivers/net/i40e/i40e_fdir.c | 7 ++++++++ 2 files changed 39 insertions(+)++diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c+index c4df65d..277c1a8 100644+--- a/drivers/net/i40e/i40e_ethdev.c++++ b/drivers/net/i40e/i40e_ethdev.c+@@ -7188 11 +7188 13 @@ struct i40e_tunnel_filter *+ node = i40e_sw_tunnel_filter_lookup(tunnel_rule &check_filter.input); + if (add && node) {+ PMD_DRV_LOG(ERR "Conflict with existing tunnel rules!"); ++ rte_free(cld_filter); + return -EINVAL; + }+ + if (!add && !node) {+ PMD_DRV_LOG(ERR "There's no corresponding tunnel filter!"); ++ rte_free(cld_filter); + return -EINVAL; + }+ +@@ -7201 16 +7203 26 @@ struct i40e_tunnel_filter *+ vsi->seid &cld_filter->element 1); + if (ret < 0) {+ PMD_DRV_LOG(ERR "Failed to add a tunnel filter."); ++ rte_free(cld_filter); + return -ENOTSUP; + }+ tunnel = rte_zmalloc("tunnel_filter" sizeof(*tunnel) 0); ++ if (tunnel == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory."); ++ rte_free(cld_filter); ++ return -ENOMEM; ++ }+++ rte_memcpy(tunnel &check_filter sizeof(check_filter)); + ret = i40e_sw_tunnel_filter_insert(pf tunnel); ++ if (ret < 0)++ rte_free(tunnel); + } else {+ ret = i40e_aq_remove_cloud_filters(hw vsi->seid + &cld_filter->element 1); + if (ret < 0) {+ PMD_DRV_LOG(ERR "Failed to delete a tunnel filter."); ++ rte_free(cld_filter); + return -ENOTSUP; + }+ ret = i40e_sw_tunnel_filter_del(pf &node->input); +@@ -7639 6 +7651 7 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)+ else {+ if (tunnel_filter->vf_id >= pf->vf_num) {+ PMD_DRV_LOG(ERR "Invalid argument."); ++ rte_free(cld_filter); + return -EINVAL; + }+ vf = &pf->vfs[tunnel_filter->vf_id]; +@@ -7653 11 +7666 13 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)+ node = i40e_sw_tunnel_filter_lookup(tunnel_rule &check_filter.input); + if (add && node) {+ PMD_DRV_LOG(ERR "Conflict with existing tunnel rules!"); ++ rte_free(cld_filter); + return -EINVAL; + }+ + if (!add && !node) {+ PMD_DRV_LOG(ERR "There's no corresponding tunnel filter!"); ++ rte_free(cld_filter); + return -EINVAL; + }+ +@@ -7670 11 +7685 20 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)+ vsi->seid &cld_filter->element 1); + if (ret < 0) {+ PMD_DRV_LOG(ERR "Failed to add a tunnel filter."); ++ rte_free(cld_filter); + return -ENOTSUP; + }+ tunnel = rte_zmalloc("tunnel_filter" sizeof(*tunnel) 0); ++ if (tunnel == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory."); ++ rte_free(cld_filter); ++ return -ENOMEM; ++ }+++ rte_memcpy(tunnel &check_filter sizeof(check_filter)); + ret = i40e_sw_tunnel_filter_insert(pf tunnel); ++ if (ret < 0)++ rte_free(tunnel); + } else {+ if (big_buffer)+ ret = i40e_aq_remove_cloud_filters_big_buffer(+@@ -7684 6 +7708 7 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)+ &cld_filter->element 1); + if (ret < 0) {+ PMD_DRV_LOG(ERR "Failed to delete a tunnel filter."); ++ rte_free(cld_filter); + return -ENOTSUP; + }+ ret = i40e_sw_tunnel_filter_del(pf &node->input); +@@ -9295 9 +9320 16 @@ struct i40e_ethertype_filter *+ if (add) {+ ethertype_filter = rte_zmalloc("ethertype_filter" + sizeof(*ethertype_filter) 0); ++ if (ethertype_filter == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory."); ++ return -ENOMEM; ++ }+++ rte_memcpy(ethertype_filter &check_filter + sizeof(check_filter)); + ret = i40e_sw_ethertype_filter_insert(pf ethertype_filter); ++ if (ret < 0)++ rte_free(ethertype_filter); + } else {+ ret = i40e_sw_ethertype_filter_del(pf &node->input); + }+diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c+index a4320b1..c392dc4 100644+--- a/drivers/net/i40e/i40e_fdir.c++++ b/drivers/net/i40e/i40e_fdir.c+@@ -1595 8 +1595 15 @@ static int i40e_sw_fdir_filter_insert(struct i40e_pf *pf + if (add) {+ fdir_filter = rte_zmalloc("fdir_filter" + sizeof(*fdir_filter) 0); ++ if (fdir_filter == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory."); ++ return -ENOMEM; ++ }+++ rte_memcpy(fdir_filter &check_filter sizeof(check_filter)); + ret = i40e_sw_fdir_filter_insert(pf fdir_filter); ++ if (ret < 0)++ rte_free(fdir_filter); + } else {+ ret = i40e_sw_fdir_filter_del(pf &node->fdir.input); + }+-- +1.8.3.1+diff --git a/v3-0002-net-e1000-add-null-point-check-for-rte_zmalloc.patch b/v3-0002-net-e1000-add-null-point-check-for-rte_zmalloc.patchnew file mode 100644index 0000000..75499b5--- /dev/null+++ b/v3-0002-net-e1000-add-null-point-check-for-rte_zmalloc.patch@@ -0 0 +1 65 @@+From 52be687c63ba0b44fa9a9ddc172e44525279fe8b Mon Sep 17 00:00:00 2001+ [PATCH v3 2/3] net/e1000: add null point check for rte_zmalloc++Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>+---+ drivers/net/e1000/igb_flow.c | 20 +++++++++++++++++++++ 1 file changed 20 insertions(+)++diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c+index d98bdc8..a142759 100644+--- a/drivers/net/e1000/igb_flow.c++++ b/drivers/net/e1000/igb_flow.c+@@ -1413 6 +1413 11 @@+ if (!ret) {+ ntuple_filter_ptr = rte_zmalloc("igb_ntuple_filter" + sizeof(struct igb_ntuple_filter_ele) 0); ++ if (!ntuple_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&ntuple_filter_ptr->filter_info + &ntuple_filter + sizeof(struct rte_eth_ntuple_filter)); +@@ -1435 6 +1440 11 @@+ ethertype_filter_ptr = rte_zmalloc(+ "igb_ethertype_filter" + sizeof(struct igb_ethertype_filter_ele) 0); ++ if (!ethertype_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(ðertype_filter_ptr->filter_info + ðertype_filter + sizeof(struct rte_eth_ethertype_filter)); +@@ -1455 6 +1465 11 @@+ if (!ret) {+ syn_filter_ptr = rte_zmalloc("igb_syn_filter" + sizeof(struct igb_eth_syn_filter_ele) 0); ++ if (!syn_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&syn_filter_ptr->filter_info + &syn_filter + sizeof(struct rte_eth_syn_filter)); +@@ -1476 6 +1491 11 @@+ if (!ret) {+ flex_filter_ptr = rte_zmalloc("igb_flex_filter" + sizeof(struct igb_flex_filter_ele) 0); ++ if (!flex_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&flex_filter_ptr->filter_info + &flex_filter + sizeof(struct rte_eth_flex_filter)); +-- +1.8.3.1+diff --git a/v3-0003-crypto-qat-add-null-point-check-and-fix-mem-leak.patch b/v3-0003-crypto-qat-add-null-point-check-and-fix-mem-leak.patchnew file mode 100644index 0000000..f04d485--- /dev/null+++ b/v3-0003-crypto-qat-add-null-point-check-and-fix-mem-leak.patch@@ -0 0 +1 84 @@+From 492fbb9d1c0afecb7736f360fe278751cfd1b0fc Mon Sep 17 00:00:00 2001+ [PATCH v3 3/3] crypto/qat: add null point check and fix mem leak++There are several func calls to rte_zmalloc() which don't do null+point check on the return value. And before return the memory is not+freed. Fix it by adding null point check and rte_free().++Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>+---+v3:+* Rebase on master and modify again.+v2:+* Fix code style warning.+---+ drivers/crypto/qat/qat_adf/qat_algs_build_desc.c | 10 +++++++++++ drivers/crypto/qat/qat_qp.c | 8 +++++++-+ 2 files changed 17 insertions(+) 1 deletion(-)++diff --git a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c+index db6c9a3..26f854c 100644+--- a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c++++ b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c+@@ -359 6 +359 11 @@ static int qat_alg_do_precomputes(enum icp_qat_hw_auth_algo hash_alg + + in = rte_zmalloc("working mem for key" + ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ 16); ++ if (in == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory"); ++ return -ENOMEM; ++ }+++ rte_memcpy(in qat_aes_xcbc_key_seed + ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ); + for (x = 0; x < HASH_XCBC_PRECOMP_KEY_NUM; x++) {+@@ -389 6 +394 11 @@ static int qat_alg_do_precomputes(enum icp_qat_hw_auth_algo hash_alg + ICP_QAT_HW_GALOIS_E_CTR0_SZ); + in = rte_zmalloc("working mem for key" + ICP_QAT_HW_GALOIS_H_SZ 16); ++ if (in == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory"); ++ return -ENOMEM; ++ }+++ memset(in 0 ICP_QAT_HW_GALOIS_H_SZ); + if (AES_set_encrypt_key(auth_key auth_keylen << 3 + &enc_key) != 0) {+diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c+index 0941a58..812dce9 100644+--- a/drivers/crypto/qat/qat_qp.c++++ b/drivers/crypto/qat/qat_qp.c+@@ -151 6 +151 11 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + qp->op_cookies = rte_zmalloc("qat PMD op cookie pointer" + qp_conf->nb_descriptors * sizeof(*qp->op_cookies) + RTE_CACHE_LINE_SIZE); ++ if (qp->op_cookies == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc mem for cookie"); ++ rte_free(qp); ++ return -ENOMEM; ++ }+ + qp->mmap_bar_addr = pci_dev->mem_resource[0].addr; + qp->inflights16 = 0; +@@ -192 7 +197 7 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + for (i = 0; i < qp->nb_descriptors; i++) {+ if (rte_mempool_get(qp->op_cookie_pool &qp->op_cookies[i])) {+ PMD_DRV_LOG(ERR "QAT PMD Cannot get op_cookie"); +- return -EFAULT; ++ goto create_err; + }+ + struct qat_crypto_op_cookie *sql_cookie =+@@ -217 6 +222 7 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + return 0; + + create_err:++ rte_free(qp->op_cookies); + rte_free(qp); + return -EFAULT; + }+-- +1.8.3.1+diff --git a/v4-0001-crypto-qat-add-null-point-check-and-fix-mem-leak.patch b/v4-0001-crypto-qat-add-null-point-check-and-fix-mem-leak.patchnew file mode 100644index 0000000..2e2dc2c--- /dev/null+++ b/v4-0001-crypto-qat-add-null-point-check-and-fix-mem-leak.patch@@ -0 0 +1 92 @@+From 50a235000e02d5e1135ae9ed82809b62027f2fb2 Mon Sep 17 00:00:00 2001+ [PATCH v4] crypto/qat: add null point check and fix mem leak++There are several func calls to rte_zmalloc() which don't do null+point check on the return value. And before return the memory is not+freed. Fix it by adding null point check and rte_free().++Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")+Fixes: e09231eaa2af ("crypto/qat: add SGL capability")++Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>+---+v4:+* Cover errors that happen after the rte_mempool_create.+* Add fix information.+v3:+* Rebase on master and modify again.+v2:+* Fix code style warning.+---+ drivers/crypto/qat/qat_adf/qat_algs_build_desc.c | 10 +++++++++++ drivers/crypto/qat/qat_qp.c | 10 +++++++++-+ 2 files changed 19 insertions(+) 1 deletion(-)++diff --git a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c+index db6c9a3..26f854c 100644+--- a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c++++ b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c+@@ -359 6 +359 11 @@ static int qat_alg_do_precomputes(enum icp_qat_hw_auth_algo hash_alg + + in = rte_zmalloc("working mem for key" + ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ 16); ++ if (in == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory"); ++ return -ENOMEM; ++ }+++ rte_memcpy(in qat_aes_xcbc_key_seed + ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ); + for (x = 0; x < HASH_XCBC_PRECOMP_KEY_NUM; x++) {+@@ -389 6 +394 11 @@ static int qat_alg_do_precomputes(enum icp_qat_hw_auth_algo hash_alg + ICP_QAT_HW_GALOIS_E_CTR0_SZ); + in = rte_zmalloc("working mem for key" + ICP_QAT_HW_GALOIS_H_SZ 16); ++ if (in == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc memory"); ++ return -ENOMEM; ++ }+++ memset(in 0 ICP_QAT_HW_GALOIS_H_SZ); + if (AES_set_encrypt_key(auth_key auth_keylen << 3 + &enc_key) != 0) {+diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c+index 0941a58..87b9ce0 100644+--- a/drivers/crypto/qat/qat_qp.c++++ b/drivers/crypto/qat/qat_qp.c+@@ -151 6 +151 11 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + qp->op_cookies = rte_zmalloc("qat PMD op cookie pointer" + qp_conf->nb_descriptors * sizeof(*qp->op_cookies) + RTE_CACHE_LINE_SIZE); ++ if (qp->op_cookies == NULL) {++ PMD_DRV_LOG(ERR "Failed to alloc mem for cookie"); ++ rte_free(qp); ++ return -ENOMEM; ++ }+ + qp->mmap_bar_addr = pci_dev->mem_resource[0].addr; + qp->inflights16 = 0; +@@ -192 7 +197 7 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + for (i = 0; i < qp->nb_descriptors; i++) {+ if (rte_mempool_get(qp->op_cookie_pool &qp->op_cookies[i])) {+ PMD_DRV_LOG(ERR "QAT PMD Cannot get op_cookie"); +- return -EFAULT; ++ goto create_err; + }+ + struct qat_crypto_op_cookie *sql_cookie =+@@ -217 6 +222 9 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev uint16_t queue_pair_id + return 0; + + create_err:++ if (qp->op_cookie_pool)++ rte_mempool_free(qp->op_cookie_pool); ++ rte_free(qp->op_cookies); + rte_free(qp); + return -EFAULT; + }+-- +1.8.3.1+diff --git a/v4-0001-net-e1000-add-null-point-check-for-rte_zmalloc.patch b/v4-0001-net-e1000-add-null-point-check-for-rte_zmalloc.patchnew file mode 100644index 0000000..6f43da0--- /dev/null+++ b/v4-0001-net-e1000-add-null-point-check-for-rte_zmalloc.patch@@ -0 0 +1 77 @@+From be7c61f3b6b580b9c83bde2b4016fda38be2057a Mon Sep 17 00:00:00 2001+ [PATCH v4] net/e1000: add null point check for rte_zmalloc++There are several func calls to rte_zmalloc() which don't do null+point check on the return value. Fix it by adding null point check.++Fixes: 22bb13410cb2 ("net/igb: create consistent filter")++Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>+---+v4:+* Add description and fix information.+v3:+* Rebase on master and modify again.+v2:+* Fix code style warning.+---+ drivers/net/e1000/igb_flow.c | 20 +++++++++++++++++++++ 1 file changed 20 insertions(+)++diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c+index d98bdc8..a142759 100644+--- a/drivers/net/e1000/igb_flow.c++++ b/drivers/net/e1000/igb_flow.c+@@ -1413 6 +1413 11 @@+ if (!ret) {+ ntuple_filter_ptr = rte_zmalloc("igb_ntuple_filter" + sizeof(struct igb_ntuple_filter_ele) 0); ++ if (!ntuple_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&ntuple_filter_ptr->filter_info + &ntuple_filter + sizeof(struct rte_eth_ntuple_filter)); +@@ -1435 6 +1440 11 @@+ ethertype_filter_ptr = rte_zmalloc(+ "igb_ethertype_filter" + sizeof(struct igb_ethertype_filter_ele) 0); ++ if (!ethertype_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(ðertype_filter_ptr->filter_info + ðertype_filter + sizeof(struct rte_eth_ethertype_filter)); +@@ -1455 6 +1465 11 @@+ if (!ret) {+ syn_filter_ptr = rte_zmalloc("igb_syn_filter" + sizeof(struct igb_eth_syn_filter_ele) 0); ++ if (!syn_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&syn_filter_ptr->filter_info + &syn_filter + sizeof(struct rte_eth_syn_filter)); +@@ -1476 6 +1491 11 @@+ if (!ret) {+ flex_filter_ptr = rte_zmalloc("igb_flex_filter" + sizeof(struct igb_flex_filter_ele) 0); ++ if (!flex_filter_ptr) {++ PMD_DRV_LOG(ERR "failed to allocate memory"); ++ goto out; ++ }+++ rte_memcpy(&flex_filter_ptr->filter_info + &flex_filter + sizeof(struct rte_eth_flex_filter)); +-- +1.8.3.1+diff --git a/v4-0001-net-i40e-add-null-point-check-and-fix-mem-leak.patch b/v4-0001-net-i40e-add-null-point-check-and-fix-mem-leak.patchnew file mode 100644index 0000000..a96d952--- /dev/null+++ b/v4-0001-net-i40e-add-null-point-check-and-fix-mem-leak.patch@@ -0 0 +1 163 @@+From 8624ca94b94a0f222ca64a93af33d977ea0a004d Mon Sep 17 00:00:00 2001+
Date: 01 May 2018 23:12:03 -0700 [thread overview]
Message-ID: <ca5293$1h85t1@fmsmga001.fm.intel.com> (raw )
[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]
Test-Label: Intel-compilation
Test-Status: SUCCESS
http://dpdk.org/patch/38395
_Compilation OK_
Submitter: li han <han.li1@zte.com.cn>
Date: Wed, 18 Apr 2018 04:37:22 -0400Wed, 20 Dec 2017 05:14:28 -0500Wed, 20 Dec 2017 05:16:11 -0500Wed, 20 Dec 2017 05:18:25 -0500Wed, 20 Dec 2017 05:18:25 -0500Wed, 20 Dec 2017 05:16:11 -0500Wed, 20 Dec 2017 05:14:28 -0500
DPDK git baseline: Repo:dpdk, Branch:master, CommitID:af7551e2bfceef7ddeb7941b26b06a9b6d6dee5e
Patch38395-38395 --> compile pass
Build Summary: 15 Builds Done, 15 Successful, 0 Failures
Test environment and configuration as below:
OS: FreeBSD10.3_64
Kernel Version:10.3-RELEASE
CPU info: Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz (2194.96-MHz K8-class CPU)
GCC Version:gcc (FreeBSD Ports Collection) 4.8.5
Clang Version:3.4.1
x86_64-native-bsdapp-clang
x86_64-native-bsdapp-gcc
OS: FC24_64
Kernel Version:4.9.13-100.fc24.x86_64
CPU info:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz
GCC Version:gcc (GCC) 6.2.1 20160916 (Red Hat 6.2.1-2)
Clang Version:3.8.0
x86_64-native-linuxapp-clang
i686-native-linuxapp-gcc
x86_64-native-linuxapp-gcc-debug
x86_64-native-linuxapp-gcc-shared
x86_64-native-linuxapp-gcc
OS: UB1604_64
Kernel Version:4.4.0-81-generic
CPU info:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz
GCC Version:gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Clang Version:3.8.0
i686-native-linuxapp-gcc
x86_64-native-linuxapp-clang
x86_64-native-linuxapp-gcc-shared
x86_64-native-linuxapp-gcc
OS: CentOS7_64
Kernel Version:3.10.0-514.10.2.el7.x86_64
CPU info:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz
GCC Version:gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
Clang Version:3.4.2
i686-native-linuxapp-gcc
x86_64-native-linuxapp-gcc
x86_64-native-linuxapp-gcc-shared
x86_64-native-linuxapp-clang
DPDK STV team
reply other threads:[~2018-05-02 6:12 UTC |newest ]
Thread overview: [no followups] expand[flat |nested ] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to , --cc , and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='ca5293$1h85t1@fmsmga001.fm.intel.com' \
--to=sys_stv@intel.com \
--cc=test-report@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).