Skip to content
  1. Nov 03, 2022
    • Daniel Machon's avatar
      net: dcb: add new apptrust attribute · 6182d587
      Daniel Machon authored
      
      
      Add new apptrust extension attributes to the 8021Qaz APP managed object.
      
      Two new attributes, DCB_ATTR_DCB_APP_TRUST_TABLE and
      DCB_ATTR_DCB_APP_TRUST, has been added. Trusted selectors are passed in
      the nested attribute DCB_ATTR_DCB_APP_TRUST, in order of precedence.
      
      The new attributes are meant to allow drivers, whose hw supports the
      notion of trust, to be able to set whether a particular app selector is
      trusted - and in which order.
      
      Signed-off-by: default avatarDaniel Machon <daniel.machon@microchip.com>
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      6182d587
    • Daniel Machon's avatar
      net: dcb: add new pcp selector to app object · ec32c0c4
      Daniel Machon authored
      
      
      Add new PCP selector for the 8021Qaz APP managed object.
      
      As the PCP selector is not part of the 8021Qaz standard, a new non-std
      extension attribute DCB_ATTR_DCB_APP has been introduced. Also two
      helper functions to translate between selector and app attribute type
      has been added. The new selector has been given a value of 255, to
      minimize the risk of future overlap of std- and non-std attributes.
      
      The new DCB_ATTR_DCB_APP is sent alongside the ieee std attribute in the
      app table. This means that the dcb_app struct can now both contain std-
      and non-std app attributes. Currently there is no overlap between the
      selector values of the two attributes.
      
      The purpose of adding the PCP selector, is to be able to offload
      PCP-based queue classification to the 8021Q Priority Code Point table,
      see 6.9.3 of IEEE Std 802.1Q-2018.
      
      PCP and DEI is encoded in the protocol field as 8*dei+pcp, so that a
      mapping of PCP 2 and DEI 1 to priority 3 is encoded as {255, 10, 3}.
      
      Signed-off-by: default avatarDaniel Machon <daniel.machon@microchip.com>
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      ec32c0c4
    • Saurabh Sengar's avatar
      net: mana: Assign interrupts to CPUs based on NUMA nodes · 71fa6887
      Saurabh Sengar authored
      
      
      In large VMs with multiple NUMA nodes, network performance is usually
      best if network interrupts are all assigned to the same virtual NUMA
      node. This patch assigns online CPU according to a numa aware policy,
      local cpus are returned first, followed by non-local ones, then it wraps
      around.
      
      Signed-off-by: default avatarSaurabh Sengar <ssengar@linux.microsoft.com>
      Reviewed-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
      Link: https://lore.kernel.org/r/1667282761-11547-1-git-send-email-ssengar@linux.microsoft.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      71fa6887
    • Shenwei Wang's avatar
      net: fec: add initial XDP support · 6d6b39f1
      Shenwei Wang authored
      
      
      This patch adds the initial XDP support to Freescale driver. It supports
      XDP_PASS, XDP_DROP and XDP_REDIRECT actions. Upcoming patches will add
      support for XDP_TX and Zero Copy features.
      
      As the patch is rather large, the part of codes to collect the
      statistics is separated and will prepare a dedicated patch for that
      part.
      
      I just tested with the application of xdpsock.
        -- Native here means running command of "xdpsock -i eth0"
        -- SKB-Mode means running command of "xdpsock -S -i eth0"
      
      The following are the testing result relating to XDP mode:
      
      root@imx8qxpc0mek:~/bpf# ./xdpsock -i eth0
       sock0@eth0:0 rxdrop xdp-drv
                         pps            pkts           1.00
      rx                 371347         2717794
      tx                 0              0
      
      root@imx8qxpc0mek:~/bpf# ./xdpsock -S -i eth0
       sock0@eth0:0 rxdrop xdp-skb
                         pps            pkts           1.00
      rx                 202229         404528
      tx                 0              0
      
      root@imx8qxpc0mek:~/bpf# ./xdp2 eth0
      proto 0:     496708 pkt/s
      proto 0:     505469 pkt/s
      proto 0:     505283 pkt/s
      proto 0:     505443 pkt/s
      proto 0:     505465 pkt/s
      
      root@imx8qxpc0mek:~/bpf# ./xdp2 -S eth0
      proto 0:          0 pkt/s
      proto 17:     118778 pkt/s
      proto 17:     118989 pkt/s
      proto 0:          1 pkt/s
      proto 17:     118987 pkt/s
      proto 0:          0 pkt/s
      proto 17:     118943 pkt/s
      proto 17:     118976 pkt/s
      proto 0:          1 pkt/s
      proto 17:     119006 pkt/s
      proto 0:          0 pkt/s
      proto 17:     119071 pkt/s
      proto 17:     119092 pkt/s
      
      Signed-off-by: default avatarShenwei Wang <shenwei.wang@nxp.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Link: https://lore.kernel.org/r/20221031185350.2045675-1-shenwei.wang@nxp.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      6d6b39f1
    • Ilya Maximets's avatar
      net: tun: bump the link speed from 10Mbps to 10Gbps · 598d2982
      Ilya Maximets authored
      
      
      The 10Mbps link speed was set in 2004 when the ethtool interface was
      initially added to the tun driver.  It might have been a good
      assumption 18 years ago, but CPUs and network stack came a long way
      since then.
      
      Other virtual ports typically report much higher speeds.  For example,
      veth reports 10Gbps since its introduction in 2007.
      
      Some userspace applications rely on the current link speed in
      certain situations.  For example, Open vSwitch is using link speed
      as an upper bound for QoS configuration if user didn't specify the
      maximum rate.  Advertised 10Mbps doesn't match reality in a modern
      world, so users have to always manually override the value with
      something more sensible to avoid configuration issues, e.g. limiting
      the traffic too much.  This also creates additional confusion among
      users.
      
      Bump the advertised speed to at least match the veth.
      
      Alternative might be to explicitly report UNKNOWN and let the user
      decide on a right value for them.  And it is indeed "the right way"
      of fixing the problem.  However, that may cause issues with bonding
      or with some userspace applications that may rely on speed value to
      be reported (even though they should not).  Just changing the speed
      value should be a safer option.
      
      Users can still override the speed with ethtool, if necessary.
      
      RFC discussion is linked below.
      
      Link: https://lore.kernel.org/lkml/20221021114921.3705550-1-i.maximets@ovn.org/
      Link: https://mail.openvswitch.org/pipermail/ovs-discuss/2022-July/051958.html
      Signed-off-by: default avatarIlya Maximets <i.maximets@ovn.org>
      Reviewed-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Link: https://lore.kernel.org/r/20221031173953.614577-1-i.maximets@ovn.org
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      598d2982
    • Jakub Kicinski's avatar
      Merge branch 'rocker-two-small-changes' · d3a47063
      Jakub Kicinski authored
      
      
      Ido Schimmel says:
      
      ====================
      rocker: Two small changes
      
      Patch #1 avoids allocating and scheduling a work item when it is not
      doing any work.
      
      Patch #2 aligns rocker with other switchdev drivers to explicitly mark
      FDB entries as offloaded. Needed for upcoming MAB offload [1].
      
      [1] https://lore.kernel.org/netdev/20221025100024.1287157-1-idosch@nvidia.com/
      ====================
      
      Link: https://lore.kernel.org/r/20221101123936.1900453-1-idosch@nvidia.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d3a47063
    • Ido Schimmel's avatar
      rocker: Explicitly mark learned FDB entries as offloaded · 386b4174
      Ido Schimmel authored
      
      
      Currently, FDB entries that are notified to the bridge driver via
      'SWITCHDEV_FDB_ADD_TO_BRIDGE' are always marked as offloaded by the
      bridge. With MAB enabled, this will no longer be universally true.
      Device drivers will report locked FDB entries to the bridge to let it
      know that the corresponding hosts required authorization, but it does
      not mean that these entries are necessarily programmed in the underlying
      hardware.
      
      We would like to solve it by having the bridge driver determine the
      offload indication based of the 'offloaded' bit in the FDB notification
      [1].
      
      Prepare for that change by having rocker explicitly mark learned FDB
      entries as offloaded. This is consistent with all the other switchdev
      drivers.
      
      [1] https://lore.kernel.org/netdev/20221025100024.1287157-4-idosch@nvidia.com/
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      386b4174
    • Ido Schimmel's avatar
      rocker: Avoid unnecessary scheduling of work item · 42e51de9
      Ido Schimmel authored
      
      
      The work item function ofdpa_port_fdb_learn_work() does not do anything
      when 'OFDPA_OP_FLAG_LEARNED' is not set in the work item's flags.
      
      Therefore, do not allocate and do not schedule the work item when the
      flag is not set.
      
      Suggested-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      42e51de9
    • Jiri Slaby (SUSE)'s avatar
      sfc (gcc13): synchronize ef100_enqueue_skb()'s return type · 3319dbb3
      Jiri Slaby (SUSE) authored
      
      
      ef100_enqueue_skb() generates a valid warning with gcc-13:
        drivers/net/ethernet/sfc/ef100_tx.c:370:5: error: conflicting types for 'ef100_enqueue_skb' due to enum/integer mismatch; have 'int(struct efx_tx_queue *, struct sk_buff *)'
        drivers/net/ethernet/sfc/ef100_tx.h:25:13: note: previous declaration of 'ef100_enqueue_skb' with type 'netdev_tx_t(struct efx_tx_queue *, struct sk_buff *)'
      
      I.e. the type of the ef100_enqueue_skb()'s return value in the declaration is
      int, while the definition spells enum netdev_tx_t. Synchronize them to the
      latter.
      
      Cc: Martin Liska <mliska@suse.cz>
      Cc: Edward Cree <ecree.xilinx@gmail.com>
      Cc: Martin Habets <habetsm.xilinx@gmail.com>
      Signed-off-by: default avatarJiri Slaby (SUSE) <jirislaby@kernel.org>
      Link: https://lore.kernel.org/r/20221031114440.10461-1-jirislaby@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3319dbb3
    • Jiri Slaby (SUSE)'s avatar
      bonding (gcc13): synchronize bond_{a,t}lb_xmit() types · 777fa87c
      Jiri Slaby (SUSE) authored
      
      
      Both bond_alb_xmit() and bond_tlb_xmit() produce a valid warning with
      gcc-13:
        drivers/net/bonding/bond_alb.c:1409:13: error: conflicting types for 'bond_tlb_xmit' due to enum/integer mismatch; have 'netdev_tx_t(struct sk_buff *, struct net_device *)' ...
        include/net/bond_alb.h:160:5: note: previous declaration of 'bond_tlb_xmit' with type 'int(struct sk_buff *, struct net_device *)'
      
        drivers/net/bonding/bond_alb.c:1523:13: error: conflicting types for 'bond_alb_xmit' due to enum/integer mismatch; have 'netdev_tx_t(struct sk_buff *, struct net_device *)' ...
        include/net/bond_alb.h:159:5: note: previous declaration of 'bond_alb_xmit' with type 'int(struct sk_buff *, struct net_device *)'
      
      I.e. the return type of the declaration is int, while the definitions
      spell netdev_tx_t. Synchronize both of them to the latter.
      
      Cc: Martin Liska <mliska@suse.cz>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: default avatarJiri Slaby (SUSE) <jirislaby@kernel.org>
      Link: https://lore.kernel.org/r/20221031114409.10417-1-jirislaby@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      777fa87c
    • Jiri Slaby (SUSE)'s avatar
      qed (gcc13): use u16 for fid to be big enough · 7d841182
      Jiri Slaby (SUSE) authored
      
      
      gcc 13 correctly reports overflow in qed_grc_dump_addr_range():
      In file included from drivers/net/ethernet/qlogic/qed/qed.h:23,
                       from drivers/net/ethernet/qlogic/qed/qed_debug.c:10:
      drivers/net/ethernet/qlogic/qed/qed_debug.c: In function 'qed_grc_dump_addr_range':
      include/linux/qed/qed_if.h:1217:9: error: overflow in conversion from 'int' to 'u8' {aka 'unsigned char'} changes value from '(int)vf_id << 8 | 128' to '128' [-Werror=overflow]
      
      We do:
        u8 fid;
        ...
        fid = vf_id << 8 | 128;
      
      Since fid is 16bit (and the stored value above too), fid should be u16,
      not u8. Fix that.
      
      Cc: Martin Liska <mliska@suse.cz>
      Cc: Ariel Elior <aelior@marvell.com>
      Cc: Manish Chopra <manishc@marvell.com>
      Signed-off-by: default avatarJiri Slaby (SUSE) <jirislaby@kernel.org>
      Link: https://lore.kernel.org/r/20221031114354.10398-1-jirislaby@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7d841182
    • Rafał Miłecki's avatar
      net: broadcom: bcm4908_enet: report queued and transmitted bytes · 471ef777
      Rafał Miłecki authored
      
      
      This allows BQL to operate avoiding buffer bloat and reducing latency.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Link: https://lore.kernel.org/r/20221031104856.32388-1-zajec5@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      471ef777
    • Suman Ghosh's avatar
      octeontx2-af: Allow mkex profile without DMAC and add L2M/L2B header extraction support · 2cee6401
      Suman Ghosh authored
      
      
      1. It is possible to have custom mkex profiles which do not extract
      DMAC at all into the key. Hence allow mkex profiles which do not
      have DMAC to be loaded into MCAM hardware. This patch also adds
      debugging prints needed to identify profiles with wrong
      configuration.
      
      2. If a mkex profile set "l2l3mb" field for Rx interface,
      then Rx multicast and broadcast entry should be configured.
      
      Signed-off-by: default avatarSuman Ghosh <sumang@marvell.com>
      Link: https://lore.kernel.org/r/20221031090856.1404303-1-sumang@marvell.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2cee6401
  2. Nov 02, 2022
    • Jakub Kicinski's avatar
      Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · b54a0d40
      Jakub Kicinski authored
      
      
      Daniel Borkmann says:
      
      ====================
      bpf-next 2022-11-02
      
      We've added 70 non-merge commits during the last 14 day(s) which contain
      a total of 96 files changed, 3203 insertions(+), 640 deletions(-).
      
      The main changes are:
      
      1) Make cgroup local storage available to non-cgroup attached BPF programs
         such as tc BPF ones, from Yonghong Song.
      
      2) Avoid unnecessary deadlock detection and failures wrt BPF task storage
         helpers, from Martin KaFai Lau.
      
      3) Add LLVM disassembler as default library for dumping JITed code
         in bpftool, from Quentin Monnet.
      
      4) Various kprobe_multi_link fixes related to kernel modules,
         from Jiri Olsa.
      
      5) Optimize x86-64 JIT with emitting BMI2-based shift instructions,
         from Jie Meng.
      
      6) Improve BPF verifier's memory type compatibility for map key/value
         arguments, from Dave Marchevsky.
      
      7) Only create mmap-able data section maps in libbpf when data is exposed
         via skeletons, from Andrii Nakryiko.
      
      8) Add an autoattach option for bpftool to load all object assets,
         from Wang Yufen.
      
      9) Various memory handling fixes for libbpf and BPF selftests,
         from Xu Kuohai.
      
      10) Initial support for BPF selftest's vmtest.sh on arm64,
          from Manu Bretelle.
      
      11) Improve libbpf's BTF handling to dedup identical structs,
          from Alan Maguire.
      
      12) Add BPF CI and denylist documentation for BPF selftests,
          from Daniel Müller.
      
      13) Check BPF cpumap max_entries before doing allocation work,
          from Florian Lehner.
      
      * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (70 commits)
        samples/bpf: Fix typo in README
        bpf: Remove the obsolte u64_stats_fetch_*_irq() users.
        bpf: check max_entries before allocating memory
        bpf: Fix a typo in comment for DFS algorithm
        bpftool: Fix spelling mistake "disasembler" -> "disassembler"
        selftests/bpf: Fix bpftool synctypes checking failure
        selftests/bpf: Panic on hard/soft lockup
        docs/bpf: Add documentation for new cgroup local storage
        selftests/bpf: Add test cgrp_local_storage to DENYLIST.s390x
        selftests/bpf: Add selftests for new cgroup local storage
        selftests/bpf: Fix test test_libbpf_str/bpf_map_type_str
        bpftool: Support new cgroup local storage
        libbpf: Support new cgroup local storage
        bpf: Implement cgroup storage available to non-cgroup-attached bpf progs
        bpf: Refactor some inode/task/sk storage functions for reuse
        bpf: Make struct cgroup btf id global
        selftests/bpf: Tracing prog can still do lookup under busy lock
        selftests/bpf: Ensure no task storage failure for bpf_lsm.s prog due to deadlock detection
        bpf: Add new bpf_task_storage_delete proto with no deadlock detection
        bpf: bpf_task_storage_delete_recur does lookup first before the deadlock check
        ...
      ====================
      
      Link: https://lore.kernel.org/r/20221102062120.5724-1-daniel@iogearbox.net
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b54a0d40
    • David S. Miller's avatar
      Merge branch 'renesas-eswitch' · ef2dd61a
      David S. Miller authored
      
      
      Yoshihiro Shimoda says:
      
      ====================
      net: ethernet: renesas: Add support for "Ethernet Switch"
      
      This patch series is based on next-20221027.
      
      Add initial support for Renesas "Ethernet Switch" device of R-Car S4-8.
      The hardware has features about forwarding for an ethernet switch
      device. But, for now, it acts as ethernet controllers so that any
      forwarding offload features are not supported. So, any switchdev
      header files and DSA framework are not used.
      
      Notes that this driver requires some special settings on marvell10g,
      Especially host mactype and host speed. And, I need further investigation
      to modify the marvell10g driver for upstream. But, the special settings
      are applied, this rswitch driver can work correcfly without any changes
      of this rswitch driver. So, I believe the rswitch driver can go for
      upstream.
      
      Changes from v6:
      https://lore.kernel.org/all/20221028065458.2417293-1-yoshihiro.shimoda.uh@renesas.com/
       - Add Reviewed-by tag in the patch [1/3].
       - Fix ordering of initialization because NFS root can start mounting
         the filesystem before register_netdev() even returns
      
      Changes from v5:
      https://lore.kernel.org/all/20221027134034.2343230-1-yoshihiro.shimoda.uh@renesas.com/
       - Add maxItems for the ethernet-port/port/reg property.
      
      Changes from v4:
      https://lore.kernel.org/all/20221019083518.933070-1-yoshihiro.shimoda.uh@renesas.com/
       - Rebased on next-20221027.
       - Drop some unneeded properties on the dt-bindings doc.
       - Change the subject and commit descriptions on the patch [2/3].
       - Use phylink instead of phylib.
       - Modify struct rswitch_*_desc to remove similar functions ([gs]et_dptr).
      
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef2dd61a
    • Yoshihiro Shimoda's avatar
      net: ethernet: renesas: rswitch: Add R-Car Gen4 gPTP support · 6c6fa1a0
      Yoshihiro Shimoda authored
      
      
      Add R-Car Gen4 gPTP support into the rswitch driver.
      
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c6fa1a0
    • Yoshihiro Shimoda's avatar
      net: ethernet: renesas: Add support for "Ethernet Switch" · 3590918b
      Yoshihiro Shimoda authored
      
      
      Add initial support for Renesas "Ethernet Switch" device of R-Car S4-8.
      The hardware has features about forwarding for an ethernet switch
      device. But, for now, it acts as ethernet controllers so that any
      forwarding offload features are not supported. So, any switchdev
      header files and DSA framework are not used.
      
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3590918b
    • Yoshihiro Shimoda's avatar
      dt-bindings: net: renesas: Document Renesas Ethernet Switch · f9edd827
      Yoshihiro Shimoda authored
      
      
      Document Renesas Etherent Switch for R-Car S4-8 (r8a779f0).
      
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9edd827
    • David S. Miller's avatar
      Merge branch 'txgbe' · d312bad4
      David S. Miller authored
      
      
      Mengyuan Lou says:
      
      ====================
      net: WangXun txgbe/ngbe ethernet driver
      
      This patch series adds support for WangXun NICS, to initialize
      interface from software to firmware.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d312bad4
    • Mengyuan Lou's avatar
      net: ngbe: Initialize sw info and register netdev · 02338c48
      Mengyuan Lou authored
      
      
      Initialize ngbe mac/phy type.
      Check whether the firmware is initialized.
      Initialize ngbe hw and register netdev.
      
      Signed-off-by: default avatarMengyuan Lou <mengyuanlou@net-swift.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      02338c48
    • Jiawen Wu's avatar
      net: txgbe: Add operations to interact with firmware · 049fe536
      Jiawen Wu authored
      
      
      Add firmware interaction to get EEPROM information.
      
      Signed-off-by: default avatarJiawen Wu <jiawenwu@trustnetic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      049fe536
    • Jiawen Wu's avatar
      net: libwx: Implement interaction with firmware · 1efa9bfe
      Jiawen Wu authored
      
      
      Add mailbox commands to interact with firmware.
      
      Signed-off-by: default avatarJiawen Wu <jiawenwu@trustnetic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1efa9bfe
    • Heng Qi's avatar
      veth: Avoid drop packets when xdp_redirect performs · 2e0de636
      Heng Qi authored
      
      
      In the current processing logic, when xdp_redirect occurs, it transmits
      the xdp frame based on napi.
      
      If napi of the peer veth is not ready, the veth will drop the packets.
      This doesn't meet our expectations.
      
      In this context, we enable napi of the peer veth automatically when the
      veth loads the xdp. Then if the veth unloads the xdp, we need to
      correctly judge whether to disable napi of the peer veth, because the peer
      veth may have loaded xdp, or even the user has enabled GRO.
      
      Signed-off-by: default avatarHeng Qi <henqqi@linux.alibaba.com>
      Reviewed-by: default avatarXuan Zhuo <xuanzhuo@linux.alibaba.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e0de636
    • Dmitry Vyukov's avatar
      nfc: Add KCOV annotations · 7e8cdc97
      Dmitry Vyukov authored
      
      
      Add remote KCOV annotations for NFC processing that is done
      in background threads. This enables efficient coverage-guided
      fuzzing of the NFC subsystem.
      
      The intention is to add annotations to background threads that
      process skb's that were allocated in syscall context
      (thus have a KCOV handle associated with the current fuzz test).
      This includes nci_recv_frame() that is called by the virtual nci
      driver in the syscall context.
      
      Signed-off-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Cc: Bongsu Jeon <bongsu.jeon@samsung.com>
      Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7e8cdc97
    • Shailend Chand's avatar
      gve: Reduce alloc and copy costs in the GQ rx path · 82fd151d
      Shailend Chand authored
      
      
      Previously, even if just one of the many fragments of a 9k packet
      required a copy, we'd copy the whole packet into a freshly-allocated
      9k-sized linear SKB, and this led to performance issues.
      
      By having a pool of pages to copy into, each fragment can be
      independently handled, leading to a reduced incidence of
      allocation and copy.
      
      Signed-off-by: default avatarShailend Chand <shailend@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      82fd151d
    • Shane Parslow's avatar
      net: wwan: iosm: add rpc interface for xmm modems · d08b0f8f
      Shane Parslow authored
      
      
      Add a new iosm wwan port that connects to the modem rpc interface. This
      interface provides a configuration channel, and in the case of the 7360, is
      the only way to configure the modem (as it does not support mbim).
      
      The new interface is compatible with existing software, such as
      open_xdatachannel.py from the xmm7360-pci project [1].
      
      [1] https://github.com/xmm7360/xmm7360-pci
      
      Signed-off-by: default avatarShane Parslow <shaneparslow808@gmail.com>
      Reviewed-by: default avatarLoic Poulain <loic.poulain@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d08b0f8f
    • M Chetan Kumar's avatar
      net: wwan: t7xx: Add port for modem logging · 3349e4a4
      M Chetan Kumar authored
      
      
      The Modem Logging (MDL) port provides an interface to collect modem
      logs for debugging purposes. MDL is supported by the relay interface,
      and the mtk_t7xx port infrastructure. MDL allows user-space apps to
      control logging via mbim command and to collect logs via the relay
      interface, while port infrastructure facilitates communication between
      the driver and the modem.
      
      Signed-off-by: default avatarMoises Veleta <moises.veleta@linux.intel.com>
      Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Signed-off-by: default avatarDevegowda Chandrashekar <chandrashekar.devegowda@intel.com>
      Acked-by: default avatarRicardo Martinez <ricardo.martinez@linux.intel.com>
      Reviewed-by: default avatarSergey Ryazanov <ryazanov.s.a@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3349e4a4
    • M Chetan Kumar's avatar
      net: wwan: t7xx: use union to group port type specific data · fece7a8c
      M Chetan Kumar authored
      
      
      Use union inside t7xx_port to group port type specific data members.
      
      Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Reviewed-by: default avatarSergey Ryazanov <ryazanov.s.a@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fece7a8c
    • Eric Dumazet's avatar
      tcp: refine tcp_prune_ofo_queue() logic · b0e01253
      Eric Dumazet authored
      After commits 36a6503f ("tcp: refine tcp_prune_ofo_queue()
      to not drop all packets") and 72cd43ba
      
      
      ("tcp: free batches of packets in tcp_prune_ofo_queue()")
      tcp_prune_ofo_queue() drops a fraction of ooo queue,
      to make room for incoming packet.
      
      However it makes no sense to drop packets that are
      before the incoming packet, in sequence space.
      
      In order to recover from packet losses faster,
      it makes more sense to only drop ooo packets
      which are after the incoming packet.
      
      Tested:
      packetdrill test:
         0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
         +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
         +0 setsockopt(3, SOL_SOCKET, SO_RCVBUF, [3800], 4) = 0
         +0 bind(3, ..., ...) = 0
         +0 listen(3, 1) = 0
      
         +0 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7>
         +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 0>
        +.1 < . 1:1(0) ack 1 win 1024
         +0 accept(3, ..., ...) = 4
      
       +.01 < . 200:300(100) ack 1 win 1024
         +0 > . 1:1(0) ack 1 <nop,nop, sack 200:300>
      
       +.01 < . 400:500(100) ack 1 win 1024
         +0 > . 1:1(0) ack 1 <nop,nop, sack 400:500 200:300>
      
       +.01 < . 600:700(100) ack 1 win 1024
         +0 > . 1:1(0) ack 1 <nop,nop, sack 600:700 400:500 200:300>
      
       +.01 < . 800:900(100) ack 1 win 1024
         +0 > . 1:1(0) ack 1 <nop,nop, sack 800:900 600:700 400:500 200:300>
      
       +.01 < . 1000:1100(100) ack 1 win 1024
         +0 > . 1:1(0) ack 1 <nop,nop, sack 1000:1100 800:900 600:700 400:500>
      
       +.01 < . 1200:1300(100) ack 1 win 1024
         +0 > . 1:1(0) ack 1 <nop,nop, sack 1200:1300 1000:1100 800:900 600:700>
      
      // this packet is dropped because we have no room left.
       +.01 < . 1400:1500(100) ack 1 win 1024
      
       +.01 < . 1:200(199) ack 1 win 1024
      // Make sure kernel did not drop 200:300 sequence
         +0 > . 1:1(0) ack 300 <nop,nop, sack 1200:1300 1000:1100 800:900 600:700>
      // Make room, since our RCVBUF is very small
         +0 read(4, ..., 299) = 299
      
       +.01 < . 300:400(100) ack 1 win 1024
         +0 > . 1:1(0) ack 500 <nop,nop, sack 1200:1300 1000:1100 800:900 600:700>
      
       +.01 < . 500:600(100) ack 1 win 1024
         +0 > . 1:1(0) ack 700 <nop,nop, sack 1200:1300 1000:1100 800:900>
      
         +0 read(4, ..., 400) = 400
      
       +.01 < . 700:800(100) ack 1 win 1024
         +0 > . 1:1(0) ack 900 <nop,nop, sack 1200:1300 1000:1100>
      
       +.01 < . 900:1000(100) ack 1 win 1024
         +0 > . 1:1(0) ack 1100 <nop,nop, sack 1200:1300>
      
       +.01 < . 1100:1200(100) ack 1 win 1024
      // This checks that 1200:1300 has not been removed from ooo queue
         +0 > . 1:1(0) ack 1300
      
      Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Link: https://lore.kernel.org/r/20221101035234.3910189-1-edumazet@google.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b0e01253
    • Dr. David Alan Gilbert's avatar
      net: core: inet[46]_pton strlen len types · 44827016
      Dr. David Alan Gilbert authored
      
      
      inet[46]_pton check the input length against
      a sane length limit (INET[6]_ADDRSTRLEN), but
      the strlen value gets truncated due to being stored in an int,
      so there's a theoretical potential for a >4G string to pass
      the limit test.
      Use size_t since that's what strlen actually returns.
      
      I've had a hunt for callers that could hit this, but
      I've not managed to find anything that doesn't get checked with
      some other limit first; but it's possible that I've missed
      something in the depth of the storage target paths.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <linux@treblig.org>
      Link: https://lore.kernel.org/r/20221029014604.114024-1-linux@treblig.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      44827016
  3. Nov 01, 2022