DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev
@ 2015-11-30  3:54 Jingjing Wu
  2015-11-30  5:17 ` Zhang, Helin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jingjing Wu @ 2015-11-30  3:54 UTC (permalink / raw)
  To: dev

When dev_stop is called in i40evf pmd driver, queues are switched off
to stop receiving and transmitting. But the mac address of this VF
still exists in VEB switch.
To stop the traffic from VSI level, the mac address need to be removed
too. Then the bandwidth for this SRIOV VSI can be freed.
This patch fix this issue.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 5c554f2..14d2a50 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1878,7 +1878,9 @@ err_queue:
 static void
 i40evf_dev_stop(struct rte_eth_dev *dev)
 {
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+	struct ether_addr mac_addr;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -1892,6 +1894,11 @@ i40evf_dev_stop(struct rte_eth_dev *dev)
 		rte_free(intr_handle->intr_vec);
 		intr_handle->intr_vec = NULL;
 	}
+	/* Set mac addr */
+	(void)rte_memcpy(mac_addr.addr_bytes, hw->mac.addr,
+				sizeof(mac_addr.addr_bytes));
+	/* Delete mac addr of this vf */
+	i40evf_del_mac_addr(dev, &mac_addr);
 }
 
 static int
-- 
2.4.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev
  2015-11-30  3:54 [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev Jingjing Wu
@ 2015-11-30  5:17 ` Zhang, Helin
  2015-11-30  5:48   ` Wu, Jingjing
  2015-11-30 16:33 ` Stephen Hemminger
  2015-12-06 21:34 ` Thomas Monjalon
  2 siblings, 1 reply; 6+ messages in thread
From: Zhang, Helin @ 2015-11-30  5:17 UTC (permalink / raw)
  To: Wu, Jingjing, dev



> -----Original Message-----
> From: Wu, Jingjing
> Sent: Monday, November 30, 2015 11:54 AM
> To: dev@dpdk.org
> Cc: Wu, Jingjing; Zhang, Helin; Pei, Yulong
> Subject: [PATCH] i40evf: fix mac deletion when stop dev
> 
> When dev_stop is called in i40evf pmd driver, queues are switched off to
> stop receiving and transmitting. But the mac address of this VF still exists in
> VEB switch.
> To stop the traffic from VSI level, the mac address need to be removed too.
> Then the bandwidth for this SRIOV VSI can be freed.
> This patch fix this issue.
> 
> Fixes: 4861cde46116 ("i40e: new poll mode driver")
> 
> Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> b/drivers/net/i40e/i40e_ethdev_vf.c
> index 5c554f2..14d2a50 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1878,7 +1878,9 @@ err_queue:
>  static void
>  i40evf_dev_stop(struct rte_eth_dev *dev)  {
> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
>  	struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
> +	struct ether_addr mac_addr;
> 
>  	PMD_INIT_FUNC_TRACE();
> 
> @@ -1892,6 +1894,11 @@ i40evf_dev_stop(struct rte_eth_dev *dev)
>  		rte_free(intr_handle->intr_vec);
>  		intr_handle->intr_vec = NULL;
>  	}
> +	/* Set mac addr */
> +	(void)rte_memcpy(mac_addr.addr_bytes, hw->mac.addr,
> +				sizeof(mac_addr.addr_bytes));
Use ether_addr_copy() instead.

/Helin

> +	/* Delete mac addr of this vf */
> +	i40evf_del_mac_addr(dev, &mac_addr);
>  }
> 
>  static int
> --
> 2.4.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev
  2015-11-30  5:17 ` Zhang, Helin
@ 2015-11-30  5:48   ` Wu, Jingjing
  0 siblings, 0 replies; 6+ messages in thread
From: Wu, Jingjing @ 2015-11-30  5:48 UTC (permalink / raw)
  To: Zhang, Helin, dev

> > +	/* Set mac addr */
> > +	(void)rte_memcpy(mac_addr.addr_bytes, hw->mac.addr,
> > +				sizeof(mac_addr.addr_bytes));
> Use ether_addr_copy() instead.
> 
> /Helin

Thanks. But the types of mac_addr and hw->mac are different, cannot use ether_addr_copy.

Thanks
Jingjing

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev
  2015-11-30  3:54 [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev Jingjing Wu
  2015-11-30  5:17 ` Zhang, Helin
@ 2015-11-30 16:33 ` Stephen Hemminger
  2015-12-06 21:34   ` Thomas Monjalon
  2015-12-06 21:34 ` Thomas Monjalon
  2 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2015-11-30 16:33 UTC (permalink / raw)
  To: Jingjing Wu; +Cc: dev

On Mon, 30 Nov 2015 11:54:09 +0800
Jingjing Wu <jingjing.wu@intel.com> wrote:

> +	(void)rte_memcpy(mac_addr.addr_bytes, hw->mac.addr,
> +				sizeof(mac_addr.addr_bytes))

Please don't add useless (void) cast.
I haven't seen that since lint on Unix.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev
  2015-11-30 16:33 ` Stephen Hemminger
@ 2015-12-06 21:34   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2015-12-06 21:34 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

2015-11-30 08:33, Stephen Hemminger:
> On Mon, 30 Nov 2015 11:54:09 +0800
> Jingjing Wu <jingjing.wu@intel.com> wrote:
> 
> > +	(void)rte_memcpy(mac_addr.addr_bytes, hw->mac.addr,
> > +				sizeof(mac_addr.addr_bytes))
> 
> Please don't add useless (void) cast.
> I haven't seen that since lint on Unix.

It is the style in i40e driver.
It may deserve a general cleanup.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev
  2015-11-30  3:54 [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev Jingjing Wu
  2015-11-30  5:17 ` Zhang, Helin
  2015-11-30 16:33 ` Stephen Hemminger
@ 2015-12-06 21:34 ` Thomas Monjalon
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2015-12-06 21:34 UTC (permalink / raw)
  To: Jingjing Wu; +Cc: dev

2015-11-30 11:54, Jingjing Wu:
> When dev_stop is called in i40evf pmd driver, queues are switched off
> to stop receiving and transmitting. But the mac address of this VF
> still exists in VEB switch.
> To stop the traffic from VSI level, the mac address need to be removed
> too. Then the bandwidth for this SRIOV VSI can be freed.
> This patch fix this issue.
> 
> Fixes: 4861cde46116 ("i40e: new poll mode driver")
> 
> Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-06 21:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-30  3:54 [dpdk-dev] [PATCH] i40evf: fix mac deletion when stop dev Jingjing Wu
2015-11-30  5:17 ` Zhang, Helin
2015-11-30  5:48   ` Wu, Jingjing
2015-11-30 16:33 ` Stephen Hemminger
2015-12-06 21:34   ` Thomas Monjalon
2015-12-06 21:34 ` Thomas Monjalon

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).