18 Dec, 2020

5 commits

  • * pm/next: (55 commits)
    MLK-24081-01: power: imx: Add hdmi rx power domain
    soc: fsl: enable acpi support in RCPM driver
    soc: fsl: handle RCPM errata A-008646 on SoC LS1021A
    LF-2594-4 imx: scu-pd: remove mlb power domain
    MLK-24833-1 imx: scu-pd: add lpi2c4 power domain for imx8qm
    ...

    BJ DevOps Team
     
  • * net/next: (207 commits)
    LF-2788-2 net: ethernet: dwmac-imx: delete check for platform w/o SCU FW
    tsn: status return variable initialize to be 0
    net:tsn: fix coverity issues
    net: tsn: fix headfile voliates the new rule
    net:tsn: netlink interface for APP layer to config TSN capability hardware ports
    ...

    BJ DevOps Team
     
  • * crypto/next: (39 commits)
    MLK-23746 crypto: dcp - add power management support
    crypto: dcp - check zero-length input
    MLK-24912-2 crypto: caam - fix RNG vs. hwrng kthread race
    MLK-24912-1 crypto: caam/jr - update jr_list during suspend/resume
    LF-2943 crypto: caam - optimize RNG sample size
    ...

    BJ DevOps Team
     
  • * clock/next: (213 commits)
    MLK-24081-02: clk: imx: Add imx8qm hdmi rx lpcg clocks
    LF-632 clk: s32v234: Fix "enetpll_dfs3" position in sdhc_sels
    clk: s32v234: Enable FlexCAN clock
    clk: s32v234: Add definitions for CAN clocks
    clk: s32v234: Initial enet clk support
    ...

    BJ DevOps Team
     
  • * origin/net/ls1028-switch:
    net: dsa: felix: fixup build issue in felix_cbs_set
    net: dsa: felix: add tsn support for felix switch based on net/tsn
    drivers: net: mscc_ocelot: don't flood unicast traffic to cpu

    BJ DevOps Team
     

14 Dec, 2020

9 commits

  • VSC9959 has TSN capabilities on hardware. Using tsntool netlink
    interface to configure TSN protocols, such as qbv, qbu, qci, cbs,
    802.1cb. This patch based on netlink adapt layer in net/tsn/*.

    Enable CONFIG_MSCC_FELIX_SWITCH_TSN config to add this tsn support.

    Signed-off-by: Xiaoliang Yang

    Xiaoliang Yang
     
  • Order preservation is a feature that will be supported
    in dpni, dpseci and dpci devices.
    This is a preliminary patch for the changes to be
    introduced in the corresponding drivers.

    Signed-off-by: Radu Alexe
    Signed-off-by: Horia Geantă

    Horia Geantă
     
  • Import M4 SRC call from TF-A

    Reviewed-by: Richard Zhu
    Signed-off-by: Peng Fan

    Peng Fan
     
  • The i.MX8M family is a set of NXP product focus on delivering
    the latest and greatest video and audio experience combining
    state-of-the-art media-specific features with high-performance
    processing while optimized for lowest power consumption.

    i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all
    belong to this family. A GPC module is used to manage all the
    PU power domain on/off. But the situation is that the number of
    power domains & the power up sequence has significate difference
    on those SoCs. Even on the same SoC. The power up sequence still
    has big difference. It makes us hard to reuse the GPCv2 driver to
    cover the whole i.MX8M family. Each time a new SoC is supported in
    the mainline kernel, we need to modify the GPCv2 driver to support
    it. We need to add or modify hundred lines of code in worst case.
    It is a bad practice for the driver maintainability.

    This driver add a more generic power domain driver that the actual
    power on/off is done by TF-A code. the abstraction give us the
    possibility that using one driver to cover the whole i.MX8M family
    in kernel side.

    Signed-off-by: Jacky Bai

    Jacky Bai
     
  • Order preservation is a feature that will be supported
    in dpni, dpseci and dpci devices.
    This is a preliminary patch for the changes to be
    introduced in the corresponding drivers.

    Signed-off-by: Radu Alexe
    Signed-off-by: Horia Geantă

    Horia Geantă
     
  • Add DPIO support for HW assisted order restoration

    Signed-off-by: Roy Pledge

    Roy Pledge
     
  • Add M4 related APIs for suspend/resume support, and make
    MMDC P1 IPG clock always ON, as it is required during resume
    with FastMix OFF.

    Signed-off-by: Anson Huang
    [ Aisheng: update to CLK HW APIs and add FIXME]
    Signed-off-by: Dong Aisheng

    Anson Huang
     
  • The driver register an IRQ handle to SCU for security
    violation interrupt.

    When an interruption is fired, the driver inform the user.

    Signed-off-by: Franck LENORMAND

    Franck LENORMAND
     
  • drivers/clk/imx/clk-gate2.o: In function `clk_gate2_do_shared_clks':
    /home/b29396/Work/linux/dash-linux-devel/build_v8/../drivers/clk/imx/clk-gate2.c:61: undefined reference to `imx_src_is_m4_enabled'
    drivers/clk/imx/clk-pfd.o: In function `clk_pfd_do_shared_clks':
    /home/b29396/Work/linux/dash-linux-devel/build_v8/../drivers/clk/imx/clk-pfd.c:55: undefined reference to `imx_src_is_m4_enabled'
    /home/b29396/Work/linux/dash-linux-devel/build_v8/../drivers/clk/imx/clk-pfd.c:55: undefined reference to `imx_src_is_m4_enabled'
    drivers/clk/imx/clk-pllv3.o: In function `clk_pllv3_do_shared_clks':
    /home/b29396/Work/linux/dash-linux-devel/build_v8/../drivers/clk/imx/clk-pllv3.c:109: undefined reference to `imx_src_is_m4_enabled'
    /home/b29396/Work/linux/dash-linux-devel/Makefile:1047: recipe for target 'vmlinux' failed
    make[1]: *** [vmlinux] Error 1
    make[1]: Leaving directory '/home/b29396/Work/linux/dash-linux-devel/build_v8'
    Makefile:179: recipe for target 'sub-make' failed
    make: *** [sub-make] Error 2

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     

06 Dec, 2020

1 commit

  • The current assumption is that the felix DSA driver has flooding knobs
    per traffic class, while ocelot switchdev has a single flooding knob.
    This was correct for felix VSC9959 and ocelot VSC7514, but with the
    introduction of seville VSC9953, we see a switch driven by felix.c which
    has a single flooding knob.

    So it is clear that we must do what should have been done from the
    beginning, which is not to overwrite the configuration done by ocelot.c
    in felix, but instead to teach the common ocelot library about the
    differences in our switches, and set up the flooding PGIDs centrally.

    The effect that the bogus iteration through FELIX_NUM_TC has upon
    seville is quite dramatic. ANA_FLOODING is located at 0x00b548, and
    ANA_FLOODING_IPMC is located at 0x00b54c. So the bogus iteration will
    actually overwrite ANA_FLOODING_IPMC when attempting to write
    ANA_FLOODING[1]. There is no ANA_FLOODING[1] in sevile, just ANA_FLOODING.

    And when ANA_FLOODING_IPMC is overwritten with a bogus value, the effect
    is that ANA_FLOODING_IPMC gets the value of 0x0003CF7D:
    MC6_DATA = 61,
    MC6_CTRL = 61,
    MC4_DATA = 60,
    MC4_CTRL = 0.
    Because MC4_CTRL is zero, this means that IPv4 multicast control packets
    are not flooded, but dropped. An invalid configuration, and this is how
    the issue was actually spotted.

    Reported-by: Eldar Gasanov
    Reported-by: Maxim Kochetkov
    Tested-by: Eldar Gasanov
    Fixes: 84705fc16552 ("net: dsa: felix: introduce support for Seville VSC9953 switch")
    Fixes: 3c7b51bd39b2 ("net: dsa: felix: allow flooding for all traffic classes")
    Signed-off-by: Vladimir Oltean
    Reviewed-by: Alexandre Belloni
    Link: https://lore.kernel.org/r/20201204175416.1445937-1-vladimir.oltean@nxp.com
    Signed-off-by: Jakub Kicinski

    Vladimir Oltean
     

25 Oct, 2020

1 commit

  • Pull ARM SoC-related driver updates from Olof Johansson:
    "Various driver updates for platforms. A bulk of this is smaller fixes
    or cleanups, but some of the new material this time around is:

    - Support for Nvidia Tegra234 SoC

    - Ring accelerator support for TI AM65x

    - PRUSS driver for TI platforms

    - Renesas support for R-Car V3U SoC

    - Reset support for Cortex-M4 processor on i.MX8MQ

    There are also new socinfo entries for a handful of different SoCs and
    platforms"

    * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (131 commits)
    drm/mediatek: reduce clear event
    soc: mediatek: cmdq: add clear option in cmdq_pkt_wfe api
    soc: mediatek: cmdq: add jump function
    soc: mediatek: cmdq: add write_s_mask value function
    soc: mediatek: cmdq: add write_s value function
    soc: mediatek: cmdq: add read_s function
    soc: mediatek: cmdq: add write_s_mask function
    soc: mediatek: cmdq: add write_s function
    soc: mediatek: cmdq: add address shift in jump
    soc: mediatek: mtk-infracfg: Fix kerneldoc
    soc: amlogic: pm-domains: use always-on flag
    reset: sti: reset-syscfg: fix struct description warnings
    reset: imx7: add the cm4 reset for i.MX8MQ
    dt-bindings: reset: imx8mq: add m4 reset
    reset: Fix and extend kerneldoc
    reset: reset-zynqmp: Added support for Versal platform
    dt-bindings: reset: Updated binding for Versal reset driver
    reset: imx7: Support module build
    soc: fsl: qe: Remove unnessesary check in ucc_set_tdm_rxtx_clk
    soc: fsl: qman: convert to use be32_add_cpu()
    ...

    Linus Torvalds
     

16 Oct, 2020

2 commits

  • Pull networking updates from Jakub Kicinski:

    - Add redirect_neigh() BPF packet redirect helper, allowing to limit
    stack traversal in common container configs and improving TCP
    back-pressure.

    Daniel reports ~10Gbps => ~15Gbps single stream TCP performance gain.

    - Expand netlink policy support and improve policy export to user
    space. (Ge)netlink core performs request validation according to
    declared policies. Expand the expressiveness of those policies
    (min/max length and bitmasks). Allow dumping policies for particular
    commands. This is used for feature discovery by user space (instead
    of kernel version parsing or trial and error).

    - Support IGMPv3/MLDv2 multicast listener discovery protocols in
    bridge.

    - Allow more than 255 IPv4 multicast interfaces.

    - Add support for Type of Service (ToS) reflection in SYN/SYN-ACK
    packets of TCPv6.

    - In Multi-patch TCP (MPTCP) support concurrent transmission of data on
    multiple subflows in a load balancing scenario. Enhance advertising
    addresses via the RM_ADDR/ADD_ADDR options.

    - Support SMC-Dv2 version of SMC, which enables multi-subnet
    deployments.

    - Allow more calls to same peer in RxRPC.

    - Support two new Controller Area Network (CAN) protocols - CAN-FD and
    ISO 15765-2:2016.

    - Add xfrm/IPsec compat layer, solving the 32bit user space on 64bit
    kernel problem.

    - Add TC actions for implementing MPLS L2 VPNs.

    - Improve nexthop code - e.g. handle various corner cases when nexthop
    objects are removed from groups better, skip unnecessary
    notifications and make it easier to offload nexthops into HW by
    converting to a blocking notifier.

    - Support adding and consuming TCP header options by BPF programs,
    opening the doors for easy experimental and deployment-specific TCP
    option use.

    - Reorganize TCP congestion control (CC) initialization to simplify
    life of TCP CC implemented in BPF.

    - Add support for shipping BPF programs with the kernel and loading
    them early on boot via the User Mode Driver mechanism, hence reusing
    all the user space infra we have.

    - Support sleepable BPF programs, initially targeting LSM and tracing.

    - Add bpf_d_path() helper for returning full path for given 'struct
    path'.

    - Make bpf_tail_call compatible with bpf-to-bpf calls.

    - Allow BPF programs to call map_update_elem on sockmaps.

    - Add BPF Type Format (BTF) support for type and enum discovery, as
    well as support for using BTF within the kernel itself (current use
    is for pretty printing structures).

    - Support listing and getting information about bpf_links via the bpf
    syscall.

    - Enhance kernel interfaces around NIC firmware update. Allow
    specifying overwrite mask to control if settings etc. are reset
    during update; report expected max time operation may take to users;
    support firmware activation without machine reboot incl. limits of
    how much impact reset may have (e.g. dropping link or not).

    - Extend ethtool configuration interface to report IEEE-standard
    counters, to limit the need for per-vendor logic in user space.

    - Adopt or extend devlink use for debug, monitoring, fw update in many
    drivers (dsa loop, ice, ionic, sja1105, qed, mlxsw, mv88e6xxx,
    dpaa2-eth).

    - In mlxsw expose critical and emergency SFP module temperature alarms.
    Refactor port buffer handling to make the defaults more suitable and
    support setting these values explicitly via the DCBNL interface.

    - Add XDP support for Intel's igb driver.

    - Support offloading TC flower classification and filtering rules to
    mscc_ocelot switches.

    - Add PTP support for Marvell Octeontx2 and PP2.2 hardware, as well as
    fixed interval period pulse generator and one-step timestamping in
    dpaa-eth.

    - Add support for various auth offloads in WiFi APs, e.g. SAE (WPA3)
    offload.

    - Add Lynx PHY/PCS MDIO module, and convert various drivers which have
    this HW to use it. Convert mvpp2 to split PCS.

    - Support Marvell Prestera 98DX3255 24-port switch ASICs, as well as
    7-port Mediatek MT7531 IP.

    - Add initial support for QCA6390 and IPQ6018 in ath11k WiFi driver,
    and wcn3680 support in wcn36xx.

    - Improve performance for packets which don't require much offloads on
    recent Mellanox NICs by 20% by making multiple packets share a
    descriptor entry.

    - Move chelsio inline crypto drivers (for TLS and IPsec) from the
    crypto subtree to drivers/net. Move MDIO drivers out of the phy
    directory.

    - Clean up a lot of W=1 warnings, reportedly the actively developed
    subsections of networking drivers should now build W=1 warning free.

    - Make sure drivers don't use in_interrupt() to dynamically adapt their
    code. Convert tasklets to use new tasklet_setup API (sadly this
    conversion is not yet complete).

    * tag 'net-next-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2583 commits)
    Revert "bpfilter: Fix build error with CONFIG_BPFILTER_UMH"
    net, sockmap: Don't call bpf_prog_put() on NULL pointer
    bpf, selftest: Fix flaky tcp_hdr_options test when adding addr to lo
    bpf, sockmap: Add locking annotations to iterator
    netfilter: nftables: allow re-computing sctp CRC-32C in 'payload' statements
    net: fix pos incrementment in ipv6_route_seq_next
    net/smc: fix invalid return code in smcd_new_buf_create()
    net/smc: fix valid DMBE buffer sizes
    net/smc: fix use-after-free of delayed events
    bpfilter: Fix build error with CONFIG_BPFILTER_UMH
    cxgb4/ch_ipsec: Replace the module name to ch_ipsec from chcr
    net: sched: Fix suspicious RCU usage while accessing tcf_tunnel_info
    bpf: Fix register equivalence tracking.
    rxrpc: Fix loss of final ack on shutdown
    rxrpc: Fix bundle counting for exclusive connections
    netfilter: restore NF_INET_NUMHOOKS
    ibmveth: Identify ingress large send packets.
    ibmveth: Switch order of ibmveth_helper calls.
    cxgb4: handle 4-tuple PEDIT to NAT mode translation
    selftests: Add VRF route leaking tests
    ...

    Linus Torvalds
     
  • Pull USB/PHY/Thunderbolt driver updates from Greg KH:
    "Here is the big set of USB, PHY, and Thunderbolt driver updates for
    5.10-rc1.

    Lots of tiny different things for these subsystems are in here,
    including:

    - phy driver updates

    - thunderbolt / USB 4 updates and additions

    - USB gadget driver updates

    - xhci fixes and updates

    - typec driver additions and updates

    - api conversions to various drivers for core kernel api changes

    - new USB control message functions to make it harder to get wrong,
    as found by syzbot (took 2 tries to get it right)

    - lots of tiny USB driver fixes and updates all over the place

    All of these have been in linux-next for a while, with the exception
    of the last "obviously correct" patch that updated a FALLTHROUGH
    comment that got merged last weekend"

    * tag 'usb-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (374 commits)
    usb: musb: gadget: Use fallthrough pseudo-keyword
    usb: typec: Add QCOM PMIC typec detection driver
    USB: serial: option: add Cellient MPL200 card
    usb: typec: tcpci_maxim: Add support for Sink FRS
    usb: typec: tcpci: Implement callbacks for FRS
    usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)
    usb: typec: tcpci_maxim: Chip level TCPC driver
    usb: typec: tcpci: Add set_vbus tcpci callback
    usb: typec: tcpci: Add a getter method to retrieve tcpm_port reference
    usbip: vhci_hcd: fix calling usb_hcd_giveback_urb() with irqs enabled
    usb: cdc-acm: add quirk to blacklist ETAS ES58X devices
    USB: serial: ftdi_sio: use cur_altsetting for consistency
    USB: serial: option: Add Telit FT980-KS composition
    USB: core: remove polling for /sys/kernel/debug/usb/devices
    usb: typec: add support for STUSB160x Type-C controller family
    usb: typec: add typec_find_pwr_opmode
    usb: typec: hd3ss3220: Use OF graph API to get the connector fwnode
    dt-bindings: usb: renesas,usb3-peri: Document HS and SS data bus
    dt-bindings: usb: convert ti,hd3ss3220 bindings to json-schema
    usb: dwc2: Fix INTR OUT transfers in DDMA mode.
    ...

    Linus Torvalds
     

06 Oct, 2020

1 commit


05 Oct, 2020

2 commits

  • 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
    Cc: Martin Blumenstingl
    Cc: Hauke Mehrtens
    Cc: Woojung Huh
    Cc: Microchip Linux Driver Support
    Cc: Sean Wang
    Cc: Landen Chao
    Cc: Andrew Lunn
    Cc: Vivien Didelot
    Cc: Jonathan McDowell
    Cc: Linus Walleij
    Cc: Alexandre Belloni
    Cc: Claudiu Manoil
    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • We need the USB fixes in here as well for testing.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

04 Oct, 2020

1 commit

  • …leo/linux into arm/drivers

    NXP/FSL SoC driver updates for v5.10

    Fix various compile warnings and static analysis warnings for:
    - QBMan driver
    - DPIO driver
    - QE driver

    * tag 'soc-fsl-next-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
    soc: fsl: qe: Remove unnessesary check in ucc_set_tdm_rxtx_clk
    soc: fsl: qman: convert to use be32_add_cpu()
    soc: fsl: dpio: remove set but not used 'addr_cena'
    soc: fsl: qbman: Fix return value on success
    soc: fsl: qman: fix -Wpacked-not-aligned warnings

    Link: https://lore.kernel.org/r/20200923224416.25788-1-leoyang.li@nxp.com
    Signed-off-by: Olof Johansson <olof@lixom.net>

    Olof Johansson
     

03 Oct, 2020

2 commits

  • For Ocelot switches, there are 2 ingress pipelines for flow offload
    rules: VCAP IS1 (Ingress Classification) and IS2 (Security Enforcement).
    IS1 and IS2 support different sets of actions. The pipeline order for a
    packet on ingress is:

    Basic classification -> VCAP IS1 -> VCAP IS2

    Furthermore, IS1 is looked up 3 times, and IS2 is looked up twice (each
    TCAM entry can be configured to match only on the first lookup, or only
    on the second, or on both etc).

    Because the TCAMs are completely independent in hardware, and because of
    the fixed pipeline, we actually have very limited options when it comes
    to offloading complex rules to them while still maintaining the same
    semantics with the software data path.

    This patch maps flow offload rules to ingress TCAMs according to a
    predefined chain index number. There is going to be a script in
    selftests that clarifies the usage model.

    There is also an egress TCAM (VCAP ES0, the Egress Rewriter), which is
    modeled on top of the default chain 0 of the egress qdisc, because it
    doesn't have multiple lookups.

    Suggested-by: Allan W. Nielsen
    Co-developed-by: Xiaoliang Yang
    Signed-off-by: Xiaoliang Yang
    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • Since the mscc_ocelot_switch_lib is common between a pure switchdev and
    a DSA driver, the procedure of retrieving a net_device for a certain
    port index differs, as those are registered by their individual
    front-ends.

    Up to now that has been dealt with by always passing the port index to
    the switch library, but now, we're going to need to work with net_device
    pointers from the tc-flower offload, for things like indev, or mirred.
    It is not desirable to refactor that, so let's make sure that the flower
    offload core has the ability to translate between a net_device and a
    port index properly.

    Signed-off-by: Vladimir Oltean
    Acked-by: Alexandre Belloni
    Signed-off-by: David S. Miller

    Vladimir Oltean
     

30 Sep, 2020

5 commits

  • The numbers in struct vcap_props are not intuitive to derive, because
    they are not a straightforward copy-and-paste from the reference manual
    but instead rely on a fairly detailed level of understanding of the
    layout of an entry in the TCAM and in the action RAM. For this reason,
    bugs are very easy to introduce here.

    Ease the work of hardware porters and read from hardware the constants
    that were exported for this particular purpose. Note that this implies
    that struct vcap_props can no longer be const.

    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • As a preparation step for the offloading to ES0, let's create the
    infrastructure for talking with this hardware block.

    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • As a preparation step for the offloading to IS1, let's create the
    infrastructure for talking with this hardware block.

    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • In the Ocelot switches there are 3 TCAMs: VCAP ES0, IS1 and IS2, which
    have the same configuration interface, but different sets of keys and
    actions. The driver currently only supports VCAP IS2.

    In preparation of VCAP IS1 and ES0 support, the existing code must be
    generalized to work with any VCAP.

    In that direction, we should move the structures that depend upon VCAP
    instantiation, like vcap_is2_keys and vcap_is2_actions, out of struct
    ocelot and into struct vcap_props .keys and .actions, a structure that
    is replicated 3 times, once per VCAP. We'll pass that structure as an
    argument to each function that does the key and action packing - only
    the control logic needs to distinguish between ocelot->vcap[VCAP_IS2]
    or IS1 or ES0.

    Another change is to make use of the newly introduced ocelot_target_read
    and ocelot_target_write API, since the 3 VCAPs have the same registers
    but put at different addresses.

    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • There are some targets (register blocks) in the Ocelot switch that are
    instantiated more than once. For example, the VCAP IS1, IS2 and ES0
    blocks all share the same register layout for interacting with the cache
    for the TCAM and the action RAM.

    For the VCAPs, the procedure for servicing them is actually common. We
    just need an API specifying which VCAP we are talking to, and we do that
    via these raw ocelot_target_read and ocelot_target_write accessors.

    In plain ocelot_read, the target is encoded into the register enum
    itself:

    u16 target = reg >> TARGET_OFFSET;

    For the VCAPs, the registers are currently defined like this:

    enum ocelot_reg {
    [...]
    S2_CORE_UPDATE_CTRL = S2 << TARGET_OFFSET,
    S2_CORE_MV_CFG,
    S2_CACHE_ENTRY_DAT,
    S2_CACHE_MASK_DAT,
    S2_CACHE_ACTION_DAT,
    S2_CACHE_CNT_DAT,
    S2_CACHE_TG_DAT,
    [...]
    };

    which is precisely what we want to avoid, because we'd have to duplicate
    the same register map for S1 and for S0, and then figure out how to pass
    VCAP instance-specific registers to the ocelot_read calls (basically
    another lookup table that undoes the effect of shifting with
    TARGET_OFFSET).

    So for some targets, propose a more raw API, similar to what is
    currently done with ocelot_port_readl and ocelot_port_writel. Those
    targets can only be accessed with ocelot_target_{read,write} and not
    with ocelot_{read,write} after the conversion, which is fine.

    The VCAP registers are not actually modified to use this new API as of
    this patch. They will be modified in the next one.

    Signed-off-by: Vladimir Oltean
    Acked-by: Alexandre Belloni
    Signed-off-by: David S. Miller

    Vladimir Oltean
     

27 Sep, 2020

2 commits

  • There are 2 goals that we follow:

    - Reduce the header size
    - Make the header size equal between RX and TX

    The issue that required long prefix on RX was the fact that the ocelot
    DSA tag, being put before Ethernet as it is, would overlap with the area
    that a DSA master uses for RX filtering (destination MAC address
    mainly).

    Now that we can ask DSA to put the master in promiscuous mode, in theory
    we could remove the prefix altogether and call it a day, but it looks
    like we can't. Using no prefix on ingress, some packets (such as ICMP)
    would be received, while others (such as PTP) would not be received.
    This is because the DSA master we use (enetc) triggers parse errors
    ("MAC rx frame errors") presumably because it sees Ethernet frames with
    a bad length. And indeed, when using no prefix, the EtherType (bytes
    12-13 of the frame, bits 96-111) falls over the REW_VAL field from the
    extraction header, aka the PTP timestamp.

    When turning the short (32-bit) prefix on, the EtherType overlaps with
    bits 64-79 of the extraction header, which are a reserved area
    transmitted as zero by the switch. The packets are not dropped by the
    DSA master with a short prefix. Actually, the frames look like this in
    tcpdump (below is a PTP frame, with an extra dsa_8021q tag - dadb 0482 -
    added by a downstream sja1105).

    89:0c:a9:f2:01:00 > 88:80:00:0a:00:1d, 802.3, length 0: LLC, \
    dsap Unknown (0x10) Individual, ssap ProWay NM (0x0e) Response, \
    ctrl 0x0004: Information, send seq 2, rcv seq 0, \
    Flags [Response], length 78

    0x0000: 8880 000a 001d 890c a9f2 0100 0000 100f ................
    0x0010: 0400 0000 0180 c200 000e 001f 7b63 0248 ............{c.H
    0x0020: dadb 0482 88f7 1202 0036 0000 0000 0000 .........6......
    0x0030: 0000 0000 0000 0000 0000 001f 7bff fe63 ............{..c
    0x0040: 0248 0001 1f81 0500 0000 0000 0000 0000 .H..............
    0x0050: 0000 0000 0000 0000 0000 0000 ............

    So the short prefix is our new default: we've shortened our RX frames by
    12 octets, increased TX by 4, and headers are now equal between RX and
    TX. Note that we still need promiscuous mode for the DSA master to not
    drop it.

    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • Remove the ocelot_configure_cpu() function, which was in fact bringing
    up 2 ports: the CPU port module, which both switchdev and DSA have, and
    the NPI port, which only DSA has.

    The (non-Ethernet) CPU port module is at a fixed index in the analyzer,
    whereas the NPI port is selected through the "ethernet" property in the
    device tree.

    Therefore, the function to set up an NPI port is DSA-specific, so we
    move it there, simplifying the ocelot switch library a little bit.

    Cc: Horatiu Vultur
    Cc: Alexandre Belloni
    Cc: UNGLinuxDriver
    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     

25 Sep, 2020

2 commits

  • INIT_IPS and GATE_ENABLE fields have a wrong offset in SG_CONFIG_REG_3.
    This register is used by stream gate control of PSFP, and it has not
    been used before, because PSFP is not implemented in ocelot driver.

    Signed-off-by: Xiaoliang Yang
    Signed-off-by: David S. Miller

    Xiaoliang Yang
     
  • Currently, ocelot switchdev passes the skb directly to the function that
    enqueues it to the list of skb's awaiting a TX timestamp. Whereas the
    felix DSA driver first clones the skb, then passes the clone to this
    queue.

    This matters because in the case of felix, the common IRQ handler, which
    is ocelot_get_txtstamp(), currently clones the clone, and frees the
    original clone. This is useless and can be simplified by using
    skb_complete_tx_timestamp() instead of skb_tstamp_tx().

    Signed-off-by: Vladimir Oltean
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Vladimir Oltean
     

23 Sep, 2020

3 commits

  • Two minor conflicts:

    1) net/ipv4/route.c, adding a new local variable while
    moving another local variable and removing it's
    initial assignment.

    2) drivers/net/dsa/microchip/ksz9477.c, overlapping changes.
    One pretty prints the port mode differently, whilst another
    changes the driver to try and obtain the port mode from
    the port node rather than the switch node.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This fixes compile warnings from the -Wpacked-not-aligned option.

    In file included from ../drivers/crypto/caam/qi.c:12:
    ../include/soc/fsl/qman.h:259:1: warning: alignment 1 of ‘struct qm_dqrr_entry’ is less than 8 [-Wpacked-not-aligned]
    } __packed;
    ^
    ../include/soc/fsl/qman.h:292:2: warning: alignment 1 of ‘struct ’ is less than 8 [-Wpacked-not-aligned]
    } __packed ern;
    ^

    Reported-by: Herbert Xu
    Signed-off-by: Li Yang

    Li Yang
     
  • Pull networking fixes from Jakub Kicinski:

    - fix failure to add bond interfaces to a bridge, the offload-handling
    code was too defensive there and recent refactoring unearthed that.
    Users complained (Ido)

    - fix unnecessarily reflecting ECN bits within TOS values / QoS marking
    in TCP ACK and reset packets (Wei)

    - fix a deadlock with bpf iterator. Hopefully we're in the clear on
    this front now... (Yonghong)

    - BPF fix for clobbering r2 in bpf_gen_ld_abs (Daniel)

    - fix AQL on mt76 devices with FW rate control and add a couple of AQL
    issues in mac80211 code (Felix)

    - fix authentication issue with mwifiex (Maximilian)

    - WiFi connectivity fix: revert IGTK support in ti/wlcore (Mauro)

    - fix exception handling for multipath routes via same device (David
    Ahern)

    - revert back to a BH spin lock flavor for nsid_lock: there are paths
    which do require the BH context protection (Taehee)

    - fix interrupt / queue / NAPI handling in the lantiq driver (Hauke)

    - fix ife module load deadlock (Cong)

    - make an adjustment to netlink reply message type for code added in
    this release (the sole change touching uAPI here) (Michal)

    - a number of fixes for small NXP and Microchip switches (Vladimir)

    [ Pull request acked by David: "you can expect more of this in the
    future as I try to delegate more things to Jakub" ]

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (167 commits)
    net: mscc: ocelot: fix some key offsets for IP4_TCP_UDP VCAP IS2 entries
    net: dsa: seville: fix some key offsets for IP4_TCP_UDP VCAP IS2 entries
    net: dsa: felix: fix some key offsets for IP4_TCP_UDP VCAP IS2 entries
    inet_diag: validate INET_DIAG_REQ_PROTOCOL attribute
    net: bridge: br_vlan_get_pvid_rcu() should dereference the VLAN group under RCU
    net: Update MAINTAINERS for MediaTek switch driver
    net/mlx5e: mlx5e_fec_in_caps() returns a boolean
    net/mlx5e: kTLS, Avoid kzalloc(GFP_KERNEL) under spinlock
    net/mlx5e: kTLS, Fix leak on resync error flow
    net/mlx5e: kTLS, Add missing dma_unmap in RX resync
    net/mlx5e: kTLS, Fix napi sync and possible use-after-free
    net/mlx5e: TLS, Do not expose FPGA TLS counter if not supported
    net/mlx5e: Fix using wrong stats_grps in mlx5e_update_ndo_stats()
    net/mlx5e: Fix multicast counter not up-to-date in "ip -s"
    net/mlx5e: Fix endianness when calculating pedit mask first bit
    net/mlx5e: Enable adding peer miss rules only if merged eswitch is supported
    net/mlx5e: CT: Fix freeing ct_label mapping
    net/mlx5e: Fix memory leak of tunnel info when rule under multipath not ready
    net/mlx5e: Use synchronize_rcu to sync with NAPI
    net/mlx5e: Use RCU to protect rq->xdp_prog
    ...

    Linus Torvalds
     

19 Sep, 2020

3 commits

  • It is a good measure to ensure correctness if the structures that are
    meant to remain constant are only processed by functions that thake
    constant arguments.

    Signed-off-by: Vladimir Oltean
    Reviewed-by: Alexandre Belloni
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • Currently mscc_ocelot_init_ports() will skip initializing a port when it
    doesn't have a phy-handle, so the ocelot->ports[port] pointer will be
    NULL. Take this into consideration when tearing down the driver, and add
    a new function ocelot_deinit_port() to the switch library, mirror of
    ocelot_init_port(), which needs to be called by the driver for all ports
    it has initialized.

    Signed-off-by: Vladimir Oltean
    Reviewed-by: Florian Fainelli
    Tested-by: Alexandre Belloni
    Reviewed-by: Alexandre Belloni
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • The ocelot_port->ts_id is used to:
    (a) populate skb->cb[0] for matching the TX timestamp in the PTP IRQ
    with an skb.
    (b) populate the REW_OP from the injection header of the ongoing skb.
    Only then is ocelot_port->ts_id incremented.

    This is a problem because, at least theoretically, another timestampable
    skb might use the same ocelot_port->ts_id before that is incremented.
    Normally all transmit calls are serialized by the netdev transmit
    spinlock, but in this case, ocelot_port_add_txtstamp_skb() is also
    called by DSA, which has started declaring the NETIF_F_LLTX feature
    since commit 2b86cb829976 ("net: dsa: declare lockless TX feature for
    slave ports"). So the logic of using and incrementing the timestamp id
    should be atomic per port.

    The solution is to use the global ocelot_port->ts_id only while
    protected by the associated ocelot_port->ts_id_lock. That's where we
    populate skb->cb[0]. Note that for ocelot, ocelot_port_add_txtstamp_skb
    is called for the actual skb, but for felix, it is called for the skb's
    clone. That is something which will also be changed in the future.

    Signed-off-by: Vladimir Oltean
    Reviewed-by: Horatiu Vultur
    Reviewed-by: Florian Fainelli
    Tested-by: Alexandre Belloni
    Reviewed-by: Alexandre Belloni
    Signed-off-by: David S. Miller

    Vladimir Oltean
     

18 Sep, 2020

1 commit