From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AFAEBA04C1; Thu, 21 Nov 2019 15:35:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AA89B2BA8; Thu, 21 Nov 2019 15:35:49 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 467ED2BA3 for ; Thu, 21 Nov 2019 15:35:48 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2019 06:35:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,226,1571727600"; d="scan'208";a="238197589" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by fmsmga002.fm.intel.com with ESMTP; 21 Nov 2019 06:35:45 -0800 Date: Thu, 21 Nov 2019 22:32:07 +0800 From: Ye Xiaolong To: Shougang Wang Cc: dev@dpdk.org, qiming.yang@intel.com, wenzhuo.lu@intel.com Message-ID: <20191121143207.GJ103671@intel.com> References: <20191120080743.26405-1-shougangx.wang@intel.com> <20191121073205.65910-1-shougangx.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121073205.65910-1-shougangx.wang@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix QoS performance drop issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 11/21, Shougang Wang wrote: >Currently macsec offload will be enabled all the time >when device start. It will cause QoS sample application >performance drop issue. This patch add check before this >feature enabled. > >Fixes: 50556c88104c ("net/ixgbe: fix MACsec setting") > >Signed-off-by: Shougang Wang >--- > drivers/net/ixgbe/ixgbe_ethdev.c | 14 ++++++++------ > drivers/net/ixgbe/ixgbe_ethdev.h | 1 + > drivers/net/ixgbe/rte_pmd_ixgbe.c | 1 + > 3 files changed, 10 insertions(+), 6 deletions(-) > >diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c >index 8c1caac18..aeb82d1c8 100644 >--- a/drivers/net/ixgbe/ixgbe_ethdev.c >+++ b/drivers/net/ixgbe/ixgbe_ethdev.c >@@ -1095,6 +1095,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) > > PMD_INIT_FUNC_TRACE(); > >+ ixgbe_dev_macsec_setting_reset(eth_dev); >+ > eth_dev->dev_ops = &ixgbe_eth_dev_ops; > eth_dev->rx_pkt_burst = &ixgbe_recv_pkts; > eth_dev->tx_pkt_burst = &ixgbe_xmit_pkts; >@@ -2545,7 +2547,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev) > uint32_t *link_speeds; > struct ixgbe_tm_conf *tm_conf = > IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private); >- struct ixgbe_macsec_setting *macsec_ctrl = >+ struct ixgbe_macsec_setting *macsec_setting = > IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private); > > PMD_INIT_FUNC_TRACE(); >@@ -2799,8 +2801,9 @@ ixgbe_dev_start(struct rte_eth_dev *dev) > */ > ixgbe_dev_link_update(dev, 0); > >- /* setup the macsec ctrl register */ >- ixgbe_dev_macsec_register_enable(dev, macsec_ctrl); >+ /* setup the macsec setting register */ >+ if (macsec_setting->offload_en) >+ ixgbe_dev_macsec_register_enable(dev, macsec_setting); > > return 0; > >@@ -2833,9 +2836,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev) > > PMD_INIT_FUNC_TRACE(); > >- /* disable mecsec register */ >- ixgbe_dev_macsec_register_disable(dev); >- > rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev); > > /* disable interrupts */ >@@ -8843,6 +8843,7 @@ ixgbe_dev_macsec_setting_save(struct rte_eth_dev *dev, > struct ixgbe_macsec_setting *macsec = > IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private); > >+ macsec->offload_en = macsec_setting->offload_en; > macsec->encrypt_en = macsec_setting->encrypt_en; > macsec->replayprotect_en = macsec_setting->replayprotect_en; > } >@@ -8853,6 +8854,7 @@ ixgbe_dev_macsec_setting_reset(struct rte_eth_dev *dev) > struct ixgbe_macsec_setting *macsec = > IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private); > >+ macsec->offload_en = 0; > macsec->encrypt_en = 0; > macsec->replayprotect_en = 0; > } >diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h >index 5da6923a1..76a1b9d18 100644 >--- a/drivers/net/ixgbe/ixgbe_ethdev.h >+++ b/drivers/net/ixgbe/ixgbe_ethdev.h >@@ -366,6 +366,7 @@ struct rte_flow { > }; > > struct ixgbe_macsec_setting { >+ uint8_t offload_en; > uint8_t encrypt_en; > uint8_t replayprotect_en; > }; >diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c >index 073fe1e23..8bcaded6e 100644 >--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c >+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c >@@ -522,6 +522,7 @@ rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp) > > dev = &rte_eth_devices[port]; > >+ macsec_setting.offload_en = 1; > macsec_setting.encrypt_en = en; > macsec_setting.replayprotect_en = rp; > >-- >2.17.1 > Applied to dpdk-next-net-intel, Thanks.