patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Yang, Qiming" <qiming.yang@intel.com>
To: "Sun, GuinanX" <guinanx.sun@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Zhao1, Wei" <wei.zhao1@intel.com>,
	"Sun, GuinanX" <guinanx.sun@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/ixgbe: fix MAC security private API
Date: Fri, 22 May 2020 07:51:33 +0000	[thread overview]
Message-ID: <MN2PR11MB35825B70EDCA58C9BCDAE58AE5B40@MN2PR11MB3582.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200522044010.26962-1-guinanx.sun@intel.com>

Hi, 
Do you copy the commit log of the other patch? I think this patch don't touch any private API.

Qiming

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Guinan Sun
> Sent: Friday, May 22, 2020 12:40
> To: dev@dpdk.org
> Cc: Zhao1, Wei <wei.zhao1@intel.com>; Sun, GuinanX
> <guinanx.sun@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/ixgbe: fix MAC security private API
> 
> The driver type need to be checked in private API.
> The patch fixes the issue.
> 
> Fixes: 50556c88104c ("net/ixgbe: fix MACsec setting")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c  | 14 ++++++++++++--
> drivers/net/ixgbe/ixgbe_ethdev.h  |  4 ++--
> drivers/net/ixgbe/rte_pmd_ixgbe.c | 10 ++++++----
>  3 files changed, 20 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index f8a84c565..3e9c0f895 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -8988,7 +8988,7 @@ ixgbe_dev_macsec_setting_reset(struct
> rte_eth_dev *dev)
>  	macsec->replayprotect_en = 0;
>  }
> 
> -void
> +int
>  ixgbe_dev_macsec_register_enable(struct rte_eth_dev *dev,
>  				struct ixgbe_macsec_setting
> *macsec_setting)  { @@ -8997,6 +8997,9 @@
> ixgbe_dev_macsec_register_enable(struct rte_eth_dev *dev,
>  	uint8_t en = macsec_setting->encrypt_en;
>  	uint8_t rp = macsec_setting->replayprotect_en;
> 
> +	if (!is_ixgbe_supported(dev))
> +		return -ENOTSUP;
> +
>  	/**
>  	 * Workaround:
>  	 * As no ixgbe_disable_sec_rx_path equivalent is @@ -9057,14
> +9060,19 @@ ixgbe_dev_macsec_register_enable(struct rte_eth_dev *dev,
>  	 * just call the hand-written one directly for now.
>  	 */
>  	ixgbe_enable_sec_tx_path_generic(hw);
> +
> +	return 0;
>  }
> 
> -void
> +int
>  ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev)  {
>  	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
>  	uint32_t ctrl;
> 
> +	if (!is_ixgbe_supported(dev))
> +		return -ENOTSUP;
> +
>  	/**
>  	 * Workaround:
>  	 * As no ixgbe_disable_sec_rx_path equivalent is @@ -9106,6
> +9114,8 @@ ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev)
>  	 * just call the hand-written one directly for now.
>  	 */
>  	ixgbe_enable_sec_tx_path_generic(hw);
> +
> +	return 0;
>  }
> 
>  RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd); diff --git
> a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
> index 3d78b2ee2..c14cadab4 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.h
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.h
> @@ -755,10 +755,10 @@ int ixgbe_action_rss_same(const struct
> rte_flow_action_rss *comp,  int ixgbe_config_rss_filter(struct rte_eth_dev
> *dev,
>  		struct ixgbe_rte_flow_rss_conf *conf, bool add);
> 
> -void ixgbe_dev_macsec_register_enable(struct rte_eth_dev *dev,
> +int ixgbe_dev_macsec_register_enable(struct rte_eth_dev *dev,
>  		struct ixgbe_macsec_setting *macsec_setting);
> 
> -void ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev);
> +int ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev);
> 
>  void ixgbe_dev_macsec_setting_save(struct rte_eth_dev *dev,
>  		struct ixgbe_macsec_setting *macsec_setting); diff --git
> a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
> index 8bcaded6e..40cc7058f 100644
> --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
> +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
> @@ -517,6 +517,7 @@ rte_pmd_ixgbe_macsec_enable(uint16_t port,
> uint8_t en, uint8_t rp)  {
>  	struct rte_eth_dev *dev;
>  	struct ixgbe_macsec_setting macsec_setting;
> +	int ret = 0;
> 
>  	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
> 
> @@ -528,15 +529,16 @@ rte_pmd_ixgbe_macsec_enable(uint16_t port,
> uint8_t en, uint8_t rp)
> 
>  	ixgbe_dev_macsec_setting_save(dev, &macsec_setting);
> 
> -	ixgbe_dev_macsec_register_enable(dev, &macsec_setting);
> +	ret = ixgbe_dev_macsec_register_enable(dev, &macsec_setting);
> 
> -	return 0;
> +	return ret;
>  }
> 
>  int
>  rte_pmd_ixgbe_macsec_disable(uint16_t port)  {
>  	struct rte_eth_dev *dev;
> +	int ret = 0;
> 
>  	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
> 
> @@ -544,9 +546,9 @@ rte_pmd_ixgbe_macsec_disable(uint16_t port)
> 
>  	ixgbe_dev_macsec_setting_reset(dev);
> 
> -	ixgbe_dev_macsec_register_disable(dev);
> +	ret = ixgbe_dev_macsec_register_disable(dev);
> 
> -	return 0;
> +	return ret;
>  }
> 
>  int
> --
> 2.17.1


      reply	other threads:[~2020-05-22  7:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22  4:40 [dpdk-stable] " Guinan Sun
2020-05-22  7:51 ` Yang, Qiming [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR11MB35825B70EDCA58C9BCDAE58AE5B40@MN2PR11MB3582.namprd11.prod.outlook.com \
    --to=qiming.yang@intel.com \
    --cc=dev@dpdk.org \
    --cc=guinanx.sun@intel.com \
    --cc=stable@dpdk.org \
    --cc=wei.zhao1@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).