1. 02 Jul, 2020 19 commits
  2. 01 Jul, 2020 21 commits
    • Bruce Allan's avatar
      ice: replace single-element array used for C struct hack · 66486d89
      Bruce Allan authored
      Convert the pre-C90-extension "C struct hack" method (using a single-
      element array at the end of a structure for implementing variable-length
      types) to the preferred use of C99 flexible array member.
      
      Additional code cleanups were done near areas affected by this change.
      Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      66486d89
    • Bruce Allan's avatar
      ice: avoid unnecessary single-member variable-length structs · b3c38904
      Bruce Allan authored
      There are a number of structures that consist of a one-element array as the
      only struct member.  Some of those are unused so remove them. Others are
      used to index into a buffer/array consisting of a variable number of a
      different data or structure type.  Those are unnecessary since we can use
      simple pointer arithmetic or index directly into the buffer to access
      individual elements of the buffer/array.
      
      Additional code cleanups were done near areas affected by this change.
      Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      b3c38904
    • Jarod Wilson's avatar
      bonding: allow xfrm offload setup post-module-load · a3b658cf
      Jarod Wilson authored
      At the moment, bonding xfrm crypto offload can only be set up if the bonding
      module is loaded with active-backup mode already set. We need to be able to
      make this work with bonds set to AB after the bonding driver has already
      been loaded.
      
      So what's done here is:
      
      1) move #define BOND_XFRM_FEATURES to net/bonding.h so it can be used
      by both bond_main.c and bond_options.c
      2) set BOND_XFRM_FEATURES in bond_dev->hw_features universally, rather than
      only when loading in AB mode
      3) wire up xfrmdev_ops universally too
      4) disable BOND_XFRM_FEATURES in bond_dev->features if not AB
      5) exit early (non-AB case) from bond_ipsec_offload_ok, to prevent a
      performance hit from traversing into the underlying drivers
      5) toggle BOND_XFRM_FEATURES in bond_dev->wanted_features and call
      netdev_change_features() from bond_option_mode_set()
      
      In my local testing, I can change bonding modes back and forth on the fly,
      have hardware offload work when I'm in AB, and see no performance penalty
      to non-AB software encryption, despite having xfrm bits all wired up for
      all modes now.
      
      Fixes: 18cb261a ("bonding: support hardware encryption offload to slaves")
      Reported-by: default avatarHuy Nguyen <huyn@mellanox.com>
      CC: Saeed Mahameed <saeedm@mellanox.com>
      CC: Jay Vosburgh <j.vosburgh@gmail.com>
      CC: Veaceslav Falico <vfalico@gmail.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      CC: Jakub Kicinski <kuba@kernel.org>
      CC: Steffen Klassert <steffen.klassert@secunet.com>
      CC: Herbert Xu <herbert@gondor.apana.org.au>
      CC: netdev@vger.kernel.org
      CC: intel-wired-lan@lists.osuosl.org
      Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a3b658cf
    • Jacob Keller's avatar
      ice: implement snapshot for device capabilities · 8d7aab35
      Jacob Keller authored
      Add a new devlink region used for capturing a snapshot of the device
      capabilities buffer which is reported by the firmware over the AdminQ.
      This information can useful in debugging driver and firmware
      interactions.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      8d7aab35
    • David S. Miller's avatar
      Merge branch 'net-ipa-endpoint-configuration-updates' · 651f8bd4
      David S. Miller authored
      Alex Elder says:
      
      ====================
      net: ipa: endpoint configuration updates
      
      This series updates code that configures IPA endpoints.  The changes
      made mainly affect access to registers that are valid only for RX, or
      only for TX endpoints.
      
      The first three patches avoid writing endpoint registers if they are
      not defined to be valid.  The fourth patch slightly modifies the
      parameters for the offset macros used for these endpoint registers,
      to make it explicit when only some endpoints are valid.
      
      The last patch just tweaks one line of code so it uses a convention
      used everywhere else in the driver.
      
      Version 2 of this series eliminates some of the "assert()" comments
      that Jakub inquired about.  The ones removed will actually go away
      in an upcoming (not-yet-posted) patch series anyway.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      651f8bd4
    • Alex Elder's avatar
      net: ipa: HOL_BLOCK_EN_FMASK is a 1-bit mask · 547c8788
      Alex Elder authored
      The convention throughout the IPA driver is to directly use
      single-bit field mask values, rather than using (for example)
      u32_encode_bits() to set or clear them.
      
      Fix the one place that doesn't follow that convention, which sets
      HOL_BLOCK_EN_FMASK in ipa_endpoint_init_hol_block_enable().
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      547c8788
    • Alex Elder's avatar
      net: ipa: clarify endpoint register macro constraints · 8b97bcb7
      Alex Elder authored
      A handful of registers are valid only for RX endpoints, and some
      others are valid only for TX endpoints.  For these endpoints, add
      a comment above their defined offset macro that indicates the
      endpoints to which they apply.
      
      Extend the endpoint parameter naming convention as well, to make
      these constraints more explicit.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b97bcb7
    • Alex Elder's avatar
      net: ipa: mode register is TX only · 00b9102a
      Alex Elder authored
      The INIT_MODE endpoint configuration register is only valid for TX
      endpoints.  Rather than writing a zero to that register for RX
      endpoints, avoid writing the register at all.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00b9102a
    • Alex Elder's avatar
      net: ipa: metadata_mask register is RX only · 9b63f093
      Alex Elder authored
      The INIT_HDR_METADATA_MASK endpoint configuration register is only
      valid for RX endpoints.  Rather than writing a zero to that register
      for TX endpoints, avoid writing the register at all.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9b63f093
    • Alex Elder's avatar
      net: ipa: head-of-line block registers are RX only · f8d34dfd
      Alex Elder authored
      The INIT_HOL_BLOCK_EN and INIT_HOL_BLOCK_TIMER endpoint registers
      are only valid for RX endpoints.
      
      Have ipa_endpoint_modem_hol_block_clear_all() skip writing these
      registers for TX endpoints.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f8d34dfd
    • David S. Miller's avatar
      Merge branch 'net-ipa-small-improvements' · 21ddff5c
      David S. Miller authored
      Alex Elder says:
      
      ====================
      net: ipa: small improvements
      
      This series contains two patches that improve the error output
      that's reported when an error occurs while changing the state of a
      GSI channel or event ring.  The first ensures all such error
      conditions report an error, and the second simplifies the messages a
      little and ensures they are all consistent.
      
      A third (independent) patch gets rid of an unused symbol in the
      microcontroller code.
      
      Version 2 fixes two alignment problems pointed out by checkpatch.pl,
      as requested by Jakub Kicinski.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21ddff5c
    • Alex Elder's avatar
      net: ipa: kill IPA_MEM_UC_OFFSET · 722208ea
      Alex Elder authored
      The microcontroller shared memory area is at the beginning of the
      IPA resident memory.  IPA_MEM_UC_OFFSET was defined as the offset
      within that region where it's found, but it's 0, and it's never
      actually used.  Just get rid of the definition, and move some of the
      description it had to be above the definition of the ipa_uc_mem_area
      structure.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      722208ea
    • Alex Elder's avatar
      net: ipa: standarize more GSI error messages · 8463488a
      Alex Elder authored
      Make minor updates to error messages reported in "gsi.c":
        - Use local variables to reduce multi-line function calls
        - Don't use parentheses in messages
        - Do some slight rewording in a few cases
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8463488a
    • Alex Elder's avatar
      net: ipa: always report GSI state errors · a442b3c7
      Alex Elder authored
      We check the state of an event ring or channel both before and after
      any GSI command issued that will change that state.  In most--but
      not all--cases, if the state is something different than expected we
      report an error message.
      
      Add error messages where missing, so that all unexpected states
      provide information about what went wrong.  Drop the parentheses
      around the state value shown in all cases.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a442b3c7
    • David S. Miller's avatar
      Merge branch 'net-ipa-simple-refactorizations' · 6f6746d7
      David S. Miller authored
      Alex Elder says:
      
      ====================
      net: ipa: simple refactorizations
      
      This series makes three small changes to some endpoint configuration
      code.  The first uses a constant to represent the frequency of an
      internal clock used for timers in the IPA.  The second modifies a
      limit used so it matches Qualcomm's internal code.  And the third
      reworks a few lines of code, eliminating a multi-line function call.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f6746d7
    • Alex Elder's avatar
      net: ipa: reuse a local variable in ipa_endpoint_init_aggr() · 9e88cb5f
      Alex Elder authored
      Reuse the "limit" local variable in ipa_endpoint_init_aggr() when
      setting the aggregation size limit.  Simple cleanup.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e88cb5f
    • Alex Elder's avatar
      net: ipa: reduce aggregation time limit · 1d86652b
      Alex Elder authored
      Halve the time limit used when aggregation is enabled on an RX
      endpoint, to half a millisecond.
      
      Use DIV_ROUND_CLOSEST() to compute the value that represents the
      time period, to get better accuracy in the event the time limit is
      not an even multiple of the granularity.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1d86652b
    • Alex Elder's avatar
      net: ipa: rework ipa_aggr_granularity_val() · 317a5740
      Alex Elder authored
      The timer used for aggregation makes use of an internal 32 KHz clock.
      The granularity of the timer is programmed by a field whose value is
      computed by ipa_aggr_granularity_val().  Redefine the way that value
      is computed by using a new TIMER_FREQUENCY constant representing the
      underlying clock frequency.
      
      Add two BUILD_BUG_ON() calls to ensure the value used is valid.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      317a5740
    • David S. Miller's avatar
      Merge branch 'add-XDP-support-to-xen-netfront' · 8c964397
      David S. Miller authored
      Denis Kirjanov says:
      
      ====================
      xen networking: add XDP support to xen-netfront
      
      The first patch adds a new extra type to enable proper synchronization
      between an RX request/response pair.
      The second patch implements BFP interface for xen-netfront.
      The third patch enables extra space for XDP processing.
      
      v14:
      - fixed compilation warnings
      
      v13:
      - fixed compilation due to previous rename
      
      v12:
      - xen-netback: rename netfront_xdp_headroom to xdp_headroom
      
      v11:
      - add the new headroom constant to netif.h
      - xenbus_scanf check
      - lock a bulk of puckets in xennet_xdp_xmit()
      
      v10:
      - add a new xen_netif_extra_info type to enable proper synchronization
       between an RX request/response pair.
      - order local variable declarations
      
      v9:
      - assign an xdp program before switching to Reconfiguring
      - minor cleanups
      - address checkpatch issues
      
      v8:
      - add PAGE_POOL config dependency
      - keep the state of XDP processing in netfront_xdp_enabled
      - fixed allocator type in xdp_rxq_info_reg_mem_model()
      - minor cleanups in xen-netback
      
      v7:
      - use page_pool_dev_alloc_pages() on page allocation
      - remove the leftover break statement from netback_changed
      
      v6:
      - added the missing SOB line
      - fixed subject
      
      v5:
      - split netfront/netback changes
      - added a sync point between backend/frontend on switching to XDP
      - added pagepool API
      
      v4:
      - added verbose patch descriprion
      - don't expose the XDP headroom offset to the domU guest
      - add a modparam to netback to toggle XDP offset
      - don't process jumbo frames for now
      
      v3:
      - added XDP_TX support (tested with xdping echoserver)
      - added XDP_REDIRECT support (tested with modified xdp_redirect_kern)
      - moved xdp negotiation to xen-netback
      
      v2:
      - avoid data copying while passing to XDP
      - tell xen-netback that we need the headroom space
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8c964397
    • Denis Kirjanov's avatar
      xen networking: add XDP offset adjustment to xen-netback · 1c9535c7
      Denis Kirjanov authored
      the patch basically adds the offset adjustment and netfront
      state reading to make XDP work on netfront side.
      Reviewed-by: default avatarPaul Durrant <paul@xen.org>
      Signed-off-by: default avatarDenis Kirjanov <kda@linux-powerpc.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c9535c7
    • Denis Kirjanov's avatar
      xen networking: add basic XDP support for xen-netfront · 6c5aa6fc
      Denis Kirjanov authored
      The patch adds a basic XDP processing to xen-netfront driver.
      
      We ran an XDP program for an RX response received from netback
      driver. Also we request xen-netback to adjust data offset for
      bpf_xdp_adjust_head() header space for custom headers.
      
      synchronization between frontend and backend parts is done
      by using xenbus state switching:
      Reconfiguring -> Reconfigured- > Connected
      
      UDP packets drop rate using xdp program is around 310 kpps
      using ./pktgen_sample04_many_flows.sh and 160 kpps without the patch.
      Signed-off-by: default avatarDenis Kirjanov <kda@linux-powerpc.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c5aa6fc