1. 11 9月, 2020 1 次提交
    • D
      Bluetooth: Add MGMT capability flags for tx power and ext advertising · d5ea32da
      Daniel Winkler 提交于
      For new advertising features, it will be important for userspace to
      know the capabilities of the controller and kernel. If the controller
      and kernel support extended advertising, we include flags indicating
      hardware offloading support and support for setting tx power of adv
      instances.
      
      In the future, vendor-specific commands may allow the setting of tx
      power in advertising instances, but for now this feature is only
      marked available if extended advertising is supported.
      
      This change is manually verified in userspace by ensuring the
      advertising manager's supported_flags field is updated with new flags on
      hatch chromebook (ext advertising supported).
      Signed-off-by: NDaniel Winkler <danielwinkler@google.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      d5ea32da
  2. 01 8月, 2020 4 次提交
  3. 31 7月, 2020 13 次提交
  4. 30 7月, 2020 4 次提交
  5. 29 7月, 2020 1 次提交
  6. 28 7月, 2020 1 次提交
  7. 25 7月, 2020 9 次提交
  8. 24 7月, 2020 1 次提交
    • V
      net: dsa: stop overriding master's ndo_get_phys_port_name · 5df5661a
      Vladimir Oltean 提交于
      The purpose of this override is to give the user an indication of what
      the number of the CPU port is (in DSA, the CPU port is a hardware
      implementation detail and not a network interface capable of traffic).
      
      However, it has always failed (by design) at providing this information
      to the user in a reliable fashion.
      
      Prior to commit 3369afba ("net: Call into DSA netdevice_ops
      wrappers"), the behavior was to only override this callback if it was
      not provided by the DSA master.
      
      That was its first failure: if the DSA master itself was a DSA port or a
      switchdev, then the user would not see the number of the CPU port in
      /sys/class/net/eth0/phys_port_name, but the number of the DSA master
      port within its respective physical switch.
      
      But that was actually ok in a way. The commit mentioned above changed
      that behavior, and now overrides the master's ndo_get_phys_port_name
      unconditionally. That comes with problems of its own, which are worse in
      a way.
      
      The idea is that it's typical for switchdev users to have udev rules for
      consistent interface naming. These are based, among other things, on
      the phys_port_name attribute. If we let the DSA switch at the bottom
      to start randomly overriding ndo_get_phys_port_name with its own CPU
      port, we basically lose any predictability in interface naming, or even
      uniqueness, for that matter.
      
      So, there are reasons to let DSA override the master's callback (to
      provide a consistent interface, a number which has a clear meaning and
      must not be interpreted according to context), and there are reasons to
      not let DSA override it (it breaks udev matching for the DSA master).
      
      But, there is an alternative method for users to retrieve the number of
      the CPU port of each DSA switch in the system:
      
        $ devlink port
        pci/0000:00:00.5/0: type eth netdev swp0 flavour physical port 0
        pci/0000:00:00.5/2: type eth netdev swp2 flavour physical port 2
        pci/0000:00:00.5/4: type notset flavour cpu port 4
        spi/spi2.0/0: type eth netdev sw0p0 flavour physical port 0
        spi/spi2.0/1: type eth netdev sw0p1 flavour physical port 1
        spi/spi2.0/2: type eth netdev sw0p2 flavour physical port 2
        spi/spi2.0/4: type notset flavour cpu port 4
        spi/spi2.1/0: type eth netdev sw1p0 flavour physical port 0
        spi/spi2.1/1: type eth netdev sw1p1 flavour physical port 1
        spi/spi2.1/2: type eth netdev sw1p2 flavour physical port 2
        spi/spi2.1/3: type eth netdev sw1p3 flavour physical port 3
        spi/spi2.1/4: type notset flavour cpu port 4
      
      So remove this duplicated, unreliable and troublesome method. From this
      patch on, the phys_port_name attribute of the DSA master will only
      contain information about itself (if at all). If the users need reliable
      information about the CPU port they're probably using devlink anyway.
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Acked-by: Nflorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5df5661a
  9. 22 7月, 2020 2 次提交
  10. 21 7月, 2020 2 次提交
  11. 20 7月, 2020 2 次提交
    • W
      icmp: support rfc 4884 · eba75c58
      Willem de Bruijn 提交于
      Add setsockopt SOL_IP/IP_RECVERR_4884 to return the offset to an
      extension struct if present.
      
      ICMP messages may include an extension structure after the original
      datagram. RFC 4884 standardized this behavior. It stores the offset
      in words to the extension header in u8 icmphdr.un.reserved[1].
      
      The field is valid only for ICMP types destination unreachable, time
      exceeded and parameter problem, if length is at least 128 bytes and
      entire packet does not exceed 576 bytes.
      
      Return the offset to the start of the extension struct when reading an
      ICMP error from the error queue, if it matches the above constraints.
      
      Do not return the raw u8 field. Return the offset from the start of
      the user buffer, in bytes. The kernel does not return the network and
      transport headers, so subtract those.
      
      Also validate the headers. Return the offset regardless of validation,
      as an invalid extension must still not be misinterpreted as part of
      the original datagram. Note that !invalid does not imply valid. If
      the extension version does not match, no validation can take place,
      for instance.
      
      For backward compatibility, make this optional, set by setsockopt
      SOL_IP/IP_RECVERR_RFC4884. For API example and feature test, see
      github.com/wdebruij/kerneltools/blob/master/tests/recv_icmp_v2.c
      
      For forward compatibility, reserve only setsockopt value 1, leaving
      other bits for additional icmp extensions.
      
      Changes
        v1->v2:
        - convert word offset to byte offset from start of user buffer
          - return in ee_data as u8 may be insufficient
        - define extension struct and object header structs
        - return len only if constraints met
        - if returning len, also validate
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eba75c58
    • L
      xdp: introduce xdp_get_shared_info_from_{buff, frame} utility routines · 2f0bc54b
      Lorenzo Bianconi 提交于
      Introduce xdp_get_shared_info_from_{buff,frame} utility routines to get
      skb_shared_info from xdp buffer/frame pointer.
      xdp_get_shared_info_from_{buff,frame} will be used to implement xdp
      multi-buffer support
      Signed-off-by: NLorenzo Bianconi <lorenzo@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2f0bc54b