1. 06 Sep, 2017 4 commits
    • David S. Miller's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue · 66bed846
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2017-09-05
      
      This series contains fixes for i40e only.
      
      These two patches fix an issue where our nvmupdate tool does not work on RHEL 7.4
      and newer kernels, in fact, the use of the nvmupdate tool on newer kernels can
      cause the cards to be non-functional unless these patches are applied.
      
      Anjali reworks the locking around accessing the NVM so that NVM acquire timeouts
      do not occur which was causing the failed firmware updates.
      
      Jake correctly updates the wb_desc when reading the NVM through the AdminQ.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      66bed846
    • David S. Miller's avatar
    • Jacob Keller's avatar
      i40e: point wb_desc at the nvm_wb_desc during i40e_read_nvm_aq · 3c8f3e96
      Jacob Keller authored
      When introducing the functions to read the NVM through the AdminQ, we
      did not correctly mark the wb_desc.
      
      Fixes: 7073f46e ("i40e: Add AQ commands for NVM Update for X722", 2015-06-05)
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      3c8f3e96
    • Anjali Singhai Jain's avatar
      i40e: avoid NVM acquire deadlock during NVM update · 09f79fd4
      Anjali Singhai Jain authored
      X722 devices use the AdminQ to access the NVM, and this requires taking
      the AdminQ lock. Because of this, we lock the AdminQ during
      i40e_read_nvm(), which is also called in places where the lock is
      already held, such as the firmware update path which wants to lock once
      and then unlock when finished after performing several tasks.
      
      Although this should have only affected X722 devices, commit
      96a39aed ("i40e: Acquire NVM lock before reads on all devices",
      2016-12-02) added locking for all NVM reads, regardless of device
      family.
      
      This resulted in us accidentally causing NVM acquire timeouts on all
      devices, causing failed firmware updates which left the eeprom in
      a corrupt state.
      
      Create unsafe non-locked variants of i40e_read_nvm_word and
      i40e_read_nvm_buffer, __i40e_read_nvm_word and __i40e_read_nvm_buffer
      respectively. These variants will not take the NVM lock and are expected
      to only be called in places where the NVM lock is already held if
      needed.
      
      Since the only caller of i40e_read_nvm_buffer() was in such a path,
      remove it entirely in favor of the unsafe version. If necessary we can
      always add it back in the future.
      
      Additionally, we now need to hold the NVM lock in i40e_validate_checksum
      because the call to i40e_calc_nvm_checksum now assumes that the NVM lock
      is held. We can further move the call to read I40E_SR_SW_CHECKSUM_WORD
      up a bit so that we do not need to acquire the NVM lock twice.
      
      This should resolve firmware updates and also fix potential raise that
      could have caused the driver to report an invalid NVM checksum upon
      driver load.
      Reported-by: default avatarStefan Assmann <sassmann@kpanic.de>
      Fixes: 96a39aed ("i40e: Acquire NVM lock before reads on all devices", 2016-12-02)
      Signed-off-by: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      09f79fd4
  2. 05 Sep, 2017 30 commits
  3. 04 Sep, 2017 6 commits
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next · 2ff81cd3
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter updates for next-net (part 2)
      
      The following patchset contains Netfilter updates for net-next. This
      patchset includes updates for nf_tables, removal of
      CONFIG_NETFILTER_DEBUG and a new mode for xt_hashlimit. More
      specifically, they:
      
      1) Add new rate match mode for hashlimit, this introduces a new revision
         for this match. The idea is to stop matching packets until ratelimit
         criteria stands true. Patch from Vishwanath Pai.
      
      2) Add ->select_ops indirection to nf_tables named objects, so we can
         choose between different flavours of the same object type, patch from
         Pablo M. Bermudo.
      
      3) Shorter function names in nft_limit, basically:
         s/nft_limit_pkt_bytes/nft_limit_bytes, also from Pablo M. Bermudo.
      
      4) Add new stateful limit named object type, this allows us to create
         limit policies that you can identify via name, also from Pablo.
      
      5) Remove unused hooknum parameter in conntrack ->packet indirection.
         From Florian Westphal.
      
      6) Patches to remove CONFIG_NETFILTER_DEBUG and macros such as
         IP_NF_ASSERT and IP_NF_ASSERT. From Varsha Rao.
      
      7) Add nf_tables_updchain() helper function and use it from
         nf_tables_newchain() to make it more maintainable. Similarly,
         add nf_tables_addchain() and use it too.
      
      8) Add new netlink NLM_F_NONREC flag, this flag should only be used for
         deletion requests, specifically, to support non-recursive deletion.
         Based on what we discussed during NFWS'17 in Faro.
      
      9) Use NLM_F_NONREC from table and sets in nf_tables.
      
      10) Support for recursive chain deletion. Table and set deletion
          commands come with an implicit content flush on deletion, while
          chains do not. This patch addresses this inconsistency by adding
          the code to perform recursive chain deletions. This also comes with
          the bits to deal with the new NLM_F_NONREC netlink flag.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2ff81cd3
    • Pablo Neira Ayuso's avatar
      netfilter: nf_tables: support for recursive chain deletion · 9dee1474
      Pablo Neira Ayuso authored
      This patch sorts out an asymmetry in deletions. Currently, table and set
      deletion commands come with an implicit content flush on deletion.
      However, chain deletion results in -EBUSY if there is content in this
      chain, so no implicit flush happens. So you have to send a flush command
      in first place to delete chains, this is inconsistent and it can be
      annoying in terms of user experience.
      
      This patch uses the new NLM_F_NONREC flag to request non-recursive chain
      deletion, ie. if the chain to be removed contains rules, then this
      returns EBUSY. This problem was discussed during the NFWS'17 in Faro,
      Portugal. In iptables, you hit -EBUSY if you try to delete a chain that
      contains rules, so you have to flush first before you can remove
      anything. Since iptables-compat uses the nf_tables netlink interface, it
      has to use the NLM_F_NONREC flag from userspace to retain the original
      iptables semantics, ie.  bail out on removing chains that contain rules.
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      9dee1474
    • Pablo Neira Ayuso's avatar
      netfilter: nf_tables: use NLM_F_NONREC for deletion requests · a8278400
      Pablo Neira Ayuso authored
      Bail out if user requests non-recursive deletion for tables and sets.
      This new flags tells nf_tables netlink interface to reject deletions if
      tables and sets have content.
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      a8278400
    • Pablo Neira Ayuso's avatar
      netlink: add NLM_F_NONREC flag for deletion requests · 2335ba70
      Pablo Neira Ayuso authored
      In the last NFWS in Faro, Portugal, we discussed that netlink is lacking
      the semantics to request non recursive deletions, ie. do not delete an
      object iff it has child objects that hang from this parent object that
      the user requests to be deleted.
      
      We need this new flag to solve a problem for the iptables-compat
      backward compatibility utility, that runs iptables commands using the
      existing nf_tables netlink interface. Specifically, custom chains in
      iptables cannot be deleted if there are rules in it, however, nf_tables
      allows to remove any chain that is populated with content. To sort out
      this asymmetry, iptables-compat userspace sets this new NLM_F_NONREC
      flag to obtain the same semantics that iptables provides.
      
      This new flag should only be used for deletion requests. Note this new
      flag value overlaps with the existing:
      
      * NLM_F_ROOT for get requests.
      * NLM_F_REPLACE for new requests.
      
      However, those flags should not ever be used in deletion requests.
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      2335ba70
    • Pablo Neira Ayuso's avatar
      netfilter: nf_tables: add nf_tables_addchain() · 4035285f
      Pablo Neira Ayuso authored
      Wrap the chain addition path in a function to make it more maintainable.
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      4035285f
    • Pablo Neira Ayuso's avatar
      netfilter: nf_tables: add nf_tables_updchain() · 2c4a488a
      Pablo Neira Ayuso authored
      nf_tables_newchain() is too large, wrap the chain update path in a
      function to make it more maintainable.
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      2c4a488a