DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: fix default MAC setting
@ 2017-05-02  8:34 Wenzhuo Lu
  2017-05-02 13:32 ` Igor Ryzhov
  2017-05-05 14:40 ` Thomas Monjalon
  0 siblings, 2 replies; 4+ messages in thread
From: Wenzhuo Lu @ 2017-05-02  8:34 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu, stable

Pool 0 is not PF, it's VF 0. So the MAC is set for VF 0
but not PF.
The code introduced a weird issue. In the scenario PF + VF,
when only starting PF, the default PF MAC address is working.
But after starting a VF, the default PF MAC address becomes
the VF's address.

Use the pool which is not occupied by VFs for PF to fix it.

Fixes: 8164fe82846b ("ixgbe: add default mac address modifier")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index bbae4f9..9ddd685 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4658,9 +4658,11 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 static void
 ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr)
 {
+	struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+
 	ixgbe_remove_rar(dev, 0);
 
-	ixgbe_add_rar(dev, addr, 0, 0);
+	ixgbe_add_rar(dev, addr, 0, pci_dev->max_vfs);
 }
 
 static bool
-- 
1.9.3

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

* Re: [dpdk-dev] [PATCH] net/ixgbe: fix default MAC setting
  2017-05-02  8:34 [dpdk-dev] [PATCH] net/ixgbe: fix default MAC setting Wenzhuo Lu
@ 2017-05-02 13:32 ` Igor Ryzhov
  2017-05-03  1:01   ` Lu, Wenzhuo
  2017-05-05 14:40 ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Igor Ryzhov @ 2017-05-02 13:32 UTC (permalink / raw)
  To: Wenzhuo Lu; +Cc: dev, stable

Hello Wenzhuo,

How about also delete meaningless "ixgbe_remove_rar(dev, 0);"?

Best regards,
Igor

On Tue, May 2, 2017 at 11:34 AM, Wenzhuo Lu <wenzhuo.lu@intel.com> wrote:

> Pool 0 is not PF, it's VF 0. So the MAC is set for VF 0
> but not PF.
> The code introduced a weird issue. In the scenario PF + VF,
> when only starting PF, the default PF MAC address is working.
> But after starting a VF, the default PF MAC address becomes
> the VF's address.
>
> Use the pool which is not occupied by VFs for PF to fix it.
>
> Fixes: 8164fe82846b ("ixgbe: add default mac address modifier")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_
> ethdev.c
> index bbae4f9..9ddd685 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -4658,9 +4658,11 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused
> struct rte_eth_dev *dev,
>  static void
>  ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr
> *addr)
>  {
> +       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
> +
>         ixgbe_remove_rar(dev, 0);
>
> -       ixgbe_add_rar(dev, addr, 0, 0);
> +       ixgbe_add_rar(dev, addr, 0, pci_dev->max_vfs);
>  }
>
>  static bool
> --
> 1.9.3
>
>

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

* Re: [dpdk-dev] [PATCH] net/ixgbe: fix default MAC setting
  2017-05-02 13:32 ` Igor Ryzhov
@ 2017-05-03  1:01   ` Lu, Wenzhuo
  0 siblings, 0 replies; 4+ messages in thread
From: Lu, Wenzhuo @ 2017-05-03  1:01 UTC (permalink / raw)
  To: Igor Ryzhov; +Cc: dev, stable

Hi Igor,

From: Igor Ryzhov [mailto:iryzhov@nfware.com]
Sent: Tuesday, May 2, 2017 9:33 PM
To: Lu, Wenzhuo
Cc: dev@dpdk.org; stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix default MAC setting

Hello Wenzhuo,

How about also delete meaningless "ixgbe_remove_rar(dev, 0);"?
[Wenzhuo] The current behavior of this set_default_mac_addr is to delete all  the existing MAC addresses and only set the assigned address as the default address. This patch is to fix a bug not change the behavior. So have to leave "ixgbe_remove_rar(dev, 0);" here.

Best regards,
Igor

On Tue, May 2, 2017 at 11:34 AM, Wenzhuo Lu <wenzhuo.lu@intel.com<mailto:wenzhuo.lu@intel.com>> wrote:
Pool 0 is not PF, it's VF 0. So the MAC is set for VF 0
but not PF.
The code introduced a weird issue. In the scenario PF + VF,
when only starting PF, the default PF MAC address is working.
But after starting a VF, the default PF MAC address becomes
the VF's address.

Use the pool which is not occupied by VFs for PF to fix it.

Fixes: 8164fe82846b ("ixgbe: add default mac address modifier")
Cc: stable@dpdk.org<mailto:stable@dpdk.org>

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com<mailto:wenzhuo.lu@intel.com>>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index bbae4f9..9ddd685 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4658,9 +4658,11 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 static void
 ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr)
 {
+       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+
        ixgbe_remove_rar(dev, 0);

-       ixgbe_add_rar(dev, addr, 0, 0);
+       ixgbe_add_rar(dev, addr, 0, pci_dev->max_vfs);
 }

 static bool
--
1.9.3


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

* Re: [dpdk-dev] [PATCH] net/ixgbe: fix default MAC setting
  2017-05-02  8:34 [dpdk-dev] [PATCH] net/ixgbe: fix default MAC setting Wenzhuo Lu
  2017-05-02 13:32 ` Igor Ryzhov
@ 2017-05-05 14:40 ` Thomas Monjalon
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2017-05-05 14:40 UTC (permalink / raw)
  To: Wenzhuo Lu; +Cc: dev, stable

02/05/2017 10:34, Wenzhuo Lu:
> Pool 0 is not PF, it's VF 0. So the MAC is set for VF 0
> but not PF.
> The code introduced a weird issue. In the scenario PF + VF,
> when only starting PF, the default PF MAC address is working.
> But after starting a VF, the default PF MAC address becomes
> the VF's address.
> 
> Use the pool which is not occupied by VFs for PF to fix it.
> 
> Fixes: 8164fe82846b ("ixgbe: add default mac address modifier")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Applied, thanks

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

end of thread, other threads:[~2017-05-05 14:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02  8:34 [dpdk-dev] [PATCH] net/ixgbe: fix default MAC setting Wenzhuo Lu
2017-05-02 13:32 ` Igor Ryzhov
2017-05-03  1:01   ` Lu, Wenzhuo
2017-05-05 14:40 ` 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).