1. 05 Oct, 2020 4 commits
    • Vladimir Oltean's avatar
      net: dsa: propagate switchdev vlan_filtering prepare phase to drivers · 2e554a7a
      Vladimir Oltean authored
      A driver may refuse to enable VLAN filtering for any reason beyond what
      the DSA framework cares about, such as:
      - having tc-flower rules that rely on the switch being VLAN-aware
      - the particular switch does not support VLAN, even if the driver does
        (the DSA framework just checks for the presence of the .port_vlan_add
        and .port_vlan_del pointers)
      - simply not supporting this configuration to be toggled at runtime
      
      Currently, when a driver rejects a configuration it cannot support, it
      does this from the commit phase, which triggers various warnings in
      switchdev.
      
      So propagate the prepare phase to drivers, to give them the ability to
      refuse invalid configurations cleanly and avoid the warnings.
      
      Since we need to modify all function prototypes and check for the
      prepare phase from within the drivers, take that opportunity and move
      the existing driver restrictions within the prepare phase where that is
      possible and easy.
      
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Cc: Woojung Huh <woojung.huh@microchip.com>
      Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
      Cc: Sean Wang <sean.wang@mediatek.com>
      Cc: Landen Chao <Landen.Chao@mediatek.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Jonathan McDowell <noodles@earth.li>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Claudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e554a7a
    • David S. Miller's avatar
      Merge branch 'net-Constify-struct-genl_small_ops' · c2568c8c
      David S. Miller authored
      Rikard Falkeborn says:
      
      ====================
      net: Constify struct genl_small_ops
      
      Make a couple of static struct genl_small_ops const to allow the compiler
      to put them in read-only memory. Patches are independent.
      
      v2: Rebase on net-next, genl_ops -> genl_small_ops
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c2568c8c
    • Rikard Falkeborn's avatar
      net: openvswitch: Constify static struct genl_small_ops · b980b313
      Rikard Falkeborn authored
      The only usage of these is to assign their address to the small_ops field
      in the genl_family struct, which is a const pointer, and applying
      ARRAY_SIZE() on them. Make them const to allow the compiler to put them
      in read-only memory.
      Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b980b313
    • Rikard Falkeborn's avatar
      mptcp: Constify mptcp_pm_ops · 674d3ab9
      Rikard Falkeborn authored
      The only usages of mptcp_pm_ops is to assign its address to the small_ops
      field of the genl_family struct, which is a const pointer, and applying
      ARRAY_SIZE() on it. Make it const to allow the compiler to put it in
      read-only memory.
      Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      674d3ab9
  2. 04 Oct, 2020 36 commits