1. 21 Apr, 2023 14 commits
  2. 20 Apr, 2023 11 commits
  3. 19 Apr, 2023 15 commits
    • Jakub Kicinski's avatar
      page_pool: add DMA_ATTR_WEAK_ORDERING on all mappings · 8e4c62c7
      Jakub Kicinski authored
      Commit c519fe9a ("bnxt: add dma mapping attributes") added
      DMA_ATTR_WEAK_ORDERING to DMA attrs on bnxt. It has since spread
      to a few more drivers (possibly as a copy'n'paste).
      
      DMA_ATTR_WEAK_ORDERING only seems to matter on Sparc and PowerPC/cell,
      the rarity of these platforms is likely why we never bothered adding
      the attribute in the page pool, even though it should be safe to add.
      
      To make the page pool migration in drivers which set this flag less
      of a risk (of regressing the precious sparc database workloads or
      whatever needed this) let's add DMA_ATTR_WEAK_ORDERING on all
      page pool DMA mappings.
      
      We could make this a driver opt-in but frankly I don't think it's
      worth complicating the API. I can't think of a reason why device
      accesses to packet memory would have to be ordered.
      Acked-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      Acked-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
      Reviewed-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
      Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Link: https://lore.kernel.org/r/20230417152805.331865-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8e4c62c7
    • Corinna Vinschen's avatar
      stmmac: fix changing mac address · 4e195166
      Corinna Vinschen authored
      Without the IFF_LIVE_ADDR_CHANGE flag being set, the network code
      disallows changing the mac address while the interface is UP.
      
      Consequences are, for instance, that the interface can't be used
      in a failover bond.
      
      Add the missing flag to net_device priv_flags.
      
      Tested on Intel Elkhart Lake with default settings, as well as with
      failover and alb mode bonds.
      Signed-off-by: default avatarCorinna Vinschen <vinschen@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e195166
    • David S. Miller's avatar
      Merge branch 'skbuff-bitfields' · fbb192a8
      David S. Miller authored
      Jakub Kicinski says:
      
      ====================
      net: skbuff: hide some bitfield members
      
      There is a number of protocol or subsystem specific fields
      in struct sk_buff which are only accessed by one subsystem.
      We can wrap them in ifdefs with minimal code impact.
      
      This gives us a better chance to save a 2B and a 4B holes
      resulting with the following savings (assuming a lucky
      kernel config):
      
      -	/* size: 232, cachelines: 4, members: 28 */
      -	/* sum members: 227, holes: 1, sum holes: 4 */
      -	/* sum bitfield members: 8 bits (1 bytes) */
      +	/* size: 224, cachelines: 4, members: 28 */
       	/* forced alignments: 2 */
      -	/* last cacheline: 40 bytes */
      +	/* last cacheline: 32 bytes */
      
      I think that the changes shouldn't be too controversial.
      The only one I'm not 100% sure of is the SCTP one,
      12 extra LoC for one bit.. But it did fit squarely
      in the "this bit has only one user" category.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Acked-by: default avatarSimon Horman <horms@kernel.org>
      fbb192a8
    • Jakub Kicinski's avatar
      net: skbuff: hide nf_trace and ipvs_property · 48d80c39
      Jakub Kicinski authored
      Accesses to nf_trace and ipvs_property are already wrapped
      by ifdefs where necessary. Don't allocate the bits for those
      fields at all if possible.
      Acked-by: default avatarFlorian Westphal <fw@strlen.de>
      Acked-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      48d80c39
    • Jakub Kicinski's avatar
      net: skbuff: push nf_trace down the bitfield · 4c60d04c
      Jakub Kicinski authored
      nf_trace is a debug feature, AFAIU, and yet it sits oddly
      high in the sk_buff bitfield. Move it down, pushing up
      dst_pending_confirm and inner_protocol_type.
      
      Next change will make nf_trace optional (under Kconfig)
      and all optional fields should be placed after 2b fields
      to avoid 2b fields straddling bytes.
      
      dst_pending_confirm is L3, so it makes sense next to ignore_df.
      inner_protocol_type goes up just to keep the balance.
      Acked-by: default avatarFlorian Westphal <fw@strlen.de>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c60d04c
    • Jakub Kicinski's avatar
      net: skbuff: move alloc_cpu into a potential hole · 4398f3f6
      Jakub Kicinski authored
      alloc_cpu is currently between 4 byte fields, so it's almost
      guaranteed to create a 2B hole. It has a knock on effect of
      creating a 4B hole after @end (and @end and @tail being in
      different cachelines).
      
      None of this matters hugely, but for kernel configs which
      don't enable all the features there may well be a 2B hole
      after the bitfield. Move alloc_cpu there.
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4398f3f6
    • Jakub Kicinski's avatar
      net: skbuff: hide csum_not_inet when CONFIG_IP_SCTP not set · c24831a1
      Jakub Kicinski authored
      SCTP is not universally deployed, allow hiding its bit
      from the skb.
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c24831a1
    • Jakub Kicinski's avatar
      net: skbuff: hide wifi_acked when CONFIG_WIRELESS not set · eb6fba75
      Jakub Kicinski authored
      Datacenter kernel builds will very likely not include WIRELESS,
      so let them shave 2 bits off the skb by hiding the wifi fields.
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Acked-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eb6fba75
    • David S. Miller's avatar
      Merge branch 'switch-phy-leds' · 4edd97fb
      David S. Miller authored
      Christian Marangi says:
      
      ====================
      net: Add basic LED support for switch/phy
      
      This is a continue of [1]. It was decided to take a more gradual
      approach to implement LEDs support for switch and phy starting with
      basic support and then implementing the hw control part when we have all
      the prereq done.
      
      This series implements only the brightness_set() and blink_set() ops.
      An example of switch implementation is done with qca8k.
      
      For PHY a more generic approach is used with implementing the LED
      support in PHY core and with the user (in this case marvell) adding all
      the required functions.
      
      Currently we set the default-state as "keep" to not change the default
      configuration of the declared LEDs since almost every switch have a
      default configuration.
      
      [1] https://lore.kernel.org/lkml/20230216013230.22978-1-ansuelsmth@gmail.com/
      
      Changes in new series v7:
      - Drop ethernet-leds schema and add unevaluatedProperties to
        ethernet-controller and ethernet-phy schema
      - Drop function-enumerator binding from schema example and DT
      - Set devname_mandatory for qca8k leds and assign better name to LEDs
        using the format {slave_mii_bus id}:0{port number}:{color}:{function}
      - Add Documentation patch for Correct LEDs naming from Andrew
      - Changes in Andrew patch:
        - net: phy: Add a binding for PHY LEDs
          - Convert index from u32 to u8
        - net: phy: phy_device: Call into the PHY driver to set LED brightness
          - Fixup kernel doc
          - Convert index from u32 to u8
        - net: phy: marvell: Add software control of the LEDs
          - Convert index from u32 to u8
        - net: phy: phy_device: Call into the PHY driver to set LED blinking
          - Kernel doc fix
          - Convert index from u32 to u8
        - net: phy: marvell: Implement led_blink_set()
          - Convert index from u32 to u8
      Changes in new series v6:
      - Add leds-ethernet.yaml to document reg in led node
      - Update ethernet-controller and ethernet-phy to follow new leds-ethernet schema
      - Fix comments in qca8k-leds.c (at least -> at most)
        (wrong GENMASK for led phy 0 and 4)
      - Add review and ack tag from Pavel Machek
      - Changes in Andrew patch:
        - leds: Provide stubs for when CLASS_LED & NEW_LEDS are disabled
          - Change LED_CLASS to NEW_LEDS for led_init_default_state_get()
        - net: phy: Add a binding for PHY LEDs
          - Add dependency on LED_CLASS
          - Drop review tag from Michal Kubiak (patch modified)
      Changes in new series v5:
      - Rebase everything on top of net-next/main
      - Add more info on LED probe fail for qca8k
      - Drop some additional raw number and move to define in qca8k header
      - Add additional info on LED mapping on qca8k regs
      - Checks port number in qca8k switch port parse
      - Changes in Andrew patch:
        - Add additional patch for stubs when CLASS_LED disabled
        - Drop CLASS_LED dependency for PHYLIB (to fix kbot errors reported)
      Changes in new series v4:
      - Changes in Andrew patch:
        - net: phy: Add a binding for PHY LEDs:
          - Rename phy_led: led_list to list
          - Rename phy_device: led_list to leds
          - Remove phy_leds_remove() since devm_ should do what is needed
          - Fixup documentation for struct phy_led
          - Fail probe on LED errors
        - net: phy: phy_device: Call into the PHY driver to set LED brightness
          - Moved phy_led::phydev from previous patch to here since it is first
            used here.
        - net: phy: marvell: Implement led_blink_set()
          - Use int instead of unsigned
        - net: phy: marvell: Add software control of the LEDs
          - Use int instead of unsigned
      - Add depends on LED_CLASS for qca8k Kconfig
      - Fix Makefile for qca8k as suggested
      - Move qca8k_setup_led_ctrl to separate header
      - Move Documentation from dsa-port to ethernet-controller
      - Drop trailing . from Andrew patch fro consistency
      Changes in new series v3:
      - Move QCA8K_LEDS Kconfig option from tristate to bool
      - Use new helper led_init_default_state_get for default-state in qca8k
      - Drop cled_qca8k_brightness_get() as there isn't a good way to describe
        the mode the led is currently in
      - Rework qca8k_led_brightness_get() to return true only when LED is set
        to always ON
      Changes in new series v2:
      - Add LEDs node for rb3011
      - Fix rb3011 switch node unevaluated properties while running
        make dtbs_check
      - Fix a copypaste error in qca8k-leds.c for port 4 required shift
      - Drop phy-handle usage for qca8k and use qca8k_port_to_phy()
      - Add review tag from Andrew
      - Add Christian Marangi SOB in each Andrew patch
      - Add extra description for dsa-port stressing that PHY have no access
        and LED are controlled by the related MAC
      - Add missing additionalProperties for dsa-port.yaml and ethernet-phy.yaml
      
      Changes from the old v8 series:
      - Drop linux,default-trigger set to netdev.
      - Dropped every hw control related patch and implement only
        blink_set and brightness_set
      - Add default-state to "keep" for each LED node example
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4edd97fb
    • Andrew Lunn's avatar
      Documentation: LEDs: Describe good names for network LEDs · c693ea2f
      Andrew Lunn authored
      Network LEDs can exist in both the MAC and the PHY. Naming is
      difficult because the netdev name is neither stable or unique, do to
      commands like ip link set name eth42 dev eth0, and network
      namesspaces.
      
      Give some example names where the MAC and the PHY have unique names
      based on device tree nodes, or PCI bus addresses.
      
      Since the LED can be used for anything which Linux supports for LEDs,
      avoid using names like activity or link, rather describe the location
      on the RJ-45, of what the RJ-45 is expected to be used for, WAN/LAN
      etc.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c693ea2f
    • Andrew Lunn's avatar
      arm: mvebu: dt: Add PHY LED support for 370-rd WAN port · 380a8fe1
      Andrew Lunn authored
      The WAN port of the 370-RD has a Marvell PHY, with one LED on
      the front panel.y List this LED in the device tree.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      380a8fe1
    • Christian Marangi's avatar
      dt-bindings: net: phy: Document support for LEDs node · 18a24b69
      Christian Marangi authored
      Document support for LEDs node in phy and add an example for it.
      PHY LED will have to match led pattern and should be treated as a
      generic led.
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      18a24b69
    • Christian Marangi's avatar
      ARM: dts: qcom: ipq8064-rb3011: Add Switch LED for each port · 09930f1f
      Christian Marangi authored
      Add Switch LED for each port for MikroTik RB3011UiAS-RM.
      
      MikroTik RB3011UiAS-RM is a 10 port device with 2 qca8337 switch chips
      connected.
      
      It was discovered that in the hardware design all 3 Switch LED trace of
      the related port is connected to the same LED. This was discovered by
      setting to 'always on' the related led in the switch regs and noticing
      that all 3 LED for the specific port (for example for port 1) cause the
      connected LED for port 1 to turn on. As an extra test we tried enabling
      2 different LED for the port resulting in the LED turned off only if
      every led in the reg was off.
      
      Aside from this funny and strange hardware implementation, the device
      itself have one green LED for each port, resulting in 10 green LED one
      for each of the 10 supported port.
      
      Cc: Jonathan McDowell <noodles@earth.li>
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09930f1f
    • Christian Marangi's avatar
      ARM: dts: qcom: ipq8064-rb3011: Drop unevaluated properties in switch nodes · 939595c7
      Christian Marangi authored
      IPQ8064 MikroTik RB3011UiAS-RM DT have currently unevaluted properties
      in the 2 switch nodes. The bindings #address-cells and #size-cells are
      redundant and cause warning for 'Unevaluated properties are not
      allowed'.
      
      Drop these bindings to mute these warning as they should not be there
      from the start.
      
      Cc: Jonathan McDowell <noodles@earth.li>
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Reviewed-by: default avatarJonathan McDowell <noodles@earth.li>
      Tested-by: default avatarJonathan McDowell <noodles@earth.li>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      939595c7
    • Christian Marangi's avatar
      dt-bindings: net: dsa: qca8k: add LEDs definition example · ed617bc0
      Christian Marangi authored
      Add LEDs definition example for qca8k Switch Family to describe how they
      should be defined for a correct usage.
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ed617bc0