From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2] net/ixgbe: removed ipsec keys from private data Date: Wed, 20 Dec 2017 07:46:00 -0800 Message-ID: <20171220074600.507383f8@xeon-e3> References: <1511349560-12704-1-git-send-email-radu.nicolau@intel.com> <1513769571-16734-1-git-send-email-radu.nicolau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, helin.zhang@intel.com, konstantin.ananyev@intel.com, wenzhuo.lu@intel.com, declan.doherty@intel.com To: Radu Nicolau Return-path: Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by dpdk.org (Postfix) with ESMTP id 72C381B1CB for ; Wed, 20 Dec 2017 16:46:03 +0100 (CET) Received: by mail-pl0-f66.google.com with SMTP id z5so9220947plo.10 for ; Wed, 20 Dec 2017 07:46:03 -0800 (PST) In-Reply-To: <1513769571-16734-1-git-send-email-radu.nicolau@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 20 Dec 2017 11:32:51 +0000 Radu Nicolau wrote: > All ipsec related setting are being held in the driver > private data to allow easy add and remove of SAs. There > is no need to keep a record of the keys, and also > storing the keys can be a security issue. > > Signed-off-by: Radu Nicolau > Acked-by: Declan Doherty > --- > drivers/net/ixgbe/ixgbe_ipsec.c | 78 ++++++++++++++++++----------------------- > drivers/net/ixgbe/ixgbe_ipsec.h | 4 --- > 2 files changed, 35 insertions(+), 47 deletions(-) > > diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c > index 105da11..a7ba358 100644 > --- a/drivers/net/ixgbe/ixgbe_ipsec.c > +++ b/drivers/net/ixgbe/ixgbe_ipsec.c > @@ -70,6 +70,8 @@ static void > ixgbe_crypto_clear_ipsec_tables(struct rte_eth_dev *dev) > { > struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + struct ixgbe_ipsec *priv = IXGBE_DEV_PRIVATE_TO_IPSEC( > + dev->data->dev_private); > int i = 0; > > /* clear Rx IP table*/ > @@ -106,6 +108,10 @@ ixgbe_crypto_clear_ipsec_tables(struct rte_eth_dev *dev) > IXGBE_WRITE_REG(hw, IXGBE_IPSTXSALT, 0); > IXGBE_WAIT_TWRITE; > } > + > + memset(priv->rx_ip_tbl, 0, sizeof(priv->rx_ip_tbl)); > + memset(priv->rx_sa_tbl, 0, sizeof(priv->rx_sa_tbl)); > + memset(priv->tx_sa_tbl, 0, sizeof(priv->tx_sa_tbl)); GCC has been known to optimize out this kind of memset. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=8537