1. 21 12月, 2021 22 次提交
  2. 18 12月, 2021 15 次提交
    • Y
      xdp: move the if dev statements to the first · f85b244e
      Yajun Deng 提交于
      The xdp_rxq_info_unreg() called by xdp_rxq_info_reg() is meaningless when
      dev is NULL, so move the if dev statements to the first.
      Signed-off-by: NYajun Deng <yajun.deng@linux.dev>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f85b244e
    • D
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue · 23044d77
      David S. Miller 提交于
      Tony Nguyen says:
      
      ====================
      40GbE Intel Wired LAN Driver Updates 2021-12-17
      
      Brett Creeley says:
      
      This patch series adds support in the iavf driver for communicating and
      using VIRTCHNL_VF_OFFLOAD_VLAN_V2. The current VIRTCHNL_VF_OFFLOAD_VLAN
      is very limited and covers all 802.1Q VLAN offloads and filtering with
      no granularity.
      
      The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 adds more granularity, flexibility,
      and support for 802.1ad offloads and filtering. This includes the VF
      negotiating which VLAN offloads/filtering it's allowed, where VLAN tags
      should be inserted and/or stripped into and from descriptors, and the
      supported VLAN protocols.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      23044d77
    • J
      Merge branch 'mptcp-miscellaneous-changes-for-5-17' · 7e1c5d7b
      Jakub Kicinski 提交于
      Mat Martineau says:
      
      ====================
      mptcp: Miscellaneous changes for 5.17
      
      These are three unrelated patches that we've been testing in the MPTCP
      tree.
      
      Patch 1 modifies the packet scheduler that picks which TCP subflow is
      used for each chunk of outgoing data. The updated scheduler improves
      throughput on multiple-subflow connections.
      
      Patch 2 updates a selftest to verify recent TCP_ULP sockopt changes
      on MPTCP fallback sockets.
      
      Patch 3 cleans up some unnecessary comparisons with an 8-bit value.
      ====================
      
      Link: https://lore.kernel.org/r/20211217233702.299461-1-mathew.j.martineau@linux.intel.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      7e1c5d7b
    • J
      mptcp: clean up harmless false expressions · 59060a47
      Jean Sacren 提交于
      entry->addr.id is u8 with a range from 0 to 255 and MAX_ADDR_ID is 255.
      We should drop both false expressions of (entry->addr.id > MAX_ADDR_ID).
      
      We should also remove the obsolete parentheses in the first if branch.
      
      Use U8_MAX for MAX_ADDR_ID and add a comment to show the link to
      mptcp_addr_info.id as suggested by Mr. Matthieu Baerts.
      Reviewed-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: NJean Sacren <sakiwit@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      59060a47
    • F
      selftests: mptcp: try to set mptcp ulp mode in different sk states · f730b65c
      Florian Westphal 提交于
      The kernel will crash without
      'mptcp: clear 'kern' flag from fallback sockets' change.
      
      Since this doesn't slow down testing in a noticeable way,
      run this unconditionally.
      
      The explicit test did not catch this, because the check was done
      for tcp socket returned by 'socket(.. IPPROTO_TCP) rather than a
      tcp socket returned by accept() on a mptcp listen fd.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      f730b65c
    • P
      mptcp: enforce HoL-blocking estimation · 3ce0852c
      Paolo Abeni 提交于
      The MPTCP packet scheduler has sub-optimal behavior with asymmetric
      subflows: if the faster subflow-level cwin is closed, the packet
      scheduler can enqueue "too much" data on a slower subflow.
      
      When all the data on the faster subflow is acked, if the mptcp-level
      cwin is closed, and link utilization becomes suboptimal.
      
      The solution is implementing blest-like[1] HoL-blocking estimation,
      transmitting only on the subflow with the shorter estimated time to
      flush the queued memory. If such subflows cwin is closed, we wait
      even if other subflows are available.
      
      This is quite simpler than the original blest implementation, as we
      leverage the pacing rate provided by the TCP socket. To get a more
      accurate estimation for the subflow linger-time, we maintain a
      per-subflow weighted average of such info.
      
      Additionally drop magic numbers usage in favor of newly defined
      macros and use more meaningful names for status variable.
      
      [1] http://dl.ifip.org/db/conf/networking/networking2016/1570234725.pdf
      
      Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/137Reviewed-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      3ce0852c
    • D
      net: ethernet: mtk_eth_soc: delete some dead code · ab9d0e21
      Dan Carpenter 提交于
      The debugfs_create_dir() function never returns NULL.  It does return
      error pointers but in normal situations like this there is no need to
      check for errors.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Link: https://lore.kernel.org/r/20211217071037.GE26548@kiliSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      ab9d0e21
    • D
      net: mtk_eth_soc: delete an unneeded variable · ddfbe18d
      Dan Carpenter 提交于
      There is already an "int err" declared at the start of the function so
      re-use that instead of declaring a shadow err variable.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Link: https://lore.kernel.org/r/20211217070735.GC26548@kiliSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      ddfbe18d
    • G
      tsnep: Fix s390 devm_ioremap_resource warning · 00315e16
      Gerhard Engleder 提交于
      The following warning is fixed with additional config dependencies:
      
      s390-linux-ld: drivers/net/ethernet/engleder/tsnep_main.o: in function `tsnep_probe':
      tsnep_main.c:(.text+0x1de6): undefined reference to `devm_ioremap_resource'
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NGerhard Engleder <gerhard@engleder-embedded.com>
      Link: https://lore.kernel.org/r/20211216200154.1520-1-gerhard@engleder-embedded.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      00315e16
    • B
      iavf: Restrict maximum VLAN filters for VIRTCHNL_VF_OFFLOAD_VLAN_V2 · 92fc5085
      Brett Creeley 提交于
      For VIRTCHNL_VF_OFFLOAD_VLAN, PF's would limit the number of VLAN
      filters a VF was allowed to add. However, by the time the opcode failed,
      the VLAN netdev had already been added. VIRTCHNL_VF_OFFLOAD_VLAN_V2
      added the ability for a PF to tell the VF how many VLAN filters it's
      allowed to add. Make changes to support that functionality.
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      92fc5085
    • B
      iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 offload enable/disable · 8afadd1c
      Brett Creeley 提交于
      The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability added support that allows
      the VF to support 802.1Q and 802.1ad VLAN insertion and stripping if
      successfully negotiated via VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS.
      Multiple changes were needed to support this new functionality.
      
      1. Added new aq_required flags to support any kind of VLAN stripping and
         insertion offload requests via virtchnl.
      
      2. Added the new method iavf_set_vlan_offload_features() that's
         used during VF initialization, VF reset, and iavf_set_features() to
         set the aq_required bits based on the current VLAN offload
         configuration of the VF's netdev.
      
      3. Added virtchnl handling for VIRTCHNL_OP_ENABLE_STRIPPING_V2,
         VIRTCHNL_OP_DISABLE_STRIPPING_V2, VIRTCHNL_OP_ENABLE_INSERTION_V2,
         and VIRTCHNL_OP_ENABLE_INSERTION_V2.
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      8afadd1c
    • B
      iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 hotpath · ccd219d2
      Brett Creeley 提交于
      The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability added support that allows
      the PF to set the location of the Tx and Rx VLAN tag for insertion and
      stripping offloads. In order to support this functionality a few changes
      are needed.
      
      1. Add a new method to cache the VLAN tag location based on negotiated
         capabilities for the Tx and Rx ring flags. This needs to be called in
         the initialization and reset paths.
      
      2. Refactor the transmit hotpath to account for the new Tx ring flags.
         When IAVF_TXR_FLAGS_VLAN_LOC_L2TAG2 is set, then the driver needs to
         insert the VLAN tag in the L2TAG2 field of the transmit descriptor.
         When the IAVF_TXRX_FLAGS_VLAN_LOC_L2TAG1 is set, then the driver needs
         to use the l2tag1 field of the data descriptor (same behavior as
         before).
      
      3. Refactor the iavf_tx_prepare_vlan_flags() function to simplify
         transmit hardware VLAN offload functionality by only depending on the
         skb_vlan_tag_present() function. This can be done because the OS
         won't request transmit offload for a VLAN unless the driver told the
         OS it's supported and enabled.
      
      4. Refactor the receive hotpath to account for the new Rx ring flags and
         VLAN ethertypes. This requires checking the Rx ring flags and
         descriptor status bits to determine the location of the VLAN tag.
         Also, since only a single ethertype can be supported at a time, check
         the enabled netdev features before specifying a VLAN ethertype in
         __vlan_hwaccel_put_tag().
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      ccd219d2
    • B
      iavf: Add support VIRTCHNL_VF_OFFLOAD_VLAN_V2 during netdev config · 48ccc43e
      Brett Creeley 提交于
      Based on VIRTCHNL_VF_OFFLOAD_VLAN_V2, the VF can now support more VLAN
      capabilities (i.e. 802.1AD offloads and filtering). In order to
      communicate these capabilities to the netdev layer, the VF needs to
      parse its VLAN capabilities based on whether it was able to negotiation
      VIRTCHNL_VF_OFFLOAD_VLAN or VIRTCHNL_VF_OFFLOAD_VLAN_V2 or neither of
      these.
      
      In order to support this, add the following functionality:
      
      iavf_get_netdev_vlan_hw_features() - This is used to determine the VLAN
      features that the underlying hardware supports and that can be toggled
      off/on based on the negotiated capabiltiies. For example, if
      VIRTCHNL_VF_OFFLOAD_VLAN_V2 was negotiated, then any capability marked
      with VIRTCHNL_VLAN_TOGGLE can be toggled on/off by the VF. If
      VIRTCHNL_VF_OFFLOAD_VLAN was negotiated, then only VLAN insertion and/or
      stripping can be toggled on/off.
      
      iavf_get_netdev_vlan_features() - This is used to determine the VLAN
      features that the underlying hardware supports and that should be
      enabled by default. For example, if VIRTHCNL_VF_OFFLOAD_VLAN_V2 was
      negotiated, then any supported capability that has its ethertype_init
      filed set should be enabled by default. If VIRTCHNL_VF_OFFLOAD_VLAN was
      negotiated, then filtering, stripping, and insertion should be enabled
      by default.
      
      Also, refactor iavf_fix_features() to take into account the new
      capabilities. To do this, query all the supported features (enabled by
      default and toggleable) and make sure the requested change is supported.
      If VIRTCHNL_VF_OFFLOAD_VLAN_V2 is successfully negotiated, there is no
      need to check VIRTCHNL_VLAN_TOGGLE here because the driver already told
      the netdev layer which features can be toggled via netdev->hw_features
      during iavf_process_config(), so only those features will be requested
      to change.
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      48ccc43e
    • B
      iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 negotiation · 209f2f9c
      Brett Creeley 提交于
      In order to support the new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability the
      VF driver needs to rework it's initialization state machine and reset
      flow. This has to be done because successful negotiation of
      VIRTCHNL_VF_OFFLOAD_VLAN_V2 requires the VF driver to perform a second
      capability request via VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS before
      configuring the adapter and its netdev.
      
      Add the VIRTCHNL_VF_OFFLOAD_VLAN_V2 bit when sending the
      VIRTHCNL_OP_GET_VF_RESOURECES message. The underlying PF will either
      support VIRTCHNL_VF_OFFLOAD_VLAN or VIRTCHNL_VF_OFFLOAD_VLAN_V2 or
      neither. Both of these offloads should never be supported together.
      
      Based on this, add 2 new states to the initialization state machine:
      
      __IAVF_INIT_GET_OFFLOAD_VLAN_V2_CAPS
      __IAVF_INIT_CONFIG_ADAPTER
      
      The __IAVF_INIT_GET_OFFLOAD_VLAN_V2_CAPS state is used to request/store
      the new VLAN capabilities if and only if VIRTCHNL_VLAN_OFFLOAD_VLAN_V2
      was successfully negotiated in the __IAVF_INIT_GET_RESOURCES state.
      
      The __IAVF_INIT_CONFIG_ADAPTER state is used to configure the
      adapter/netdev after the resource requests have finished. The VF will
      move into this state regardless of whether it successfully negotiated
      VIRTCHNL_VF_OFFLOAD_VLAN or VIRTCHNL_VF_OFFLOAD_VLAN_V2.
      
      Also, add a the new flag IAVF_FLAG_AQ_GET_OFFLOAD_VLAN_V2_CAPS and set
      it during VF reset. If VIRTCHNL_VF_OFFLOAD_VLAN_V2 was successfully
      negotiated then the VF will request its VLAN capabilities via
      VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS during the reset. This is needed
      because the PF may change/modify the VF's configuration during VF reset
      (i.e. modifying the VF's port VLAN configuration).
      
      This also, required the VF to call netdev_update_features() since its
      VLAN features may change during VF reset. Make sure to call this under
      rtnl_lock().
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      209f2f9c
    • B
      virtchnl: Add support for new VLAN capabilities · bd0b536d
      Brett Creeley 提交于
      Currently VIRTCHNL only allows for VLAN filtering and offloads to happen
      on a single 802.1Q VLAN. Add support to filter and offload on inner,
      outer, and/or inner + outer VLANs.
      
      This is done by introducing the new capability
      VIRTCHNL_VF_OFFLOAD_VLAN_V2. The flow to negotiate this new capability
      is shown below.
      
      1. VF - sets the VIRTCHNL_VF_OFFLOAD_VLAN_V2 bit in the
         virtchnl_vf_resource.vf_caps_flags during the
         VIRTCHNL_OP_GET_VF_RESOURCES request message. The VF should also set
         the VIRTCHNL_VF_OFFLOAD_VLAN bit in case the PF driver doesn't support
         the new capability.
      
      2. PF - sets the VLAN capability bit it supports in the
         VIRTCHNL_OP_GET_VF_RESOURCES response message. This will either be
         VIRTCHNL_VF_OFFLOAD_VLAN_V2, VIRTCHNL_VF_OFFLOAD_VLAN, or none.
      
      3. VF - If the VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability was ACK'd by the
         PF, then the VF needs to request the VLAN capabilities of the
         PF/Device by issuing a VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS request.
         If the VIRTCHNL_VF_OFFLOAD_VLAN capability was ACK'd then the VF
         knows only single 802.1Q VLAN filtering/offloads are supported. If no
         VLAN capability is ACK'd then the PF/Device doesn't support hardware
         VLAN filtering/offloads for this VF.
      
      4. PF - Populates the virtchnl_vlan_caps structure based on what it
         allows/supports for that VF and sends that response via
         VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS.
      
      After VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS is successfully negotiated
      the VF driver needs to interpret the capabilities supported by the
      underlying PF/Device. The VF will be allowed to filter/offload the
      inner 802.1Q, outer (various ethertype), inner 802.1Q + outer
      (various ethertypes), or none based on which fields are set.
      
      The VF will also need to interpret where the VLAN tag should be inserted
      and/or stripped based on the negotiated capabilities.
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      bd0b536d
  3. 17 12月, 2021 3 次提交