Skip to content
Permalink
Ansuel-Smith/A…
Switch branches/tags

Commits on Nov 23, 2021

  1. net: dsa: qca8k: add LAG support

    Add LAG support to this switch. In Documentation this is described as
    trunk mode. A max of 4 LAGs are supported and each can support up to 4
    port. The current tx mode supported is Hash mode with both L2 and L2+3
    mode.
    When no port are present in the trunk, the trunk is disabled in the
    switch.
    When a port is disconnected, the traffic is redirected to the other
    available port.
    The hash mode is global and each LAG require to have the same hash mode
    set. To change the hash mode when multiple LAG are configured, it's
    required to remove each LAG and set the desired hash mode to the last.
    An error is printed when it's asked to set a not supported hadh mode.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 23, 2021
  2. net: dsa: qca8k: add support for mirror mode

    The switch supports mirror mode. Only one port can set as mirror port and
    every other port can set to both ingress and egress mode. The mirror
    port is disabled and reverted to normal operation once every port is
    removed from sending packet to it.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 23, 2021

Commits on Nov 22, 2021

  1. Merge branch 'qca8k-next'

    Ansuel Smith says:
    
    ====================
    Multiple cleanup and feature for qca8k
    
    This is a reduced version of the old massive series.
    Refer to the changelog to know what is removed from this.
    
    We clean and convert the driver to GENMASK FIELD_PREP to clean multiple
    use of various naming scheme. (example we have a mix of _MASK, _S _M,
    and various name) The idea is to ""simplify"" and remove some shift and
    data handling by using FIELD API.
    The patch contains various checkpatch warning and are ignored to not
    create more mess in the header file. (fixing the too long line warning
    would results in regs definition less readable)
    
    We conver the driver to regmap API as ipq40xx SoC is based on the same
    reg structure and we need to generilize the read/write access to split
    the driver to commond and specific code.
    
    The conversion to regmap is NOT done for the read/write/rmw operation,
    the function are reworked to use the regmap helper instead.
    This is done to keep the patch delta low but will come sooner or later
    when the code will be split.
    Any new feature will directly use the regmap helper and the reg
    set/clear and the busy wait function are migrated to regmap helper as
    the use of these function is low.
    
    We also add a minor patch for MIB counter as qca8337 is missing 2 extra
    counter, support for mdb and ageing settings.
    
    v3:
    - Try to reduce regmap conversion patch
    v2:
    - Move regmap init to sw_probe instead of moving switch id check.
    - Removed LAGs, mirror extra features will come later in another
      smaller series.
    - Squash 2 ageing patch
    - Add more description about the regmap patch
    - Rework mdb patch to do operation under the same lock
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Nov 22, 2021
  2. net: dsa: qca8k: add support for mdb_add/del

    Add support for mdb add/del function. The ARL table is used to insert
    the rule. The rule will be searched, deleted and reinserted with the
    port mask updated. The function will check if the rule has to be updated
    or insert directly with no deletion of the old rule.
    If every port is removed from the port mask, the rule is removed.
    The rule is set STATIC in the ARL table (aka it doesn't age) to not be
    flushed by fast age function.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Nov 22, 2021
  3. net: dsa: qca8k: add set_ageing_time support

    qca8k support setting ageing time in step of 7s. Add support for it and
    set the max value accepted of 7645m.
    Documentation talks about support for 10000m but that values doesn't
    make sense as the value doesn't match the max value in the reg.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Nov 22, 2021
  4. net: dsa: qca8k: add support for port fast aging

    The switch supports fast aging by flushing any rule in the ARL
    table for a specific port.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Nov 22, 2021
  5. net: dsa: qca8k: add additional MIB counter and make it dynamic

    We are currently missing 2 additionals MIB counter present in QCA833x
    switch.
    QC832x switch have 39 MIB counter and QCA833X have 41 MIB counter.
    Add the additional MIB counter and rework the MIB function to print the
    correct supported counter from the match_data struct.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Nov 22, 2021
  6. net: dsa: qca8k: initial conversion to regmap helper

    Convert any qca8k set/clear/pool to regmap helper and add
    missing config to regmap_config struct.
    Read/write/rmw operation are reworked to use the regmap helper
    internally to keep the delta of this patch low. These additional
    function will then be dropped when the code split will be proposed.
    
    Ipq40xx SoC have the internal switch based on the qca8k regmap but use
    mmio for read/write/rmw operation instead of mdio.
    In preparation for the support of this internal switch, convert the
    driver to regmap API to later split the driver to common and specific
    code. The overhead introduced by the use of regamp API is marginal as the
    internal mdio will bypass it by using its direct access and regmap will be
    used only by configuration functions or fdb access.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Nov 22, 2021
  7. net: dsa: qca8k: move regmap init in probe and set it mandatory

    In preparation for regmap conversion, move regmap init in the probe
    function and make it mandatory as any read/write/rmw operation will be
    converted to regmap API.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Nov 22, 2021
  8. net: dsa: qca8k: remove extra mutex_init in qca8k_setup

    Mutex is already init in sw_probe. Remove the extra init in qca8k_setup.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Nov 22, 2021
  9. net: dsa: qca8k: convert to GENMASK/FIELD_PREP/FIELD_GET

    Convert and try to standardize bit fields using
    GENMASK/FIELD_PREP/FIELD_GET macros. Rework some logic to support the
    standard macro and tidy things up. No functional change intended.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Nov 22, 2021
  10. net: dsa: qca8k: remove redundant check in parse_port_config

    The very next check for port 0 and 6 already makes sure we don't go out
    of bounds with the ports_config delay table.
    Remove the redundant check.
    
    Reported-by: kernel test robot <lkp@intel.com>
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Nov 22, 2021
  11. Merge branch 'skbuff-struct-group'

    Kees Cook says:
    
    ====================
    skbuff: Switch structure bounds to struct_group()
    
    This is a pair of patches to add struct_group() to struct sk_buff. The
    first is needed to work around sparse-specific complaints, and is new
    for v2. The second patch is the same as originally sent as v1.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Nov 22, 2021
  12. skbuff: Switch structure bounds to struct_group()

    In preparation for FORTIFY_SOURCE performing compile-time and run-time
    field bounds checking for memcpy(), memmove(), and memset(), avoid
    intentionally writing across neighboring fields.
    
    Replace the existing empty member position markers "headers_start" and
    "headers_end" with a struct_group(). This will allow memcpy() and sizeof()
    to more easily reason about sizes, and improve readability.
    
    "pahole" shows no size nor member offset changes to struct sk_buff.
    "objdump -d" shows no object code changes (outside of WARNs affected by
    source line number changes).
    
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
    Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> # drivers/net/wireguard/*
    Link: https://lore.kernel.org/lkml/20210728035006.GD35706@embeddedor
    Signed-off-by: David S. Miller <davem@davemloft.net>
    kees authored and davem330 committed Nov 22, 2021
  13. skbuff: Move conditional preprocessor directives out of struct sk_buff

    In preparation for using the struct_group() macro in struct sk_buff,
    move the conditional preprocessor directives out of the region of struct
    sk_buff that will be enclosed by struct_group(). While GCC and Clang are
    happy with conditional preprocessor directives here, sparse is not, even
    under -Wno-directive-within-macro[1], as would be seen under a C=1 build:
    
    net/core/filter.c: note: in included file (through include/linux/netlink.h, include/linux/sock_diag.h):
    ./include/linux/skbuff.h:820:1: warning: directive in macro's argument list
    ./include/linux/skbuff.h:822:1: warning: directive in macro's argument list
    ./include/linux/skbuff.h:846:1: warning: directive in macro's argument list
    ./include/linux/skbuff.h:848:1: warning: directive in macro's argument list
    
    Additionally remove empty macro argument definitions and usage.
    
    "objdump -d" shows no object code differences.
    
    [1] https://www.spinics.net/lists/linux-sparse/msg10857.html
    
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    kees authored and davem330 committed Nov 22, 2021
  14. sections: global data can be in .bss

    When checking an address is located in a global data section also check
    for the .bss section as global variables initialized to 0 can be in
    there (-fzero-initialized-in-bss).
    
    This was found when looking at ensure_safe_net_sysctl which was failing
    to detect non-init sysctl pointing to a global data section when the
    data was in the .bss section.
    
    Signed-off-by: Antoine Tenart <atenart@kernel.org>
    Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    atenart authored and davem330 committed Nov 22, 2021
  15. arp: Remove #ifdef CONFIG_PROC_FS

    proc_create_net() and remove_proc_entry() already contain the case
    whether to define CONFIG_PROC_FS, so remove #ifdef CONFIG_PROC_FS.
    
    Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Yajun Deng authored and davem330 committed Nov 22, 2021
  16. hv_netvsc: Use bitmap_zalloc() when applicable

    'send_section_map' is a bitmap. So use 'bitmap_zalloc()' to simplify code,
    improve the semantic and avoid some open-coded arithmetic in allocator
    arguments.
    
    Also change the corresponding 'kfree()' into 'bitmap_free()' to keep
    consistency.
    
    While at it, change an '== NULL' test into a '!'.
    
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    tititiou36 authored and davem330 committed Nov 22, 2021
  17. qed: Use the bitmap API to simplify some functions

    'cid_map' is a bitmap. So use 'bitmap_zalloc()' to simplify code,
    improve the semantic and avoid some open-coded arithmetic in allocator
    arguments.
    
    Also change the corresponding 'kfree()' into 'bitmap_free()' to keep
    consistency.
    
    Also change some 'memset()' into 'bitmap_zero()' to keep consistency. This
    is also much less verbose.
    
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    tititiou36 authored and davem330 committed Nov 22, 2021
  18. net-sysfs: Slightly optimize 'xps_queue_show()'

    The 'mask' bitmap is local to this function. So the non-atomic
    '__set_bit()' can be used to save a few cycles.
    
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    tititiou36 authored and davem330 committed Nov 22, 2021
  19. rds: Fix a typo in a comment

    s/cold/could/
    
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Acked-By: Devesh Sharma <devesh.s.sharma@oracle.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    tititiou36 authored and davem330 committed Nov 22, 2021
  20. Fix coverity issue 'Uninitialized scalar variable"

    There are three boolean variable which were not initialized and later
    being used in the code.
    
    Signed-off-by: Yacov Simhony <ysimhony@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    ysimhony authored and davem330 committed Nov 22, 2021
  21. pcmcia: hide the MAC address helpers if !NET

    pcmcia_get_mac_from_cis is only called from networking and
    recent changes made it call dev_addr_mod() which is itself
    only defined if NET.
    
    Reported-by: kernel test robot <lkp@intel.com>
    Fixes: adeef3e ("net: constify netdev->dev_addr")
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Jakub Kicinski authored and davem330 committed Nov 22, 2021
  22. tsn: Fix build.

    Due to const dev_addr changes.
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Nov 22, 2021
  23. net: wwan: iosm: device trace collection using relayfs

    This patch brings in support for device trace collection.
    It implements relayfs interface for pushing device trace
    from kernel space to user space.
    
    Driver gets the debugfs base directory associated to WWAN
    Device and creates trace_control and trace debugfs for
    device tracing. Both trace_control & trace debugfs are
    created under /sys/kernel/debug/wwan/wwan0/.
    
    In order to collect device trace on trace0 interface, user
    need to write 1 to trace_ctl interface.
    
    Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    mchetankumar authored and davem330 committed Nov 22, 2021
  24. net: wwan: common debugfs base dir for wwan device

    This patch set brings in a common debugfs base directory
    i.e. /sys/kernel/debugfs/wwan/ in WWAN Subsystem for a
    WWAN device instance. So that it avoids driver polluting
    debugfs root with unrelated directories & possible name
    collusion.
    
    Having a common debugfs base directory for WWAN drivers
    eases user to match control devices with debugfs entries.
    
    WWAN Subsystem creates dentry (/sys/kernel/debugfs/wwan)
    on module load & removes dentry on module unload.
    
    When driver registers a new wwan device, dentry (wwanX)
    is created for WWAN device instance & on driver unregister
    dentry is removed.
    
    New API is introduced to return the wwan device instance
    dentry so that driver can create debugfs entries under it.
    
    Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
    Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    mchetankumar authored and davem330 committed Nov 22, 2021
  25. octeon: constify netdev->dev_addr

    Argument of a helper is missing a const.
    
    Reported-by: kernel test robot <lkp@intel.com>
    Fixes: adeef3e ("net: constify netdev->dev_addr")
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Jakub Kicinski authored and davem330 committed Nov 22, 2021
  26. net: mana: Add XDP support

    Add support of XDP for the MANA driver.
    
    Supported XDP actions:
    	XDP_PASS, XDP_TX, XDP_DROP, XDP_ABORTED
    
    XDP actions not yet supported:
    	XDP_REDIRECT
    
    Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    haiyangz authored and davem330 committed Nov 22, 2021
  27. Merge branch 'tsn-endpoint-driver'

    Gerhard Engleder says:
    
    ====================
    TSN endpoint Ethernet MAC driver
    
    This series adds a driver for my FPGA based TSN endpoint Ethernet MAC.
    It also includes the device tree binding.
    
    The device is designed as Ethernet MAC for TSN networks. It will be used
    in PLCs with real-time requirements up to isochronous communication with
    protocols like OPC UA Pub/Sub.
    
    v3:
     - set MAC mode based on PHY information (Andrew Lunn)
     - remove/postpone loopback mode interface (Andrew Lunn)
     - add suppress_preamble node support (Andrew Lunn)
     - add mdio timeout (Andrew Lunn)
     - no need to call phy_start_aneg (Andrew Lunn)
     - remove unreachable code (Andrew Lunn)
     - move 'struct napi_struct' closer to queues (Vinicius Costa Gomes)
     - remove unused variable (kernel test robot)
     - switch from mdio interrupt to polling
     - mdio register without PHY address flag
     - thread safe interrupt enable register
     - add PTP_1588_CLOCK_OPTIONAL dependency to Kconfig
     - introduce dmadev for DMA allocation
     - mdiobus for platforms without device tree
     - prepare MAC address support for platforms without device tree
     - add missing interrupt disable to probe error path
    
    v2:
     - add C45 check (Andrew Lunn)
     - forward phy_connect_direct() return value (Andrew Lunn)
     - use phy_remove_link_mode() (Andrew Lunn)
     - do not touch PHY directly, use PHY subsystem (Andrew Lunn)
     - remove management data lock (Andrew Lunn)
     - use phy_loopback (Andrew Lunn)
     - remove GMII2RGMII handling, use xgmiitorgmii (Andrew Lunn)
     - remove char device for direct TX/RX queue access (Andrew Lunn)
     - mdio node for mdiobus (Rob Herring)
     - simplify compatible node (Rob Herring)
     - limit number of items of reg and interrupts nodes (Rob Herring)
     - restrict phy-connection-type node (Rob Herring)
     - reference to mdio.yaml under mdio node (Rob Herring)
     - remove device tree (Michal Simek)
     - fix %llx warning (kernel test robot)
     - fix unused tmp variable warning (kernel test robot)
     - add missing of_node_put() for of_parse_phandle()
     - use devm_mdiobus_alloc()
     - simplify mdiobus read/write
     - reduce required nodes
     - ethtool priv flags interface for loopback
     - add missing static for some functions
     - remove obsolete hardware defines
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Nov 22, 2021
  28. tsnep: Add TSN endpoint Ethernet MAC driver

    The TSN endpoint Ethernet MAC is a FPGA based network device for
    real-time communication.
    
    It is integrated as Ethernet controller with ethtool and PTP support.
    For real-time communcation TC_SETUP_QDISC_TAPRIO is supported.
    
    Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Gerhard Engleder authored and davem330 committed Nov 22, 2021
  29. dt-bindings: net: Add tsnep Ethernet controller

    The TSN endpoint Ethernet MAC is a FPGA based network device for
    real-time communication.
    
    It is integrated as normal Ethernet controller with
    ethernet-controller.yaml and mdio.yaml.
    
    Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
    Reviewed-by: Rob Herring <robh@kernel.org>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Gerhard Engleder authored and davem330 committed Nov 22, 2021
  30. dt-bindings: Add vendor prefix for Engleder

    Engleder develops FPGA based controllers for real-time communication.
    
    Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
    Acked-by: Rob Herring <robh@kernel.org>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Gerhard Engleder authored and davem330 committed Nov 22, 2021
  31. net: phylink: handle NA interface mode in phylink_fwnode_phy_connect()

    Commit 4904b6e ("net: phy: phylink: Use PHY device interface if
    N/A") introduced handling for the phy interface mode where this is not
    known at phylink creation time. This was never added to the OF/fwnode
    paths, but is necessary when the phy is present in DT, but the phy-mode
    is not specified.
    
    Add this handling.
    
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Acked-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Russell King (Oracle) authored and davem330 committed Nov 22, 2021
  32. net: phylink: Add helpers for c22 registers without MDIO

    Some devices expose memory-mapped c22-compliant PHYs. Because these
    devices do not have an MDIO bus, we cannot use the existing helpers.
    Refactor the existing helpers to allow supplying the values for c22
    registers directly, instead of using MDIO to access them. Only get_state
    and set_advertisement are converted, since they contain the most complex
    logic. Because set_advertisement is never actually used outside
    phylink_mii_c22_pcs_config, move the MDIO-writing part into that
    function. Because some modes do not need the advertisement register set
    at all, we use -EINVAL for this purpose.
    
    Additionally, a new function phylink_pcs_enable_an is provided to
    determine whether to enable autonegotiation.
    
    Signed-off-by: Sean Anderson <sean.anderson@seco.com>
    Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    sean-anderson-seco authored and davem330 committed Nov 22, 2021
  33. net: annotate accesses to dev->gso_max_segs

    dev->gso_max_segs is written under RTNL protection, or when the device is
    not yet visible, but is read locklessly.
    
    Add netif_set_gso_max_segs() helper.
    
    Add the READ_ONCE()/WRITE_ONCE() pairs, and use netif_set_gso_max_segs()
    where we can to better document what is going on.
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    neebe000 authored and davem330 committed Nov 22, 2021
Older