1. 24 2月, 2021 4 次提交
  2. 22 2月, 2021 2 次提交
    • S
      Revert "ath9k: fix ath_tx_process_buffer() potential null ptr dereference" · 14ebaeef
      Shuah Khan 提交于
      This reverts commit a56c14bb.
      
      ath_tx_process_buffer() doesn't dereference or check sta and passes it
      to ath_tx_complete_aggr() and ath_tx_complete_buf().
      
      ath_tx_complete_aggr() checks the pointer before use. No problem here.
      
      ath_tx_complete_buf() doesn't check or dereference sta and passes it on
      to ath_tx_complete(). ath_tx_complete() doesn't check or dereference sta,
      but assigns it to tx_info->status.status_driver_data[0]
      
      ath_tx_complete_buf() is called from ath_tx_complete_aggr() passing
      null ieee80211_sta pointer.
      
      There is a potential for dereference later on, if and when the
      tx_info->status.status_driver_data[0]is referenced. In addition, the
      rcu read lock might be released before referencing the contents.
      
      ath_tx_complete_buf() should be fixed to check sta perhaps? Worth
      looking into.
      
      Reverting this patch because it doesn't solve the problem and introduces
      memory leak by skipping buffer completion if the pointer (sta) is NULL.
      
      Fixes: a56c14bb ("ath9k: fix ath_tx_process_buffer() potential null ptr dereference")
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20210217211801.22540-1-skhan@linuxfoundation.org
      14ebaeef
    • K
      ath11k: print hardware name and version during initialisation · 6b7abacb
      Kalle Valo 提交于
      This way it's easy for the user to find what device is actually installed. This
      also helps reporting bugs.
      
      Screenshot:
      
      [  459.988812] ath11k_pci 0000:06:00.0: BAR 0: assigned [mem 0xdb000000-0xdbffffff 64bit]
      [  459.988867] ath11k_pci 0000:06:00.0: enabling device (0000 -> 0002)
      [  459.997048] ath11k_pci 0000:06:00.0: qca6390 hw2.0
      [  460.058093] mhi mhi0: Requested to power ON
      [  460.059741] mhi mhi0: Power on setup success
      [  460.476924] ath11k_pci 0000:06:00.0: chip_id 0x0 chip_family 0xb board_id 0xff soc_id 0xffffffff
      [  460.477032] ath11k_pci 0000:06:00.0: fw_version 0x101c06cc fw_build_timestamp 2020-06-24 19:50 fw_build_id
      
      Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/1613589400-18891-1-git-send-email-kvalo@codeaurora.org
      6b7abacb
  3. 18 2月, 2021 2 次提交
  4. 17 2月, 2021 11 次提交
  5. 16 2月, 2021 2 次提交
  6. 13 2月, 2021 19 次提交
    • D
      Merge branch 'Xilinx-axienet-updates' · 773dc50d
      David S. Miller 提交于
      Robert Hancock says:
      
      ====================
      Xilinx axienet updates
      
      Updates to the Xilinx AXI Ethernet driver to add support for an additional
      ethtool operation, and to support dynamic switching between 1000BaseX and
      SGMII interface modes.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      773dc50d
    • R
      net: axienet: Support dynamic switching between 1000BaseX and SGMII · 6c8f06bb
      Robert Hancock 提交于
      Newer versions of the Xilinx AXI Ethernet core (specifically version 7.2 or
      later) allow the core to be configured with a PHY interface mode of "Both",
      allowing either 1000BaseX or SGMII modes to be selected at runtime. Add
      support for this in the driver to allow better support for applications
      which can use both fiber and copper SFP modules.
      Signed-off-by: NRobert Hancock <robert.hancock@calian.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6c8f06bb
    • R
      dt-bindings: net: xilinx_axienet: add xlnx,switch-x-sgmii attribute · eceac9d2
      Robert Hancock 提交于
      Document the new xlnx,switch-x-sgmii attribute which is used to indicate
      that the Ethernet core supports dynamic switching between 1000BaseX and
      SGMII.
      Signed-off-by: NRobert Hancock <robert.hancock@calian.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eceac9d2
    • R
      net: axienet: hook up nway_reset ethtool operation · 66b51663
      Robert Hancock 提交于
      Hook up the nway_reset ethtool operation to the corresponding phylink
      function so that "ethtool -r" can be supported.
      Signed-off-by: NRobert Hancock <robert.hancock@calian.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66b51663
    • D
      Merge branch 'tcp-mem-pressure-vs-SO_RCVLOWAT' · 762d17b9
      David S. Miller 提交于
      Eric Dumazet says:
      
      ====================
      tcp: mem pressure vs SO_RCVLOWAT
      
      First patch fixes an issue for applications using SO_RCVLOWAT
      to reduce context switches.
      
      Second patch is a cleanup.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      762d17b9
    • E
      tcp: factorize logic into tcp_epollin_ready() · 05dc72ab
      Eric Dumazet 提交于
      Both tcp_data_ready() and tcp_stream_is_readable() share the same logic.
      
      Add tcp_epollin_ready() helper to avoid duplication.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Arjun Roy <arjunroy@google.com>
      Cc: Wei Wang <weiwan@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05dc72ab
    • E
      tcp: fix SO_RCVLOWAT related hangs under mem pressure · f969dc5a
      Eric Dumazet 提交于
      While commit 24adbc16 ("tcp: fix SO_RCVLOWAT hangs with fat skbs")
      fixed an issue vs too small sk_rcvbuf for given sk_rcvlowat constraint,
      it missed to address issue caused by memory pressure.
      
      1) If we are under memory pressure and socket receive queue is empty.
      First incoming packet is allowed to be queued, after commit
      76dfa608 ("tcp: allow one skb to be received per socket under memory pressure")
      
      But we do not send EPOLLIN yet, in case tcp_data_ready() sees sk_rcvlowat
      is bigger than skb length.
      
      2) Then, when next packet comes, it is dropped, and we directly
      call sk->sk_data_ready().
      
      3) If application is using poll(), tcp_poll() will then use
      tcp_stream_is_readable() and decide the socket receive queue is
      not yet filled, so nothing will happen.
      
      Even when sender retransmits packets, phases 2) & 3) repeat
      and flow is effectively frozen, until memory pressure is off.
      
      Fix is to consider tcp_under_memory_pressure() to take care
      of global memory pressure or memcg pressure.
      
      Fixes: 24adbc16 ("tcp: fix SO_RCVLOWAT hangs with fat skbs")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: NArjun Roy <arjunroy@google.com>
      Suggested-by: NWei Wang <weiwan@google.com>
      Reviewed-by: NWei Wang <weiwan@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f969dc5a
    • D
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue · 5cdaf9d6
      David S. Miller 提交于
      Tony Nguyen says:
      
      ====================
      40GbE Intel Wired LAN Driver Updates 2021-02-12
      
      This series contains updates to i40e, ice, and ixgbe drivers.
      
      Maciej does cleanups on the following drivers.
      For i40e, removes redundant check for XDP prog, cleans up no longer
      relevant information, and removes an unused function argument.
      For ice, removes local variable use, instead returning values directly.
      Moves skb pointer from buffer to ring and removes an unneeded check for
      xdp_prog in zero copy path. Also removes a redundant MTU check when
      changing it.
      For i40e, ice, and ixgbe, stores the rx_offset in the Rx ring as
      the value is constant so there's no need for continual calls.
      
      Bjorn folds a decrement into a while statement.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5cdaf9d6
    • D
      Merge branch 'tc-mpls-selftests' · 7aceeb73
      David S. Miller 提交于
      Guillaume Nault says:
      
      ====================
      selftests: tc: Test tc-flower's MPLS features
      
      A couple of patches for exercising the MPLS filters of tc-flower.
      
      Patch 1 tests basic MPLS matching features: those that only work on the
      first label stack entry (that is, the mpls_label, mpls_tc, mpls_bos and
      mpls_ttl options).
      
      Patch 2 tests the more generic "mpls" and "lse" options, which allow
      matching MPLS fields beyond the first stack entry.
      
      In both patches, special care is taken to skip these new tests for
      incompatible versions of tc.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7aceeb73
    • G
      selftests: tc: Add generic mpls matching support for tc-flower · c09bfd9a
      Guillaume Nault 提交于
      Add tests in tc_flower.sh for generic matching on MPLS Label Stack
      Entries. The label, tc, bos and ttl fields are tested for the first
      and second labels. For each field, the minimal and maximal values are
      tested (the former at depth 1 and the later at depth 2).
      There are also tests for matching the presence of a label stack entry
      at a given depth.
      
      In order to reduce the amount of code, all "lse" subcommands are tested
      in match_mpls_lse_test(). Action "continue" is used, so that test
      packets are evaluated by all filters. Then, we can verify if each
      filter matched the expected number of packets.
      
      Some versions of tc-flower produced invalid json output when dumping
      MPLS filters with depth > 1. Skip the test if tc isn't recent enough.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c09bfd9a
    • G
      selftests: tc: Add basic mpls_* matching support for tc-flower · 203ee5cd
      Guillaume Nault 提交于
      Add tests in tc_flower.sh for mpls_label, mpls_tc, mpls_bos and
      mpls_ttl. For each keyword, test the minimal and maximal values.
      
      Selectively skip these new mpls tests for tc versions that don't
      support them.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      203ee5cd
    • D
      Merge branch 'brport-flags' · 4098ced4
      David S. Miller 提交于
      Vladimir Oltean says:
      
      ====================
      Cleanup in brport flags switchdev offload for DSA
      
      The initial goal of this series was to have better support for
      standalone ports mode on the DSA drivers like ocelot/felix and sja1105.
      This turned out to require some API adjustments in both directions:
      to the information presented to and by the switchdev notifier, and to
      the API presented to the switch drivers by the DSA layer.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4098ced4
    • V
      net: dsa: sja1105: offload bridge port flags to device · 4d942354
      Vladimir Oltean 提交于
      The chip can configure unicast flooding, broadcast flooding and learning.
      Learning is per port, while flooding is per {ingress, egress} port pair
      and we need to configure the same value for all possible ingress ports
      towards the requested one.
      
      While multicast flooding is not officially supported, we can hack it by
      using a feature of the second generation (P/Q/R/S) devices, which is that
      FDB entries are maskable, and multicast addresses always have an odd
      first octet. So by putting a match-all for 00:01:00:00:00:00 addr and
      00:01:00:00:00:00 mask at the end of the FDB, we make sure that it is
      always checked last, and does not take precedence in front of any other
      MDB. So it behaves effectively as an unknown multicast entry.
      
      For the first generation switches, this feature is not available, so
      unknown multicast will always be treated the same as unknown unicast.
      So the only thing we can do is request the user to offload the settings
      for these 2 flags in tandem, i.e.
      
      ip link set swp2 type bridge_slave flood off
      Error: sja1105: This chip cannot configure multicast flooding independently of unicast.
      ip link set swp2 type bridge_slave flood off mcast_flood off
      ip link set swp2 type bridge_slave mcast_flood on
      Error: sja1105: This chip cannot configure multicast flooding independently of unicast.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4d942354
    • V
      net: mscc: ocelot: offload bridge port flags to device · 421741ea
      Vladimir Oltean 提交于
      We should not be unconditionally enabling address learning, since doing
      that is actively detrimential when a port is standalone and not offloading
      a bridge. Namely, if a port in the switch is standalone and others are
      offloading the bridge, then we could enter a situation where we learn an
      address towards the standalone port, but the bridged ports could not
      forward the packet there, because the CPU is the only path between the
      standalone and the bridged ports. The solution of course is to not
      enable address learning unless the bridge asks for it.
      
      We need to set up the initial port flags for no learning and flooding
      everything, and also when the port joins and leaves the bridge.
      The flood configuration was already configured ok for standalone mode
      in ocelot_init, we just need to disable learning in ocelot_init_port.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      421741ea
    • V
      net: mscc: ocelot: use separate flooding PGID for broadcast · b360d94f
      Vladimir Oltean 提交于
      In preparation of offloading the bridge port flags which have
      independent settings for unknown multicast and for broadcast, we should
      also start reserving one destination Port Group ID for the flooding of
      broadcast packets, to allow configuring it individually.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b360d94f
    • V
      net: dsa: felix: restore multicast flood to CPU when NPI tagger reinitializes · 6edb9e8d
      Vladimir Oltean 提交于
      ocelot_init sets up PGID_MC to include the CPU port module, and that is
      fine, but the ocelot-8021q tagger removes the CPU port module from the
      unknown multicast replicator. So after a transition from the default
      ocelot tagger towards ocelot-8021q and then again towards ocelot,
      multicast flooding towards the CPU port module will be disabled.
      
      Fixes: e21268ef ("net: dsa: felix: perform switch setup for tag_8021q")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6edb9e8d
    • V
      net: dsa: act as passthrough for bridge port flags · a8b659e7
      Vladimir Oltean 提交于
      There are multiple ways in which a PORT_BRIDGE_FLAGS attribute can be
      expressed by the bridge through switchdev, and not all of them can be
      emulated by DSA mid-layer API at the same time.
      
      One possible configuration is when the bridge offloads the port flags
      using a mask that has a single bit set - therefore only one feature
      should change. However, DSA currently groups together unicast and
      multicast flooding in the .port_egress_floods method, which limits our
      options when we try to add support for turning off broadcast flooding:
      do we extend .port_egress_floods with a third parameter which b53 and
      mv88e6xxx will ignore? But that means that the DSA layer, which
      currently implements the PRE_BRIDGE_FLAGS attribute all by itself, will
      see that .port_egress_floods is implemented, and will report that all 3
      types of flooding are supported - not necessarily true.
      
      Another configuration is when the user specifies more than one flag at
      the same time, in the same netlink message. If we were to create one
      individual function per offloadable bridge port flag, we would limit the
      expressiveness of the switch driver of refusing certain combinations of
      flag values. For example, a switch may not have an explicit knob for
      flooding of unknown multicast, just for flooding in general. In that
      case, the only correct thing to do is to allow changes to BR_FLOOD and
      BR_MCAST_FLOOD in tandem, and never allow mismatched values. But having
      a separate .port_set_unicast_flood and .port_set_multicast_flood would
      not allow the driver to possibly reject that.
      
      Also, DSA doesn't consider it necessary to inform the driver that a
      SWITCHDEV_ATTR_ID_BRIDGE_MROUTER attribute was offloaded, because it
      just calls .port_egress_floods for the CPU port. When we'll add support
      for the plain SWITCHDEV_ATTR_ID_PORT_MROUTER, that will become a real
      problem because the flood settings will need to be held statefully in
      the DSA middle layer, otherwise changing the mrouter port attribute will
      impact the flooding attribute. And that's _assuming_ that the underlying
      hardware doesn't have anything else to do when a multicast router
      attaches to a port than flood unknown traffic to it.  If it does, there
      will need to be a dedicated .port_set_mrouter anyway.
      
      So we need to let the DSA drivers see the exact form that the bridge
      passes this switchdev attribute in, otherwise we are standing in the
      way. Therefore we also need to use this form of language when
      communicating to the driver that it needs to configure its initial
      (before bridge join) and final (after bridge leave) port flags.
      
      The b53 and mv88e6xxx drivers are converted to the passthrough API and
      their implementation of .port_egress_floods is split into two: a
      function that configures unicast flooding and another for multicast.
      The mv88e6xxx implementation is quite hairy, and it turns out that
      the implementations of unknown unicast flooding are actually the same
      for 6185 and for 6352:
      
      behind the confusing names actually lie two individual bits:
      NO_UNKNOWN_MC -> FLOOD_UC = 0x4 = BIT(2)
      NO_UNKNOWN_UC -> FLOOD_MC = 0x8 = BIT(3)
      
      so there was no reason to entangle them in the first place.
      
      Whereas the 6185 writes to MV88E6185_PORT_CTL0_FORWARD_UNKNOWN of
      PORT_CTL0, which has the exact same bit index. I have left the
      implementations separate though, for the only reason that the names are
      different enough to confuse me, since I am not able to double-check with
      a user manual. The multicast flooding setting for 6185 is in a different
      register than for 6352 though.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8b659e7
    • V
      net: switchdev: pass flags and mask to both {PRE_,}BRIDGE_FLAGS attributes · e18f4c18
      Vladimir Oltean 提交于
      This switchdev attribute offers a counterproductive API for a driver
      writer, because although br_switchdev_set_port_flag gets passed a
      "flags" and a "mask", those are passed piecemeal to the driver, so while
      the PRE_BRIDGE_FLAGS listener knows what changed because it has the
      "mask", the BRIDGE_FLAGS listener doesn't, because it only has the final
      value. But certain drivers can offload only certain combinations of
      settings, like for example they cannot change unicast flooding
      independently of multicast flooding - they must be both on or both off.
      The way the information is passed to switchdev makes drivers not
      expressive enough, and unable to reject this request ahead of time, in
      the PRE_BRIDGE_FLAGS notifier, so they are forced to reject it during
      the deferred BRIDGE_FLAGS attribute, where the rejection is currently
      ignored.
      
      This patch also changes drivers to make use of the "mask" field for edge
      detection when possible.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e18f4c18
    • V
      net: dsa: configure better brport flags when ports leave the bridge · 5e38c158
      Vladimir Oltean 提交于
      For a DSA switch port operating in standalone mode, address learning
      doesn't make much sense since that is a bridge function. In fact,
      address learning even breaks setups such as this one:
      
         +---------------------------------------------+
         |                                             |
         | +-------------------+                       |
         | |        br0        |    send      receive  |
         | +--------+-+--------+ +--------+ +--------+ |
         | |        | |        | |        | |        | |
         | |  swp0  | |  swp1  | |  swp2  | |  swp3  | |
         | |        | |        | |        | |        | |
         +-+--------+-+--------+-+--------+-+--------+-+
                |         ^           |          ^
                |         |           |          |
                |         +-----------+          |
                |                                |
                +--------------------------------+
      
      because if the switch has a single FDB (can offload a single bridge)
      then source address learning on swp3 can "steal" the source MAC address
      of swp2 from br0's FDB, because learning frames coming from swp2 will be
      done twice: first on the swp1 ingress port, second on the swp3 ingress
      port. So the hardware FDB will become out of sync with the software
      bridge, and when swp2 tries to send one more packet towards swp1, the
      ASIC will attempt to short-circuit the forwarding path and send it
      directly to swp3 (since that's the last port it learned that address on),
      which it obviously can't, because swp3 operates in standalone mode.
      
      So DSA drivers operating in standalone mode should still configure a
      list of bridge port flags even when they are standalone. Currently DSA
      attempts to call dsa_port_bridge_flags with 0, which disables egress
      flooding of unknown unicast and multicast, something which doesn't make
      much sense. For the switches that implement .port_egress_floods - b53
      and mv88e6xxx, it probably doesn't matter too much either, since they
      can possibly inject traffic from the CPU into a standalone port,
      regardless of MAC DA, even if egress flooding is turned off for that
      port, but certainly not all DSA switches can do that - sja1105, for
      example, can't. So it makes sense to use a better common default there,
      such as "flood everything".
      
      It should also be noted that what DSA calls "dsa_port_bridge_flags()"
      is a degenerate name for just calling .port_egress_floods(), since
      nothing else is implemented - not learning, in particular. But disabling
      address learning, something that this driver is also coding up for, will
      be supported by individual drivers once .port_egress_floods is replaced
      with a more generic .port_bridge_flags.
      
      Previous attempts to code up this logic have been in the common bridge
      layer, but as pointed out by Ido Schimmel, there are corner cases that
      are missed when doing that:
      https://patchwork.kernel.org/project/netdevbpf/patch/20210209151936.97382-5-olteanv@gmail.com/
      
      So, at least for now, let's leave DSA in charge of setting port flags
      before and after the bridge join and leave.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5e38c158