summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShougang Wang <shougangx.wang@intel.com>2019-11-21 07:32:05 +0000
committerXiaolong Ye <xiaolong.ye@intel.com>2019-11-21 22:30:18 +0800
commiteb093442ad9fe9d56b07d657f349d49c4aec79aa (patch)
treebc85b4b616259b067ab649721422a3a9633e20e5
parent5765b0525b567ee93159692d70ac17001e103ba7 (diff)
downloaddpdk-next-net-intel-eb093442ad9fe9d56b07d657f349d49c4aec79aa.zip
dpdk-next-net-intel-eb093442ad9fe9d56b07d657f349d49c4aec79aa.tar.gz
dpdk-next-net-intel-eb093442ad9fe9d56b07d657f349d49c4aec79aa.tar.xz
net/ixgbe: fix QoS performance drop issue
Currently macsec offload will be enabled every time when device starts. It will cause QoS sample application performance drop issue. This patch adds check in dev_start ops to make sure macsec is only enabled when required explicitly. Fixes: 50556c88104c ("net/ixgbe: fix MACsec setting") Signed-off-by: Shougang Wang <shougangx.wang@intel.com> Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
-rw-r--r--drivers/net/ixgbe/ixgbe_ethdev.c14
-rw-r--r--drivers/net/ixgbe/ixgbe_ethdev.h1
-rw-r--r--drivers/net/ixgbe/rte_pmd_ixgbe.c1
3 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 0084c33..118bc74 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;
@@ -2548,7 +2550,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();
@@ -2802,8 +2804,9 @@ skip_link_setup:
*/
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;
@@ -2836,9 +2839,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 */
@@ -8847,6 +8847,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;
}
@@ -8857,6 +8858,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 5da6923..76a1b9d 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 073fe1e..8bcaded 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;