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 61533A04F5 for ; Thu, 12 Dec 2019 11:02:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 26D181BEDE; Thu, 12 Dec 2019 11:02:04 +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 4FC381BEDE for ; Thu, 12 Dec 2019 11:02:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576144921; 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:autocrypt:autocrypt; bh=R3EwLpaNDtecsNwcD+o1z6QoNpbz3HgRBnAnrscl9No=; b=aegtLxLEcY75nRKFghspJBLB29GTXBAJdjUF6GBAxEoBfy6RlU+cHyWkYC9P4kthSfuk0u Uv3hiK1LxLueQCJQMvL8GYtZKRuZXhcIxTzuaznHatXmh/gIjzNtPxvZs0B72WjYx3dtLj GPEUh/ItWLgaSKTeK6wa4qcC/sJnMHc= 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-220-qJK-dZJ_NZGIybGsulakEw-1; Thu, 12 Dec 2019 05:01:54 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E384B108595D; Thu, 12 Dec 2019 10:01:53 +0000 (UTC) Received: from [10.36.117.53] (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A55C019C58; Thu, 12 Dec 2019 10:01:52 +0000 (UTC) To: "Sun, GuinanX" Cc: "Ye, Xiaolong" , dpdk stable References: <20191211212702.27851-1-ktraynor@redhat.com> <20191211212702.27851-4-ktraynor@redhat.com> <05758BDAD7FC8E4BAED63D0390A8A9557EE22E@SHSMSX101.ccr.corp.intel.com> From: Kevin Traynor Autocrypt: addr=ktraynor@redhat.com; keydata= mQINBF2J2awBEADUEPNhgNI+nJNgiTAUcw4YIgVXEoHlsNPyyzG1BEXkWXALy0Y3fNTiw6+r ltWDkF9jzL9kfkecgQ67itGfk1OaBXgSGKuw1PUpxAwX2Bi76LAR6M5OsyGM9TSVVQwARalz hMwRBIZPzPc7or6Pw7jAOJ8SQGJ1Zlp1YJCjrvpe87V1tH/LY8Wnxn/EuoseFmWILAQZAtYS tGjcrAgYn3SPMLR1B0BP5bTBY06vWQjiufH8drenfDnMJAzuBdG1mqjnTqCjULZ3Hunv4xqZ aMnkvL/K5Tj1c12Oe4930EE53LrXIBUltRg5mBudSWHnC7twjH0082HH9f963Z/2UI63SFIT iUvRvAzJYytgy7XnWLQ0+goZBADKYfolOuC0H8VgCaux8u8KFF28Dy+N6TV2KI58jTlyg1Zu l7QwykZpnOkJFiy37Gfbu3YEOzO72cP/S7/A+zvuqkxi63jyEkd+FY99vLt/HN2MUZwRmKDw UPbLkmrs8WU01/POVsqDcfvz7vu2St8hqqTiSIdQGS2zyTKB2/DvPSM3jws3udkIYSuhn+X4 QBiV6lkVZ7DSE6a065gnAauAql+b32Eymy+xnG5jCt1tR+0Cp2VZYCR9OU2gmomUKBDoX/He pSgED01CqYPNjN+TddirwmQX7ep4DtXc8FWvv2g/pq9WZFQk2QARAQABtCNLZXZpbiBUcmF5 bm9yIDxrdHJheW5vckByZWRoYXQuY29tPokCTgQTAQgAOBYhBAoiOaH51tHF7VYtEI9CINER a+yJBQJdidmsAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEI9CINERa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 Dec 2019 10:01:51 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <05758BDAD7FC8E4BAED63D0390A8A9557EE22E@SHSMSX101.ccr.corp.intel.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: qJK-dZJ_NZGIybGsulakEw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-stable] patch 'net/ixgbe: fix MACsec setting' 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" On 12/12/2019 02:42, Sun, GuinanX wrote: > Hi, Kevin >=20 Hi Guinan, Thanks for the note. I have both these patches queued, > macsec fix has two patches: >=20 > http://patches.dpdk.org/patch/62265/ https://github.com/kevintraynor/dpdk-stable-queue/commit/7137dc35798febc3ab= 6738921eab092ca5c4ac0e > and http://patches.dpdk.org/patch/63196/ >=20 https://github.com/kevintraynor/dpdk-stable-queue/commit/f4d7ffe6e960c5edaf= c4073d724f6ad5d3247800 Kevin. >=20 > The 62265 patch is used to fix the problem that the macsec setting is inv= alid when the port is stopped. >=20 > The 63196 patch is used to fix the QoS sample application performance dro= p issue caused by 62265. >=20 > Please must merge patch 63196 after merging patch 62265. >=20 > Best Regards > Guinan Sun >=20 >> -----Original Message----- >> From: Kevin Traynor [mailto:ktraynor@redhat.com] >> Sent: Thursday, December 12, 2019 5:26 AM >> To: Sun, GuinanX >> Cc: Ye, Xiaolong ; dpdk stable >> Subject: patch 'net/ixgbe: fix MACsec setting' has been queued to LTS re= lease >> 18.11.6 >> >> 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 shou= t 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 need= ed to >> apply to the stable branch. If there were code changes for rebasing >> (ie: not only metadata diffs), please double check that the rebase was c= orrectly >> 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/7137dc35798febc3ab6738921eab092ca5c4ac0e >> >> Thanks. >> >> Kevin. >> >> --- >> From 7137dc35798febc3ab6738921eab092ca5c4ac0e Mon Sep 17 00:00:00 >> 2001 >> From: Guinan Sun >> Date: Thu, 31 Oct 2019 11:31:52 +0000 >> Subject: [PATCH] net/ixgbe: fix MACsec setting >> >> [ upstream commit 50556c88104cbc0096e90f454dc137258be2099f ] >> >> MACsec setting is not valid when port is stopped. >> In order to make it valid, the patch changes the setting to where port i= s started. >> >> Fixes: 597f9fafe13b ("app/testpmd: convert to new Tx offloads API") >> >> Signed-off-by: Guinan Sun >> Reviewed-by: Xiaolong Ye >> --- >> drivers/net/ixgbe/ixgbe_ethdev.c | 149 ++++++++++++++++++++++++++++++ >> drivers/net/ixgbe/ixgbe_ethdev.h | 19 ++++ >> drivers/net/ixgbe/rte_pmd_ixgbe.c | 125 ++----------------------- >> 3 files changed, 175 insertions(+), 118 deletions(-) >> >> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_= ethdev.c >> index 74de2ff4e..1336236ba 100644 >> --- a/drivers/net/ixgbe/ixgbe_ethdev.c >> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c >> @@ -2591,4 +2591,6 @@ 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 >> +=09=09IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data- >>> dev_private); >> >> =09PMD_INIT_FUNC_TRACE(); >> @@ -2831,4 +2833,7 @@ skip_link_setup: >> =09ixgbe_dev_link_update(dev, 0); >> >> +=09/* setup the macsec ctrl register */ >> +=09ixgbe_dev_macsec_register_enable(dev, macsec_ctrl); >> + >> =09return 0; >> >> @@ -2859,4 +2864,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev) >> =09PMD_INIT_FUNC_TRACE(); >> >> +=09/* disable mecsec register */ >> +=09ixgbe_dev_macsec_register_disable(dev); >> + >> =09rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev); >> >> @@ -8679,4 +8687,145 @@ ixgbe_clear_all_l2_tn_filter(struct rte_eth_dev >> *dev) } >> >> +void >> +ixgbe_dev_macsec_setting_save(struct rte_eth_dev *dev, >> +=09=09=09=09struct ixgbe_macsec_setting *macsec_setting) >> { >> +=09struct ixgbe_macsec_setting *macsec =3D >> +=09=09IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data- >>> dev_private); >> + >> +=09macsec->encrypt_en =3D macsec_setting->encrypt_en; >> +=09macsec->replayprotect_en =3D macsec_setting->replayprotect_en; } >> + >> +void >> +ixgbe_dev_macsec_setting_reset(struct rte_eth_dev *dev) { >> +=09struct ixgbe_macsec_setting *macsec =3D >> +=09=09IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data- >>> dev_private); >> + >> +=09macsec->encrypt_en =3D 0; >> +=09macsec->replayprotect_en =3D 0; >> +} >> + >> +void >> +ixgbe_dev_macsec_register_enable(struct rte_eth_dev *dev, >> +=09=09=09=09struct ixgbe_macsec_setting *macsec_setting) >> { >> +=09struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data- >>> dev_private); >> +=09uint32_t ctrl; >> +=09uint8_t en =3D macsec_setting->encrypt_en; >> +=09uint8_t rp =3D macsec_setting->replayprotect_en; >> + >> +=09/** >> +=09 * Workaround: >> +=09 * As no ixgbe_disable_sec_rx_path equivalent is >> +=09 * implemented for tx in the base code, and we are >> +=09 * not allowed to modify the base code in DPDK, so >> +=09 * just call the hand-written one directly for now. >> +=09 * The hardware support has been checked by >> +=09 * ixgbe_disable_sec_rx_path(). >> +=09 */ >> +=09ixgbe_disable_sec_tx_path_generic(hw); >> + >> +=09/* Enable Ethernet CRC (required by MACsec offload) */ >> +=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_HLREG0); >> +=09ctrl |=3D IXGBE_HLREG0_TXCRCEN | IXGBE_HLREG0_RXCRCSTRP; >> +=09IXGBE_WRITE_REG(hw, IXGBE_HLREG0, ctrl); >> + >> +=09/* Enable the TX and RX crypto engines */ >> +=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_SECTXCTRL); >> +=09ctrl &=3D ~IXGBE_SECTXCTRL_SECTX_DIS; >> +=09IXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, ctrl); >> + >> +=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_SECRXCTRL); >> +=09ctrl &=3D ~IXGBE_SECRXCTRL_SECRX_DIS; >> +=09IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, ctrl); >> + >> +=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_SECTXMINIFG); >> +=09ctrl &=3D ~IXGBE_SECTX_MINSECIFG_MASK; >> +=09ctrl |=3D 0x3; >> +=09IXGBE_WRITE_REG(hw, IXGBE_SECTXMINIFG, ctrl); >> + >> +=09/* Enable SA lookup */ >> +=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_LSECTXCTRL); >> +=09ctrl &=3D ~IXGBE_LSECTXCTRL_EN_MASK; >> +=09ctrl |=3D en ? IXGBE_LSECTXCTRL_AUTH_ENCRYPT : >> +=09=09 IXGBE_LSECTXCTRL_AUTH; >> +=09ctrl |=3D IXGBE_LSECTXCTRL_AISCI; >> +=09ctrl &=3D ~IXGBE_LSECTXCTRL_PNTHRSH_MASK; >> +=09ctrl |=3D IXGBE_MACSEC_PNTHRSH & >> IXGBE_LSECTXCTRL_PNTHRSH_MASK; >> +=09IXGBE_WRITE_REG(hw, IXGBE_LSECTXCTRL, ctrl); >> + >> +=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_LSECRXCTRL); >> +=09ctrl &=3D ~IXGBE_LSECRXCTRL_EN_MASK; >> +=09ctrl |=3D IXGBE_LSECRXCTRL_STRICT << IXGBE_LSECRXCTRL_EN_SHIFT; >> +=09ctrl &=3D ~IXGBE_LSECRXCTRL_PLSH; >> +=09if (rp) >> +=09=09ctrl |=3D IXGBE_LSECRXCTRL_RP; >> +=09else >> +=09=09ctrl &=3D ~IXGBE_LSECRXCTRL_RP; >> +=09IXGBE_WRITE_REG(hw, IXGBE_LSECRXCTRL, ctrl); >> + >> +=09/* Start the data paths */ >> +=09ixgbe_enable_sec_rx_path(hw); >> +=09/** >> +=09 * Workaround: >> +=09 * As no ixgbe_enable_sec_rx_path equivalent is >> +=09 * implemented for tx in the base code, and we are >> +=09 * not allowed to modify the base code in DPDK, so >> +=09 * just call the hand-written one directly for now. >> +=09 */ >> +=09ixgbe_enable_sec_tx_path_generic(hw); >> +} >> + >> +void >> +ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev) { >> +=09struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data- >>> dev_private); >> +=09uint32_t ctrl; >> + >> +=09/** >> +=09 * Workaround: >> +=09 * As no ixgbe_disable_sec_rx_path equivalent is >> +=09 * implemented for tx in the base code, and we are >> +=09 * not allowed to modify the base code in DPDK, so >> +=09 * just call the hand-written one directly for now. >> +=09 * The hardware support has been checked by >> +=09 * ixgbe_disable_sec_rx_path(). >> +=09 */ >> +=09ixgbe_disable_sec_tx_path_generic(hw); >> + >> +=09/* Disable the TX and RX crypto engines */ >> +=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_SECTXCTRL); >> +=09ctrl |=3D IXGBE_SECTXCTRL_SECTX_DIS; >> +=09IXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, ctrl); >> + >> +=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_SECRXCTRL); >> +=09ctrl |=3D IXGBE_SECRXCTRL_SECRX_DIS; >> +=09IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, ctrl); >> + >> +=09/* Disable SA lookup */ >> +=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_LSECTXCTRL); >> +=09ctrl &=3D ~IXGBE_LSECTXCTRL_EN_MASK; >> +=09ctrl |=3D IXGBE_LSECTXCTRL_DISABLE; >> +=09IXGBE_WRITE_REG(hw, IXGBE_LSECTXCTRL, ctrl); >> + >> +=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_LSECRXCTRL); >> +=09ctrl &=3D ~IXGBE_LSECRXCTRL_EN_MASK; >> +=09ctrl |=3D IXGBE_LSECRXCTRL_DISABLE << IXGBE_LSECRXCTRL_EN_SHIFT; >> +=09IXGBE_WRITE_REG(hw, IXGBE_LSECRXCTRL, ctrl); >> + >> +=09/* Start the data paths */ >> +=09ixgbe_enable_sec_rx_path(hw); >> +=09/** >> +=09 * Workaround: >> +=09 * As no ixgbe_enable_sec_rx_path equivalent is >> +=09 * implemented for tx in the base code, and we are >> +=09 * not allowed to modify the base code in DPDK, so >> +=09 * just call the hand-written one directly for now. >> +=09 */ >> +=09ixgbe_enable_sec_tx_path_generic(hw); >> +} >> + >> RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd); >> RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map); diff --git >> a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h >> index 5023fa13f..418adfa3d 100644 >> --- a/drivers/net/ixgbe/ixgbe_ethdev.h >> +++ b/drivers/net/ixgbe/ixgbe_ethdev.h >> @@ -361,4 +361,9 @@ struct rte_flow { >> }; >> >> +struct ixgbe_macsec_setting { >> +=09uint8_t encrypt_en; >> +=09uint8_t replayprotect_en; >> +}; >> + >> /* >> * Statistics counters collected by the MACsec @@ -467,4 +472,5 @@ stru= ct >> ixgbe_adapter { >> =09struct ixgbe_hw_stats stats; >> =09struct ixgbe_macsec_stats macsec_stats; >> +=09struct ixgbe_macsec_setting=09macsec_setting; >> =09struct ixgbe_hw_fdir_info fdir; >> =09struct ixgbe_interrupt intr; >> @@ -519,4 +525,7 @@ int ixgbe_vf_representor_uninit(struct rte_eth_dev >> *ethdev); >> =09(&((struct ixgbe_adapter *)adapter)->macsec_stats) >> >> +#define IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(adapter) \ >> +=09(&((struct ixgbe_adapter *)adapter)->macsec_setting) >> + >> #define IXGBE_DEV_PRIVATE_TO_INTR(adapter) \ >> =09(&((struct ixgbe_adapter *)adapter)->intr) @@ -737,4 +746,14 @@ int >> ixgbe_config_rss_filter(struct rte_eth_dev *dev, >> =09=09struct ixgbe_rte_flow_rss_conf *conf, bool add); >> >> +void ixgbe_dev_macsec_register_enable(struct rte_eth_dev *dev, >> +=09=09struct ixgbe_macsec_setting *macsec_setting); >> + >> +void ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev); >> + >> +void ixgbe_dev_macsec_setting_save(struct rte_eth_dev *dev, >> +=09=09struct ixgbe_macsec_setting *macsec_setting); >> + >> +void ixgbe_dev_macsec_setting_reset(struct rte_eth_dev *dev); >> + >> static inline int >> ixgbe_ethertype_filter_lookup(struct ixgbe_filter_info *filter_info, di= ff --git >> a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c >> index 3a874f9a9..49d538ef1 100644 >> --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c >> +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c >> @@ -515,7 +515,6 @@ int >> rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp) { >> -=09struct ixgbe_hw *hw; >> =09struct rte_eth_dev *dev; >> -=09uint32_t ctrl; >> +=09struct ixgbe_macsec_setting macsec_setting; >> >> =09RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); @@ -523,72 >> +522,10 @@ rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_= t >> rp) >> =09dev =3D &rte_eth_devices[port]; >> >> -=09if (!is_ixgbe_supported(dev)) >> -=09=09return -ENOTSUP; >> +=09macsec_setting.encrypt_en =3D en; >> +=09macsec_setting.replayprotect_en =3D rp; >> >> -=09hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); >> +=09ixgbe_dev_macsec_setting_save(dev, &macsec_setting); >> >> -=09/* Stop the data paths */ >> -=09if (ixgbe_disable_sec_rx_path(hw) !=3D IXGBE_SUCCESS) >> -=09=09return -ENOTSUP; >> -=09/** >> -=09 * Workaround: >> -=09 * As no ixgbe_disable_sec_rx_path equivalent is >> -=09 * implemented for tx in the base code, and we are >> -=09 * not allowed to modify the base code in DPDK, so >> -=09 * just call the hand-written one directly for now. >> -=09 * The hardware support has been checked by >> -=09 * ixgbe_disable_sec_rx_path(). >> -=09 */ >> -=09ixgbe_disable_sec_tx_path_generic(hw); >> - >> -=09/* Enable Ethernet CRC (required by MACsec offload) */ >> -=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_HLREG0); >> -=09ctrl |=3D IXGBE_HLREG0_TXCRCEN | IXGBE_HLREG0_RXCRCSTRP; >> -=09IXGBE_WRITE_REG(hw, IXGBE_HLREG0, ctrl); >> - >> -=09/* Enable the TX and RX crypto engines */ >> -=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_SECTXCTRL); >> -=09ctrl &=3D ~IXGBE_SECTXCTRL_SECTX_DIS; >> -=09IXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, ctrl); >> - >> -=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_SECRXCTRL); >> -=09ctrl &=3D ~IXGBE_SECRXCTRL_SECRX_DIS; >> -=09IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, ctrl); >> - >> -=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_SECTXMINIFG); >> -=09ctrl &=3D ~IXGBE_SECTX_MINSECIFG_MASK; >> -=09ctrl |=3D 0x3; >> -=09IXGBE_WRITE_REG(hw, IXGBE_SECTXMINIFG, ctrl); >> - >> -=09/* Enable SA lookup */ >> -=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_LSECTXCTRL); >> -=09ctrl &=3D ~IXGBE_LSECTXCTRL_EN_MASK; >> -=09ctrl |=3D en ? IXGBE_LSECTXCTRL_AUTH_ENCRYPT : >> -=09=09 IXGBE_LSECTXCTRL_AUTH; >> -=09ctrl |=3D IXGBE_LSECTXCTRL_AISCI; >> -=09ctrl &=3D ~IXGBE_LSECTXCTRL_PNTHRSH_MASK; >> -=09ctrl |=3D IXGBE_MACSEC_PNTHRSH & >> IXGBE_LSECTXCTRL_PNTHRSH_MASK; >> -=09IXGBE_WRITE_REG(hw, IXGBE_LSECTXCTRL, ctrl); >> - >> -=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_LSECRXCTRL); >> -=09ctrl &=3D ~IXGBE_LSECRXCTRL_EN_MASK; >> -=09ctrl |=3D IXGBE_LSECRXCTRL_STRICT << IXGBE_LSECRXCTRL_EN_SHIFT; >> -=09ctrl &=3D ~IXGBE_LSECRXCTRL_PLSH; >> -=09if (rp) >> -=09=09ctrl |=3D IXGBE_LSECRXCTRL_RP; >> -=09else >> -=09=09ctrl &=3D ~IXGBE_LSECRXCTRL_RP; >> -=09IXGBE_WRITE_REG(hw, IXGBE_LSECRXCTRL, ctrl); >> - >> -=09/* Start the data paths */ >> -=09ixgbe_enable_sec_rx_path(hw); >> -=09/** >> -=09 * Workaround: >> -=09 * As no ixgbe_enable_sec_rx_path equivalent is >> -=09 * implemented for tx in the base code, and we are >> -=09 * not allowed to modify the base code in DPDK, so >> -=09 * just call the hand-written one directly for now. >> -=09 */ >> -=09ixgbe_enable_sec_tx_path_generic(hw); >> +=09ixgbe_dev_macsec_register_enable(dev, &macsec_setting); >> >> =09return 0; >> @@ -598,7 +535,5 @@ int >> rte_pmd_ixgbe_macsec_disable(uint16_t port) { >> -=09struct ixgbe_hw *hw; >> =09struct rte_eth_dev *dev; >> -=09uint32_t ctrl; >> >> =09RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); @@ -606,53 >> +541,7 @@ rte_pmd_ixgbe_macsec_disable(uint16_t port) >> =09dev =3D &rte_eth_devices[port]; >> >> -=09if (!is_ixgbe_supported(dev)) >> -=09=09return -ENOTSUP; >> +=09ixgbe_dev_macsec_setting_reset(dev); >> >> -=09hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); >> - >> -=09/* Stop the data paths */ >> -=09if (ixgbe_disable_sec_rx_path(hw) !=3D IXGBE_SUCCESS) >> -=09=09return -ENOTSUP; >> -=09/** >> -=09 * Workaround: >> -=09 * As no ixgbe_disable_sec_rx_path equivalent is >> -=09 * implemented for tx in the base code, and we are >> -=09 * not allowed to modify the base code in DPDK, so >> -=09 * just call the hand-written one directly for now. >> -=09 * The hardware support has been checked by >> -=09 * ixgbe_disable_sec_rx_path(). >> -=09 */ >> -=09ixgbe_disable_sec_tx_path_generic(hw); >> - >> -=09/* Disable the TX and RX crypto engines */ >> -=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_SECTXCTRL); >> -=09ctrl |=3D IXGBE_SECTXCTRL_SECTX_DIS; >> -=09IXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, ctrl); >> - >> -=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_SECRXCTRL); >> -=09ctrl |=3D IXGBE_SECRXCTRL_SECRX_DIS; >> -=09IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, ctrl); >> - >> -=09/* Disable SA lookup */ >> -=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_LSECTXCTRL); >> -=09ctrl &=3D ~IXGBE_LSECTXCTRL_EN_MASK; >> -=09ctrl |=3D IXGBE_LSECTXCTRL_DISABLE; >> -=09IXGBE_WRITE_REG(hw, IXGBE_LSECTXCTRL, ctrl); >> - >> -=09ctrl =3D IXGBE_READ_REG(hw, IXGBE_LSECRXCTRL); >> -=09ctrl &=3D ~IXGBE_LSECRXCTRL_EN_MASK; >> -=09ctrl |=3D IXGBE_LSECRXCTRL_DISABLE << IXGBE_LSECRXCTRL_EN_SHIFT; >> -=09IXGBE_WRITE_REG(hw, IXGBE_LSECRXCTRL, ctrl); >> - >> -=09/* Start the data paths */ >> -=09ixgbe_enable_sec_rx_path(hw); >> -=09/** >> -=09 * Workaround: >> -=09 * As no ixgbe_enable_sec_rx_path equivalent is >> -=09 * implemented for tx in the base code, and we are >> -=09 * not allowed to modify the base code in DPDK, so >> -=09 * just call the hand-written one directly for now. >> -=09 */ >> -=09ixgbe_enable_sec_tx_path_generic(hw); >> +=09ixgbe_dev_macsec_register_disable(dev); >> >> =09return 0; >> -- >> 2.21.0 >> >> --- >> Diff of the applied patch vs upstream commit (please double-check if n= on- >> empty: >> --- >> --- -=092019-12-11 21:24:13.077637869 +0000 >> +++ 0004-net-ixgbe-fix-MACsec-setting.patch=092019-12-11 >> 21:24:12.552653594 +0000 >> @@ -1 +1 @@ >> -From 50556c88104cbc0096e90f454dc137258be2099f Mon Sep 17 00:00:00 >> 2001 >> +From 7137dc35798febc3ab6738921eab092ca5c4ac0e Mon Sep 17 00:00:00 >> 2001 >> @@ -5,0 +6,2 @@ >> +[ upstream commit 50556c88104cbc0096e90f454dc137258be2099f ] >> + >> @@ -11 +12,0 @@ >> -Cc: stable@dpdk.org >> @@ -22 +23 @@ >> -index 3c7624f3a..06414d110 100644 >> +index 74de2ff4e..1336236ba 100644 >> @@ -25 +26 @@ >> -@@ -2543,4 +2543,6 @@ ixgbe_dev_start(struct rte_eth_dev *dev) >> +@@ -2591,4 +2591,6 @@ ixgbe_dev_start(struct rte_eth_dev *dev) >> @@ -32 +33 @@ >> -@@ -2795,4 +2797,7 @@ skip_link_setup: >> +@@ -2831,4 +2833,7 @@ skip_link_setup: >> @@ -40 +41 @@ >> -@@ -2826,4 +2831,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev) >> +@@ -2859,4 +2864,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev) >> @@ -48 +49 @@ >> -@@ -8817,4 +8825,145 @@ ixgbe_clear_all_l2_tn_filter(struct rte_eth_dev >> *dev) >> +@@ -8679,4 +8687,145 @@ ixgbe_clear_all_l2_tn_filter(struct rte_eth_dev >> +*dev) >> @@ -195 +196 @@ >> -index 6e9ed2e10..5da6923a1 100644 >> +index 5023fa13f..418adfa3d 100644 >> @@ -198 +199 @@ >> -@@ -366,4 +366,9 @@ struct rte_flow { >> +@@ -361,4 +361,9 @@ struct rte_flow { >> @@ -208 +209 @@ >> -@@ -472,4 +477,5 @@ struct ixgbe_adapter { >> +@@ -467,4 +472,5 @@ struct ixgbe_adapter { >> @@ -214 +215 @@ >> -@@ -524,4 +530,7 @@ int ixgbe_vf_representor_uninit(struct rte_eth_dev >> *ethdev); >> +@@ -519,4 +525,7 @@ int ixgbe_vf_representor_uninit(struct rte_eth_dev >> +*ethdev); >> @@ -222 +223 @@ >> -@@ -742,4 +751,14 @@ int ixgbe_config_rss_filter(struct rte_eth_dev *de= v, >> +@@ -737,4 +746,14 @@ int ixgbe_config_rss_filter(struct rte_eth_dev >> +*dev, >> @@ -238 +239 @@ >> -index 9514f2cf5..073fe1e23 100644 >> +index 3a874f9a9..49d538ef1 100644 >> @@ -241 +242 @@ >> -@@ -516,7 +516,6 @@ int >> +@@ -515,7 +515,6 @@ int >> @@ -250 +251 @@ >> -@@ -524,72 +523,10 @@ rte_pmd_ixgbe_macsec_enable(uint16_t port, >> uint8_t en, uint8_t rp) >> +@@ -523,72 +522,10 @@ rte_pmd_ixgbe_macsec_enable(uint16_t port, >> +uint8_t en, uint8_t rp) >> @@ -327 +328 @@ >> -@@ -599,7 +536,5 @@ int >> +@@ -598,7 +535,5 @@ int >> @@ -335 +336 @@ >> -@@ -607,53 +542,7 @@ rte_pmd_ixgbe_macsec_disable(uint16_t port) >> +@@ -606,53 +541,7 @@ rte_pmd_ixgbe_macsec_disable(uint16_t port) >=20