<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in sysfs-class-net-dsa</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>53da0eba - net: dsa: allow changing the tag protocol via the &quot;tagging&quot; device attribute</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/Documentation/ABI/testing/sysfs-class-net-dsa#53da0eba</link>
        <description>net: dsa: allow changing the tag protocol via the &quot;tagging&quot; device attributeCurrently DSA exposes the following sysfs:$ cat /sys/class/net/eno2/dsa/taggingocelotwhich is a read-only device attribute, introduced in the kernel ascommit 98cdb4807123 (&quot;net: dsa: Expose tagging protocol to user-space&quot;),and used by libpcap since its commit 993db3800d7d (&quot;Add support for DSAlink-layer types&quot;).It would be nice if we could extend this device attribute by making itwritable:$ echo ocelot-8021q &gt; /sys/class/net/eno2/dsa/taggingThis is useful with DSA switches that can make use of more than onetagging protocol. It may be useful in dsa_loop in the future too, toperform offline testing of various taggers, or for changing between dsaand edsa on Marvell switches, if that is desirable.In terms of implementation, drivers can support this feature byimplementing .change_tag_protocol, which should always leave the switchin a consistent state: either with the new protocol if things went well,or with the old one if something failed. Teardown of the old protocol,if necessary, must be handled by the driver.Some things remain as before:- The .get_tag_protocol is currently only called at probe time, to load  the initial tagging protocol driver. Nonetheless, new drivers should  report the tagging protocol in current use now.- The driver should manage by itself the initial setup of tagging  protocol, no later than the .setup() method, as well as destroying  resources used by the last tagger in use, no earlier than the  .teardown() method.For multi-switch DSA trees, error handling is a bit more complicated,since e.g. the 5th out of 7 switches may fail to change the tagprotocol. When that happens, a revert to the original tag protocol isattempted, but that may fail too, leaving the tree in an inconsistentstate despite each individual switch implementing .change_tag_protocoltransactionally. Since the intersection between drivers that implement.change_tag_protocol and drivers that support D in DSA is currently theempty set, the possibility for this error to happen is ignored for now.Testing:$ insmod mscc_felix.ko[   79.549784] mscc_felix 0000:00:00.5: Adding to iommu group 14[   79.565712] mscc_felix 0000:00:00.5: Failed to register DSA switch: -517$ insmod tag_ocelot.ko$ rmmod mscc_felix.ko$ insmod mscc_felix.ko[   97.261724] libphy: VSC9959 internal MDIO bus: probed[   97.267363] mscc_felix 0000:00:00.5: Found PCS at internal MDIO address 0[   97.274998] mscc_felix 0000:00:00.5: Found PCS at internal MDIO address 1[   97.282561] mscc_felix 0000:00:00.5: Found PCS at internal MDIO address 2[   97.289700] mscc_felix 0000:00:00.5: Found PCS at internal MDIO address 3[   97.599163] mscc_felix 0000:00:00.5 swp0 (uninitialized): PHY [0000:00:00.3:10] driver [Microsemi GE VSC8514 SyncE] (irq=POLL)[   97.862034] mscc_felix 0000:00:00.5 swp1 (uninitialized): PHY [0000:00:00.3:11] driver [Microsemi GE VSC8514 SyncE] (irq=POLL)[   97.950731] mscc_felix 0000:00:00.5 swp0: configuring for inband/qsgmii link mode[   97.964278] 8021q: adding VLAN 0 to HW filter on device swp0[   98.146161] mscc_felix 0000:00:00.5 swp2 (uninitialized): PHY [0000:00:00.3:12] driver [Microsemi GE VSC8514 SyncE] (irq=POLL)[   98.238649] mscc_felix 0000:00:00.5 swp1: configuring for inband/qsgmii link mode[   98.251845] 8021q: adding VLAN 0 to HW filter on device swp1[   98.433916] mscc_felix 0000:00:00.5 swp3 (uninitialized): PHY [0000:00:00.3:13] driver [Microsemi GE VSC8514 SyncE] (irq=POLL)[   98.485542] mscc_felix 0000:00:00.5: configuring for fixed/internal link mode[   98.503584] mscc_felix 0000:00:00.5: Link is Up - 2.5Gbps/Full - flow control rx/tx[   98.527948] device eno2 entered promiscuous mode[   98.544755] DSA: tree 0 setup$ ping 10.0.0.1PING 10.0.0.1 (10.0.0.1): 56 data bytes64 bytes from 10.0.0.1: seq=0 ttl=64 time=2.337 ms64 bytes from 10.0.0.1: seq=1 ttl=64 time=0.754 ms^C -  10.0.0.1 ping statistics  -2 packets transmitted, 2 packets received, 0% packet lossround-trip min/avg/max = 0.754/1.545/2.337 ms$ cat /sys/class/net/eno2/dsa/taggingocelot$ cat ./test_ocelot_8021q.sh        #!/bin/bash        ip link set swp0 down        ip link set swp1 down        ip link set swp2 down        ip link set swp3 down        ip link set swp5 down        ip link set eno2 down        echo ocelot-8021q &gt; /sys/class/net/eno2/dsa/tagging        ip link set eno2 up        ip link set swp0 up        ip link set swp1 up        ip link set swp2 up        ip link set swp3 up        ip link set swp5 up$ ./test_ocelot_8021q.sh./test_ocelot_8021q.sh: line 9: echo: write error: Protocol not available$ rmmod tag_ocelot.kormmod: can&apos;t unload module &apos;tag_ocelot&apos;: Resource temporarily unavailable$ insmod tag_ocelot_8021q.ko$ ./test_ocelot_8021q.sh$ cat /sys/class/net/eno2/dsa/taggingocelot-8021q$ rmmod tag_ocelot.ko$ rmmod tag_ocelot_8021q.kormmod: can&apos;t unload module &apos;tag_ocelot_8021q&apos;: Resource temporarily unavailable$ ping 10.0.0.1PING 10.0.0.1 (10.0.0.1): 56 data bytes64 bytes from 10.0.0.1: seq=0 ttl=64 time=0.953 ms64 bytes from 10.0.0.1: seq=1 ttl=64 time=0.787 ms64 bytes from 10.0.0.1: seq=2 ttl=64 time=0.771 ms$ rmmod mscc_felix.ko[  645.544426] mscc_felix 0000:00:00.5: Link is Down[  645.838608] DSA: tree 0 torn down$ rmmod tag_ocelot_8021q.koSigned-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;

            List of files:
            /linux-6.15/Documentation/ABI/testing/sysfs-class-net-dsa</description>
        <pubDate>Fri, 29 Jan 2021 01:00:06 +0000</pubDate>
        <dc:creator>Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;</dc:creator>
    </item>
<item>
        <title>a3d7e01d - net: dsa: Fix tagging attribute location</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/Documentation/ABI/testing/sysfs-class-net-dsa#a3d7e01d</link>
        <description>net: dsa: Fix tagging attribute locationWhile introducing the DSA tagging protocol attribute, it was added to the DSAslave network devices, but those actually see untagged traffic (that is theirwhole purpose). Correct this mistake by putting the tagging sysfs attributeunder the DSA master network device where this is the information that we need.While at it, also correct the sysfs documentation mistake that missed the&quot;dsa/&quot; directory component of the attribute.Fixes: 98cdb4807123 (&quot;net: dsa: Expose tagging protocol to user-space&quot;)Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

            List of files:
            /linux-6.15/Documentation/ABI/testing/sysfs-class-net-dsa</description>
        <pubDate>Wed, 28 Nov 2018 21:40:04 +0000</pubDate>
        <dc:creator>Florian Fainelli &lt;f.fainelli@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>98cdb480 - net: dsa: Expose tagging protocol to user-space</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/Documentation/ABI/testing/sysfs-class-net-dsa#98cdb480</link>
        <description>net: dsa: Expose tagging protocol to user-spaceThere is no way for user-space to know what a given DSA network device&apos;stagging protocol is. Expose this information through a dsa/taggingattribute which reflects the tagging protocol currently in use.This is helpful for configuration (e.g: none behaves dramaticallydifferent wrt. bridges) as well as for packet capture tools when thereis not a proper Ethernet type available.Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

            List of files:
            /linux-6.15/Documentation/ABI/testing/sysfs-class-net-dsa</description>
        <pubDate>Fri, 07 Sep 2018 18:09:02 +0000</pubDate>
        <dc:creator>Florian Fainelli &lt;f.fainelli@gmail.com&gt;</dc:creator>
    </item>
</channel>
</rss>
