From patchwork Thu Oct 13 12:19:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radu Nicolau X-Patchwork-Id: 118153 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E7718A00C2; Thu, 13 Oct 2022 14:19:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D97A642DC8; Thu, 13 Oct 2022 14:19:41 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 64F0C42DC7 for ; Thu, 13 Oct 2022 14:19:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665663580; x=1697199580; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=BP8PCamT71EO/++I0qDXd3Hgp7sIUUD+77ioueAJfgg=; b=kmlwHipjAEkVBCwM03Odo05PmjURJcScfawS7vZAh0ffWnjJZzQg6Sa6 c0ws4TYWHag7VPL2hT5/hm7X6FwpNt08K7V6J/2uBXrsoribIl4G/kTLd IL4e5UNWwm6DkjsDPiz6mFyc/FbmQAG4l+Z+nko/elwxQgVkJ6l4qcE9n Wk9gz9WTVG7p9DTy2CDTNY/07Mox8h3blAb4KvuMIzPpEevEQJS1Xg4j8 ZiVy9VK6NAly2TshN+JdBsj6bJx+Bg5RPv3FWcQDNIefRhORoxu68t/LC oZQ2x7yskElpMpy+VWRnqsjVB4C+zfpAU0KUI+UsOuIcWnzMdPDdqrzgS Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10498"; a="306124633" X-IronPort-AV: E=Sophos;i="5.95,180,1661842800"; d="scan'208";a="306124633" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2022 05:19:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10498"; a="956141382" X-IronPort-AV: E=Sophos;i="5.95,180,1661842800"; d="scan'208";a="956141382" Received: from silpixa00400884.ir.intel.com ([10.243.22.82]) by fmsmga005.fm.intel.com with ESMTP; 13 Oct 2022 05:19:15 -0700 From: Radu Nicolau To: Jingjing Wu , Beilei Xing Cc: dev@dpdk.org, Radu Nicolau , gakhil@marvell.com Subject: [PATCH 1/3] net/iavf: fix security session destroy Date: Thu, 13 Oct 2022 13:19:11 +0100 Message-Id: <20221013121913.3543260-1-radu.nicolau@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Replace mempool_put with memset 0, the internal session memory block is no longer allocated from a mempool Fixes: 3f3fc3308bd0 ("security: remove private mempool usage") Cc: gakhil@marvell.com Signed-off-by: Radu Nicolau Acked-by: Akhil Goyal --- drivers/net/iavf/iavf_ipsec_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c index afd7f8f467..46a77afa27 100644 --- a/drivers/net/iavf/iavf_ipsec_crypto.c +++ b/drivers/net/iavf/iavf_ipsec_crypto.c @@ -1042,7 +1042,7 @@ iavf_ipsec_crypto_session_destroy(void *device, return -EINVAL; ret = iavf_ipsec_crypto_sa_del(adapter, iavf_sess); - rte_mempool_put(rte_mempool_from_obj(iavf_sess), (void *)iavf_sess); + memset(iavf_sess, 0, sizeof(struct iavf_security_session)); return ret; } From patchwork Thu Oct 13 12:19:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radu Nicolau X-Patchwork-Id: 118154 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E8F02A00C2; Thu, 13 Oct 2022 14:19:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6140A42F50; Thu, 13 Oct 2022 14:19:45 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 31AB542DC7 for ; Thu, 13 Oct 2022 14:19:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665663581; x=1697199581; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J1FNXubOYT5FFkbhkA1hdA4T8Nk/FzuGl2EzlRtylAA=; b=Or1LfVPxkpSwq3tGOW767rXVgVwJ4+7S0Uw12EDa2Z4R/H3eSwp3lhIy 41A1jmnUC4PZT7kzCTB5pdIij69OiLK1KptOrLr+zJoHvL/H5VaGzF/po NOcep5tq6kL/IuS4swA4I6nYlYdTJeHuRVzxmeA11VFS8MXuawo2BlxzY uB0vjWfxjKoqAqpOAGUk+CLp2DIJ97VBxRoj5xJRxyQD8ii8gHfFYQmF9 8+9FQDe0wk5w3jz5zKXZcvS2t0iK71NwHbF5TiVtXHkSPJWMT6z25tkXr jYtkAy1hoBVHEwk/8iEZVm0i0qRKcPjapnU8oqxwyHxXLeAJocqveGXRf g==; X-IronPort-AV: E=McAfee;i="6500,9779,10498"; a="306124638" X-IronPort-AV: E=Sophos;i="5.95,180,1661842800"; d="scan'208";a="306124638" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2022 05:19:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10498"; a="956141388" X-IronPort-AV: E=Sophos;i="5.95,180,1661842800"; d="scan'208";a="956141388" Received: from silpixa00400884.ir.intel.com ([10.243.22.82]) by fmsmga005.fm.intel.com with ESMTP; 13 Oct 2022 05:19:18 -0700 From: Radu Nicolau To: Qiming Yang , Wenjun Wu Cc: dev@dpdk.org, Radu Nicolau , gakhil@marvell.com Subject: [PATCH 2/3] net/ixgbe: fix security session destroy Date: Thu, 13 Oct 2022 13:19:12 +0100 Message-Id: <20221013121913.3543260-2-radu.nicolau@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221013121913.3543260-1-radu.nicolau@intel.com> References: <20221013121913.3543260-1-radu.nicolau@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Replace mempool_put with memset 0, the internal session memory block is no longer allocated from a mempool Fixes: 3f3fc3308bd0 ("security: remove private mempool usage") Cc: gakhil@marvell.com Signed-off-by: Radu Nicolau Acked-by: Akhil Goyal --- drivers/net/ixgbe/ixgbe_ipsec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c index 8a96a9f11a..0c75fd36da 100644 --- a/drivers/net/ixgbe/ixgbe_ipsec.c +++ b/drivers/net/ixgbe/ixgbe_ipsec.c @@ -429,7 +429,6 @@ ixgbe_crypto_remove_session(void *device, { struct rte_eth_dev *eth_dev = device; struct ixgbe_crypto_session *ic_session = SECURITY_GET_SESS_PRIV(session); - struct rte_mempool *mempool = rte_mempool_from_obj(ic_session); if (eth_dev != ic_session->dev) { PMD_DRV_LOG(ERR, "Session not bound to this device\n"); @@ -441,8 +440,7 @@ ixgbe_crypto_remove_session(void *device, return -EFAULT; } - rte_mempool_put(mempool, (void *)ic_session); - + memset(ic_session, 0, sizeof(struct ixgbe_crypto_session)); return 0; } From patchwork Thu Oct 13 12:19:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radu Nicolau X-Patchwork-Id: 118155 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C0C98A00C2; Thu, 13 Oct 2022 14:19:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36D2C42F57; Thu, 13 Oct 2022 14:19:46 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 84DF442F40 for ; Thu, 13 Oct 2022 14:19:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665663582; x=1697199582; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uwQjYpKBQzkgGDVcLrfSesMrzReS/4wFvDia3TbcuvU=; b=f3YYyS0AGXw1bGCRtGv9Vzv5ZOAkGB6N41MrGH5pODOgfo7OIPAs5V2z qsPRDrnFbo8ClorBw4OaPVIP2SuICs+r00RWeIdNzoeM/yYems/X98cBJ V3sl9jpyZWrq0sGcml3+sa5Xo1NztyEaVEQH2mrOo5C0emdpw+IIkF9CA /gaRJIAI0VwCD7YVkfkG4svQeYaUgJT+f7SNZr5iDsMgfdlxEjZlwB6OG Mk8qr+beRloYA5l8aq3n+YqT/j09EtacOE+P9TEyB/LCN4Dn6zioG3Hva NBHXUV6X8l1PBJZRid3QnMaZnVDOoYl65Kl/U4U9bOtZ03qH0SE90wbq8 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10498"; a="306124645" X-IronPort-AV: E=Sophos;i="5.95,180,1661842800"; d="scan'208";a="306124645" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2022 05:19:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10498"; a="956141396" X-IronPort-AV: E=Sophos;i="5.95,180,1661842800"; d="scan'208";a="956141396" Received: from silpixa00400884.ir.intel.com ([10.243.22.82]) by fmsmga005.fm.intel.com with ESMTP; 13 Oct 2022 05:19:20 -0700 From: Radu Nicolau To: Jiawen Wu , Jian Wang Cc: dev@dpdk.org, Radu Nicolau , gakhil@marvell.com Subject: [PATCH 3/3] net/txgbe: fix security session destroy Date: Thu, 13 Oct 2022 13:19:13 +0100 Message-Id: <20221013121913.3543260-3-radu.nicolau@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221013121913.3543260-1-radu.nicolau@intel.com> References: <20221013121913.3543260-1-radu.nicolau@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Replace mempool_put with memset 0, the internal session memory block is no longer allocated from a mempool Fixes: 3f3fc3308bd0 ("security: remove private mempool usage") Cc: gakhil@marvell.com Signed-off-by: Radu Nicolau Acked-by: Akhil Goyal Reviewed-by: Jiawen Wu --- drivers/net/txgbe/txgbe_ipsec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/txgbe/txgbe_ipsec.c b/drivers/net/txgbe/txgbe_ipsec.c index b458b3a922..f9f8108fb8 100644 --- a/drivers/net/txgbe/txgbe_ipsec.c +++ b/drivers/net/txgbe/txgbe_ipsec.c @@ -409,7 +409,6 @@ txgbe_crypto_remove_session(void *device, { struct rte_eth_dev *eth_dev = device; struct txgbe_crypto_session *ic_session = SECURITY_GET_SESS_PRIV(session); - struct rte_mempool *mempool = rte_mempool_from_obj(ic_session); if (eth_dev != ic_session->dev) { PMD_DRV_LOG(ERR, "Session not bound to this device\n"); @@ -421,7 +420,7 @@ txgbe_crypto_remove_session(void *device, return -EFAULT; } - rte_mempool_put(mempool, (void *)ic_session); + memset(ic_session, 0, sizeof(struct txgbe_crypto_session)); return 0; }