1. 01 Jul, 2020 10 commits
    • Magnus Karlsson's avatar
      i40e: optimize AF_XDP Tx completion path · 5574ff7b
      Magnus Karlsson authored
      Improve the performance of the AF_XDP zero-copy Tx completion
      path. When there are no XDP buffers being sent using XDP_TX or
      XDP_REDIRECT, we do not have go through the SW ring to clean up any
      entries since the AF_XDP path does not use these. In these cases, just
      fast forward the next-to-use counter and skip going through the SW
      ring. The limit on the maximum number of entries to complete is also
      removed since the algorithm is now O(1). To simplify the code path, the
      maximum number of entries to complete for the XDP path is therefore
      also increased from 256 to 512 (the default number of Tx HW
      descriptors). This should be fine since the completion in the XDP path
      is faster than in the SKB path that has 256 as the maximum number.
      
      This patch provides around 4% throughput improvement for the l2fwd
      application in xdpsock on my machine.
      Signed-off-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
      Reviewed-by: default avatarSridhar Samudrala <sridhar.samudrala@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      5574ff7b
    • Wei Yongjun's avatar
      iavf: fix error return code in iavf_init_get_resources() · 753f3884
      Wei Yongjun authored
      Fix to return negative error code -ENOMEM from the error handling
      case instead of 0, as done elsewhere in this function.
      
      Fixes: b66c7bc1 ("iavf: Refactor init state machine")
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      753f3884
    • Arkadiusz Kubalewski's avatar
      i40e: Add support for a new feature Total Port Shutdown · d5ec9e2c
      Arkadiusz Kubalewski authored
      After OS requests to down a link on a physical network port, the
      traffic is no longer being processed but the physical link with
      a link partner is still established.
      
      Currently there is a feature (Link down on close) which allows
      to physically bring the link down (after OS request).
      
      With this patch new feature with similar capability is introduced:
      TOTAL_PORT_SHUTDOWN
      Allows to physically disable the link on the NIC's port.
      If enabled, (after link down request from the OS)
      no link, traffic or led activity is possible on that port.
      
      If I40E_FLAG_TOTAL_PORT_SHUTDOWN is enabled, the
      I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED must be explicitly forced to
      true and cannot be disabled at that time.
      The functionalities are exclusive in terms of configuration, but
      they also have similar behavior (allowing to disable physical link
      of the port), with following differences:
      - LINK_DOWN_ON_CLOSE_ENABLED is configurable at host OS run-time
        and is supported by whole family of 7xx Intel Ethernet Controllers
      - TOTAL_PORT_SHUTDOWN may be enabled only before OS loads (in BIOS)
        only if motherboard's BIOS and NIC's FW has support of it
      - when LINK_DOWN_ON_CLOSE_ENABLED is used, the link is being brought
        down by sending phy_type=0 to NIC's FW
      - when TOTAL_PORT_SHUTDOWN is used, phy_type is not altered, instead
        the link is being brought down by clearing bit
        (I40E_AQ_PHY_ENABLE_LINK) in abilities field of
        i40e_aq_set_phy_config structure
      
      Introduced changes:
      - new private flag I40E_FLAG_TOTAL_PORT_SHUTDOWN for handling the
        feature
      - probe of NVM if the feature was enabled at driver's port
        initialization
      - special handling on link-down procedure to let FW physically
        shutdown the port if the feature was enabled
      Signed-off-by: default avatarArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Signed-off-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      d5ec9e2c
    • Jeff Kirsher's avatar
      ethernet/intel: Convert fallthrough code comments · 5463fce6
      Jeff Kirsher authored
      Convert all the remaining 'fall through" code comments to the newer
      'fallthrough;' keyword.
      Suggested-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      5463fce6
    • David S. Miller's avatar
      Merge branch 'cxgb4-add-mirror-action-support-for-TC-MATCHALL' · 2b04a661
      David S. Miller authored
      Rahul Lakkireddy says:
      
      ====================
      cxgb4: add mirror action support for TC-MATCHALL
      
      This series of patches add support to mirror all ingress traffic
      for TC-MATCHALL ingress offload.
      
      Patch 1 adds support to dynamically create a mirror Virtual Interface
      (VI) that accepts all mirror ingress traffic when mirror action is
      set in TC-MATCHALL offload.
      
      Patch 2 adds support to allocate mirror Rxqs and setup RSS for the
      mirror VI.
      
      Patch 3 adds support to replicate all the main VI configuration to
      mirror VI. This includes replicating MTU, promiscuous mode,
      all-multicast mode, and enabled netdev Rx feature offloads.
      
      v3:
      - Replace mirror VI refcount_t with normal u32 variable in all patches.
      - Add back calling cxgb4_port_mirror_start() in cxgb_open(), which
        was there in v1, but got missed in v2 during refactoring, in patch
        3.
      
      v2:
      - Add mutex to protect all mirror VI data, instead of just
        mirror Rxqs, in patch 1 and 2.
      - Remove the un-needed mirror Rxq mutex in patch 2.
      - Simplify the replication code by refactoring t4_set_rxmode()
        to handle mirror VI, instead of duplicating the t4_set_rxmode()
        calls in multiple places in patch 3.
      ====================
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b04a661
    • Rahul Lakkireddy's avatar
      cxgb4: add main VI to mirror VI config replication · 696c278f
      Rahul Lakkireddy authored
      When mirror VI is enabled, replicate various VI config params
      enabled on main VI to mirror VI. These include replicating MTU,
      promiscuous mode, all-multicast mode, and enabled netdev Rx
      feature offloads.
      
      v3:
      - Replace mirror VI refcount_t with normal u32 variable.
      - Add back calling cxgb4_port_mirror_start() in cxgb_open(), which
        was there in v1, but got missed in v2 during refactoring.
      
      v2:
      - Simplify the replication code by refactoring t4_set_rxmode()
        to handle mirror VI, instead of duplicating the t4_set_rxmode()
        calls in multiple places.
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      696c278f
    • Rahul Lakkireddy's avatar
      cxgb4: add support for mirror Rxqs · 2b465ed0
      Rahul Lakkireddy authored
      When mirror VI is enabled, allocate the mirror Rxqs and setup the
      mirror VI RSS table. The mirror Rxqs are allocated/freed when
      the mirror VI is created/destroyed or when underlying port is
      brought up/down, respectively.
      
      v3:
      - Replace mirror VI refcount_t with normal u32 variable.
      
      v2:
      - Use mutex to protect all mirror VI data, instead of just
        mirror Rxqs.
      - Remove the un-needed mirror Rxq mutex.
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b465ed0
    • Rahul Lakkireddy's avatar
      cxgb4: add mirror action to TC-MATCHALL offload · fd2261d8
      Rahul Lakkireddy authored
      Add mirror Virtual Interface (VI) support to receive all ingress
      mirror traffic from the underlying device. The mirror VI is
      created dynamically, if the TC-MATCHALL rule has a corresponding
      mirror action. Also request MSI-X vectors needed for the mirror VI
      Rxqs. If no vectors are available, then disable mirror VI support.
      
      v3:
      - Replace mirror VI refcount_t with normal u32 variable.
      
      v2:
      - Add mutex to protect all mirror VI data, instead of just
        mirror Rxqs.
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fd2261d8
    • Nathan Chancellor's avatar
      pcnet32: Mark PM functions as __maybe_unused · 75603a31
      Nathan Chancellor authored
      In certain configurations without power management support, the
      following warnings happen:
      
      ../drivers/net/ethernet/amd/pcnet32.c:2928:12: warning:
      'pcnet32_pm_resume' defined but not used [-Wunused-function]
       2928 | static int pcnet32_pm_resume(struct device *device_d)
            |            ^~~~~~~~~~~~~~~~~
      ../drivers/net/ethernet/amd/pcnet32.c:2916:12: warning:
      'pcnet32_pm_suspend' defined but not used [-Wunused-function]
       2916 | static int pcnet32_pm_suspend(struct device *device_d)
            |            ^~~~~~~~~~~~~~~~~~
      
      Mark these functions as __maybe_unused to make it clear to the compiler
      that this is going to happen based on the configuration, which is the
      standard for these types of functions.
      
      Fixes: a86688fb ("pcnet32: Convert to generic power management")
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      75603a31
    • Nathan Chancellor's avatar
      amd8111e: Mark PM functions as __maybe_unused · 0adcd298
      Nathan Chancellor authored
      In certain configurations without power management support, the
      following warnings happen:
      
      ../drivers/net/ethernet/amd/amd8111e.c:1623:12: warning:
      'amd8111e_resume' defined but not used [-Wunused-function]
       1623 | static int amd8111e_resume(struct device *dev_d)
            |            ^~~~~~~~~~~~~~~
      ../drivers/net/ethernet/amd/amd8111e.c:1584:12: warning:
      'amd8111e_suspend' defined but not used [-Wunused-function]
       1584 | static int amd8111e_suspend(struct device *dev_d)
            |            ^~~~~~~~~~~~~~~~
      
      Mark these functions as __maybe_unused to make it clear to the compiler
      that this is going to happen based on the configuration, which is the
      standard for these types of functions.
      
      Fixes: 2caf751f ("amd8111e: Convert to generic power management")
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0adcd298
  2. 30 Jun, 2020 30 commits