1. 08 Feb, 2019 5 commits
    • Sara Sharon's avatar
      mac80211: pass bssids to elements parsing function · 4abb52a4
      Sara Sharon authored
      In multiple BSSID, we have nested IEs inside the multiple
      BSSID IE, that override the external ones for that specific
      BSS. As preparation for supporting that, pass 2 BSSIDs to the
      parse function, the transmitter, and the selected BSSID, so
      it can know which IEs to choose. If the selected BSSID is
      NULL, the outer ones will be applied.
      
      Change ieee80211_bss_info_update to parse elements itself,
      instead of receiving them parsed, so we have the relevant
      bss entry in hand.
      Signed-off-by: default avatarSara Sharon <sara.sharon@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      4abb52a4
    • Johannes Berg's avatar
      nl80211: use for_each_element() in validate_ie_attr() · 9f308616
      Johannes Berg authored
      This makes for much simpler code, simply walk through all
      the elements and check that the last one found ends with
      the end of the data. This works because if any element is
      malformed the walk is aborted, we end up with a mismatch.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      9f308616
    • Johannes Berg's avatar
      cfg80211: add various struct element finding helpers · 49a68e0d
      Johannes Berg authored
      We currently have a number of helpers to find elements that just
      return a u8 *, change those to return a struct element and add
      inlines to deal with the u8 * compatibility.
      
      Note that the match behaviour is changed to start the natch at
      the data, so conversion from _ie_match to _elem_match need to
      be done carefully.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      49a68e0d
    • Johannes Berg's avatar
      mac80211: use element iteration macro in parsing · c17e28d1
      Johannes Berg authored
      Instead of open-coding the element walk, use the new macro.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      c17e28d1
    • Johannes Berg's avatar
      cfg80211: add and use strongly typed element iteration macros · 0f3b07f0
      Johannes Berg authored
      Rather than always iterating elements from frames with pure
      u8 pointers, add a type "struct element" that encapsulates
      the id/datalen/data format of them.
      
      Then, add the element iteration macros
       * for_each_element
       * for_each_element_id
       * for_each_element_extid
      
      which take, as their first 'argument', such a structure and
      iterate through a given u8 array interpreting it as elements.
      
      While at it and since we'll need it, also add
       * for_each_subelement
       * for_each_subelement_id
       * for_each_subelement_extid
      
      which instead of taking data/length just take an outer element
      and use its data/datalen.
      
      Also add for_each_element_completed() to determine if any of
      the loops above completed, i.e. it was able to parse all of
      the elements successfully and no data remained.
      
      Use for_each_element_id() in cfg80211_find_ie_match() as the
      first user of this.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      0f3b07f0
  2. 05 Feb, 2019 9 commits
  3. 04 Feb, 2019 12 commits
  4. 03 Feb, 2019 14 commits
    • David S. Miller's avatar
      Merge branch 'phy-aquantia-improvements' · ee825e8b
      David S. Miller authored
      Heiner Kallweit says:
      
      ====================
      net: phy: aquantia: number of improvements
      
      This patch series is based on work from Andrew. I adjusted and added
      certain parts. The series improves few aspects of driver, no functional
      change intended.
      
      v2:
      - add my SoB to patch 1
      - leave kernel.h in in patch 2
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ee825e8b
    • Heiner Kallweit's avatar
      net: phy: aquantia: replace magic numbers with constants · 278f6b67
      Heiner Kallweit authored
      Replace magic numbers with proper constants. The original patch is
      from Andrew, I extended / adjusted certain parts:
      - Use decimal bit numbers. The datasheet uses hex bit numbers 0 .. F.
      - Order defines from highest to lowest bit numbers
      - correct some typos
      - add constant MDIO_AN_TX_VEND_INT_MASK2_LINK
      - Remove few functional improvements from the patch, they will come as
        a separate patch.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      278f6b67
    • Heiner Kallweit's avatar
      net: phy: aquantia: use macro PHY_ID_MATCH_MODEL · 4d5dfb66
      Heiner Kallweit authored
      Make use of macro PHY_ID_MATCH_MODEL to simplify the code.
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d5dfb66
    • Heiner Kallweit's avatar
      net: phy: aquantia: remove unneeded includes · 81e6578c
      Heiner Kallweit authored
      Remove unneeded header includes.
      
      v2:
      - leave kernel.h in
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      81e6578c
    • Andrew Lunn's avatar
      net: phy: aquantia: Shorten name space prefix to aqr_ · b37ecb59
      Andrew Lunn authored
      aquantia_ as a name space prefix is rather long, resulting in lots of
      lines needing wrapping, reducing readability. Use the prefix aqr_
      instead, which fits with the vendor naming there devices aqr107, for
      example.
      
      v2:
      - add SoB from Heiner
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b37ecb59
    • Florian Fainelli's avatar
      net: Fix ip_mc_{dec,inc}_group allocation context · 9fb20801
      Florian Fainelli authored
      After 4effd28c ("bridge: join all-snoopers multicast address"), I
      started seeing the following sleep in atomic warnings:
      
      [   26.763893] BUG: sleeping function called from invalid context at mm/slab.h:421
      [   26.771425] in_atomic(): 1, irqs_disabled(): 0, pid: 1658, name: sh
      [   26.777855] INFO: lockdep is turned off.
      [   26.781916] CPU: 0 PID: 1658 Comm: sh Not tainted 5.0.0-rc4 #20
      [   26.787943] Hardware name: BCM97278SV (DT)
      [   26.792118] Call trace:
      [   26.794645]  dump_backtrace+0x0/0x170
      [   26.798391]  show_stack+0x24/0x30
      [   26.801787]  dump_stack+0xa4/0xe4
      [   26.805182]  ___might_sleep+0x208/0x218
      [   26.809102]  __might_sleep+0x78/0x88
      [   26.812762]  kmem_cache_alloc_trace+0x64/0x28c
      [   26.817301]  igmp_group_dropped+0x150/0x230
      [   26.821573]  ip_mc_dec_group+0x1b0/0x1f8
      [   26.825585]  br_ip4_multicast_leave_snoopers.isra.11+0x174/0x190
      [   26.831704]  br_multicast_toggle+0x78/0xcc
      [   26.835887]  store_bridge_parm+0xc4/0xfc
      [   26.839894]  multicast_snooping_store+0x3c/0x4c
      [   26.844517]  dev_attr_store+0x44/0x5c
      [   26.848262]  sysfs_kf_write+0x50/0x68
      [   26.852006]  kernfs_fop_write+0x14c/0x1b4
      [   26.856102]  __vfs_write+0x60/0x190
      [   26.859668]  vfs_write+0xc8/0x168
      [   26.863059]  ksys_write+0x70/0xc8
      [   26.866449]  __arm64_sys_write+0x24/0x30
      [   26.870458]  el0_svc_common+0xa0/0x11c
      [   26.874291]  el0_svc_handler+0x38/0x70
      [   26.878120]  el0_svc+0x8/0xc
      
      while toggling the bridge's multicast_snooping attribute dynamically.
      
      Pass a gfp_t down to igmpv3_add_delrec(), introduce
      __igmp_group_dropped() and introduce __ip_mc_dec_group() to take a gfp_t
      argument.
      
      Similarly introduce ____ip_mc_inc_group() and __ip_mc_inc_group() to
      allow caller to specify gfp_t.
      
      IPv6 part of the patch appears fine.
      
      Fixes: 4effd28c ("bridge: join all-snoopers multicast address")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9fb20801
    • Jakub Kicinski's avatar
      net: devlink: report cell size of shared buffers · bff5731d
      Jakub Kicinski authored
      Shared buffer allocation is usually done in cell increments.
      Drivers will either round up the allocation or refuse the
      configuration if it's not an exact multiple of cell size.
      Drivers know exactly the cell size of shared buffer, so help
      out users by providing this information in dumps.
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: default avatarDirk van der Merwe <dirk.vandermerwe@netronome.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bff5731d
    • David S. Miller's avatar
      Merge branch 'net-y2038-safe-socket-timestamps' · a98dc6ae
      David S. Miller authored
      Deepa Dinamani says:
      
      ====================
      net: y2038-safe socket timestamps
      
      The series introduces new socket timestamps that are
      y2038 safe.
      
      The time data types used for the existing socket timestamp
      options: SO_TIMESTAMP, SO_TIMESTAMPNS and SO_TIMESTAMPING
      are not y2038 safe. The series introduces SO_TIMESTAMP_NEW,
      SO_TIMESTAMPNS_NEW and SO_TIMESTAMPING_NEW to replace these.
      These new timestamps can be used on all architectures.
      
      The alternative considered was to extend the sys_setsockopt()
      by using the flags. We did not receive any strong opinions about
      either of the approaches. Hence, this was chosen, as glibc folks
      preferred this.
      
      The series does not deal with updating the internal kernel socket
      calls like rxrpc to make them y2038 safe. This will be dealt
      with separately.
      
      Note that the timestamps behavior already does not match the
      man page specific behavior:
      SIOCGSTAMP
          This ioctl should only be used if the socket option SO_TIMESTAMP
      	is not set on the socket. Otherwise, it returns the timestamp of
      	the last packet that was received while SO_TIMESTAMP was not set,
      	or it fails if no such packet has been received,
      	(i.e., ioctl(2) returns -1 with errno set to ENOENT).
      
      The recommendation is to update the man page to remove the above statement.
      
      The overview of the socket timestamp series is as below:
      1. Delete asm specific socket.h when possible.
      2. Support SO/SCM_TIMESTAMP* options only in userspace.
      3. Rename current SO/SCM_TIMESTAMP* to SO/SCM_TIMESTAMP*_OLD.
      3. Alter socket options so that SOCK_RCVTSTAMPNS does
         not rely on SOCK_RCVTSTAMP.
      4. Introduce y2038 safe types for socket timestamp.
      5. Introduce new y2038 safe socket options SO/SCM_TIMESTAMP*_NEW.
      6. Intorduce new y2038 safe socket timeout options.
      
      Changes since v4:
      * Fixed the typo in calling sock_get_timeout()
      
      Changes since v3:
      * Rebased onto net-next and fixups as per review comments
      * Merged the socket timeout series
      * Integrated Arnd's patch to simplify compat handling of timeout syscalls
      
      Changes since v2:
      * Removed extra functions to reduce diff churn as per code review
      
      Changes since v1:
      * Dropped the change to disentangle sock flags
      * Renamed sock_timeval to __kernel_sock_timeval
      * Updated a few comments
      * Added documentation changes
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a98dc6ae
    • Deepa Dinamani's avatar
      sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW · a9beb86a
      Deepa Dinamani authored
      Add new socket timeout options that are y2038 safe.
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Cc: ccaulfie@redhat.com
      Cc: davem@davemloft.net
      Cc: deller@gmx.de
      Cc: paulus@samba.org
      Cc: ralf@linux-mips.org
      Cc: rth@twiddle.net
      Cc: cluster-devel@redhat.com
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-alpha@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a9beb86a
    • Deepa Dinamani's avatar
      socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes · 45bdc661
      Deepa Dinamani authored
      SO_RCVTIMEO and SO_SNDTIMEO socket options use struct timeval
      as the time format. struct timeval is not y2038 safe.
      The subsequent patches in the series add support for new socket
      timeout options with _NEW suffix that will use y2038 safe
      data structures. Although the existing struct timeval layout
      is sufficiently wide to represent timeouts, because of the way
      libc will interpret time_t based on user defined flag, these
      new flags provide a way of having a structure that is the same
      for all architectures consistently.
      Rename the existing options with _OLD suffix forms so that the
      right option is enabled for userspace applications according
      to the architecture and time_t definition of libc.
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Cc: ccaulfie@redhat.com
      Cc: deller@gmx.de
      Cc: paulus@samba.org
      Cc: ralf@linux-mips.org
      Cc: rth@twiddle.net
      Cc: cluster-devel@redhat.com
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-alpha@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      45bdc661
    • Deepa Dinamani's avatar
      socket: Update timestamping Documentation · 9dd49211
      Deepa Dinamani authored
      With the new y2038 safe timestamping options added, update the
      documentation to reflect the changes.
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9dd49211
    • Deepa Dinamani's avatar
      socket: Add SO_TIMESTAMPING_NEW · 9718475e
      Deepa Dinamani authored
      Add SO_TIMESTAMPING_NEW variant of socket timestamp options.
      This is the y2038 safe versions of the SO_TIMESTAMPING_OLD
      for all architectures.
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Cc: chris@zankel.net
      Cc: fenghua.yu@intel.com
      Cc: rth@twiddle.net
      Cc: tglx@linutronix.de
      Cc: ubraun@linux.ibm.com
      Cc: linux-alpha@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Cc: linux-s390@vger.kernel.org
      Cc: linux-xtensa@linux-xtensa.org
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9718475e
    • Deepa Dinamani's avatar
      socket: Add SO_TIMESTAMP[NS]_NEW · 887feae3
      Deepa Dinamani authored
      Add SO_TIMESTAMP_NEW and SO_TIMESTAMPNS_NEW variants of
      socket timestamp options.
      These are the y2038 safe versions of the SO_TIMESTAMP_OLD
      and SO_TIMESTAMPNS_OLD for all architectures.
      
      Note that the format of scm_timestamping.ts[0] is not changed
      in this patch.
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Cc: jejb@parisc-linux.org
      Cc: ralf@linux-mips.org
      Cc: rth@twiddle.net
      Cc: linux-alpha@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Cc: linux-parisc@vger.kernel.org
      Cc: linux-rdma@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      887feae3
    • Deepa Dinamani's avatar
      socket: Add struct __kernel_sock_timeval · 98bb03c8
      Deepa Dinamani authored
      The new type is meant to be used as a y2038 safe structure
      to be used as part of cmsg data.
      Presently the SO_TIMESTAMP socket option uses struct timeval
      for timestamps. This is not y2038 safe.
      Subsequent patches in the series add new y2038 safe socket
      option to be used in the place of SO_TIMESTAMP_OLD.
      struct __kernel_sock_timeval will be used as the timestamp
      format at that time.
      
      struct __kernel_sock_timeval also maintains the same layout
      across 32 bit and 64 bit ABIs.
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      98bb03c8