1. 03 Feb, 2022 34 commits
  2. 02 Feb, 2022 6 commits
    • Rafael J. Wysocki's avatar
      drivers: net: Replace acpi_bus_get_device() · 52dae93f
      Rafael J. Wysocki authored
      Replace acpi_bus_get_device() that is going to be dropped with
      acpi_fetch_acpi_dev().
      
      No intentional functional impact.
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Link: https://lore.kernel.org/r/11918902.O9o76ZdvQC@kreacher
      Link: https://lore.kernel.org/r/11920660.O9o76ZdvQC@kreacherSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      52dae93f
    • Akhmat Karakotov's avatar
      tcp: Use BPF timeout setting for SYN ACK RTO · 5903123f
      Akhmat Karakotov authored
      When setting RTO through BPF program, some SYN ACK packets were unaffected
      and continued to use TCP_TIMEOUT_INIT constant. This patch adds timeout
      option to struct request_sock. Option is initialized with TCP_TIMEOUT_INIT
      and is reassigned through BPF using tcp_timeout_init call. SYN ACK
      retransmits now use newly added timeout option.
      Signed-off-by: default avatarAkhmat Karakotov <hmukos@yandex-team.ru>
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      
      v2:
      	- Add timeout option to struct request_sock. Do not call
      	  tcp_timeout_init on every syn ack retransmit.
      
      v3:
      	- Use unsigned long for min. Bound tcp_timeout_init to TCP_RTO_MAX.
      
      v4:
      	- Refactor duplicate code by adding reqsk_timeout function.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5903123f
    • David S. Miller's avatar
      Merge branch 'qca8k-mdio' · 0b6b0d31
      David S. Miller authored
      Ansuel Smith says:
      
      ====================
      Add support for qca8k mdio rw in Ethernet packet
      
      The main reason for this is that we notice some routing problem in the
      switch and it seems assisted learning is needed. Considering mdio is
      quite slow due to the indirect write using this Ethernet alternative way
      seems to be quicker.
      
      The qca8k switch supports a special way to pass mdio read/write request
      using specially crafted Ethernet packet.
      This works by putting some defined data in the Ethernet header where the
      mac source and dst should be placed. The Ethernet type header is set to qca
      header and is set to a mdio read/write type.
      This is used to communicate to the switch that this is a special packet
      and should be parsed differently.
      
      Currently we use Ethernet packet for
      - MIB counter
      - mdio read/write configuration
      - phy read/write for each port
      
      Current implementation of this use completion API to wait for the packet
      to be processed by the tagger and has a timeout that fallback to the
      legacy mdio way and mutex to enforce one transaction at time.
      
      We now have connect()/disconnect() ops for the tagger. They are used to
      allocate priv data in the dsa priv. The header still has to be put in
      global include to make it usable by a dsa driver.
      They are called when the tag is connect to the dst and the data is freed
      using discconect on tagger change.
      
      (if someone wonder why the bind function is put at in the general setup
      function it's because tag is set in the cpu port where the notifier is
      still not available and we require the notifier to sen the
      tag_proto_connect() event.
      
      We now have a tag_proto_connect() for the dsa driver used to put
      additional data in the tagger priv (that is actually the dsa priv).
      This is called using a switch event DSA_NOTIFIER_TAG_PROTO_CONNECT.
      Current use for this is adding handler for the Ethernet packet to keep
      the tagger code as dumb as possible.
      
      The tagger priv implement only the handler for the special packet. All the
      other stuff is placed in the qca8k_priv and the tagger has to access
      it under lock.
      
      We use the new API from Vladimir to track if the master port is
      operational or not. We had to track many thing to reach a usable state.
      Checking if the port is UP is not enough and tracking a NETDEV_CHANGE is
      also not enough since it use also for other task. The correct way was
      both track for interface UP and if a qdisc was assigned to the
      interface. That tells us the port (and the tagger indirectly) is ready
      to accept and process packet.
      
      I tested this with multicpu port and with port6 set as the unique port and
      it's sad.
      It seems they implemented this feature in a bad way and this is only
      supported with cpu port0. When cpu port6 is the unique port, the switch
      doesn't send ack packet. With multicpu port, packet ack are not duplicated
      and only cpu port0 sends them. This is the same for the MIB counter.
      For this reason this feature is enabled only when cpu port0 is enabled and
      operational.
      
      v8:
      - Reworked to rolling counter for the seq_num
      - Reworked the hi/lo cache patch
      - Fix multiple missing skb free and mutex lock errors
      - Fix some spelling mistake
      - Add macro build check for mgmt packet size
      - Change some struct naming to make them more descriptive
      v7:
      - Rebase on net-next changes
      - Add bulk patches to speedup this even more
      v6:
      - Fix some error in ethtool handler caused by rebase/cleanup
      v5:
      - Adapt to new API fixes
      - Fix a wrong logic for noop
      - Add additional lock for master_state change
      - Limit mdio Ethernet to cpu port0 (switch limitation)
      - Add priority to these special packet
      - Move mdio cache to qca8k_priv
      v4:
      - Remove duplicate patch sent by mistake.
      v3:
      - Include MIB with Ethernet packet.
      - Include phy read/write with Ethernet packet.
      - Reorganize code with new API.
      - Introuce master tracking by Vladimir
      v2:
      - Address all suggestion from Vladimir.
        Try to generilize this with connect/disconnect function from the
        tagger and tag_proto_connect for the driver.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0b6b0d31
    • Ansuel Smith's avatar
      net: dsa: qca8k: introduce qca8k_bulk_read/write function · 4f3701fc
      Ansuel Smith authored
      Introduce qca8k_bulk_read/write() function to use mgmt Ethernet way to
      read/write packet in bulk. Make use of this new function in the fdb
      function and while at it reduce the reg for fdb_read from 4 to 3 as the
      max bit for the ARL(fdb) table is 83 bits.
      Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4f3701fc
    • Ansuel Smith's avatar
      net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet · 90386223
      Ansuel Smith authored
      mgmt Ethernet packet can read/write up to 16byte at times. The len reg
      is limited to 15 (0xf). The switch actually sends and accepts data in 4
      different steps of len values.
      Len steps:
      - 0: nothing
      - 1-4: first 4 byte
      - 5-6: first 12 byte
      - 7-15: all 16 byte
      
      In the alloc skb function we check if the len is 16 and we fix it to a
      len of 15. It the read/write function interest to extract the real asked
      data. The tagger handler will always copy the fully 16byte with a READ
      command. This is useful for some big regs like the fdb reg that are
      more than 4byte of data. This permits to introduce a bulk function that
      will send and request the entire entry in one go.
      Write function is changed and it does now require to pass the pointer to
      val to also handle array val.
      Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      90386223
    • Ansuel Smith's avatar
      net: dsa: qca8k: cache lo and hi for mdio write · 2481d206
      Ansuel Smith authored
      From Documentation, we can cache lo and hi the same way we do with the
      page. This massively reduce the mdio write as 3/4 of the time as we only
      require to write the lo or hi part for a mdio write.
      Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2481d206