Skip to content
Permalink
cgel-zte-gmail…
Switch branches/tags

Commits on Dec 14, 2021

  1. pktgen: use min() to make code cleaner

    Use min() in order to make code cleaner. Issue found by coccinelle.
    
    Reported-by: Zeal Robot <zealci@zte.com.cn>
    Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
    Changcheng Deng authored and intel-lab-lkp committed Dec 14, 2021

Commits on Dec 13, 2021

  1. net: mtk_eth: add COMPILE_TEST support

    Improve the build testing of mtk_eth drivers by enabling them when
    COMPILE_TEST is selected. Moreover COMPILE_TEST will be useful
    for the driver development.
    
    Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    LorenzoBianconi authored and davem330 committed Dec 13, 2021
  2. net: dev: Always serialize on Qdisc::busylock in __dev_xmit_skb() on …

    …PREEMPT_RT.
    
    The root-lock is dropped before dev_hard_start_xmit() is invoked and after
    setting the __QDISC___STATE_RUNNING bit. If the Qdisc owner is preempted
    by another sender/task with a higher priority then this new sender won't
    be able to submit packets to the NIC directly instead they will be
    enqueued into the Qdisc. The NIC will remain idle until the Qdisc owner
    is scheduled again and finishes the job.
    
    By serializing every task on the ->busylock then the task will be
    preempted by a sender only after the Qdisc has no owner.
    
    Always serialize on the busylock on PREEMPT_RT.
    
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Sebastian Andrzej Siewior authored and davem330 committed Dec 13, 2021
  3. mt76: remove variable set but not used

    The code that uses variable queued has been removed,
    and "mt76_is_usb(dev) ? q->ndesc - q->queued : q->queued"
    didn't do anything, so all they should be removed as well.
    
    Eliminate the following clang warnings:
    drivers/net/wireless/mediatek/mt76/debugfs.c:77:9: warning: variable
    ‘queued’ set but not used.
    
    Reported-by: Abaci Robot <abaci@linux.alibaba.com>
    Fixes: 2d8be76 ("mt76: debugfs: improve queue node readability")
    Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Yang Li authored and davem330 committed Dec 13, 2021
  4. net: bonding: debug: avoid printing debug logs when bond is not notif…

    …ying peers
    
    Currently "bond_should_notify_peers: slave ..." messages are printed whenever
    "bond_should_notify_peers" function is called.
    
    +++
    Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): Received LACPDU on port 1
    Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): Rx Machine: Port=1, Last State=6, Curr State=6
    Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): partner sync=1
    Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    ...
    Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): Received LACPDU on port 2
    Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): Rx Machine: Port=2, Last State=6, Curr State=6
    Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): partner sync=1
    Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
    +++
    
    This is confusing and can also clutter up debug logs.
    Print logs only when the peer notification happens.
    
    Signed-off-by: Suresh Kumar <suresh2514@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Suresh Kumar authored and davem330 committed Dec 13, 2021
  5. net: ocelot: use dma_unmap_addr to get tx buffer dma_addr

    dma_addr was declared using DEFINE_DMA_UNMAP_ADDR() which requires to
    use dma_unmap_addr() to access it.
    
    Reported-by: kernel test robot <lkp@intel.com>
    Fixes: 753a026 ("net: ocelot: add FDMA support")
    Signed-off-by: Clément Léger <clement.leger@bootlin.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    clementleger authored and davem330 committed Dec 13, 2021
  6. net: lan966x: Fix the configuration of the pcs

    When inserting a SFP that runs at 2.5G, then the Serdes was still
    configured to run at 1G. Because the config->speed was 0, and then the
    speed of the serdes was not configured at all, it was using the default
    value which is 1G. This patch stop calling the serdes function set_speed
    and allow the serdes to figure out the speed based on the interface
    type.
    
    Fixes: d28d6d2 ("net: lan966x: add port module support")
    Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    HoratiuVultur authored and davem330 committed Dec 13, 2021
  7. selftests/net: expand gro with two machine test

    The test is currently run on a single host with private addresses,
    either over veth or by setting a nic in loopback mode with macvlan.
    
    Support running between two real devices. Allow overriding addresses.
    
    Also cut timeout to fail faster on error and explicitly log success.
    
    Signed-off-by: Willem de Bruijn <willemb@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    wdebruij authored and davem330 committed Dec 13, 2021
  8. Merge branch 'mse102x-support'

    Stefan Wahren says:
    
    ====================
    add Vertexcom MSE102x support
    
    This patch series adds support for the Vertexcom MSE102x Homeplug GreenPHY
    chips [1]. They can be connected either via RGMII, RMII or SPI to a host CPU.
    These patches handles only the last one, with an Ethernet over SPI protocol
    driver.
    
    The code has been tested only on Raspberry Pi boards, but should work
    on other platforms.
    
    Changes in V3:
    - drop IF_PORT_HOMEPLUG again, since it's actually not used
    
    Changes in V2:
    - improve lock handling for RX & TX path
    - add new patch to introduce IF_PORT_HOMEPLUG as suggested by Andrew Lunn
    - address all the comments by Jakub Kicinski, Andrew Lunn, Kernel test robot
    
    [1] - http://www.vertexcom.com/p_homeplug_plc_en.html
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Dec 13, 2021
  9. net: vertexcom: Add MSE102x SPI support

    This implements an SPI protocol driver for Vertexcom MSE102x
    Homeplug GreenPHY chip.
    
    Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    lategoodbye authored and davem330 committed Dec 13, 2021
  10. dt-bindings: net: add Vertexcom MSE102x support

    Add devicetree binding for the Vertexcom MSE102x Homeplug GreenPHY chip
    as SPI device.
    
    Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
    Reviewed-by: Rob Herring <robh@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    lategoodbye authored and davem330 committed Dec 13, 2021
  11. dt-bindings: add vendor Vertexcom

    Add vendor prefix for Vertexcom Technologies, Inc [1].
    
    [1] - http://www.vertexcom.com/
    
    Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
    Acked-by: Rob Herring <robh@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    lategoodbye authored and davem330 committed Dec 13, 2021
  12. net: mvneta: mark as a legacy_pre_march2020 driver

    mvneta provides mac_an_restart and mac_pcs_get_state methods, so needs
    to be marked as a legacy driver. Marek spotted that mvneta had stopped
    working in 2500base-X mode - thanks for reporting.
    
    Reported-by: Marek Behún <kabel@kernel.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Russell King (Oracle) authored and davem330 committed Dec 13, 2021
  13. net: axienet: mark as a legacy_pre_march2020 driver

    axienet has a PCS, but does not make use of the phylink PCS support.
    Mark it was a pre-March 2020 driver.
    
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Russell King (Oracle) authored and davem330 committed Dec 13, 2021
  14. isdn: cpai: no need to initialise statics to 0

    Static variables do not need to be initialised to 0, because compiler
    will initialise all uninitialised statics to 0. Thus, remove the
    unneeded initializations.
    
    Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Jason Wang authored and davem330 committed Dec 13, 2021
  15. net: ipa: fix IPA v4.5 interconnect data

    Update the definition of the IPA interconnects for IPA v4.5 so
    the path between IPA and system memory is represented by a single
    "memory" interconnect.
    
    Tested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Signed-off-by: Alex Elder <elder@linaro.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    alexelder authored and davem330 committed Dec 13, 2021
  16. ARM: dts: qcom: sdx55: fix IPA interconnect definitions

    The first two interconnects defined for IPA on the SDX55 SoC are
    really two parts of what should be represented as a single path
    between IPA and system memory.
    
    Fix this by combining the "memory-a" and "memory-b" interconnects
    into a single "memory" interconnect.
    
    Reported-by: David Heidelberg <david@ixit.cz>
    Tested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Signed-off-by: Alex Elder <elder@linaro.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    alexelder authored and davem330 committed Dec 13, 2021
  17. net: Enable max_dgram_qlen unix sysctl to be configurable by non-init…

    … user namespaces
    
    This patch enables the "/proc/sys/net/unix/max_dgram_qlen" sysctl to be
    exposed to non-init user namespaces. max_dgram_qlen is used as the default
    "sk_max_ack_backlog" value for when a unix socket is created.
    
    Currently, when a networking namespace is initialized, its unix sysctls
    are exposed only if the user namespace that "owns" it is the init user
    namespace. If there is an non-init user namespace that "owns" a networking
    namespace (for example, in the case after we call clone() with both
    CLONE_NEWUSER and CLONE_NEWNET set), the sysctls are hidden from view
    and not configurable.
    
    Exposing the unix sysctl is safe because any changes made to it will be
    limited in scope to the networking namespace the non-init user namespace
    "owns" and has privileges over (changes won't affect any other net
    namespace). There is also no possibility of a non-privileged user namespace
    messing up the net namespace sysctls it shares with its parent user namespace.
    When a new user namespace is created without unsharing the network namespace
    (eg calling clone()  with CLONE_NEWUSER), the new user namespace shares its
    parent's network namespace. Write access is protected by the mode set
    in the sysctl's ctl_table (and enforced by procfs). Here in the case of
    "max_dgram_qlen", 0644 is set; only the user owner has write access.
    
    v1 -> v2:
    * Add more detail to commit message, specify the
    "/proc/sys/net/unix/max_dgram_qlen" sysctl in commit message.
    
    Signed-off-by: Joanne Koong <joannekoong@fb.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    jkoong-fb authored and davem330 committed Dec 13, 2021
  18. u64_stats: Disable preemption on 32bit UP+SMP PREEMPT_RT during updates.

    On PREEMPT_RT the seqcount_t for synchronisation is required on 32bit
    architectures even on UP because the softirq (and the threaded IRQ handler) can
    be preempted.
    
    With the seqcount_t for synchronisation, a reader with higher priority can
    preempt the writer and then spin endlessly in read_seqcount_begin() while the
    writer can't make progress.
    
    To avoid such a lock up on PREEMPT_RT the writer must disable preemption during
    the update. There is no need to disable interrupts because no writer is using
    this API in hard-IRQ context on PREEMPT_RT.
    
    Disable preemption on 32bit-RT within the u64_stats write section.
    
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Sebastian Andrzej Siewior authored and davem330 committed Dec 13, 2021
  19. Merge branch 'bareudp-remove-unused'

    Guillaume Nault says:
    
    ====================
    bareudp: Remove unused code from header file
    
    Stop exporting unused functions and structures in bareudp.h. The only
    piece of bareudp.h that is actually used is netif_is_bareudp(). The
    rest can be moved to bareudp.c or even dropped entirely.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Dec 13, 2021
  20. bareudp: Move definition of struct bareudp_conf to bareudp.c

    This structure is used only in bareudp.c.
    
    While there, adjust include files: we need netdevice.h, not skbuff.h.
    
    Signed-off-by: Guillaume Nault <gnault@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Guillaume Nault authored and davem330 committed Dec 13, 2021
  21. bareudp: Remove bareudp_dev_create()

    There's no user for this function.
    
    Signed-off-by: Guillaume Nault <gnault@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Guillaume Nault authored and davem330 committed Dec 13, 2021
  22. tipc: discard MSG_CRYPTO msgs when key_exchange_enabled is not set

    When key_exchange is disabled, there is no reason to accept MSG_CRYPTO
    msgs if it doesn't send MSG_CRYPTO msgs.
    
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Acked-by: Jon Maloy <jmaloy@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    lxin authored and davem330 committed Dec 13, 2021
  23. net: stmmac: bump tc when get underflow error from DMA descriptor

    In DMA threshold mode, frame underflow errors may sometimes occur when
    the TC(threshold control) value is not enough. The TC value need to be
    bumped up in this case.
    
    There is no underflow interrupt bit on DMA_CH(#i)_Status of dwmac4, so
    the DMA threshold cannot be bumped up in stmmac_dma_interrupt(). The
    i.mx8mp board observed an underflow error while running NFS boot, the
    NFS rootfs could not be mounted.
    
    The underflow error can be got from the DMA descriptor TDES3 on dwmac4.
    This patch bump up tc value once underflow error is got from TDES3.
    
    Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Xiaoliang Yang authored and davem330 committed Dec 13, 2021

Commits on Dec 12, 2021

  1. Merge branch 'dsa-tagger-storage'

    Vladimir Oltean says:
    
    ====================
    Replace DSA dp->priv with tagger-owned storage
    
    Ansuel's recent work on qca8k register access over Ethernet:
    https://patchwork.kernel.org/project/netdevbpf/cover/20211207145942.7444-1-ansuelsmth@gmail.com/
    has triggered me to do something which I should've done for a longer
    time:
    https://patchwork.kernel.org/project/netdevbpf/patch/20211109095013.27829-7-martin.kaistra@linutronix.de/#24585521
    which is to replace dp->priv with something that has less caveats.
    
    The dp->priv was introduced when sja1105 needed to hold stateful
    information in the tagging protocol driver. In that design, dp->priv
    held memory allocated by the switch driver, because the tagging protocol
    driver design was 100% stateless.
    
    Some years have passed and others have started to feel the need for
    stateful information kept by the tagger, as well as passing data back
    and forth between the tagging protocol driver and the switch driver.
    This isn't possible cleanly in DSA due to a circular dependency which
    leads to broken module autoloading:
    https://lore.kernel.org/netdev/20210908220834.d7gmtnwrorhharna@skbuf/
    
    This patchset introduces a framework that resembles something normal,
    which allows data to be passed from the tagging protocol driver (things
    like switch management packets, which aren't intended for the network
    stack) to the switch driver, while the tagging protocol still remains
    more or less stateless. The overall design of the framework was
    discussed with Ansuel too and it appears to be flexible enough to cover
    the "register access over Ethernet" use case. Additionally, the existing
    uses of dp->priv, which have mainly to do with PTP timestamping, have
    also been migrated.
    
    Changes in v2:
    Fix transient build breakage in patch 5/11 due to a missing parenthesis,
    https://patchwork.hopto.org/static/nipa/592567/12665213/build_clang/
    and another transient build warning in patch 4/11 that for some reason
    doesn't appear in my W=1 C=1 build.
    https://patchwork.hopto.org/static/nipa/592567/12665209/build_clang/stderr
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Dec 12, 2021
  2. net: dsa: remove dp->priv

    All current in-tree uses of dp->priv have been replaced with
    ds->tagger_data, which provides for a safer API especially when the
    connection isn't the regular 1:1 link between one switch driver and one
    tagging protocol driver, but could be either one switch to many taggers,
    or many switches to one tagger.
    
    Therefore, we can remove this unused pointer.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Dec 12, 2021
  3. net: dsa: tag_sja1105: split sja1105_tagger_data into private and pub…

    …lic sections
    
    The sja1105 driver messes with the tagging protocol's state when PTP RX
    timestamping is enabled/disabled. This is fundamentally necessary
    because the tagger needs to know what to do when it receives a PTP
    packet. If RX timestamping is enabled, then a metadata follow-up frame
    is expected, and this holds the (partial) timestamp. So the tagger plays
    hide-and-seek with the network stack until it also gets the metadata
    frame, and then presents a single packet, the timestamped PTP packet.
    But when RX timestamping isn't enabled, there is no metadata frame
    expected, so the hide-and-seek game must be turned off and the packet
    must be delivered right away to the network stack.
    
    Considering this, we create a pseudo isolation by devising two tagger
    methods callable by the switch: one to get the RX timestamping state,
    and one to set it. Since we can't export symbols between the tagger and
    the switch driver, these methods are exposed through function pointers.
    
    After this change, the public portion of the sja1105_tagger_data
    contains only function pointers.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Dec 12, 2021
  4. Revert "net: dsa: move sja1110_process_meta_tstamp inside the tagging…

    … protocol driver"
    
    This reverts commit 6d709ca.
    
    The above change was done to avoid calling symbols exported by the
    switch driver from the tagging protocol driver.
    
    With the tagger-owned storage model, we have a new option on our hands,
    and that is for the switch driver to provide a data consumer handler in
    the form of a function pointer inside the ->connect_tag_protocol()
    method. Having a function pointer avoids the problems of the exported
    symbols approach.
    
    By creating a handler for metadata frames holding TX timestamps on
    SJA1110, we are able to eliminate an skb queue from the tagger data, and
    replace it with a simple, and stateless, function pointer. This skb
    queue is now handled exclusively by sja1105_ptp.c, which makes the code
    easier to follow, as it used to be before the reverted patch.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Dec 12, 2021
  5. net: dsa: tag_sja1105: convert to tagger-owned data

    Currently, struct sja1105_tagger_data is a part of struct
    sja1105_private, and is used by the sja1105 driver to populate dp->priv.
    
    With the movement towards tagger-owned storage, the sja1105 driver
    should not be the owner of this memory.
    
    This change implements the connection between the sja1105 switch driver
    and its tagging protocol, which means that sja1105_tagger_data no longer
    stays in dp->priv but in ds->tagger_data, and that the sja1105 driver
    now only populates the sja1105_port_deferred_xmit callback pointer.
    The kthread worker is now the responsibility of the tagger.
    
    The sja1105 driver also alters the tagger's state some more, especially
    with regard to the PTP RX timestamping state. This will be fixed up a
    bit in further changes.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Dec 12, 2021
  6. net: dsa: sja1105: move ts_id from sja1105_tagger_data

    The TX timestamp ID is incremented by the SJA1110 PTP timestamping
    callback (->port_tx_timestamp) for every packet, when cloning it.
    It isn't used by the tagger at all, even though it sits inside the
    struct sja1105_tagger_data.
    
    Also, serialization to this structure is currently done through
    tagger_data->meta_lock, which is a cheap hack because the meta_lock
    isn't used for anything else on SJA1110 (sja1105_rcv_meta_state_machine
    isn't called).
    
    This change moves ts_id from sja1105_tagger_data to sja1105_private and
    introduces a dedicated spinlock for it, also in sja1105_private.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Dec 12, 2021
  7. net: dsa: sja1105: make dp->priv point directly to sja1105_tagger_data

    The design of the sja1105 tagger dp->priv is that each port has a
    separate struct sja1105_port, and the sp->data pointer points to a
    common struct sja1105_tagger_data.
    
    We have removed all per-port members accessible by the tagger, and now
    only struct sja1105_tagger_data remains. Make dp->priv point directly to
    this.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Dec 12, 2021
  8. net: dsa: sja1105: remove hwts_tx_en from tagger data

    This tagger property is in fact not used at all by the tagger, only by
    the switch driver. Therefore it makes sense to be moved to
    sja1105_private.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Dec 12, 2021
  9. net: dsa: sja1105: bring deferred xmit implementation in line with oc…

    …elot-8021q
    
    When the ocelot-8021q driver was converted to deferred xmit as part of
    commit 8d5f795 ("net: dsa: felix: break at first CPU port during
    init and teardown"), the deferred implementation was deliberately made
    subtly different from what sja1105 has.
    
    The implementation differences lied on the following observations:
    
    - There might be a race between these two lines in tag_sja1105.c:
    
           skb_queue_tail(&sp->xmit_queue, skb_get(skb));
           kthread_queue_work(sp->xmit_worker, &sp->xmit_work);
    
      and the skb dequeue logic in sja1105_port_deferred_xmit(). For
      example, the xmit_work might be already queued, however the work item
      has just finished walking through the skb queue. Because we don't
      check the return code from kthread_queue_work, we don't do anything if
      the work item is already queued.
    
      However, nobody will take that skb and send it, at least until the
      next timestampable skb is sent. This creates additional (and
      avoidable) TX timestamping latency.
    
      To close that race, what the ocelot-8021q driver does is it doesn't
      keep a single work item per port, and a skb timestamping queue, but
      rather dynamically allocates a work item per packet.
    
    - It is also unnecessary to have more than one kthread that does the
      work. So delete the per-port kthread allocations and replace them with
      a single kthread which is global to the switch.
    
    This change brings the two implementations in line by applying those
    observations to the sja1105 driver as well.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Dec 12, 2021
  10. net: dsa: sja1105: let deferred packets time out when sent to ports g…

    …oing down
    
    This code is not necessary and complicates the conversion of this driver
    to tagger-owned memory. If there is a PTP packet that is sent
    concurrently with the port getting disabled, the deferred xmit mechanism
    is robust enough to time out when it sees that it hasn't been delivered,
    and recovers.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Dec 12, 2021
  11. net: dsa: tag_ocelot: convert to tagger-owned data

    The felix driver makes very light use of dp->priv, and the tagger is
    effectively stateless. dp->priv is practically only needed to set up a
    callback to perform deferred xmit of PTP and STP packets using the
    ocelot-8021q tagging protocol (the main ocelot tagging protocol makes no
    use of dp->priv, although this driver sets up dp->priv irrespective of
    actual tagging protocol in use).
    
    struct felix_port (what used to be pointed to by dp->priv) is removed
    and replaced with a two-sided structure. The public side of this
    structure, visible to the switch driver, is ocelot_8021q_tagger_data.
    The private side is ocelot_8021q_tagger_private, and the latter
    structure physically encapsulates the former. The public half of the
    tagger data structure can be accessed through a helper of the same name
    (ocelot_8021q_tagger_data) which also sanity-checks the protocol
    currently in use by the switch. The public/private split was requested
    by Andrew Lunn.
    
    Suggested-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Dec 12, 2021
Older