From: Miquel Raynal <miquel.raynal@bootlin•com>
To: Andrew Lunn <andrew@lunn•ch>
Cc: Florian Fainelli <f.fainelli@gmail•com>,
Vivien Didelot <vivien.didelot@gmail•com>,
"David S. Miller" <davem@davemloft•net>,
netdev@vger•kernel.org, linux-kernel@vger•kernel.org,
Thomas Petazzoni <thomas.petazzoni@bootlin•com>,
Gregory Clement <gregory.clement@bootlin•com>,
Antoine Tenart <antoine.tenart@bootlin•com>,
Maxime Chevallier <maxime.chevallier@bootlin•com>,
Nadav Haklai <nadavh@marvell•com>
Subject: Re: [PATCH net-next] net: dsa: mv88e6xxx: Add suspend/resume callbacks
Date: Tue, 22 Jan 2019 14:42:34 +0100 [thread overview]
Message-ID: <20190122144234.54e2edc1@xps13> (raw)
In-Reply-To: <20190122132005.GA3634@lunn.ch>
Hi Andrew,
Andrew Lunn <andrew@lunn•ch> wrote on Tue, 22 Jan 2019 14:20:05 +0100:
> > I am not sure to understand what is lost. On my setup ethtool shows
> > that everything is fine after resume but maybe I fall into a "default"
> > working case.
>
> Hi Miquèl
>
> Is the power removed from the switch? If so, you need to restore the
> full switch configuration. The current code might be sufficient for
> runtime suspend, where the switch is put into a low power mode, but it
> is kept powered. It is not sufficient for a full power cycle.
>
> > When I compare with the two drivers pointed out by Andrew:
> > * qca8k resume callback:
> > * enable ports,
> > * call dsa_switch_resume().
> > * bcm_sf2 resume callback:
> > * call dsa_switch_resume(),
> > * reset the switch,
> > * refresh rules (Not applicable?),
> > * enable the PHYs,
> > * setup the ports,
> > * configure vlan (Not applicable?),
> > * mv88e6xxx resume callback:
> > * reset the switch,
> > * enable the PHYs,
> > * setup the ports,
> > * enable IRQs,
> > * call dsa_switch_resume().
>
> Here are some commands to try before you suspend:
>
> ip link add name br0 type bridge
> ip link set br0 up
> ip link set lan1 up
> ip link set lan1 master br0
> ip link set lan2 up
> ip link set lan2 master br0
>
> At this point, you should be able to pass traffic between lan1 and
> lan2.
>
> bridge fdb add 00:42:42:42:42:42 lan1
> bridge fdb add 00:24:24:24:24:24 lan2
>
> That adds two static forwarding database entries. You can show these using
>
> bridge fdb show
>
> There are likely to be additional dynamic FDB entries. It is O.K. to
> loose the dynamic entries over a suspend/resume cycle, but the static
> ones must remain.
Thank you very much for this, it is really helpful.
>
> > This looks pretty similar. Maybe the ports setup are set to default
> > values while I should save some parameters at suspend? I changed a
> > few parameters (like the MTU or the queue length) but they seem to be
> > correct across suspend cycles.
>
> MTU and queue length have nothing to do with the actual switch. Your
> tests need to actually program the hardware.
I didn't checked the hw was programmed indeed. Well, I'll try with the
test described above and will propose something.
Thanks,
Miquèl
prev parent reply other threads:[~2019-01-22 13:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-16 15:34 [PATCH net-next] net: dsa: mv88e6xxx: Add suspend/resume callbacks Miquel Raynal
2019-01-16 15:56 ` Andrew Lunn
2019-01-16 22:20 ` Florian Fainelli
2019-01-16 22:23 ` Andrew Lunn
2019-01-17 15:46 ` Vivien Didelot
2019-01-17 15:50 ` Miquel Raynal
2019-01-17 18:00 ` Florian Fainelli
2019-01-17 18:56 ` Vivien Didelot
2019-01-22 10:04 ` Miquel Raynal
2019-01-22 13:20 ` Andrew Lunn
2019-01-22 13:42 ` Miquel Raynal [this message]
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=20190122144234.54e2edc1@xps13 \
--to=miquel.raynal@bootlin$(echo .)com \
--cc=andrew@lunn$(echo .)ch \
--cc=antoine.tenart@bootlin$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=f.fainelli@gmail$(echo .)com \
--cc=gregory.clement@bootlin$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=maxime.chevallier@bootlin$(echo .)com \
--cc=nadavh@marvell$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=thomas.petazzoni@bootlin$(echo .)com \
--cc=vivien.didelot@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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