DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Zhao1, Wei" <wei.zhao1@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>,
	"Lu, Wenzhuo" <wenzhuo.lu@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/ixgbe: enable promiscuous mode on PF host
Date: Wed, 13 Feb 2019 03:41:45 +0000	[thread overview]
Message-ID: <039ED4275CED7440929022BC67E7061153333BE7@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1547614920-59680-3-git-send-email-wei.zhao1@intel.com>



> -----Original Message-----
> From: Zhao1, Wei
> Sent: Wednesday, January 16, 2019 1:02 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH v2 2/3] net/ixgbe: enable promiscuous mode on PF host
> 

The title is misleading, we are going to support VF's promiscuous mode but not PF.

How about "Add VF promiscuous mode support when PF as host"

> There is need to PF host promiscuous mode enable. For ixgbe, in order to
> support VF vlan promiscuous or unicast promiscuous, we need to set PF host
> register PFVML2FLT of bit UPE and VPE.
> It also align to ixgbe kernel code version 5.5.3.
> 
> Fixes: 72dec9e37a84 ("ixgbe: support multicast promiscuous mode on VF")

Same to previous patch, not a fix.
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.h |  1 +
>  drivers/net/ixgbe/ixgbe_pf.c     | 78
> ++++++++++++++++++++++++++++------------
>  2 files changed, 57 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h
> b/drivers/net/ixgbe/ixgbe_ethdev.h
> index d0b9396..e81f152 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.h
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.h
> @@ -265,6 +265,7 @@ struct ixgbe_vf_info {
>  	uint8_t spoofchk_enabled;
>  	uint8_t api_version;
>  	uint16_t switch_domain_id;
> +	uint16_t xcast_mode;
>  };
> 
>  /*
> diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index
> 4b833ff..c9d1a1c 100644
> --- a/drivers/net/ixgbe/ixgbe_pf.c
> +++ b/drivers/net/ixgbe/ixgbe_pf.c
> @@ -408,23 +408,6 @@ ixgbe_vf_reset_msg(struct rte_eth_dev *dev, uint16_t
> vf)  }
> 
>  static int
> -ixgbe_enable_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf) -{
> -	struct ixgbe_hw *hw =
> IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> -	uint32_t vmolr;
> -
> -	vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
> -
> -	RTE_LOG(INFO, PMD, "VF %u: enabling multicast promiscuous\n", vf);
> -
> -	vmolr |= IXGBE_VMOLR_MPE;
> -
> -	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
> -
> -	return 0;
> -}
> -
> -static int
>  ixgbe_disable_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf)  {
>  	struct ixgbe_hw *hw =
> IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> @@ -688,19 +671,70 @@ ixgbe_set_vf_mc_promisc(struct rte_eth_dev *dev,
> uint32_t vf, uint32_t *msgbuf)  {
>  	struct ixgbe_vf_info *vfinfo =
>  		*(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
> -	bool enable = !!msgbuf[1];	/* msgbuf contains the flag to enable */
> +	struct ixgbe_hw *hw =
> IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +	int xcast_mode = msgbuf[1];	/* msgbuf contains the flag to enable */
> +	u32 vmolr, fctrl, disable, enable;
> 
>  	switch (vfinfo[vf].api_version) {
>  	case ixgbe_mbox_api_12:
> +		/* promisc introduced in 1.3 version */
> +		if (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC)
> +			return -EOPNOTSUPP;
> +		break;
> +		/* Fall threw */
> +	case ixgbe_mbox_api_13:
>  		break;
>  	default:
>  		return -1;
>  	}
> 
> -	if (enable)
> -		return ixgbe_enable_vf_mc_promisc(dev, vf);
> -	else
> -		return ixgbe_disable_vf_mc_promisc(dev, vf);
> +	if (vfinfo[vf].xcast_mode == xcast_mode)
> +		goto out;
> +
> +	switch (xcast_mode) {
> +	case IXGBEVF_XCAST_MODE_NONE:
> +		disable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
> +			  IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE |
> IXGBE_VMOLR_VPE;
> +		enable = 0;
> +		break;
> +	case IXGBEVF_XCAST_MODE_MULTI:
> +		disable = IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE |
> IXGBE_VMOLR_VPE;
> +		enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE;
> +		break;
> +	case IXGBEVF_XCAST_MODE_ALLMULTI:
> +		disable = IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
> +		enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
> IXGBE_VMOLR_MPE;
> +		break;
> +	case IXGBEVF_XCAST_MODE_PROMISC:
> +		if (hw->mac.type <= ixgbe_mac_82599EB)
> +			return -1;
> +
> +		fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
> +		if (!(fctrl & IXGBE_FCTRL_UPE)) {
> +			/* VF promisc requires PF in promisc */
> +			RTE_LOG(ERR, PMD,
> +			       "Enabling VF promisc requires PF in promisc\n");
> +			return -1;
> +		}
> +
> +		disable = 0;
> +		enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
> +			 IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE |
> IXGBE_VMOLR_VPE;
> +		break;
> +	default:
> +		return -1;
> +	}
> +
> +	vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
> +	vmolr &= ~disable;
> +	vmolr |= enable;
> +	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
> +	vfinfo[vf].xcast_mode = xcast_mode;
> +
> +out:
> +	msgbuf[1] = xcast_mode;
> +
> +	return 0;
>  }
> 
>  static int
> --
> 2.7.5

  reply	other threads:[~2019-02-13  3:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16  4:42 [dpdk-dev] [PATCH 0/3] promiscuous mode enable on VF Wei Zhao
2019-01-16  4:42 ` [dpdk-dev] [PATCH 1/3] net/ixgbe: " Wei Zhao
2019-01-16  4:42 ` [dpdk-dev] [PATCH 2/3] net/ixgbe: enable promiscous mode on PF host Wei Zhao
2019-01-16  4:42 ` [dpdk-dev] [PATCH 3/3] net/ixgbe: update API version Wei Zhao
2019-01-16  5:01 ` [dpdk-dev] [PATCH v2 0/3] net/ixgbe: promiscuous mode enable on VF Wei Zhao
2019-01-16  5:01   ` [dpdk-dev] [PATCH v2 1/3] " Wei Zhao
2019-02-13  3:35     ` Zhang, Qi Z
2019-02-13  3:36       ` Zhao1, Wei
2019-01-16  5:01   ` [dpdk-dev] [PATCH v2 2/3] net/ixgbe: enable promiscuous mode on PF host Wei Zhao
2019-02-13  3:41     ` Zhang, Qi Z [this message]
2019-02-13  3:42       ` Zhao1, Wei
2019-01-16  5:02   ` [dpdk-dev] [PATCH v2 3/3] net/ixgbe: update API version Wei Zhao
2019-02-13  3:43     ` Zhang, Qi Z
2019-02-14  1:22       ` Zhao1, Wei
2019-02-13  7:18   ` [dpdk-dev] [PATCH v3 0/2] net/ixgbe: promiscuous mode enable on VF Wei Zhao
2019-02-13  7:18     ` [dpdk-dev] [PATCH v3 1/2] " Wei Zhao
2019-03-01  7:53       ` Zhang, Qi Z
2019-03-08  3:18         ` Zhao1, Wei
2019-02-13  7:18     ` [dpdk-dev] [PATCH v3 2/2] net/ixgbe: add VF promiscuous mode support when PF as host Wei Zhao
2019-03-08  2:46     ` [dpdk-dev] [PATCH v4 0/2] net/ixgbe: promiscuous mode enable on VF Wei Zhao
2019-03-08  2:46       ` [dpdk-dev] [PATCH v4 1/2] " Wei Zhao
2019-03-08  2:46       ` [dpdk-dev] [PATCH v4 2/2] net/ixgbe: add VF promiscuous mode support when PF as host Wei Zhao
2019-03-08  5:45       ` [dpdk-dev] [PATCH v4 0/2] net/ixgbe: promiscuous mode enable on VF Zhang, Qi Z
2019-01-16  8:28 ` [dpdk-dev] [PATCH 0/3] " David Marchand
2019-01-17  9:23   ` Zhao1, Wei
2019-01-16 18:59 ` Stephen Hemminger
2019-01-17  9:27   ` Zhao1, Wei

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=039ED4275CED7440929022BC67E7061153333BE7@SHSMSX103.ccr.corp.intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=wei.zhao1@intel.com \
    --cc=wenzhuo.lu@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).