Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720097 > unrolled thread

[PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2

Started byAntoine Tenart <antoine.tenart@free-electrons.com>
First post2017-08-25 16:20 +0200
Last post2017-08-28 20:30 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2 Antoine Tenart <antoine.tenart@free-electrons.com> - 2017-08-25 16:20 +0200
    Re: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when  using PPv2.2 Andrew Lunn <andrew@lunn.ch> - 2017-08-25 16:20 +0200
      Re: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when  using PPv2.2 Antoine Tenart <antoine.tenart@free-electrons.com> - 2017-08-25 16:30 +0200
        Re: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when  using PPv2.2 Andrew Lunn <andrew@lunn.ch> - 2017-08-25 17:50 +0200
          Re: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when  using PPv2.2 Antoine Tenart <antoine.tenart@free-electrons.com> - 2017-08-25 18:00 +0200
    Re: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when  using PPv2.2 David Miller <davem@davemloft.net> - 2017-08-28 20:30 +0200

#1720097 — [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2

FromAntoine Tenart <antoine.tenart@free-electrons.com>
Date2017-08-25 16:20 +0200
Subject[PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2
Message-ID<uinCN-556-5@gated-at.bofh.it>
The mac address is only retrieved from h/w when using PPv2.1. Otherwise
the variable holding it is still checked and used if it contains a valid
value. As the variable isn't initialized to an invalid mac address
value, we end up with random mac addresses which can be the same for all
the ports handled by this PPv2 driver.

Fixes this by initializing the h/w mac address variable to {0}, which is
an invalid mac address value. This way the random assignation fallback
is called and all ports end up with their own addresses.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Fixes: 2697582144dd ("net: mvpp2: handle misc PPv2.1/PPv2.2 differences")
---
 drivers/net/ethernet/marvell/mvpp2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 48d21c1e09f2..4d598ca8503a 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -6504,7 +6504,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
 	struct resource *res;
 	const char *dt_mac_addr;
 	const char *mac_from;
-	char hw_mac_addr[ETH_ALEN];
+	char hw_mac_addr[ETH_ALEN] = {0};
 	u32 id;
 	int features;
 	int phy_mode;
-- 
2.13.5

[toc] | [next] | [standalone]


#1720102 — Re: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2

FromAndrew Lunn <andrew@lunn.ch>
Date2017-08-25 16:20 +0200
SubjectRe: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2
Message-ID<uinCO-556-21@gated-at.bofh.it>
In reply to#1720097
On Fri, Aug 25, 2017 at 04:14:17PM +0200, Antoine Tenart wrote:
> The mac address is only retrieved from h/w when using PPv2.1. Otherwise
> the variable holding it is still checked and used if it contains a valid
> value. As the variable isn't initialized to an invalid mac address
> value, we end up with random mac addresses which can be the same for all
> the ports handled by this PPv2 driver.
> 
> Fixes this by initializing the h/w mac address variable to {0}, which is
> an invalid mac address value. This way the random assignation fallback
> is called and all ports end up with their own addresses.
> 
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> Fixes: 2697582144dd ("net: mvpp2: handle misc PPv2.1/PPv2.2 differences")

Hi Antoine

Is this patch alone sufficient to fix the problem?

Ideally, you want a minimal patch for stable, i.e. -net, and a fuller
fix can go into net-next.

    Andrew

[toc] | [prev] | [next] | [standalone]


#1720110 — Re: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2

FromAntoine Tenart <antoine.tenart@free-electrons.com>
Date2017-08-25 16:30 +0200
SubjectRe: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2
Message-ID<uinMu-5ah-31@gated-at.bofh.it>
In reply to#1720102

[Multipart message — attachments visible in raw view] — view raw

Hi Andrew,

On Fri, Aug 25, 2017 at 04:19:39PM +0200, Andrew Lunn wrote:
> On Fri, Aug 25, 2017 at 04:14:17PM +0200, Antoine Tenart wrote:
> > The mac address is only retrieved from h/w when using PPv2.1. Otherwise
> > the variable holding it is still checked and used if it contains a valid
> > value. As the variable isn't initialized to an invalid mac address
> > value, we end up with random mac addresses which can be the same for all
> > the ports handled by this PPv2 driver.
> > 
> > Fixes this by initializing the h/w mac address variable to {0}, which is
> > an invalid mac address value. This way the random assignation fallback
> > is called and all ports end up with their own addresses.
> > 
> > Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> > Fixes: 2697582144dd ("net: mvpp2: handle misc PPv2.1/PPv2.2 differences")
> 
> Is this patch alone sufficient to fix the problem?

Yes it is.

> Ideally, you want a minimal patch for stable, i.e. -net, and a fuller
> fix can go into net-next.

That was my intention (providing a minimal patch for stable), and I
asked about this approach in the v1. Dave told me to resend the series
to net. Maybe my questions weren't clear enough.

So probably the best way to handle this would have been to send 1/4 to
net and 2-4/4 to net-next (but then there's a dependency between the two
series).

Let's wait for Dave's answer, I'll respin if needed so that it's easy
for him to apply it.

Thanks!
Antoine

-- 
Antoine Ténart, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1720200 — Re: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2

FromAndrew Lunn <andrew@lunn.ch>
Date2017-08-25 17:50 +0200
SubjectRe: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2
Message-ID<uip1T-5RV-13@gated-at.bofh.it>
In reply to#1720110
> So probably the best way to handle this would have been to send 1/4 to
> net and 2-4/4 to net-next

Correct. 

> (but then there's a dependency between the two series).

Dave merges net into net-next every so often. So you just need to wait
a bit before submitting the net-next parts.

  Andrew

[toc] | [prev] | [next] | [standalone]


#1720206 — Re: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2

FromAntoine Tenart <antoine.tenart@free-electrons.com>
Date2017-08-25 18:00 +0200
SubjectRe: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2
Message-ID<uipbz-5V8-5@gated-at.bofh.it>
In reply to#1720200

[Multipart message — attachments visible in raw view] — view raw

On Fri, Aug 25, 2017 at 05:42:47PM +0200, Andrew Lunn wrote:
> > So probably the best way to handle this would have been to send 1/4 to
> > net and 2-4/4 to net-next
> 
> Correct. 
> 
> > (but then there's a dependency between the two series).
> 
> Dave merges net into net-next every so often. So you just need to wait
> a bit before submitting the net-next parts.

I see. So Dave can take patch 1/4 and I'll respin the others once it's
merged into net-next.

Thanks!
Antoine

-- 
Antoine Ténart, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1721888 — Re: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2

FromDavid Miller <davem@davemloft.net>
Date2017-08-28 20:30 +0200
SubjectRe: [PATCH net v2 1/4] net: mvpp2: fix the mac address used when using PPv2.2
Message-ID<ujwXo-vG-25@gated-at.bofh.it>
In reply to#1720097
From: Antoine Tenart <antoine.tenart@free-electrons.com>
Date: Fri, 25 Aug 2017 16:14:17 +0200

> The mac address is only retrieved from h/w when using PPv2.1. Otherwise
> the variable holding it is still checked and used if it contains a valid
> value. As the variable isn't initialized to an invalid mac address
> value, we end up with random mac addresses which can be the same for all
> the ports handled by this PPv2 driver.
> 
> Fixes this by initializing the h/w mac address variable to {0}, which is
> an invalid mac address value. This way the random assignation fallback
> is called and all ports end up with their own addresses.
> 
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> Fixes: 2697582144dd ("net: mvpp2: handle misc PPv2.1/PPv2.2 differences")

Applied and queued up for -stable, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web