1. 23 Nov, 2019 10 commits
    • Edward Cree's avatar
      sfc: add statistics for ARFS · ca70bd42
      Edward Cree authored
      Report the number of successful and failed insertions, and also the
       current count of filters, to aid in tuning e.g. rps_flow_cnt.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      ca70bd42
    • Edward Cree's avatar
      sfc: suppress MCDI errors from ARFS · 0aa6608d
      Edward Cree authored
      In high connection count usage, the NIC's filter table may be filled with
       sufficiently many ARFS filters that further insertions fail.  As this
       does not represent a correctness issue, do not log the resulting MCDI
       errors.  Add a debug-level message under the (by default disabled)
       rx_status category instead; and take the opportunity to do a little extra
       expiry work.
      
      Since there are now multiple workitems able to call __efx_filter_rfs_expire
       on a given channel, it is possible for them to race and thus pass quotas
       which, combined, exceed rfs_filter_count.  Thus, don't WARN_ON if we loop
       all the way around the table with quota left over.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Tested-by: default avatarDavid Ahern <dahern@digitalocean.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      0aa6608d
    • Edward Cree's avatar
      sfc: change ARFS expiry mechanism · 8490e75c
      Edward Cree authored
      The old rfs_filters_added method for determining the quota could potentially
       allow the NIC to become filled with old filters, which never get tested for
       expiry.  Instead, explicitly make expiry check work depend on the number of
       filters installed, and don't count checking slots without filters in as
       doing work.  This guarantees that each filter will be checked for expiry at
       least once every thirty seconds (assuming the channel to which it belongs is
       NAPI polling actively) regardless of fill level.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Tested-by: default avatarDavid Ahern <dahern@digitalocean.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      8490e75c
    • Jakub Kicinski's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · c4f2cbd3
      Jakub Kicinski authored
      Jeff Kirsher says:
      
      ====================
      This series contains updates to the ice driver only.
      
      Bruce updates the driver to store the number of functions the device has
      so that it won't have to compute it when setting safe mode capabilities.
      Adds a check to adjust the reporting of capabilities for devices with
      more than 4 ports, which differ for devices with less than 4 ports.
      
      Brett adds a helper function to determine if the VF is allowed to do
      VLAN operations based on the host's VF configuration.  Also adds a new
      function that initializes VLAN stripping (enabled/disabled) for the VF
      based on the device supported capabilities.  Adds a check if the vector
      index is valid with the respect to the number of transmit and receive
      queues configured when we set coalesce settings for DCB.  Adds a check
      if the promisc_mask contains ICE_PROMISC_VLAN_RX or ICE_PROMISC_VLAN_TX
      so that VLAN 0 promiscuous rules to be removed.  Add a helper macro for
      a commonly used de-reference of a pointer to &pf->dev->pdev.
      
      Jesse fixes an issue where if an invalid virtchnl request from the VF,
      the driver would return uninitialized data to the VF from the PF stack,
      so ensure the stack variable is initialized earlier.  Add helpers to the
      virtchnl interface make the reporting of strings consistent and help
      reduce stack space.  Implements VF statistics gathering via the kernel
      ndo_get_vf_stats().
      
      Akeem ensures we disable the state flag for each VF when its resources
      are returned to the device.
      
      Tony does additional cleanup in the driver to ensure the when we
      allocate and free memory within the same function, we should not be
      using devm_* variants; use regular alloc and free functions.
      
      Henry implements code to query and set the number of channels on the
      primary VSI for a PF via ethtool.
      
      Jake cleans up needless NULL checks in ice_sched_cleanup_all().
      
      Kevin updates the firmware API version to align with current NVM images.
      
      v2: Added "Fixes:" tag to patch 5 commit description and added the use
          of netif_is_rxfh_configured() in patch 13 to see if RSS has been
          configured by the user, if so do not overwrite that configuration.
      ====================
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      c4f2cbd3
    • Maciej Żenczykowski's avatar
      net: inet_is_local_reserved_port() should return bool not int · 30429fba
      Maciej Żenczykowski authored
      Cc: Eric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      30429fba
    • Jakub Kicinski's avatar
      Merge branch 'cxgb4-add-udp-segmentation-offload-support' · 091189ab
      Jakub Kicinski authored
      Rahul Lakkireddy says:
      
      ====================
      This series of patches add UDP Segmentation Offload (USO) supported
      by Chelsio T5/T6 NICs.
      
      Patch 1 updates the current Scatter Gather List (SGL) DMA unmap logic
      for USO requests.
      
      Patch 2 adds USO support for NIC and MQPRIO QoS offload Tx path.
      
      Patch 3 adds missing stats for MQPRIO QoS offload Tx path.
      ====================
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      091189ab
    • Rahul Lakkireddy's avatar
      cxgb4: add stats for MQPRIO QoS offload Tx path · 8311f0be
      Rahul Lakkireddy authored
      Export necessary stats for traffic flowing through MQPRIO QoS offload
      Tx path.
      
      v2:
      - No change.
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      8311f0be
    • Rahul Lakkireddy's avatar
      cxgb4: add UDP segmentation offload support · 1a2a14fb
      Rahul Lakkireddy authored
      Implement and export UDP segmentation offload (USO) support for both
      NIC and MQPRIO QoS offload Tx path. Update appropriate logic in Tx to
      parse GSO info in skb and configure FW_ETH_TX_EO_WR request needed to
      perform USO.
      
      v2:
      - Remove inline keyword from write_eo_udp_wr() in sge.c. Let the
        compiler decide.
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      1a2a14fb
    • Rahul Lakkireddy's avatar
      cxgb4/chcr: update SGL DMA unmap for USO · 0ed96b46
      Rahul Lakkireddy authored
      The FW_ETH_TX_EO_WR used for sending UDP Segmentation Offload (USO)
      requests expects the headers to be part of the descriptor and the
      payload to be part of the SGL containing the DMA mapped addresses.
      Hence, the DMA address in the first entry of the SGL can start after
      the packet headers. Currently, unmap_sgl() tries to unmap from this
      wrong offset, instead of the originally mapped DMA address.
      
      So, use existing unmap_skb() instead, which takes originally saved DMA
      addresses as input. Update all necessary Tx paths to save the original
      DMA addresses, so that unmap_skb() can unmap them properly.
      
      v2:
      - No change.
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      0ed96b46
    • Jakub Kicinski's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · a9f852e9
      Jakub Kicinski authored
      Minor conflict in drivers/s390/net/qeth_l2_main.c, kept the lock
      from commit c8183f54 ("s390/qeth: fix potential deadlock on
      workqueue flush"), removed the code which was removed by commit
      9897d583 ("s390/qeth: consolidate some duplicated HW cmd code").
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      a9f852e9
  2. 22 Nov, 2019 30 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 34c36f45
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Validate tunnel options length in act_tunnel_key, from Xin Long.
      
       2) Fix DMA sync bug in gve driver, from Adi Suresh.
      
       3) TSO kills performance on some r8169 chips due to HW issues, disable
          by default in that case, from Corinna Vinschen.
      
       4) Fix clock disable mismatch in fec driver, from Chubong Yuan.
      
       5) Fix interrupt status bits define in hns3 driver, from Huazhong Tan.
      
       6) Fix workqueue deadlocks in qeth driver, from Julian Wiedmann.
      
       7) Don't napi_disable() twice in r8152 driver, from Hayes Wang.
      
       8) Fix SKB extension memory leak, from Florian Westphal.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (54 commits)
        r8152: avoid to call napi_disable twice
        MAINTAINERS: Add myself as maintainer of virtio-vsock
        udp: drop skb extensions before marking skb stateless
        net: rtnetlink: prevent underflows in do_setvfinfo()
        can: m_can_platform: remove unnecessary m_can_class_resume() call
        can: m_can_platform: set net_device structure as driver data
        hv_netvsc: Fix send_table offset in case of a host bug
        hv_netvsc: Fix offset usage in netvsc_send_table()
        net-ipv6: IPV6_TRANSPARENT - check NET_RAW prior to NET_ADMIN
        sfc: Only cancel the PPS workqueue if it exists
        nfc: port100: handle command failure cleanly
        net-sysfs: fix netdev_queue_add_kobject() breakage
        r8152: Re-order napi_disable in rtl8152_close
        net: qca_spi: Move reset_count to struct qcaspi
        net: qca_spi: fix receive buffer size check
        net/ibmvnic: Ignore H_FUNCTION return from H_EOI to tolerate XIVE mode
        Revert "net/ibmvnic: Fix EOI when running in XIVE mode"
        net/mlxfw: Verify FSM error code translation doesn't exceed array size
        net/mlx5: Update the list of the PCI supported devices
        net/mlx5: Fix auto group size calculation
        ...
      34c36f45
    • Marc Dionne's avatar
      afs: Fix large file support · b485275f
      Marc Dionne authored
      By default s_maxbytes is set to MAX_NON_LFS, which limits the usable
      file size to 2GB, enforced by the vfs.
      
      Commit b9b1f8d5 ("AFS: write support fixes") added support for the
      64-bit fetch and store server operations, but did not change this value.
      As a result, attempts to write past the 2G mark result in EFBIG errors:
      
       $ dd if=/dev/zero of=foo bs=1M count=1 seek=2048
       dd: error writing 'foo': File too large
      
      Set s_maxbytes to MAX_LFS_FILESIZE.
      
      Fixes: b9b1f8d5 ("AFS: write support fixes")
      Signed-off-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b485275f
    • Marc Dionne's avatar
      afs: Fix possible assert with callbacks from yfs servers · cd340703
      Marc Dionne authored
      Servers sending callback breaks to the YFS_CM_SERVICE service may
      send up to YFSCBMAX (1024) fids in a single RPC.  Anything over
      AFSCBMAX (50) will cause the assert in afs_break_callbacks to trigger.
      
      Remove the assert, as the count has already been checked against
      the appropriate max values in afs_deliver_cb_callback and
      afs_deliver_yfs_cb_callback.
      
      Fixes: 35dbfba3 ("afs: Implement the YFS cache manager service")
      Signed-off-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cd340703
    • Kevin Scott's avatar
      ice: Update FW API minor version · ed960c1d
      Kevin Scott authored
      Update FW API minor version to align to current value advertised
      by FW in new NVM images.
      Signed-off-by: default avatarKevin Scott <kevin.c.scott@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      ed960c1d
    • Jacob Keller's avatar
      ice: remove pointless NULL check of port_info · 1748ce80
      Jacob Keller authored
      The code in ice_sched_cleanup_all checks whether the port info is NULL
      prior to calling ice_sched_clear_port. However, ice_sched_clear_port
      already checks whether port info is non-NULL.
      
      More importantly, it also checks whether the port structure has been
      initialized by checking its port_state field as well.
      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>
      1748ce80
    • Henry Tieman's avatar
      ice: Implement ethtool ops for channels · 87324e74
      Henry Tieman authored
      Add code to query and set the number of channels on the primary VSI for a
      PF. This is accessed from the 'ethtool -l' and 'ethtool -L' commands,
      respectively.  Though the ice driver supports asymmetric queues report an
      IRQ vector that has both Rx and Tx queues attached and is counted as a
      'combined' channel.
      Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
      Co-developed-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      87324e74
    • Jesse Brandeburg's avatar
      ice: implement VF stats NDO · 730fdea4
      Jesse Brandeburg authored
      Implement the VF stats gathering via the kernel via ndo_get_vf_stats().
      The driver will show per-VF stats in the output of the
      ip -s link show dev <PF> command.
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      730fdea4
    • Jesse Brandeburg's avatar
      ice: add helpers for virtchnl · 4c66d227
      Jesse Brandeburg authored
      The virtchannel interface was repeating a lot of strings
      and wasting storage space in the kernel.  There was also
      inconsistent messages for the same thing.  Consolidate all
      those messages and bit checks into a couple of helper functions.
      
      Also, reduce stack space usage by simplifying getting the pointer
      to the pf using a helper.
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Co-developed-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4c66d227
    • Brett Creeley's avatar
      ice: Add ice_pf_to_dev(pf) macro · 4015d11e
      Brett Creeley authored
      We use &pf->dev->pdev all over the code. Add a simple
      macro to do this for us. When multiple de-references
      like this are being done add a local struct device
      variable.
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4015d11e
    • Tony Nguyen's avatar
      ice: Do not use devm* functions for local uses · 9efe35d0
      Tony Nguyen authored
      In situations where we alloc and free memory within the same function do
      not use the devm_* variants; use regular alloc and free functions. Remove
      any unused vars if there are no usages after these changes.
      
      Also, replace an allocate and copy with kmemdup() and remove an
      unnecessary memset() to 0 after a kzalloc().
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9efe35d0
    • Brett Creeley's avatar
      ice: Refactor removal of VLAN promiscuous rules · 1bc7a4ab
      Brett Creeley authored
      Currently ice_clear_vsi_promisc() detects if the VLAN ID sent is not 0
      and sets the recipe_id to ICE_SW_LKUP_PROMISC_VLAN in that case and
      ICE_SW_LKUP_PROMISC if the VLAN_ID is 0. However this doesn't allow VLAN
      0 promiscuous rules to be removed, but they can be added. Fix this by
      checking if the promisc_mask contains ICE_PROMISC_VLAN_RX or
      ICE_PROMISC_VLAN_TX. This change was made to match what is being done
      for ice_set_vsi_promisc().
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1bc7a4ab
    • Brett Creeley's avatar
      ice: Fix setting coalesce to handle DCB configuration · e25f9152
      Brett Creeley authored
      Currently there can be a case where a DCB map is applied and there are
      more interrupt vectors (vsi->num_q_vectors) than Rx queues (vsi->num_rxq)
      and Tx queues (vsi->num_txq). If we try to set coalesce settings in this
      case it will report a false failure. Fix this by checking if vector index
      is valid with respect to the number of Tx and Rx queues configured.
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e25f9152
    • Akeem G Abodunrin's avatar
      ice: Only disable VF state when freeing each VF resources · 1f9639d2
      Akeem G Abodunrin authored
      It is wrong to set PF disable state flag for all VFs when freeing VF
      resources - Instead, we should set VF disable state flag for each VF with
      its resources being returned to the device. Right now, all VF opcodes,
      mailbox communication to clear its resources as well fails - since we
      already indicate that PF is in disable state, with all VFs not active. In
      addition, we don't need to notify VF that PF is intending to reset it, if
      it is already in disabled state.
      Signed-off-by: default avatarAkeem G Abodunrin <akeem.g.abodunrin@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1f9639d2
    • Jesse Brandeburg's avatar
      ice: fix stack leakage · 949375de
      Jesse Brandeburg authored
      In the case of an invalid virtchannel request the driver
      would return uninitialized data to the VF from the PF stack
      which is a bug.  Fix by initializing the stack variable
      earlier in the function before any return paths can be taken.
      
      Fixes: 1071a835 ("ice: Implement virtchnl commands for AVF support")
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      949375de
    • Brett Creeley's avatar
      ice: Don't modify stripping for add/del VLANs on VF · 2f9ec241
      Brett Creeley authored
      Currently when adding/deleting vlans in ice_vc_process_vlan_msg()
      we are calling ice_vsi_manage_vlan_stripping() to enable/disable
      when adding and deleting a VLAN respectively. This is wrong
      because adding/deleting VLANs has nothing to do with configuring
      VLAN stripping. VLAN stripping is configured through the
      following VIRTCHNL operations:
      	VIRTCHNL_OP_ENABLE_VLAN_STRIPPING
      	VIRTCHNL_OP_DISABLE_VLAN_STRIPPING
      
      Unfortunately we can't just remove this because then stripping
      will never be configured on VF initialization. Fix this by
      adding a new function that initializes (disables/enables) VLAN
      stripping for the VF based on the device supported capabilities.
      This allows us to remove the call to
      ice_vsi_manage_vlan_stripping() in ice_vc_process_vlan_msg().
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      2f9ec241
    • Brett Creeley's avatar
      ice: Disallow VF VLAN opcodes if VLAN offloads disabled · d4bc4e2d
      Brett Creeley authored
      Currently if the host disables VLAN offloads on the VF by
      not setting the VIRTCHNL_VF_OFFLOAD_VLAN capability bit
      we will still honor VF VLAN configuration messages over
      VIRTCHNL. These messages (i.e. enable/disable VLAN stripping
      and VLAN filtering) should be blocked when the feature
      is not supported. Fix that by adding a helper function to
      determine if the VF is allowed to do VLAN operations based
      on the host's VF configuration.
      
      Also, mirror the VF communicated capabilities in the host's
      VF configuration.
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d4bc4e2d
    • Bruce Allan's avatar
      ice: Correct capabilities reporting of max TCs · 9164f761
      Bruce Allan authored
      Firmware always returns 8 as the max number of supported TCs. However on
      devices with more than 4 ports, the maximum number of TCs per port is
      limited to 4. Check and, if necessary, correct the reporting of
      capabilities for devices with more than 4 ports.
      Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9164f761
    • Bruce Allan's avatar
      ice: Store number of functions for the device · eae1bbb2
      Bruce Allan authored
      Store the number of functions the device has and use this number when
      setting safe mode capabilities instead of calculating it.
      Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
      Co-developed-by: default avatarKevin Scott <kevin.c.scott@intel.com>
      Signed-off-by: default avatarKevin Scott <kevin.c.scott@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      eae1bbb2
    • Chen Wandun's avatar
      net: dsa: ocelot: fix "should it be static?" warnings · 3243e04a
      Chen Wandun authored
      Fix following sparse warnings:
      drivers/net/dsa/ocelot/felix.c:351:6: warning: symbol 'felix_txtstamp' was not declared. Should it be static?
      Signed-off-by: default avatarChen Wandun <chenwandun@huawei.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3243e04a
    • Hayes Wang's avatar
      r8152: avoid to call napi_disable twice · 5b1d9c17
      Hayes Wang authored
      Call napi_disable() twice would cause dead lock. There are three situations
      may result in the issue.
      
      1. rtl8152_pre_reset() and set_carrier() are run at the same time.
      2. Call rtl8152_set_tunable() after rtl8152_close().
      3. Call rtl8152_set_ringparam() after rtl8152_close().
      
      For #1, use the same solution as commit 84811412 ("r8152: Re-order
      napi_disable in rtl8152_close"). For #2 and #3, add checking the flag
      of IFF_UP and using napi_disable/napi_enable during mutex.
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b1d9c17
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · cc079039
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "Three fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm/ksm.c: don't WARN if page is still mapped in remove_stable_node()
        mm/memory_hotplug: don't access uninitialized memmaps in shrink_zone_span()
        Revert "fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry()"
      cc079039
    • Andrea Mayer's avatar
      seg6: allow local packet processing for SRv6 End.DT6 behavior · fd1fef0c
      Andrea Mayer authored
      End.DT6 behavior makes use of seg6_lookup_nexthop() function which drops
      all packets that are destined to be locally processed. However, DT* should
      be able to deliver decapsulated packets that are destined to local
      addresses. Function seg6_lookup_nexthop() is also used by DX6, so in order
      to maintain compatibility I created another routing helper function which
      is called seg6_lookup_any_nexthop(). This function is able to take into
      account both packets that have to be processed locally and the ones that
      are destined to be forwarded directly to another machine. Hence,
      seg6_lookup_any_nexthop() is used in DT6 rather than seg6_lookup_nexthop()
      to allow local delivery.
      Signed-off-by: default avatarAndrea Mayer <andrea.mayer@uniroma2.it>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fd1fef0c
    • Petr Machata's avatar
      net: flow_dissector: Wrap unionized VLAN fields in a struct · d1746d1e
      Petr Machata authored
      In commit a82055af ("netfilter: nft_payload: add VLAN offload
      support"), VLAN fields in struct flow_dissector_key_vlan were unionized
      with the intention of introducing another field that covered the whole TCI
      header. However without a wrapping struct the subfields end up sharing the
      same bits. As a result, "tc filter add ... flower vlan_id 14" specifies not
      only vlan_id, but also vlan_priority.
      
      Fix by wrapping the individual VLAN fields in a struct.
      
      Fixes: a82055af ("netfilter: nft_payload: add VLAN offload support")
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d1746d1e
    • David S. Miller's avatar
      Merge tag 'linux-can-fixes-for-5.4-20191122' of... · 06829937
      David S. Miller authored
      Merge tag 'linux-can-fixes-for-5.4-20191122' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2019-11-22
      
      this is a pull request of 2 patches for net/master, if possible for the
      current release cycle. Otherwise these patches should hit v5.4 via the
      stable tree.
      
      Both patches of this pull request target the m_can driver. Pankaj Sharma
      fixes the fallout in the m_can_platform part, which appeared with the
      introduction of the m_can platform framework.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06829937
    • David S. Miller's avatar
      Merge tag 'mac80211-next-for-net-next-2019-11-22' of... · 4bbb02f1
      David S. Miller authored
      Merge tag 'mac80211-next-for-net-next-2019-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
      
      Johannes Berg says:
      
      ====================
      The interesting new thing here is AQL, the Airtime Queue Limit
      patchset from Kan Yan (Google) and Toke Høiland-Jørgensen (Redhat).
      The effect is intended to eventually be similar to BQL, but byte
      queue limits are not useful in wifi where the actual throughput can
      vary by around 4 orders of magnitude. There are more details in the
      patches themselves.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4bbb02f1
    • Stefano Garzarella's avatar
      MAINTAINERS: Add myself as maintainer of virtio-vsock · efabb6c6
      Stefano Garzarella authored
      Since I'm actively working on vsock and virtio/vhost transports,
      Stefan suggested to help him to maintain it.
      Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      efabb6c6
    • Tuong Lien's avatar
      tipc: support in-order name publication events · 41b416f1
      Tuong Lien authored
      It is observed that TIPC service binding order will not be kept in the
      publication event report to user if the service is subscribed after the
      bindings.
      
      For example, services are bound by application in the following order:
      
      Server: bound port A to {18888,66,66} scope 2
      Server: bound port A to {18888,33,33} scope 2
      
      Now, if a client subscribes to the service range (e.g. {18888, 0-100}),
      it will get the 'TIPC_PUBLISHED' events in that binding order only when
      the subscription is started before the bindings.
      Otherwise, if started after the bindings, the events will arrive in the
      opposite order:
      
      Client: received event for published {18888,33,33}
      Client: received event for published {18888,66,66}
      
      For the latter case, it is clear that the bindings have existed in the
      name table already, so when reported, the events' order will follow the
      order of the rbtree binding nodes (- a node with lesser 'lower'/'upper'
      range value will be first).
      
      This is correct as we provide the tracking on a specific service status
      (available or not), not the relationship between multiple services.
      However, some users expect to see the same order of arriving events
      irrespective of when the subscription is issued. This turns out to be
      easy to fix. We now add functionality to ensure that publication events
      always are issued in the same temporal order as the corresponding
      bindings were performed.
      
      v2: replace the unnecessary macro - 'publication_after()' with inline
      function.
      v3: reuse 'time_after32()' instead of reinventing the same exact code.
      Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarTuong Lien <tuong.t.lien@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41b416f1
    • Hoang Le's avatar
      tipc: update replicast capability for broadcast send link · ba5f6a86
      Hoang Le authored
      When setting up a cluster with non-replicast/replicast capability
      supported. This capability will be disabled for broadcast send link
      in order to be backwards compatible.
      
      However, when these non-support nodes left and be removed out the cluster.
      We don't update this capability on broadcast send link. Then, some of
      features that based on this capability will also disabling as unexpected.
      
      In this commit, we make sure the broadcast send link capabilities will
      be re-calculated as soon as a node removed/rejoined a cluster.
      Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarHoang Le <hoang.h.le@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ba5f6a86
    • Florian Westphal's avatar
      udp: drop skb extensions before marking skb stateless · 677bf08c
      Florian Westphal authored
      Once udp stack has set the UDP_SKB_IS_STATELESS flag, later skb free
      assumes all skb head state has been dropped already.
      
      This will leak the extension memory in case the skb has extensions other
      than the ipsec secpath, e.g. bridge nf data.
      
      To fix this, set the UDP_SKB_IS_STATELESS flag only if we don't have
      extensions or if the extension space can be free'd.
      
      Fixes: 895b5c9f ("netfilter: drop bridge nf reset from nf_reset")
      Cc: Paolo Abeni <pabeni@redhat.com>
      Reported-by: default avatarByron Stanoszek <gandalf@winds.org>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      677bf08c
    • Dan Carpenter's avatar
      net: rtnetlink: prevent underflows in do_setvfinfo() · ff08ddba
      Dan Carpenter authored
      The "ivm->vf" variable is a u32, but the problem is that a number of
      drivers cast it to an int and then forget to check for negatives.  An
      example of this is in the cxgb4 driver.
      
      drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
        2890  static int cxgb4_mgmt_get_vf_config(struct net_device *dev,
        2891                                      int vf, struct ifla_vf_info *ivi)
                                                  ^^^^^^
        2892  {
        2893          struct port_info *pi = netdev_priv(dev);
        2894          struct adapter *adap = pi->adapter;
        2895          struct vf_info *vfinfo;
        2896
        2897          if (vf >= adap->num_vfs)
                          ^^^^^^^^^^^^^^^^^^^
        2898                  return -EINVAL;
        2899          vfinfo = &adap->vfinfo[vf];
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
      
      There are 48 functions affected.
      
      drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c:8435 hclge_set_vf_vlan_filter() warn: can 'vfid' underflow 's32min-2147483646'
      drivers/net/ethernet/freescale/enetc/enetc_pf.c:377 enetc_pf_set_vf_mac() warn: can 'vf' underflow 's32min-2147483646'
      drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:2899 cxgb4_mgmt_get_vf_config() warn: can 'vf' underflow 's32min-254'
      drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:2960 cxgb4_mgmt_set_vf_rate() warn: can 'vf' underflow 's32min-254'
      drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:3019 cxgb4_mgmt_set_vf_rate() warn: can 'vf' underflow 's32min-254'
      drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:3038 cxgb4_mgmt_set_vf_vlan() warn: can 'vf' underflow 's32min-254'
      drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:3086 cxgb4_mgmt_set_vf_link_state() warn: can 'vf' underflow 's32min-254'
      drivers/net/ethernet/chelsio/cxgb/cxgb2.c:791 get_eeprom() warn: can 'i' underflow 's32min-(-4),0,4-s32max'
      drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:82 bnxt_set_vf_spoofchk() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:164 bnxt_set_vf_trust() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:186 bnxt_get_vf_config() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:228 bnxt_set_vf_mac() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:264 bnxt_set_vf_vlan() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:293 bnxt_set_vf_bw() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:333 bnxt_set_vf_link_state() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:2595 bnx2x_vf_op_prep() warn: can 'vfidx' underflow 's32min-63'
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:2595 bnx2x_vf_op_prep() warn: can 'vfidx' underflow 's32min-63'
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c:2281 bnx2x_post_vf_bulletin() warn: can 'vf' underflow 's32min-63'
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c:2285 bnx2x_post_vf_bulletin() warn: can 'vf' underflow 's32min-63'
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c:2286 bnx2x_post_vf_bulletin() warn: can 'vf' underflow 's32min-63'
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c:2292 bnx2x_post_vf_bulletin() warn: can 'vf' underflow 's32min-63'
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c:2297 bnx2x_post_vf_bulletin() warn: can 'vf' underflow 's32min-63'
      drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:1832 qlcnic_sriov_set_vf_mac() warn: can 'vf' underflow 's32min-254'
      drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:1864 qlcnic_sriov_set_vf_tx_rate() warn: can 'vf' underflow 's32min-254'
      drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:1937 qlcnic_sriov_set_vf_vlan() warn: can 'vf' underflow 's32min-254'
      drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:2005 qlcnic_sriov_get_vf_config() warn: can 'vf' underflow 's32min-254'
      drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:2036 qlcnic_sriov_set_vf_spoofchk() warn: can 'vf' underflow 's32min-254'
      drivers/net/ethernet/emulex/benet/be_main.c:1914 be_get_vf_config() warn: can 'vf' underflow 's32min-65534'
      drivers/net/ethernet/emulex/benet/be_main.c:1915 be_get_vf_config() warn: can 'vf' underflow 's32min-65534'
      drivers/net/ethernet/emulex/benet/be_main.c:1922 be_set_vf_tvt() warn: can 'vf' underflow 's32min-65534'
      drivers/net/ethernet/emulex/benet/be_main.c:1951 be_clear_vf_tvt() warn: can 'vf' underflow 's32min-65534'
      drivers/net/ethernet/emulex/benet/be_main.c:2063 be_set_vf_tx_rate() warn: can 'vf' underflow 's32min-65534'
      drivers/net/ethernet/emulex/benet/be_main.c:2091 be_set_vf_link_state() warn: can 'vf' underflow 's32min-65534'
      drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:2609 ice_set_vf_port_vlan() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:3050 ice_get_vf_cfg() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:3103 ice_set_vf_spoofchk() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:3181 ice_set_vf_mac() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:3237 ice_set_vf_trust() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:3286 ice_set_vf_link_state() warn: can 'vf_id' underflow 's32min-65534'
      drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:3919 i40e_validate_vf() warn: can 'vf_id' underflow 's32min-2147483646'
      drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:3957 i40e_ndo_set_vf_mac() warn: can 'vf_id' underflow 's32min-2147483646'
      drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4104 i40e_ndo_set_vf_port_vlan() warn: can 'vf_id' underflow 's32min-2147483646'
      drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4263 i40e_ndo_set_vf_bw() warn: can 'vf_id' underflow 's32min-2147483646'
      drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4309 i40e_ndo_get_vf_config() warn: can 'vf_id' underflow 's32min-2147483646'
      drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4371 i40e_ndo_set_vf_link_state() warn: can 'vf_id' underflow 's32min-2147483646'
      drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4441 i40e_ndo_set_vf_spoofchk() warn: can 'vf_id' underflow 's32min-2147483646'
      drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4441 i40e_ndo_set_vf_spoofchk() warn: can 'vf_id' underflow 's32min-2147483646'
      drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4504 i40e_ndo_set_vf_trust() warn: can 'vf_id' underflow 's32min-2147483646'
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ff08ddba