<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/dsa/port.c, branch linux-5.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-04-14T23:33:26Z</updated>
<entry>
<title>net: dsa: Down cpu/dsa ports phylink will control</title>
<updated>2020-04-14T23:33:26Z</updated>
<author>
<name>Andrew Lunn</name>
</author>
<published>2020-04-14T00:34:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3be98b2d5fbca3da7c4df0477eed95bfb5b83d64'/>
<id>urn:sha1:3be98b2d5fbca3da7c4df0477eed95bfb5b83d64</id>
<content type='text'>
DSA and CPU ports can be configured in two ways. By default, the
driver should configure such ports to there maximum bandwidth. For
most use cases, this is sufficient. When this default is insufficient,
a phylink instance can be bound to such ports, and phylink will
configure the port, e.g. based on fixed-link properties. phylink
assumes the port is initially down. Given that the driver should have
already configured it to its maximum speed, ask the driver to down
the port before instantiating the phylink instance.

Fixes: 30c4a5b0aad8 ("net: mv88e6xxx: use resolved link config in mac_link_up()")
Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: configure the MTU for switch ports</title>
<updated>2020-03-27T23:07:24Z</updated>
<author>
<name>Vladimir Oltean</name>
</author>
<published>2020-03-27T19:55:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bfcb813203e619a8960a819bf533ad2a108d8105'/>
<id>urn:sha1:bfcb813203e619a8960a819bf533ad2a108d8105</id>
<content type='text'>
It is useful be able to configure port policers on a switch to accept
frames of various sizes:

- Increase the MTU for better throughput from the default of 1500 if it
  is known that there is no 10/100 Mbps device in the network.
- Decrease the MTU to limit the latency of high-priority frames under
  congestion, or work around various network segments that add extra
  headers to packets which can't be fragmented.

For DSA slave ports, this is mostly a pass-through callback, called
through the regular ndo ops and at probe time (to ensure consistency
across all supported switches).

The CPU port is called with an MTU equal to the largest configured MTU
of the slave ports. The assumption is that the user might want to
sustain a bidirectional conversation with a partner over any switch
port.

The DSA master is configured the same as the CPU port, plus the tagger
overhead. Since the MTU is by definition L2 payload (sans Ethernet
header), it is up to each individual driver to figure out if it needs to
do anything special for its frame tags on the CPU port (it shouldn't
except in special cases). So the MTU does not contain the tagger
overhead on the CPU port.
However the MTU of the DSA master, minus the tagger overhead, is used as
a proxy for the MTU of the CPU port, which does not have a net device.
This is to avoid uselessly calling the .change_mtu function on the CPU
port when nothing should change.

So it is safe to assume that the DSA master and the CPU port MTUs are
apart by exactly the tagger's overhead in bytes.

Some changes were made around dsa_master_set_mtu(), function which was
now removed, for 2 reasons:
  - dev_set_mtu() already calls dev_validate_mtu(), so it's redundant to
    do the same thing in DSA
  - __dev_set_mtu() returns 0 if ops-&gt;ndo_change_mtu is an absent method
That is to say, there's no need for this function in DSA, we can safely
call dev_set_mtu() directly, take the rtnl lock when necessary, and just
propagate whatever errors get reported (since the user probably wants to
be informed).

Some inspiration (mainly in the MTU DSA notifier) was taken from a
vaguely similar patch from Murali and Florian, who are credited as
co-developers down below.

Co-developed-by: Murali Krishna Policharla &lt;murali.policharla@broadcom.com&gt;
Signed-off-by: Murali Krishna Policharla &lt;murali.policharla@broadcom.com&gt;
Co-developed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: warn if phylink_mac_link_state returns error</title>
<updated>2020-03-16T00:11:12Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2020-03-14T10:15:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=87615c96e77ff45d3b0e587f9cfb223009af0b86'/>
<id>urn:sha1:87615c96e77ff45d3b0e587f9cfb223009af0b86</id>
<content type='text'>
Issue a warning to the kernel log if phylink_mac_link_state() returns
an error. This should not occur, but let's make it visible.

Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2020-03-13T05:34:48Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2020-03-13T04:29:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d343579312311aa9875b34d5a921f5e2ec69f0a'/>
<id>urn:sha1:1d343579312311aa9875b34d5a921f5e2ec69f0a</id>
<content type='text'>
Minor overlapping changes, nothing serious.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed</title>
<updated>2020-03-12T06:46:11Z</updated>
<author>
<name>Andrew Lunn</name>
</author>
<published>2020-03-11T15:24:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a20f997010c4ec76eaa55b8cc047d76dcac69f70'/>
<id>urn:sha1:a20f997010c4ec76eaa55b8cc047d76dcac69f70</id>
<content type='text'>
By default, DSA drivers should configure CPU and DSA ports to their
maximum speed. In many configurations this is sufficient to make the
link work.

In some cases it is necessary to configure the link to run slower,
e.g. because of limitations of the SoC it is connected to. Or back to
back PHYs are used and the PHY needs to be driven in order to
establish link. In this case, phylink is used.

Only instantiate phylink if it is required. If there is no PHY, or no
fixed link properties, phylink can upset a link which works in the
default configuration.

Fixes: 0e27921816ad ("net: dsa: Use PHYLINK for the CPU/DSA ports")
Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: fix phylink_start()/phylink_stop() calls</title>
<updated>2020-03-03T23:45:49Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2020-03-03T15:01:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8640f8dc6d657ebfb4e67c202ad32c5457858a13'/>
<id>urn:sha1:8640f8dc6d657ebfb4e67c202ad32c5457858a13</id>
<content type='text'>
Place phylink_start()/phylink_stop() inside dsa_port_enable() and
dsa_port_disable(), which ensures that we call phylink_stop() before
tearing down phylink - which is a documented requirement.  Failure
to do so can cause use-after-free bugs.

Fixes: 0e27921816ad ("net: dsa: Use PHYLINK for the CPU/DSA ports")
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: propagate resolved link config via mac_link_up()</title>
<updated>2020-02-27T20:02:14Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2020-02-26T10:23:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b502a7b2992008a1fd5962ba032771b03c4e840'/>
<id>urn:sha1:5b502a7b2992008a1fd5962ba032771b03c4e840</id>
<content type='text'>
Propagate the resolved link configuration down via DSA's
phylink_mac_link_up() operation to allow split PCS/MAC to work.

Tested-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phylink: propagate resolved link config via mac_link_up()</title>
<updated>2020-02-27T20:02:14Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2020-02-26T10:23:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=91a208f2185ad4855ff03c342d0b7e4f5fc6f5df'/>
<id>urn:sha1:91a208f2185ad4855ff03c342d0b7e4f5fc6f5df</id>
<content type='text'>
Propagate the resolved link parameters via the mac_link_up() call for
MACs that do not automatically track their PCS state. We propagate the
link parameters via function arguments so that inappropriate members
of struct phylink_link_state can't be accessed, and creating a new
structure just for this adds needless complexity to the API.

Tested-by: Andre Przywara &lt;andre.przywara@arm.com&gt;
Tested-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Tested-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: Pass pcs_poll flag from driver to PHYLINK</title>
<updated>2020-01-06T07:22:32Z</updated>
<author>
<name>Vladimir Oltean</name>
</author>
<published>2020-01-06T01:34:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=787cac3f5a650fd3184a41c5a27a2fe9ded833aa'/>
<id>urn:sha1:787cac3f5a650fd3184a41c5a27a2fe9ded833aa</id>
<content type='text'>
The DSA drivers that implement .phylink_mac_link_state should normally
register an interrupt for the PCS, from which they should call
phylink_mac_change(). However not all switches implement this, and those
who don't should set this flag in dsa_switch in the .setup callback, so
that PHYLINK will poll for a few ms until the in-band AN link timer
expires and the PCS state settles.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: Make PHYLINK related function static again</title>
<updated>2019-12-17T22:17:46Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2019-12-16T18:32:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8ae674964e67eb7deb3f0e489bfe9c102a7990b0'/>
<id>urn:sha1:8ae674964e67eb7deb3f0e489bfe9c102a7990b0</id>
<content type='text'>
Commit 77373d49de22 ("net: dsa: Move the phylink driver calls into
port.c") moved and exported a bunch of symbols, but they are not used
outside of net/dsa/port.c at the moment, so no reason to export them.

Reported-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Reviewed-by: Vivien Didelot &lt;vivien.didelot@gmail.com&gt;
Acked-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Acked-by: Vladimir Oltean &lt;olteanv@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
