1. 01 Jan, 2023 8 commits
    • Po-Hsu Lin's avatar
      selftests: net: fix cleanup_v6() for arp_ndisc_evict_nocarrier · 9c4d7f45
      Po-Hsu Lin authored
      The cleanup_v6() will cause the arp_ndisc_evict_nocarrier script exit
      with 255 (No such file or directory), even the tests are good:
      
       # selftests: net: arp_ndisc_evict_nocarrier.sh
       # run arp_evict_nocarrier=1 test
       # RTNETLINK answers: File exists
       # ok
       # run arp_evict_nocarrier=0 test
       # RTNETLINK answers: File exists
       # ok
       # run all.arp_evict_nocarrier=0 test
       # RTNETLINK answers: File exists
       # ok
       # run ndisc_evict_nocarrier=1 test
       # ok
       # run ndisc_evict_nocarrier=0 test
       # ok
       # run all.ndisc_evict_nocarrier=0 test
       # ok
       not ok 1 selftests: net: arp_ndisc_evict_nocarrier.sh # exit=255
      
      This is because it's trying to modify the parameter for ipv4 instead.
      
      Also, tests for ipv6 (run_ndisc_evict_nocarrier_enabled() and
      run_ndisc_evict_nocarrier_disabled() are working on veth1, reflect
      this fact in cleanup_v6().
      
      Fixes: f86ca07e ("selftests: net: add arp_ndisc_evict_nocarrier")
      Signed-off-by: default avatarPo-Hsu Lin <po-hsu.lin@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c4d7f45
    • Sean Anderson's avatar
      net: phy: Update documentation for get_rate_matching · 6d4cfcf9
      Sean Anderson authored
      Now that phylink no longer calls phy_get_rate_matching with
      PHY_INTERFACE_MODE_NA, phys no longer need to support it. Remove the
      documentation mandating support.
      
      Fixes: 7642cc28 ("net: phylink: fix PHY validation with rate adaption")
      Signed-off-by: default avatarSean Anderson <sean.anderson@seco.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6d4cfcf9
    • David S. Miller's avatar
      Merge branch 'dsa-qca8k-fixes' · d02b8256
      David S. Miller authored
      Christian Marangi says:
      
      ====================
      net: dsa: qca8k: multiple fix on mdio read/write
      
      Due to some problems in reading the Documentation and elaborating it
      some wrong assumption were done. The error was reported and notice only
      now due to how things are setup in the code flow.
      
      First 2 patch fix mgmt eth where the lenght calculation is very
      confusing and in step of word size. (the related commit description have
      an extensive description about how this mess works)
      
      Last 3 patch revert the broken mdio cache and apply a correct version
      that should still save some extra mdio in phy poll secnario.
      
      These 5 patch fix each related problem and apply what the Documentation
      actually say.
      
      Changes v2:
      - Add cover letter
      - Fix typo in revert patch
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d02b8256
    • Christian Marangi's avatar
      net: dsa: qca8k: improve mdio master read/write by using single lo/hi · a4165830
      Christian Marangi authored
      Improve mdio master read/write by using singe mii read/write lo/hi.
      
      In a read and write we need to poll the mdio master regs in a busy loop
      to check for a specific bit present in the upper half of the reg. We can
      ignore the other half since it won't contain useful data. This will save
      an additional useless read for each read and write operation.
      
      In a read operation the returned data is present in the mdio master reg
      lower half. We can ignore the other half since it won't contain useful
      data. This will save an additional useless read for each read operation.
      
      In a read operation it's needed to just set the hi half of the mdio
      master reg as the lo half will be replaced by the result. This will save
      an additional useless write for each read operation.
      Tested-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4165830
    • Christian Marangi's avatar
      net: dsa: qca8k: introduce single mii read/write lo/hi · cfbd6de5
      Christian Marangi authored
      It may be useful to read/write just the lo or hi half of a reg.
      
      This is especially useful for phy poll with the use of mdio master.
      The mdio master reg is composed by the first 16 bit related to setup and
      the other half with the returned data or data to write.
      
      Refactor the mii function to permit single mii read/write of lo or hi
      half of the reg.
      Tested-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cfbd6de5
    • Christian Marangi's avatar
      Revert "net: dsa: qca8k: cache lo and hi for mdio write" · 03cb9e6d
      Christian Marangi authored
      This reverts commit 2481d206.
      
      The Documentation is very confusing about the topic.
      The cache logic for hi and lo is wrong and actually miss some regs to be
      actually written.
      
      What the Documentation actually intended was that it's possible to skip
      writing hi OR lo if half of the reg is not needed to be written or read.
      
      Revert the change in favor of a better and correct implementation.
      Reported-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Cc: stable@vger.kernel.org # v5.18+
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      03cb9e6d
    • Christian Marangi's avatar
      net: dsa: tag_qca: fix wrong MGMT_DATA2 size · d9dba91b
      Christian Marangi authored
      It was discovered that MGMT_DATA2 can contain up to 28 bytes of data
      instead of the 12 bytes written in the Documentation by accounting the
      limit of 16 bytes declared in Documentation subtracting the first 4 byte
      in the packet header.
      
      Update the define with the real world value.
      Tested-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
      Fixes: c2ee8181 ("net: dsa: tag_qca: add define for handling mgmt Ethernet packet")
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Cc: stable@vger.kernel.org # v5.18+
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d9dba91b
    • Christian Marangi's avatar
      net: dsa: qca8k: fix wrong length value for mgmt eth packet · 9807ae69
      Christian Marangi authored
      The assumption that Documentation was right about how this value work was
      wrong. It was discovered that the length value of the mgmt header is in
      step of word size.
      
      As an example to process 4 byte of data the correct length to set is 2.
      To process 8 byte 4, 12 byte 6, 16 byte 8...
      
      Odd values will always return the next size on the ack packet.
      (length of 3 (6 byte) will always return 8 bytes of data)
      
      This means that a value of 15 (0xf) actually means reading/writing 32 bytes
      of data instead of 16 bytes. This behaviour is totally absent and not
      documented in the switch Documentation.
      
      In fact from Documentation the max value that mgmt eth can process is
      16 byte of data while in reality it can process 32 bytes at once.
      
      To handle this we always round up the length after deviding it for word
      size. We check if the result is odd and we round another time to align
      to what the switch will provide in the ack packet.
      The workaround for the length limit of 15 is still needed as the length
      reg max value is 0xf(15)
      Reported-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
      Tested-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
      Fixes: 90386223 ("net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet")
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Cc: stable@vger.kernel.org # v5.18+
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9807ae69
  2. 30 Dec, 2022 18 commits
  3. 28 Dec, 2022 14 commits