1. 29 6月, 2021 13 次提交
    • D
      Merge branch 'tipc-next' · c948b46a
      David S. Miller 提交于
      Menglong Dong says:
      
      ====================
      net: tipc: fix FB_MTU eat two pages and do some code cleanup
      
      In the first patch, FB_MTU is redefined to make sure data size will not
      exceed PAGE_SIZE. Besides, I removed the alignment for buf_size in
      tipc_buf_acquire, because skb_alloc_fclone will do the alignment job.
      
      In the second patch, I removed align() in msg.c and replace it with
      ALIGN().
      
      Changes since V5:
      - remove blank line after Fixes in commit log in the first patch
      
      Changes since V4:
      - remove ONE_PAGE_SKB_SZ and replace it with one_page_mtu in the first
        patch.
      - fix some code style problems for the second patch.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c948b46a
    • M
      net: tipc: replace align() with ALIGN in msg.c · d4cfb7fe
      Menglong Dong 提交于
      The function align() which is defined in msg.c is redundant, replace it
      with ALIGN() and introduce a BUF_ALIGN().
      Signed-off-by: NMenglong Dong <dong.menglong@zte.com.cn>
      Acked-by: NJon Maloy <jmaloy@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d4cfb7fe
    • M
      net: tipc: fix FB_MTU eat two pages · 0c6de0c9
      Menglong Dong 提交于
      FB_MTU is used in 'tipc_msg_build()' to alloc smaller skb when memory
      allocation fails, which can avoid unnecessary sending failures.
      
      The value of FB_MTU now is 3744, and the data size will be:
      
        (3744 + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) + \
          SKB_DATA_ALIGN(BUF_HEADROOM + BUF_TAILROOM + 3))
      
      which is larger than one page(4096), and two pages will be allocated.
      
      To avoid it, replace '3744' with a calculation:
      
        (PAGE_SIZE - SKB_DATA_ALIGN(BUF_OVERHEAD) - \
          SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
      
      What's more, alloc_skb_fclone() will call SKB_DATA_ALIGN for data size,
      and it's not necessary to make alignment for buf_size in
      tipc_buf_acquire(). So, just remove it.
      
      Fixes: 4c94cc2d ("tipc: fall back to smaller MTU if allocation of local send skb fails")
      Signed-off-by: NMenglong Dong <dong.menglong@zte.com.cn>
      Acked-by: NJon Maloy <jmaloy@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c6de0c9
    • D
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git · 1b077ce1
      David S. Miller 提交于
      /klassert/ipsec-next
      
      Steffen Klassert says:
      
      ====================
      pull request (net-next): ipsec-next 2021-06-28
      
      1) Remove an unneeded error assignment in esp4_gro_receive().
         From Yang Li.
      
      2) Add a new byseq state hashtable to find acquire states faster.
         From Sabrina Dubroca.
      
      3) Remove some unnecessary variables in pfkey_create().
         From zuoqilin.
      
      4) Remove the unused description from xfrm_type struct.
         From Florian Westphal.
      
      5) Fix a spelling mistake in the comment of xfrm_state_ok().
         From gushengxian.
      
      6) Replace hdr_off indirections by a small helper function.
         From Florian Westphal.
      
      7) Remove xfrm4_output_finish and xfrm6_output_finish declarations,
         they are not used anymore.From Antony Antony.
      
      8) Remove xfrm replay indirections.
         From Florian Westphal.
      
      Please pull or let me know if there are problems.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b077ce1
    • D
      Merge tag 'mac80211-next-for-net-next-2021-06-25' of... · 007b312c
      David S. Miller 提交于
      Merge tag 'mac80211-next-for-net-next-2021-06-25' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
      
      Johannes berg says:
      
      ====================
      Lots of changes:
       * aggregation handling improvements for some drivers
       * hidden AP discovery on 6 GHz and other HE 6 GHz
         improvements
       * minstrel improvements for no-ack frames
       * deferred rate control for TXQs to improve reaction
         times
       * virtual time-based airtime scheduler
       * along with various little cleanups/fixups
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      007b312c
    • M
      mptcp: fix 'masking a bool' warning · c4512c63
      Matthieu Baerts 提交于
      Dan Carpenter reported an issue introduced in
      commit fde56eea ("mptcp: refine mptcp_cleanup_rbuf") where a new
      boolean (ack_pending) is masked with 0x9.
      
      This is not the intention to ignore values by using a boolean. This
      variable should not have a 'bool' type: we should keep the 'u8' to allow
      this comparison.
      
      Fixes: fde56eea ("mptcp: refine mptcp_cleanup_rbuf")
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Acked-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c4512c63
    • D
      Merge branch 'reset-mac' · 8eb517a2
      David S. Miller 提交于
      Guillaume Nault says:
      
      ====================
      net: reset MAC header consistently across L3 virtual devices
      
      Some virtual L3 devices, like vxlan-gpe and gre (in collect_md mode),
      reset the MAC header pointer after they parsed the outer headers. This
      accurately reflects the fact that the decapsulated packet is pure L3
      packet, as that makes the MAC header 0 bytes long (the MAC and network
      header pointers are equal).
      
      However, many L3 devices only adjust the network header after
      decapsulation and leave the MAC header pointer to its original value.
      This can confuse other parts of the networking stack, like TC, which
      then considers the outer headers as one big MAC header.
      
      This patch series makes the following L3 tunnels behave like VXLAN-GPE:
      bareudp, ipip, sit, gre, ip6gre, ip6tnl, gtp.
      
      The case of gre is a bit special. It already resets the MAC header
      pointer in collect_md mode, so only the classical mode needs to be
      adjusted. However, gre also has a special case that expects the MAC
      header pointer to keep pointing to the outer header even after
      decapsulation. Therefore, patch 4 keeps an exception for this case.
      
      Ideally, we'd centralise the call to skb_reset_mac_header() in
      ip_tunnel_rcv(), to avoid manual calls in ipip (patch 2),
      sit (patch 3) and gre (patch 4). That's unfortunately not feasible
      currently, because of the gre special case discussed above that
      precludes us from resetting the MAC header unconditionally.
      
      The original motivation is to redirect bareudp packets to Ethernet
      devices (as described in patch 1). The rest of this series aims at
      bringing consistency across all L3 devices (apart from gre's special
      case unfortunately).
      
      Note: the gtp patch results from pure code inspection and has been
      compiled tested only.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8eb517a2
    • G
      gtp: reset mac_header after decap · b2d898c8
      Guillaume Nault 提交于
      For consistency with other L3 tunnel devices, reset the mac_header
      pointer after decapsulation. This makes the mac_header 0 bytes long,
      thus making it clear that this skb has no mac_header.
      
      Compile tested only.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b2d898c8
    • G
      ip6_tunnel: allow redirecting ip6gre and ipxip6 packets to eth devices · da5a2e49
      Guillaume Nault 提交于
      Reset the mac_header pointer even when the tunnel transports only L3
      data (in the ARPHRD_ETHER case, this is already done by eth_type_trans).
      This prevents other parts of the stack from mistakenly accessing the
      outer header after the packet has been decapsulated.
      
      In practice, this allows to push an Ethernet header to ipip6, ip6ip6,
      mplsip6 or ip6gre packets and redirect them to an Ethernet device:
      
        $ tc filter add dev ip6tnl0 ingress matchall       \
            action vlan push_eth dst_mac 00:00:5e:00:53:01 \
                                 src_mac 00:00:5e:00:53:00 \
            action mirred egress redirect dev eth0
      
      Without this patch, push_eth refuses to add an ethernet header because
      the skb appears to already have a MAC header.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da5a2e49
    • G
      gre: let mac_header point to outer header only when necessary · aab1e898
      Guillaume Nault 提交于
      Commit e271c7b4 ("gre: do not keep the GRE header around in collect
      medata mode") did reset the mac_header for the collect_md case. Let's
      extend this behaviour to classical gre devices as well.
      
      ipgre_header_parse() seems to be the only case that requires mac_header
      to point to the outer header. We can detect this case accurately by
      checking ->header_ops. For all other cases, we can reset mac_header.
      
      This allows to push an Ethernet header to ipgre packets and redirect
      them to an Ethernet device:
      
        $ tc filter add dev gre0 ingress matchall          \
            action vlan push_eth dst_mac 00:00:5e:00:53:01 \
                                 src_mac 00:00:5e:00:53:00 \
            action mirred egress redirect dev eth0
      
      Before this patch, this worked only for collect_md gre devices.
      Now this works for regular gre devices as well. Only the special case
      of gre devices that use ipgre_header_ops isn't supported.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aab1e898
    • G
      sit: allow redirecting ip6ip, ipip and mplsip packets to eth devices · 730eed27
      Guillaume Nault 提交于
      Even though sit transports L3 data (IPv6, IPv4 or MPLS) packets, it
      needs to reset the mac_header pointer, so that other parts of the stack
      don't mistakenly access the outer header after the packet has been
      decapsulated. There are two rx handlers to modify: ipip6_rcv() for the
      ip6ip mode and sit_tunnel_rcv() which is used to re-implement the ipip
      and mplsip modes of ipip.ko.
      
      This allows to push an Ethernet header to sit packets and redirect
      them to an Ethernet device:
      
        $ tc filter add dev sit0 ingress matchall          \
            action vlan push_eth dst_mac 00:00:5e:00:53:01 \
                                 src_mac 00:00:5e:00:53:00 \
            action mirred egress redirect dev eth0
      
      Without this patch, push_eth refuses to add an ethernet header because
      the skb appears to already have a MAC header.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      730eed27
    • G
      ipip: allow redirecting ipip and mplsip packets to eth devices · 7ad136fd
      Guillaume Nault 提交于
      Even though ipip transports IPv4 or MPLS packets, it needs to reset the
      mac_header pointer, so that other parts of the stack don't mistakenly
      access the outer header after the packet has been decapsulated.
      
      This allows to push an Ethernet header to ipip or mplsip packets and
      redirect them to an Ethernet device:
      
        $ tc filter add dev ipip0 ingress matchall         \
            action vlan push_eth dst_mac 00:00:5e:00:53:01 \
                                 src_mac 00:00:5e:00:53:00 \
            action mirred egress redirect dev eth0
      
      Without this patch, push_eth refuses to add an ethernet header because
      the skb appears to already have a MAC header.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ad136fd
    • G
      bareudp: allow redirecting bareudp packets to eth devices · 99c8719b
      Guillaume Nault 提交于
      Even though bareudp transports L3 data (typically IP or MPLS), it needs
      to reset the mac_header pointer, so that other parts of the stack don't
      mistakenly access the outer header after the packet has been
      decapsulated.
      
      This allows to push an Ethernet header to bareudp packets and redirect
      them to an Ethernet device:
      
        $ tc filter add dev bareudp0 ingress matchall      \
            action vlan push_eth dst_mac 00:00:5e:00:53:01 \
                                 src_mac 00:00:5e:00:53:00 \
            action mirred egress redirect dev eth0
      
      Without this patch, push_eth refuses to add an ethernet header because
      the skb appears to already have a MAC header.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99c8719b
  2. 26 6月, 2021 9 次提交
    • D
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue · ff8744b5
      David S. Miller 提交于
      Tony Nguyen says:
      
      ====================
      100GbE Intel Wired LAN Driver Updates 2021-06-25
      
      This series contains updates to ice driver only.
      
      Jesse adds support for tracepoints to aide in debugging.
      
      Maciej adds support for PTP auxiliary pin support.
      
      Victor removes the VSI info from the old aggregator when moving the VSI
      to another aggregator.
      
      Tony removes an unnecessary VSI assignment.
      
      Christophe Jaillet fixes a memory leak for failed allocation in
      ice_pf_dcb_cfg().
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ff8744b5
    • G
      net/smc: Ensure correct state of the socket in send path · 17081633
      Guvenc Gulce 提交于
      When smc_sendmsg() is called before the SMC socket initialization has
      completed, smc_tx_sendmsg() will access un-initialized fields of the
      SMC socket which results in a null-pointer dereference.
      Fix this by checking the socket state first in smc_tx_sendmsg().
      
      Fixes: e0e4b8fa ("net/smc: Add SMC statistics support")
      Reported-by: syzbot+5dda108b672b54141857@syzkaller.appspotmail.com
      Reviewed-by: NKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: NGuvenc Gulce <guvenc@linux.ibm.com>
      Signed-off-by: NKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      17081633
    • D
      Merge tag 'wireless-drivers-next-2021-06-25' of... · 4e3db44a
      David S. Miller 提交于
      Merge tag 'wireless-drivers-next-2021-06-25' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
      
      Kalle Valo says:
      
      ====================
      wireless-drivers-next patches for v5.14
      
      Second, and most likely the last, set of patches for v5.14. mt76 and
      iwlwifi have most patches in this round, but rtw88 also has some new
      features. Nothing special really standing out.
      
      mt76
      
      * mt7915 MSI support
      
      * disable ASPM on mt7915
      
      * mt7915 tx status reporting
      
      * mt7921 decap offload
      
      rtw88
      
      * beacon filter support
      
      * path diversity support
      
      * firmware crash information via devcoredump
      
      * quirks for disabling pci capabilities
      
      mt7601u
      
      * add USB ID for a XiaoDu WiFi Dongle
      
      ath11k
      
      * enable support for QCN9074 PCI devices
      
      brcmfmac
      
      * support parse country code map from DeviceTree
      
      iwlwifi
      
      * support for new hardware
      
      * support for BIOS control of 11ax enablement in Russia
      
      * support UNII4 band enablement from BIOS
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4e3db44a
    • M
      net: mdiobus: withdraw fwnode_mdbiobus_register · ac53c264
      Marcin Wojtas 提交于
      The newly implemented fwnode_mdbiobus_register turned out to be
      problematic - in case the fwnode_/of_/acpi_mdio are built as
      modules, a dependency cycle can be observed during the depmod phase of
      modules_install, eg.:
      
      depmod: ERROR: Cycle detected: fwnode_mdio -> of_mdio -> fwnode_mdio
      depmod: ERROR: Found 2 modules in dependency cycles!
      
      OR:
      
      depmod: ERROR: Cycle detected: acpi_mdio -> fwnode_mdio -> acpi_mdio
      depmod: ERROR: Found 2 modules in dependency cycles!
      
      A possible solution could be to rework fwnode_mdiobus_register,
      so that to merge the contents of acpi_mdiobus_register and
      of_mdiobus_register. However feasible, such change would
      be very intrusive and affect huge amount of the of_mdiobus_register
      users.
      
      Since there are currently 2 users of ACPI and MDIO
      (xgmac_mdio and mvmdio), withdraw the fwnode_mdbiobus_register
      and roll back to a simple 'if' condition in affected drivers.
      
      Fixes: 62a6ef6a ("net: mdiobus: Introduce fwnode_mdbiobus_register()")
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ac53c264
    • C
      ice: Fix a memory leak in an error handling path in 'ice_pf_dcb_cfg()' · b81c191c
      Christophe JAILLET 提交于
      If this 'kzalloc()' fails we must free some resources as in all the other
      error handling paths of this function.
      
      Fixes: 348048e7 ("ice: Implement iidc operations")
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      b81c191c
    • T
      ice: remove unnecessary VSI assignment · 70fa0a07
      Tony Nguyen 提交于
      ice_get_vf_vsi() is being called twice for the same VSI. Remove the
      unnecessary call/assignment.
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      70fa0a07
    • V
      ice: remove the VSI info from previous agg · 37c59206
      Victor Raj 提交于
      Remove the VSI info from previous aggregator after moving the VSI to a
      new aggregator.
      Signed-off-by: NVictor Raj <victor.raj@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      37c59206
    • M
      ice: add support for auxiliary input/output pins · 172db5f9
      Maciej Machnikowski 提交于
      The E810 device supports programmable pins for enabling both input and
      output events related to the PTP hardware clock. This includes both
      output signals with programmable period, as well as timestamping of
      events on input pins.
      
      Add support for enabling these using the CONFIG_PTP_1588_CLOCK
      interface.
      
      This allows programming the software defined pins to take advantage of
      the hardware clock features.
      Signed-off-by: NMaciej Machnikowski <maciej.machnikowski@intel.com>
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      172db5f9
    • D
      Add Mellanox BlueField Gigabit Ethernet driver · f92e1869
      David Thompson 提交于
      This patch adds build and driver logic for the "mlxbf_gige"
      Ethernet driver from Mellanox Technologies. The second
      generation BlueField SoC from Mellanox supports an
      out-of-band GigaBit Ethernet management port to the Arm
      subsystem.  This driver supports TCP/IP network connectivity
      for that port, and provides back-end routines to handle
      basic ethtool requests.
      
      The driver interfaces to the Gigabit Ethernet block of
      BlueField SoC via MMIO accesses to registers, which contain
      control information or pointers describing transmit and
      receive resources.  There is a single transmit queue, and
      the port supports transmit ring sizes of 4 to 256 entries.
      There is a single receive queue, and the port supports
      receive ring sizes of 32 to 32K entries. The transmit and
      receive rings are allocated from DMA coherent memory. There
      is a 16-bit producer and consumer index per ring to denote
      software ownership and hardware ownership, respectively.
      
      The main driver logic such as probe(), remove(), and netdev
      ops are in "mlxbf_gige_main.c".  Logic in "mlxbf_gige_rx.c"
      and "mlxbf_gige_tx.c" handles the packet processing for
      receive and transmit respectively.
      
      The logic in "mlxbf_gige_ethtool.c" supports the handling
      of some basic ethtool requests: get driver info, get ring
      parameters, get registers, and get statistics.
      
      The logic in "mlxbf_gige_mdio.c" is the driver controlling
      the Mellanox BlueField hardware that interacts with a PHY
      device via MDIO/MDC pins.  This driver does the following:
        - At driver probe time, it configures several BlueField MDIO
          parameters such as sample rate, full drive, voltage and MDC
        - It defines functions to read and write MDIO registers and
          registers the MDIO bus.
        - It defines the phy interrupt handler reporting a
          link up/down status change
        - This driver's probe is invoked from the main driver logic
          while the phy interrupt handler is registered in ndo_open.
      
      Driver limitations
        - Only supports 1Gbps speed
        - Only supports GMII protocol
        - Supports maximum packet size of 2KB
        - Does not support scatter-gather buffering
      
      Testing
        - Successful build of kernel for ARM64, ARM32, X86_64
        - Tested ARM64 build on FastModels & Palladium
        - Tested ARM64 build on several Mellanox boards that are built with
          the BlueField-2 SoC.  The testing includes coverage in the areas
          of networking (e.g. ping, iperf, ifconfig, route), file transfers
          (e.g. SCP), and various ethtool options relevant to this driver.
      Signed-off-by: NDavid Thompson <davthompson@nvidia.com>
      Signed-off-by: NAsmaa Mnebhi <asmaa@nvidia.com>
      Reviewed-by: NLiming Sun <limings@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f92e1869
  3. 25 6月, 2021 18 次提交