DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yong Wang <yongwang@vmware.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Charles \(Chas\) Williams" <ciwillia@brocade.com>
Subject: Re: [dpdk-dev] [PATCH 2/3] vmxnet3: don't clear vf_table on restart
Date: Wed, 9 Dec 2015 20:35:44 +0000	[thread overview]
Message-ID: <2A356900-08B7-4FCF-8847-77543B8140B7@vmware.com> (raw)
In-Reply-To: <1449191107-14222-3-git-send-email-stephen@networkplumber.org>

On 12/3/15, 5:05 PM, "Stephen Hemminger" <stephen@networkplumber.org> wrote:



>From: "Charles (Chas) Williams" <ciwillia@brocade.com>
>
>From: Charles (Chas) Williams <ciwillia@brocade.com>
>
>During an MTU change, the adapter is restarted. If hardware VLAN offload
>is in use, this existing filter table would also be cleared. Instead,
>setup the shadow table once during device initialization and just update
>during restart.
>
>Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
>Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>---

Acked-by: Yong Wang <yongwang@vmware.com>

> drivers/net/vmxnet3/vmxnet3_ethdev.c | 23 ++++++++---------------
> 1 file changed, 8 insertions(+), 15 deletions(-)
>
>diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
>index c363bf6..2d7bf13 100644
>--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
>+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
>@@ -89,8 +89,8 @@ static void vmxnet3_dev_info_get(struct rte_eth_dev *dev,
> static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev,
> 				       uint16_t vid, int on);
> static void vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask);
>-static void vmxnet3_dev_vlan_offload_set_clear(struct rte_eth_dev *dev,
>-						int mask, int clear);
>+static void vmxnet3_dev_vlan_offload_update(struct rte_eth_dev *dev,
>+					    int mask);
> 
> #if PROCESS_SYS_EVENTS == 1
> static void vmxnet3_process_events(struct vmxnet3_hw *);
>@@ -294,6 +294,9 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
> 	/* Put device in Quiesce Mode */
> 	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_QUIESCE_DEV);
> 
>+	/* allow untagged pkts */
>+	VMXNET3_SET_VFTABLE_ENTRY(hw->shadow_vfta, 0);
>+
> 	return 0;
> }
> 
>@@ -518,7 +521,7 @@ vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
> 	if (dev->data->dev_conf.rxmode.hw_vlan_filter)
> 		mask |= ETH_VLAN_FILTER_MASK;
> 
>-	vmxnet3_dev_vlan_offload_set_clear(dev, mask, 1);
>+	vmxnet3_dev_vlan_offload_update(dev, mask);
> 
> 	PMD_INIT_LOG(DEBUG,
> 		     "Writing MAC Address : %02x:%02x:%02x:%02x:%02x:%02x",
>@@ -835,8 +838,7 @@ vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vid, int on)
> }
> 
> static void
>-vmxnet3_dev_vlan_offload_set_clear(struct rte_eth_dev *dev,
>-				   int mask, int clear)
>+vmxnet3_dev_vlan_offload_update(struct rte_eth_dev *dev, int mask)
> {
> 	struct vmxnet3_hw *hw = dev->data->dev_private;
> 	Vmxnet3_DSDevRead *devRead = &hw->shared->devRead;
>@@ -851,17 +853,8 @@ vmxnet3_dev_vlan_offload_set_clear(struct rte_eth_dev *dev,
> 			       VMXNET3_CMD_UPDATE_FEATURE);
> 
> 	if (mask & ETH_VLAN_FILTER_MASK) {
>-		if (clear) {
>-			memset(hw->shadow_vfta, 0,
>-			       VMXNET3_VFT_TABLE_SIZE);
>-			/* allow untagged pkts */
>-			VMXNET3_SET_VFTABLE_ENTRY(hw->shadow_vfta, 0);
>-		}
> 		memcpy(vf_table, hw->shadow_vfta, VMXNET3_VFT_TABLE_SIZE);
> 	} else {
>-		/* allow any pkts -- no filtering */
>-		if (clear)
>-			memset(hw->shadow_vfta, 0xff, VMXNET3_VFT_TABLE_SIZE);
> 		memset(vf_table, 0xff, VMXNET3_VFT_TABLE_SIZE);
> 	}
> 
>@@ -872,7 +865,7 @@ vmxnet3_dev_vlan_offload_set_clear(struct rte_eth_dev *dev,
> static void
> vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)
> {
>-	vmxnet3_dev_vlan_offload_set_clear(dev, mask, 0);
>+	vmxnet3_dev_vlan_offload_update(dev, mask);
> }
> 
> #if PROCESS_SYS_EVENTS == 1
>-- 
>2.1.4
>

  reply	other threads:[~2015-12-09 20:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04  1:05 [dpdk-dev] [PATCH 0/3] vmxnet3: bugfix and enhancements Stephen Hemminger
2015-12-04  1:05 ` [dpdk-dev] [PATCH 1/3] vmxnet3: support mult-segment receive Stephen Hemminger
2015-12-22 19:51   ` Yong Wang
2015-12-04  1:05 ` [dpdk-dev] [PATCH 2/3] vmxnet3: don't clear vf_table on restart Stephen Hemminger
2015-12-09 20:35   ` Yong Wang [this message]
2015-12-04  1:05 ` [dpdk-dev] [PATCH 3/3] vmxnet3: fix vlan_offload_set Stephen Hemminger
2015-12-09 20:38   ` Yong Wang
2016-02-03 11:10 ` [dpdk-dev] [PATCH 0/3] vmxnet3: bugfix and enhancements Bruce Richardson

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=2A356900-08B7-4FCF-8847-77543B8140B7@vmware.com \
    --to=yongwang@vmware.com \
    --cc=ciwillia@brocade.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /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).