DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: fix qos sched sample app performance drop
@ 2019-11-20  8:07 Shougang Wang
  2019-11-20 15:02 ` Ye Xiaolong
  2019-11-21  7:32 ` [dpdk-dev] [PATCH v2] net/ixgbe: fix QoS performance drop issue Shougang Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Shougang Wang @ 2019-11-20  8:07 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, qiming.yang, Shougang Wang

Currently MACsec register is set without any conditions when start port.
It should be set only when user needs. To avoid wild value, I add init
function. This patch fixes the issue.

Fixes: 50556c88104c ("net/ixgbe: fix MACsec setting")

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 8c1caac18..d54eec1c6 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -379,6 +379,8 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
 static int ixgbe_filter_restore(struct rte_eth_dev *dev);
 static void ixgbe_l2_tunnel_conf(struct rte_eth_dev *dev);
 
+static void ixgbe_dev_macsec_init(struct rte_eth_dev *dev);
+
 /*
  * Define VF Stats MACRO for Non "cleared on read" register
  */
@@ -1095,6 +1097,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 
 	PMD_INIT_FUNC_TRACE();
 
+	ixgbe_dev_macsec_init(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 +2549,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,9 +2803,11 @@ 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->encrypt_en != 0 ||
+	    macsec_setting->replayprotect_en != 0) {
+		ixgbe_dev_macsec_register_enable(dev, macsec_setting);
+	}
 	return 0;
 
 error:
@@ -2827,6 +2833,8 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 	int vf;
 	struct ixgbe_tm_conf *tm_conf =
 		IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
+	struct ixgbe_macsec_setting *macsec_setting =
+		IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private);
 
 	if (hw->adapter_stopped)
 		return;
@@ -2834,7 +2842,10 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 	PMD_INIT_FUNC_TRACE();
 
 	/* disable mecsec register */
-	ixgbe_dev_macsec_register_disable(dev);
+	if (macsec_setting->encrypt_en != 0 ||
+	    macsec_setting->replayprotect_en != 0) {
+		ixgbe_dev_macsec_register_disable(dev);
+	}
 
 	rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev);
 
@@ -8977,6 +8988,16 @@ ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev)
 	ixgbe_enable_sec_tx_path_generic(hw);
 }
 
+static void
+ixgbe_dev_macsec_init(struct rte_eth_dev *dev)
+{
+	struct ixgbe_macsec_setting *macsec =
+		IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private);
+
+	macsec->encrypt_en = 0;
+	macsec->replayprotect_en = 0;
+}
+
 RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe, "* igb_uio | uio_pci_generic | vfio-pci");
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ixgbe: fix qos sched sample app performance drop
  2019-11-20  8:07 [dpdk-dev] [PATCH] net/ixgbe: fix qos sched sample app performance drop Shougang Wang
@ 2019-11-20 15:02 ` Ye Xiaolong
  2019-11-21  5:43   ` Wang, ShougangX
  2019-11-21  7:32 ` [dpdk-dev] [PATCH v2] net/ixgbe: fix QoS performance drop issue Shougang Wang
  1 sibling, 1 reply; 6+ messages in thread
From: Ye Xiaolong @ 2019-11-20 15:02 UTC (permalink / raw)
  To: Shougang Wang, Sun GuinanX; +Cc: dev, wenzhuo.lu, qiming.yang

Hi,

Guinan, could you take a look at this patch as well.

On 11/20, Shougang Wang wrote:
>Currently MACsec register is set without any conditions when start port.
>It should be set only when user needs. To avoid wild value, I add init
>function. This patch fixes the issue.
>
>Fixes: 50556c88104c ("net/ixgbe: fix MACsec setting")
>
>Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
>---
> drivers/net/ixgbe/ixgbe_ethdev.c | 31 ++++++++++++++++++++++++++-----
> 1 file changed, 26 insertions(+), 5 deletions(-)
>
>diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>index 8c1caac18..d54eec1c6 100644
>--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>@@ -379,6 +379,8 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
> static int ixgbe_filter_restore(struct rte_eth_dev *dev);
> static void ixgbe_l2_tunnel_conf(struct rte_eth_dev *dev);
> 
>+static void ixgbe_dev_macsec_init(struct rte_eth_dev *dev);
>+
> /*
>  * Define VF Stats MACRO for Non "cleared on read" register
>  */
>@@ -1095,6 +1097,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
> 
> 	PMD_INIT_FUNC_TRACE();
> 
>+	ixgbe_dev_macsec_init(eth_dev);

This is not needed as dev_private is allocated by rte_zmalloc_socket.

>+
> 	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 +2549,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,9 +2803,11 @@ 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->encrypt_en != 0 ||
>+	    macsec_setting->replayprotect_en != 0) {
>+		ixgbe_dev_macsec_register_enable(dev, macsec_setting);
>+	}

Can we safely assume that if encrypt_en and replayprotect_en equals zero, then
we don't need to call ixgbe_dev_macsec_register_enable at all? Since this enable
routine is more about just encrypt_en/replayprotect_en, is that any usercase
when user set macsec offload with both encrypt_en and replayprotect_en are 0?

Thanks,
Xiaolong

> 	return 0;
> 
> error:
>@@ -2827,6 +2833,8 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
> 	int vf;
> 	struct ixgbe_tm_conf *tm_conf =
> 		IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
>+	struct ixgbe_macsec_setting *macsec_setting =
>+		IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private);
> 
> 	if (hw->adapter_stopped)
> 		return;
>@@ -2834,7 +2842,10 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
> 	PMD_INIT_FUNC_TRACE();
> 
> 	/* disable mecsec register */
>-	ixgbe_dev_macsec_register_disable(dev);
>+	if (macsec_setting->encrypt_en != 0 ||
>+	    macsec_setting->replayprotect_en != 0) {
>+		ixgbe_dev_macsec_register_disable(dev);
>+	}
> 
> 	rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev);
> 
>@@ -8977,6 +8988,16 @@ ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev)
> 	ixgbe_enable_sec_tx_path_generic(hw);
> }
> 
>+static void
>+ixgbe_dev_macsec_init(struct rte_eth_dev *dev)
>+{
>+	struct ixgbe_macsec_setting *macsec =
>+		IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private);
>+
>+	macsec->encrypt_en = 0;
>+	macsec->replayprotect_en = 0;
>+}
>+
> RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd);
> RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map);
> RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe, "* igb_uio | uio_pci_generic | vfio-pci");
>-- 
>2.17.1
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ixgbe: fix qos sched sample app performance drop
  2019-11-20 15:02 ` Ye Xiaolong
@ 2019-11-21  5:43   ` Wang, ShougangX
  0 siblings, 0 replies; 6+ messages in thread
From: Wang, ShougangX @ 2019-11-21  5:43 UTC (permalink / raw)
  To: Ye, Xiaolong, Sun, GuinanX; +Cc: dev, Lu, Wenzhuo, Yang, Qiming

Hi, Xiaolong

> -----Original Message-----
[snip]
> >+static void ixgbe_dev_macsec_init(struct rte_eth_dev *dev);
> >+
> > /*
> >  * Define VF Stats MACRO for Non "cleared on read" register
> >  */
> >@@ -1095,6 +1097,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev,
> >void *init_params __rte_unused)
> >
> > 	PMD_INIT_FUNC_TRACE();
> >
> >+	ixgbe_dev_macsec_init(eth_dev);
> 
> This is not needed as dev_private is allocated by rte_zmalloc_socket.
> 
OK, I will remove it.

> >+
> > 	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 +2549,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,9 +2803,11 @@ 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->encrypt_en != 0 ||
> >+	    macsec_setting->replayprotect_en != 0) {
> >+		ixgbe_dev_macsec_register_enable(dev, macsec_setting);
> >+	}
> 
> Can we safely assume that if encrypt_en and replayprotect_en equals zero,
> then we don't need to call ixgbe_dev_macsec_register_enable at all? Since this
> enable routine is more about just encrypt_en/replayprotect_en, is that any
> usercase when user set macsec offload with both encrypt_en and
> replayprotect_en are 0?
> 
As you said, this is a problem. I will fix it. Thanks a lot.

Thanks.
Shougang 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] net/ixgbe: fix QoS performance drop issue
  2019-11-20  8:07 [dpdk-dev] [PATCH] net/ixgbe: fix qos sched sample app performance drop Shougang Wang
  2019-11-20 15:02 ` Ye Xiaolong
@ 2019-11-21  7:32 ` Shougang Wang
  2019-11-21  8:53   ` Ye Xiaolong
  2019-11-21 14:32   ` Ye Xiaolong
  1 sibling, 2 replies; 6+ messages in thread
From: Shougang Wang @ 2019-11-21  7:32 UTC (permalink / raw)
  To: dev; +Cc: qiming.yang, wenzhuo.lu, Shougang Wang

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 <shougangx.wang@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix QoS performance drop issue
  2019-11-21  7:32 ` [dpdk-dev] [PATCH v2] net/ixgbe: fix QoS performance drop issue Shougang Wang
@ 2019-11-21  8:53   ` Ye Xiaolong
  2019-11-21 14:32   ` Ye Xiaolong
  1 sibling, 0 replies; 6+ messages in thread
From: Ye Xiaolong @ 2019-11-21  8:53 UTC (permalink / raw)
  To: Shougang Wang; +Cc: dev, qiming.yang, wenzhuo.lu

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 <shougangx.wang@intel.com>
>---
> 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
>

Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix QoS performance drop issue
  2019-11-21  7:32 ` [dpdk-dev] [PATCH v2] net/ixgbe: fix QoS performance drop issue Shougang Wang
  2019-11-21  8:53   ` Ye Xiaolong
@ 2019-11-21 14:32   ` Ye Xiaolong
  1 sibling, 0 replies; 6+ messages in thread
From: Ye Xiaolong @ 2019-11-21 14:32 UTC (permalink / raw)
  To: Shougang Wang; +Cc: dev, qiming.yang, wenzhuo.lu

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 <shougangx.wang@intel.com>
>---
> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-21 14:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20  8:07 [dpdk-dev] [PATCH] net/ixgbe: fix qos sched sample app performance drop Shougang Wang
2019-11-20 15:02 ` Ye Xiaolong
2019-11-21  5:43   ` Wang, ShougangX
2019-11-21  7:32 ` [dpdk-dev] [PATCH v2] net/ixgbe: fix QoS performance drop issue Shougang Wang
2019-11-21  8:53   ` Ye Xiaolong
2019-11-21 14:32   ` Ye Xiaolong

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).