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 6CD5BA04F5 for ; Wed, 11 Dec 2019 22:27:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6285B1BC25; Wed, 11 Dec 2019 22:27:45 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id D2BE21D9E for ; Wed, 11 Dec 2019 22:27:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576099663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0bouYlvwD6U9XcaZvb9X/9K2N4d8k/Oj4KnV7apz/DM=; b=BFHMU8K7xKt0DkSM6gGI1o+HyPeCWQXNR11D3z58tuWon1uZDoxX/BfLAljKoeiEqGKq7M eagT9BGx+wRv14Aw/Nn/+PD/zDITWFoiz7H6eyc3GEGrOVUBfVvg5jL/TsbGV1yyjXBLlF YdwGE5l8ZN45+P1BMQCISZ7P3rPOHQY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-226-qVY5-uGUNaaYGneaRw45WA-1; Wed, 11 Dec 2019 16:27:40 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 10A67800D41; Wed, 11 Dec 2019 21:27:39 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14D0810013A1; Wed, 11 Dec 2019 21:27:37 +0000 (UTC) From: Kevin Traynor To: Shougang Wang Cc: Xiaolong Ye , dpdk stable Date: Wed, 11 Dec 2019 21:25:57 +0000 Message-Id: <20191211212702.27851-5-ktraynor@redhat.com> In-Reply-To: <20191211212702.27851-1-ktraynor@redhat.com> References: <20191211212702.27851-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: qVY5-uGUNaaYGneaRw45WA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/ixgbe: fix performance drop caused by MACsec' has been queued to LTS release 18.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/17/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/f4d7ffe6e960c5edaf= c4073d724f6ad5d3247800 Thanks. Kevin. --- >From f4d7ffe6e960c5edafc4073d724f6ad5d3247800 Mon Sep 17 00:00:00 2001 From: Shougang Wang Date: Thu, 21 Nov 2019 07:32:05 +0000 Subject: [PATCH] net/ixgbe: fix performance drop caused by MACsec [ upstream commit 54aedfe1c02119337485388263c2782d6d39541d ] 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 Reviewed-by: Xiaolong Ye --- 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_eth= dev.c index 1336236ba..3d4e62b5a 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1079,4 +1079,6 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void = *init_params __rte_unused) =09PMD_INIT_FUNC_TRACE(); =20 +=09ixgbe_dev_macsec_setting_reset(eth_dev); + =09eth_dev->dev_ops =3D &ixgbe_eth_dev_ops; =09eth_dev->rx_pkt_burst =3D &ixgbe_recv_pkts; @@ -2591,5 +2593,5 @@ ixgbe_dev_start(struct rte_eth_dev *dev) =09struct ixgbe_tm_conf *tm_conf =3D =09=09IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private); -=09struct ixgbe_macsec_setting *macsec_ctrl =3D +=09struct ixgbe_macsec_setting *macsec_setting =3D =09=09IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private); =20 @@ -2833,6 +2835,7 @@ skip_link_setup: =09ixgbe_dev_link_update(dev, 0); =20 -=09/* setup the macsec ctrl register */ -=09ixgbe_dev_macsec_register_enable(dev, macsec_ctrl); +=09/* setup the macsec setting register */ +=09if (macsec_setting->offload_en) +=09=09ixgbe_dev_macsec_register_enable(dev, macsec_setting); =20 =09return 0; @@ -2864,7 +2867,4 @@ ixgbe_dev_stop(struct rte_eth_dev *dev) =09PMD_INIT_FUNC_TRACE(); =20 -=09/* disable mecsec register */ -=09ixgbe_dev_macsec_register_disable(dev); - =09rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev); =20 @@ -8694,4 +8694,5 @@ ixgbe_dev_macsec_setting_save(struct rte_eth_dev *dev= , =09=09IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private); =20 +=09macsec->offload_en =3D macsec_setting->offload_en; =09macsec->encrypt_en =3D macsec_setting->encrypt_en; =09macsec->replayprotect_en =3D macsec_setting->replayprotect_en; @@ -8704,4 +8705,5 @@ ixgbe_dev_macsec_setting_reset(struct rte_eth_dev *de= v) =09=09IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private); =20 +=09macsec->offload_en =3D 0; =09macsec->encrypt_en =3D 0; =09macsec->replayprotect_en =3D 0; diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_eth= dev.h index 418adfa3d..752d7981e 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.h +++ b/drivers/net/ixgbe/ixgbe_ethdev.h @@ -362,4 +362,5 @@ struct rte_flow { =20 struct ixgbe_macsec_setting { +=09uint8_t offload_en; =09uint8_t encrypt_en; =09uint8_t replayprotect_en; diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_= ixgbe.c index 49d538ef1..b946808bc 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -522,4 +522,5 @@ rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, = uint8_t rp) =09dev =3D &rte_eth_devices[port]; =20 +=09macsec_setting.offload_en =3D 1; =09macsec_setting.encrypt_en =3D en; =09macsec_setting.replayprotect_en =3D rp; --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-11 21:24:13.174219947 +0000 +++ 0005-net-ixgbe-fix-performance-drop-caused-by-MACsec.patch=092019-12-11= 21:24:12.568653263 +0000 @@ -1 +1 @@ -From 54aedfe1c02119337485388263c2782d6d39541d Mon Sep 17 00:00:00 2001 +From f4d7ffe6e960c5edafc4073d724f6ad5d3247800 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 54aedfe1c02119337485388263c2782d6d39541d ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 0084c3335..118bc7475 100644 +index 1336236ba..3d4e62b5a 100644 @@ -26 +27 @@ -@@ -1096,4 +1096,6 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void= *init_params __rte_unused) +@@ -1079,4 +1079,6 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void= *init_params __rte_unused) @@ -33 +34 @@ -@@ -2549,5 +2551,5 @@ ixgbe_dev_start(struct rte_eth_dev *dev) +@@ -2591,5 +2593,5 @@ ixgbe_dev_start(struct rte_eth_dev *dev) @@ -40 +41 @@ -@@ -2803,6 +2805,7 @@ skip_link_setup: +@@ -2833,6 +2835,7 @@ skip_link_setup: @@ -50 +51 @@ -@@ -2837,7 +2840,4 @@ ixgbe_dev_stop(struct rte_eth_dev *dev) +@@ -2864,7 +2867,4 @@ ixgbe_dev_stop(struct rte_eth_dev *dev) @@ -58 +59 @@ -@@ -8848,4 +8848,5 @@ ixgbe_dev_macsec_setting_save(struct rte_eth_dev *de= v, +@@ -8694,4 +8694,5 @@ ixgbe_dev_macsec_setting_save(struct rte_eth_dev *de= v, @@ -64 +65 @@ -@@ -8858,4 +8859,5 @@ ixgbe_dev_macsec_setting_reset(struct rte_eth_dev *d= ev) +@@ -8704,4 +8705,5 @@ ixgbe_dev_macsec_setting_reset(struct rte_eth_dev *d= ev) @@ -71 +72 @@ -index 5da6923a1..76a1b9d18 100644 +index 418adfa3d..752d7981e 100644 @@ -74 +75 @@ -@@ -367,4 +367,5 @@ struct rte_flow { +@@ -362,4 +362,5 @@ struct rte_flow { @@ -81 +82 @@ -index 073fe1e23..8bcaded6e 100644 +index 49d538ef1..b946808bc 100644 @@ -84 +85 @@ -@@ -523,4 +523,5 @@ rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en,= uint8_t rp) +@@ -522,4 +522,5 @@ rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en,= uint8_t rp)