Skip to content
  1. Apr 29, 2017
  2. Apr 28, 2017
    • Herbert Xu's avatar
      rhashtable: Do not lower max_elems when max_size is zero · 2d2ab658
      Herbert Xu authored
      The commit 6d684e54 ("rhashtable: Cap total number of entries
      to 2^31") breaks rhashtable users that do not set max_size.  This
      is because when max_size is zero max_elems is also incorrectly set
      to zero instead of 2^31.
      
      This patch fixes it by only lowering max_elems when max_size is not
      zero.
      
      Fixes: 6d684e54
      
       ("rhashtable: Cap total number of entries to 2^31")
      Reported-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reported-by: default avatarkernel test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d2ab658
    • Arend Van Spriel's avatar
      cfg80211: add request id to cfg80211_sched_scan_*() api · b34939b9
      Arend Van Spriel authored
      
      
      Have proper request id filled in the SCHED_SCAN_RESULTS and
      SCHED_SCAN_STOPPED notifications toward user-space by having the
      driver provide it through the api.
      
      Reviewed-by: default avatarHante Meuleman <hante.meuleman@broadcom.com>
      Reviewed-by: default avatarPieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
      Reviewed-by: default avatarFranky Lin <franky.lin@broadcom.com>
      Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      b34939b9
    • Avraham Stern's avatar
      mac80211: Add support for BSS max idle period element · e38a017b
      Avraham Stern authored
      
      
      Parse the BSS max idle period element and set the BSS configuration
      accordingly so the driver can use this information to configure the
      max idle period and to use protected management frames for keep alive
      when required.
      
      The BSS max idle period element is defined in IEEE802.11-2016,
      section 9.4.2.79
      
      Signed-off-by: default avatarAvraham Stern <avraham.stern@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      e38a017b
    • Avraham Stern's avatar
      cfg80211: unify cfg80211_roamed() and cfg80211_roamed_bss() · 29ce6ecb
      Avraham Stern authored
      
      
      cfg80211_roamed() and cfg80211_roamed_bss() take the same arguments
      except that cfg80211_roamed() requires the BSSID and
      cfg80211_roamed_bss() requires the bss entry.
      
      Unify the two functions by using a struct for driver initiated
      roaming information so that either the BSSID or the bss entry can be
      passed as an argument to the unified function.
      
      Signed-off-by: default avatarAvraham Stern <avraham.stern@intel.com>
      [modified the ath6k, brcm80211, rndis and wlan-ng drivers accordingly]
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      [modify brcmfmac to remove the useless cast, spotted by Arend]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      29ce6ecb
    • Mohammed Shafi Shajakhan's avatar
      mac80211: Fix possible sband related NULL pointer de-reference · 21a8e9dd
      Mohammed Shafi Shajakhan authored
      Existing API 'ieee80211_get_sdata_band' returns default 2 GHz band even
      if the channel context configuration is NULL. This crashes for chipsets
      which support 5 Ghz alone when it tries to access members of 'sband'.
      Channel context configuration can be NULL in multivif case and when
      channel switch is in progress (or) when it fails. Fix this by replacing
      the API 'ieee80211_get_sdata_band' with  'ieee80211_get_sband' which
      returns a NULL pointer for sband when the channel configuration is NULL.
      
      An example scenario is as below:
      
      In multivif mode (AP + STA) with drivers like ath10k, when we do a
      channel switch in the AP vif (which has a number of clients connected)
      and a STA vif which is connected to some other AP, when the channel
      switch in AP vif fails, while the STA vifs tries to connect to the
      other AP, there is a window where the channel context is NULL/invalid
      and this results in a crash  while the clients connected to the AP vif
      tries to reconnect and this race is very similar to the one investigated
      by Michal in https://patchwork.kernel.org/patch/3788161/
      
       and this does
      happens with hardware that supports 5Ghz alone after long hours of
      testing with continuous channel switch on the AP vif
      
      ieee80211 phy0: channel context reservation cannot be finalized because
      some interfaces aren't switching
      wlan0: failed to finalize CSA, disconnecting
      wlan0-1: deauthenticating from 8c:fd:f0:01:54:9c by local choice
      	(Reason: 3=DEAUTH_LEAVING)
      
      	WARNING: CPU: 1 PID: 19032 at net/mac80211/ieee80211_i.h:1013 sta_info_alloc+0x374/0x3fc [mac80211]
      	[<bf77272c>] (sta_info_alloc [mac80211])
      	[<bf78776c>] (ieee80211_add_station [mac80211]))
      	[<bf73cc50>] (nl80211_new_station [cfg80211])
      
      	Unable to handle kernel NULL pointer dereference at virtual
      	address 00000014
      	pgd = d5f4c000
      	Internal error: Oops: 17 [#1] PREEMPT SMP ARM
      	PC is at sta_info_alloc+0x380/0x3fc [mac80211]
      	LR is at sta_info_alloc+0x37c/0x3fc [mac80211]
      	[<bf772738>] (sta_info_alloc [mac80211])
      	[<bf78776c>] (ieee80211_add_station [mac80211])
      	[<bf73cc50>] (nl80211_new_station [cfg80211]))
      
      Cc: Michal Kazior <michal.kazior@tieto.com>
      Signed-off-by: default avatarMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      21a8e9dd
    • Felix Fietkau's avatar
      mac80211: add ieee80211_tx_status_ext · 5fe49a9d
      Felix Fietkau authored
      
      
      This allows the driver to pass in struct ieee80211_tx_status directly.
      Make ieee80211_tx_status_noskb a wrapper around it.
      
      As with ieee80211_tx_status_noskb, there is no _ni variant of this call,
      because it probably won't be needed.
      
      Even if the driver won't provide any extra status info other than what's
      in struct ieee80211_tx_info already, it can optimize status reporting
      this way by passing in the station pointer.
      
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      [use C99 initializers]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      5fe49a9d
    • Felix Fietkau's avatar
      mac80211: move ieee80211_tx_status_noskb below ieee80211_tx_status · eefebd31
      Felix Fietkau authored
      
      
      Makes further cleanups more readable
      
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      eefebd31
    • Felix Fietkau's avatar
      mac80211: make rate control tx status API more extensible · 18fb84d9
      Felix Fietkau authored
      
      
      Rename .tx_status_noskb to .tx_status_ext and pass a new on-stack
      struct ieee80211_tx_status instead of struct ieee80211_tx_info.
      
      This struct can be used to pass extra information, e.g. for dynamic tx
      power control
      
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      18fb84d9
    • Johannes Berg's avatar
      mac80211: use bitfield macros for encoded rate · dcba665b
      Johannes Berg authored
      
      
      Instead of hand-coding the bit manipulations, use the bitfield
      macros to generate the code for the encoded bitrate.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      dcba665b
    • Johannes Berg's avatar
      mac80211: rename ieee80211_rx_status::vht_nss to just nss · 8613c948
      Johannes Berg authored
      
      
      This field will need to be used again for HE, so rename it now.
      
      Again, mostly done with this spatch:
      
      @@
      expression status;
      @@
      -status->vht_nss
      +status->nss
      @@
      expression status;
      @@
      -status.vht_nss
      +status.nss
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      8613c948
    • Johannes Berg's avatar
      mac80211: separate encoding/bandwidth from flags · da6a4352
      Johannes Berg authored
      
      
      We currently use a lot of flags that are mutually incompatible,
      separate this out into actual encoding and bandwidth enum values.
      
      Much of this again done with spatch, with manual post-editing,
      mostly to add the switch statements and get rid of the conversions.
      
      @@
      expression status;
      @@
      -status->enc_flags |= RX_ENC_FLAG_80MHZ
      +status->bw = RATE_INFO_BW_80
      @@
      expression status;
      @@
      -status->enc_flags |= RX_ENC_FLAG_40MHZ
      +status->bw = RATE_INFO_BW_40
      @@
      expression status;
      @@
      -status->enc_flags |= RX_ENC_FLAG_20MHZ
      +status->bw = RATE_INFO_BW_20
      @@
      expression status;
      @@
      -status->enc_flags |= RX_ENC_FLAG_160MHZ
      +status->bw = RATE_INFO_BW_160
      @@
      expression status;
      @@
      -status->enc_flags |= RX_ENC_FLAG_5MHZ
      +status->bw = RATE_INFO_BW_5
      @@
      expression status;
      @@
      -status->enc_flags |= RX_ENC_FLAG_10MHZ
      +status->bw = RATE_INFO_BW_10
      
      @@
      expression status;
      @@
      -status->enc_flags |= RX_ENC_FLAG_VHT
      +status->encoding = RX_ENC_VHT
      @@
      expression status;
      @@
      -status->enc_flags |= RX_ENC_FLAG_HT
      +status->encoding = RX_ENC_HT
      @@
      expression status;
      @@
      -status.enc_flags |= RX_ENC_FLAG_VHT
      +status.encoding = RX_ENC_VHT
      @@
      expression status;
      @@
      -status.enc_flags |= RX_ENC_FLAG_HT
      +status.encoding = RX_ENC_HT
      
      @@
      expression status;
      @@
      -(status->enc_flags & RX_ENC_FLAG_HT)
      +(status->encoding == RX_ENC_HT)
      @@
      expression status;
      @@
      -(status->enc_flags & RX_ENC_FLAG_VHT)
      +(status->encoding == RX_ENC_VHT)
      
      @@
      expression status;
      @@
      -(status->enc_flags & RX_ENC_FLAG_5MHZ)
      +(status->bw == RATE_INFO_BW_5)
      @@
      expression status;
      @@
      -(status->enc_flags & RX_ENC_FLAG_10MHZ)
      +(status->bw == RATE_INFO_BW_10)
      @@
      expression status;
      @@
      -(status->enc_flags & RX_ENC_FLAG_40MHZ)
      +(status->bw == RATE_INFO_BW_40)
      @@
      expression status;
      @@
      -(status->enc_flags & RX_ENC_FLAG_80MHZ)
      +(status->bw == RATE_INFO_BW_80)
      @@
      expression status;
      @@
      -(status->enc_flags & RX_ENC_FLAG_160MHZ)
      +(status->bw == RATE_INFO_BW_160)
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      da6a4352
    • Johannes Berg's avatar
      mac80211: clean up rate encoding bits in RX status · 7fdd69c5
      Johannes Berg authored
      
      
      In preparation for adding support for HE rates, clean up
      the driver report encoding for rate/bandwidth reporting
      on RX frames.
      
      Much of this patch was done with the following spatch:
      
      @@
      expression status;
      @@
      -status->flag & (RX_FLAG_HT | RX_FLAG_VHT)
      +status->enc_flags & (RX_ENC_FLAG_HT | RX_ENC_FLAG_VHT)
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->flag op RX_FLAG_SHORTPRE
      +status->enc_flags op RX_ENC_FLAG_SHORTPRE
      @@
      expression status;
      @@
      -status->flag & RX_FLAG_SHORTPRE
      +status->enc_flags & RX_ENC_FLAG_SHORTPRE
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->flag op RX_FLAG_HT
      +status->enc_flags op RX_ENC_FLAG_HT
      @@
      expression status;
      @@
      -status->flag & RX_FLAG_HT
      +status->enc_flags & RX_ENC_FLAG_HT
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->flag op RX_FLAG_40MHZ
      +status->enc_flags op RX_ENC_FLAG_40MHZ
      @@
      expression status;
      @@
      -status->flag & RX_FLAG_40MHZ
      +status->enc_flags & RX_ENC_FLAG_40MHZ
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->flag op RX_FLAG_SHORT_GI
      +status->enc_flags op RX_ENC_FLAG_SHORT_GI
      @@
      expression status;
      @@
      -status->flag & RX_FLAG_SHORT_GI
      +status->enc_flags & RX_ENC_FLAG_SHORT_GI
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->flag op RX_FLAG_HT_GF
      +status->enc_flags op RX_ENC_FLAG_HT_GF
      @@
      expression status;
      @@
      -status->flag & RX_FLAG_HT_GF
      +status->enc_flags & RX_ENC_FLAG_HT_GF
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->flag op RX_FLAG_VHT
      +status->enc_flags op RX_ENC_FLAG_VHT
      @@
      expression status;
      @@
      -status->flag & RX_FLAG_VHT
      +status->enc_flags & RX_ENC_FLAG_VHT
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->flag op RX_FLAG_STBC_MASK
      +status->enc_flags op RX_ENC_FLAG_STBC_MASK
      @@
      expression status;
      @@
      -status->flag & RX_FLAG_STBC_MASK
      +status->enc_flags & RX_ENC_FLAG_STBC_MASK
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->flag op RX_FLAG_LDPC
      +status->enc_flags op RX_ENC_FLAG_LDPC
      @@
      expression status;
      @@
      -status->flag & RX_FLAG_LDPC
      +status->enc_flags & RX_ENC_FLAG_LDPC
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->flag op RX_FLAG_10MHZ
      +status->enc_flags op RX_ENC_FLAG_10MHZ
      @@
      expression status;
      @@
      -status->flag & RX_FLAG_10MHZ
      +status->enc_flags & RX_ENC_FLAG_10MHZ
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->flag op RX_FLAG_5MHZ
      +status->enc_flags op RX_ENC_FLAG_5MHZ
      @@
      expression status;
      @@
      -status->flag & RX_FLAG_5MHZ
      +status->enc_flags & RX_ENC_FLAG_5MHZ
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->vht_flag op RX_VHT_FLAG_80MHZ
      +status->enc_flags op RX_ENC_FLAG_80MHZ
      @@
      expression status;
      @@
      -status->vht_flag & RX_VHT_FLAG_80MHZ
      +status->enc_flags & RX_ENC_FLAG_80MHZ
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->vht_flag op RX_VHT_FLAG_160MHZ
      +status->enc_flags op RX_ENC_FLAG_160MHZ
      @@
      expression status;
      @@
      -status->vht_flag & RX_VHT_FLAG_160MHZ
      +status->enc_flags & RX_ENC_FLAG_160MHZ
      
      @@
      assignment operator op;
      expression status;
      @@
      -status->vht_flag op RX_VHT_FLAG_BF
      +status->enc_flags op RX_ENC_FLAG_BF
      @@
      expression status;
      @@
      -status->vht_flag & RX_VHT_FLAG_BF
      +status->enc_flags & RX_ENC_FLAG_BF
      
      @@
      assignment operator op;
      expression status, STBC;
      @@
      -status->flag op STBC << RX_FLAG_STBC_SHIFT
      +status->enc_flags op STBC << RX_ENC_FLAG_STBC_SHIFT
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.flag op RX_FLAG_SHORTPRE
      +status.enc_flags op RX_ENC_FLAG_SHORTPRE
      @@
      expression status;
      @@
      -status.flag & RX_FLAG_SHORTPRE
      +status.enc_flags & RX_ENC_FLAG_SHORTPRE
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.flag op RX_FLAG_HT
      +status.enc_flags op RX_ENC_FLAG_HT
      @@
      expression status;
      @@
      -status.flag & RX_FLAG_HT
      +status.enc_flags & RX_ENC_FLAG_HT
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.flag op RX_FLAG_40MHZ
      +status.enc_flags op RX_ENC_FLAG_40MHZ
      @@
      expression status;
      @@
      -status.flag & RX_FLAG_40MHZ
      +status.enc_flags & RX_ENC_FLAG_40MHZ
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.flag op RX_FLAG_SHORT_GI
      +status.enc_flags op RX_ENC_FLAG_SHORT_GI
      @@
      expression status;
      @@
      -status.flag & RX_FLAG_SHORT_GI
      +status.enc_flags & RX_ENC_FLAG_SHORT_GI
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.flag op RX_FLAG_HT_GF
      +status.enc_flags op RX_ENC_FLAG_HT_GF
      @@
      expression status;
      @@
      -status.flag & RX_FLAG_HT_GF
      +status.enc_flags & RX_ENC_FLAG_HT_GF
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.flag op RX_FLAG_VHT
      +status.enc_flags op RX_ENC_FLAG_VHT
      @@
      expression status;
      @@
      -status.flag & RX_FLAG_VHT
      +status.enc_flags & RX_ENC_FLAG_VHT
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.flag op RX_FLAG_STBC_MASK
      +status.enc_flags op RX_ENC_FLAG_STBC_MASK
      @@
      expression status;
      @@
      -status.flag & RX_FLAG_STBC_MASK
      +status.enc_flags & RX_ENC_FLAG_STBC_MASK
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.flag op RX_FLAG_LDPC
      +status.enc_flags op RX_ENC_FLAG_LDPC
      @@
      expression status;
      @@
      -status.flag & RX_FLAG_LDPC
      +status.enc_flags & RX_ENC_FLAG_LDPC
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.flag op RX_FLAG_10MHZ
      +status.enc_flags op RX_ENC_FLAG_10MHZ
      @@
      expression status;
      @@
      -status.flag & RX_FLAG_10MHZ
      +status.enc_flags & RX_ENC_FLAG_10MHZ
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.flag op RX_FLAG_5MHZ
      +status.enc_flags op RX_ENC_FLAG_5MHZ
      @@
      expression status;
      @@
      -status.flag & RX_FLAG_5MHZ
      +status.enc_flags & RX_ENC_FLAG_5MHZ
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.vht_flag op RX_VHT_FLAG_80MHZ
      +status.enc_flags op RX_ENC_FLAG_80MHZ
      @@
      expression status;
      @@
      -status.vht_flag & RX_VHT_FLAG_80MHZ
      +status.enc_flags & RX_ENC_FLAG_80MHZ
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.vht_flag op RX_VHT_FLAG_160MHZ
      +status.enc_flags op RX_ENC_FLAG_160MHZ
      @@
      expression status;
      @@
      -status.vht_flag & RX_VHT_FLAG_160MHZ
      +status.enc_flags & RX_ENC_FLAG_160MHZ
      
      @@
      assignment operator op;
      expression status;
      @@
      -status.vht_flag op RX_VHT_FLAG_BF
      +status.enc_flags op RX_ENC_FLAG_BF
      @@
      expression status;
      @@
      -status.vht_flag & RX_VHT_FLAG_BF
      +status.enc_flags & RX_ENC_FLAG_BF
      
      @@
      assignment operator op;
      expression status, STBC;
      @@
      -status.flag op STBC << RX_FLAG_STBC_SHIFT
      +status.enc_flags op STBC << RX_ENC_FLAG_STBC_SHIFT
      
      @@
      @@
      -RX_FLAG_STBC_SHIFT
      +RX_ENC_FLAG_STBC_SHIFT
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      7fdd69c5
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-next-for-davem-2017-04-27' of... · e221c1f0
      David S. Miller authored
      Merge tag 'wireless-drivers-next-for-davem-2017-04-27' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
      
      
      
      Kalle Valo says:
      
      ====================
      wireless-drivers-next patches for 4.12
      
      Few remaining patches for 4.12 submitted during the last week.
      
      Major changes:
      
      iwlwifi
      
      * the firmware for 7265D and 3168 NICs is frozen at version 29
      
      * more support for the upcoming A000 series
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e221c1f0
    • David S. Miller's avatar
      Merge branch 'qed-ptp-enhancements' · 899dc833
      David S. Miller authored
      
      
      Sudarsana Reddy Kalluru says:
      
      ====================
      qed*: PTP enhancements.
      
      The patch series contains set of enhancements for qed/qede ptp
      implementation.
      Patches (1)-(3) adds resource locking implementation to allow
      PTP functionality only on the first detected ethernet PF of the port.
      The change is required as the adapter currently supports only one
      instance of the PTP client on a given port.
      Patch (4) removes the un-needed header file.
      Patch (5) moves the ptt-lock get/release logic to the ptp specific
      code.
      
      Please consider applying this series to "net-next" branch.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      899dc833
    • sudarsana.kalluru@cavium.com's avatar
      qed: Acquire/release ptt_ptp lock when enabling/disabling PTP. · d179bd16
      sudarsana.kalluru@cavium.com authored
      
      
      Move the code for acquiring/releasing ptt_ptp lock to ptp specific
      implementations i.e., ptp_enable()/disable() respectively.
      
      Signed-off-by: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d179bd16
    • sudarsana.kalluru@cavium.com's avatar
      qed: Remove the un-needed ptp header file. · 6a3ff0db
      sudarsana.kalluru@cavium.com authored
      
      
      The patch deletes the qed_ptp.h file which is not required.
      
      Signed-off-by: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a3ff0db
    • sudarsana.kalluru@cavium.com's avatar
      qede: Add support for PTP resource locking. · 03574497
      sudarsana.kalluru@cavium.com authored
      
      
      The patch adds necessary changes to the driver to use qed resource
      locking functionality. Currently the ptp initialization is spread
      between driver probe/open implementations, associated APIs are
      qede_ptp_register_phc()/qede_ptp_start(). Clubbed this functionality
      into single API qed_ptp_enable() to simplify the usage of qed resource
      locking implementation. The new API will be invoked in the probe path.
      Similarly the ptp clean-up code is moved to qede_ptp_disable() which
      gets invoked in the driver unload path.
      
      Signed-off-by: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      03574497
    • sudarsana.kalluru@cavium.com's avatar
      qed: Add support for PTP resource locking. · db82f70e
      sudarsana.kalluru@cavium.com authored
      
      
      The patch adds support for per-port resource lock in favour of PTP.
      PTP module acquires/releases the MFW resource lock while enabling/
      disabling the PTP on the interface. The PF instance which has the
      ownership of this resource lock will get the exclusive access to the
      PTP clock functionality on the port.
      
      Signed-off-by: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      db82f70e
    • sudarsana.kalluru@cavium.com's avatar
      qed: Add support for MFW resource locking. · f470f22c
      sudarsana.kalluru@cavium.com authored
      
      
      The patch adds API for default initialization of the MFW resource
      locking.
      
      Signed-off-by: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f470f22c
    • David Ahern's avatar
      net: vrf: Do not allow looback to be moved to a VRF · 26d31ac1
      David Ahern authored
      
      
      Moving the loopback into a VRF breaks networking for the default VRF.
      Since the VRF device is the loopback for VRF domains, there is no
      reason to move the loopback. Given the repercussions, block attempts
      to set lo into a VRF.
      
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Reviewed-by: default avatarGreg Rose <gvrose8192@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26d31ac1
    • Wei Yongjun's avatar
      fib_rules: fix error return code · adeb45cb
      Wei Yongjun authored
      Fix to return error code -EINVAL from the error handling
      case instead of 0, as done elsewhere in this function.
      
      Fixes: 622ec2c9
      
       ("net: core: add UID to flows, rules, and routes")
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      adeb45cb
    • Mike Manning's avatar
      bridge: add per-port broadcast flood flag · 99f906e9
      Mike Manning authored
      Support for l2 multicast flood control was added in commit b6cb5ac8
      
      
      ("net: bridge: add per-port multicast flood flag"). It allows broadcast
      as it was introduced specifically for unknown multicast flood control.
      But as broadcast is a special case of multicast, this may also need to
      be disabled. For this purpose, introduce a flag to disable the flooding
      of received l2 broadcasts. This approach is backwards compatible and
      provides flexibility in filtering for the desired packet types.
      
      Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarMike Manning <mmanning@brocade.com>
      Reviewed-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      99f906e9
    • Gao Feng's avatar
      net: fib: Decrease one unnecessary rt cache flush in fib_disable_ip · 06b4fc52
      Gao Feng authored
      
      
      The func fib_flush already flushes the rt cache if necessary, so it
      is not necessary to invoke rt_cache_flush again in fib_disable_ip.
      
      Signed-off-by: default avatarGao Feng <fgao@ikuai8.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06b4fc52
    • Guillaume Nault's avatar
      l2tp: remove useless device duplication test in l2tp_eth_create() · 1514dc85
      Guillaume Nault authored
      
      
      There's no need to verify that cfg->ifname is unique at this point.
      register_netdev() will return -EEXIST if asked to create a device with
      a name that's alrealy in use.
      
      Signed-off-by: default avatarGuillaume Nault <g.nault@alphalink.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1514dc85
    • Zhang Shengju's avatar
      net: remove unnecessary carrier status check · 0575c86b
      Zhang Shengju authored
      
      
      Since netif_carrier_on() will do nothing if device's carrier is already
      on, so it's unnecessary to do carrier status check.
      
      It's the same for netif_carrier_off().
      
      Signed-off-by: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0575c86b
    • Zhang Shengju's avatar
      net: update comment for netif_dormant() function · 8ecbc40a
      Zhang Shengju authored
      
      
      This patch updates the comment for netif_dormant() function to reflect
      the intended usage.
      
      Signed-off-by: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ecbc40a
    • David Ahern's avatar
      samples/bpf: Add support for SKB_MODE to xdp1 and xdp_tx_iptunnel · 3993f2cb
      David Ahern authored
      
      
      Add option to xdp1 and xdp_tx_iptunnel to insert xdp program in
      SKB_MODE:
       - update set_link_xdp_fd to take a flags argument that is added to the
         RTM_SETLINK message
      
       - Add -S option to xdp1 and xdp_tx_iptunnel user code. When passed in
         XDP_FLAGS_SKB_MODE is set in the flags arg passed to set_link_xdp_fd
      
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3993f2cb
  3. Apr 27, 2017