1. 19 Nov, 2018 19 commits
    • David S. Miller's avatar
      Merge branch 'sctp-add-subscribe-per-asoc-and-sockopt-SCTP_EVENT' · cfc6731d
      David S. Miller authored
      Xin Long says:
      
      ====================
      sctp: add subscribe per asoc and sockopt SCTP_EVENT
      
      This patchset mainly adds the Event Subscription sockopt described in
      rfc6525#section-6.2:
      
      "Subscribing to events as described in [RFC6458] uses a setsockopt()
      call with the SCTP_EVENT socket option.  This option takes the
      following structure, which specifies the association, the event type
      (using the same value found in the event type field), and an on/off
      boolean.
      
        struct sctp_event {
          sctp_assoc_t se_assoc_id;
          uint16_t     se_type;
          uint8_t      se_on;
        };
      
      The user fills in the se_type field with the same value found in the
      strreset_type field, i.e., SCTP_STREAM_RESET_EVENT.  The user will
      also fill in the se_assoc_id field with either the association to set
      this event on (this field is ignored for one-to-one style sockets) or
      one of the reserved constant values defined in [RFC6458].  Finally,
      the se_on field is set with a 1 to enable the event or a 0 to disable
      the event."
      
      As for the old SCTP_EVENTS Option with struct sctp_event_subscribe,
      it's being DEPRECATED.
      
      v1->v2:
        - fix some key word in changelog that triggerred the filters at
          vger.kernel.org.
      v2->v3:
        - fix an array out of bounds noticed by Neil in patch 1/4.
      ====================
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cfc6731d
    • Xin Long's avatar
      sctp: add sockopt SCTP_EVENT · 480ba9c1
      Xin Long authored
      This patch adds sockopt SCTP_EVENT described in rfc6525#section-6.2.
      With this sockopt users can subscribe to an event from a specified
      asoc.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      480ba9c1
    • Xin Long's avatar
      sctp: rename enum sctp_event to sctp_event_type · 88ee48c1
      Xin Long authored
      sctp_event is a structure name defined in RFC for sockopt
      SCTP_EVENT. To avoid the conflict, rename it.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88ee48c1
    • Xin Long's avatar
      sctp: add subscribe per asoc · a1e3a059
      Xin Long authored
      The member subscribe should be per asoc, so that sockopt SCTP_EVENT
      in the next patch can subscribe a event from one asoc only.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1e3a059
    • Xin Long's avatar
      sctp: define subscribe in sctp_sock as __u16 · 2cc0eeb6
      Xin Long authored
      The member subscribe in sctp_sock is used to indicate to which of
      the events it is subscribed, more like a group of flags. So it's
      better to be defined as __u16 (2 bytpes), instead of struct
      sctp_event_subscribe (13 bytes).
      
      Note that sctp_event_subscribe is an UAPI struct, used on sockopt
      calls, and thus it will not be removed. This patch only changes
      the internal storage of the flags.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2cc0eeb6
    • David S. Miller's avatar
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · f2ce1065
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix some potentially uninitialized variables and use-after-free in
          kvaser_usb can drier, from Jimmy Assarsson.
      
       2) Fix leaks in qed driver, from Denis Bolotin.
      
       3) Socket leak in l2tp, from Xin Long.
      
       4) RSS context allocation fix in bnxt_en from Michael Chan.
      
       5) Fix cxgb4 build errors, from Ganesh Goudar.
      
       6) Route leaks in ipv6 when removing exceptions, from Xin Long.
      
       7) Memory leak in IDR allocation handling of act_pedit, from Davide
          Caratti.
      
       8) Use-after-free of bridge vlan stats, from Nikolay Aleksandrov.
      
       9) When MTU is locked, do not force DF bit on ipv4 tunnels. From
          Sabrina Dubroca.
      
      10) When NAPI cached skb is reused, we must set it to the proper initial
          state which includes skb->pkt_type. From Eric Dumazet.
      
      11) Lockdep and non-linear SKB handling fix in tipc from Jon Maloy.
      
      12) Set RX queue properly in various tuntap receive paths, from Matthew
          Cover.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (61 commits)
        tuntap: fix multiqueue rx
        ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF
        tipc: don't assume linear buffer when reading ancillary data
        tipc: fix lockdep warning when reinitilaizing sockets
        net-gro: reset skb->pkt_type in napi_reuse_skb()
        tc-testing: tdc.py: Guard against lack of returncode in executed command
        tc-testing: tdc.py: ignore errors when decoding stdout/stderr
        ip_tunnel: don't force DF when MTU is locked
        MAINTAINERS: Add entry for CAKE qdisc
        net: bridge: fix vlan stats use-after-free on destruction
        socket: do a generic_file_splice_read when proto_ops has no splice_read
        net: phy: mdio-gpio: Fix working over slow can_sleep GPIOs
        Revert "net: phy: mdio-gpio: Fix working over slow can_sleep GPIOs"
        net: phy: mdio-gpio: Fix working over slow can_sleep GPIOs
        net/sched: act_pedit: fix memory leak when IDR allocation fails
        net: lantiq: Fix returned value in case of error in 'xrx200_probe()'
        ipv6: fix a dst leak when removing its exception
        net: mvneta: Don't advertise 2.5G modes
        drivers/net/ethernet/qlogic/qed/qed_rdma.h: fix typo
        net/mlx4: Fix UBSAN warning of signed integer overflow
        ...
      f2ce1065
    • Matthew Cover's avatar
      tuntap: fix multiqueue rx · 8ebebcba
      Matthew Cover authored
      When writing packets to a descriptor associated with a combined queue, the
      packets should end up on that queue.
      
      Before this change all packets written to any descriptor associated with a
      tap interface end up on rx-0, even when the descriptor is associated with a
      different queue.
      
      The rx traffic can be generated by either of the following.
        1. a simple tap program which spins up multiple queues and writes packets
           to each of the file descriptors
        2. tx from a qemu vm with a tap multiqueue netdev
      
      The queue for rx traffic can be observed by either of the following (done
      on the hypervisor in the qemu case).
        1. a simple netmap program which opens and reads from per-queue
           descriptors
        2. configuring RPS and doing per-cpu captures with rxtxcpu
      
      Alternatively, if you printk() the return value of skb_get_rx_queue() just
      before each instance of netif_receive_skb() in tun.c, you will get 65535
      for every skb.
      
      Calling skb_record_rx_queue() to set the rx queue to the queue_index fixes
      the association between descriptor and rx queue.
      Signed-off-by: default avatarMatthew Cover <matthew.cover@stackpath.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ebebcba
    • David Ahern's avatar
      ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF · 7ddacfa5
      David Ahern authored
      Preethi reported that PMTU discovery for UDP/raw applications is not
      working in the presence of VRF when the socket is not bound to a device.
      The problem is that ip6_sk_update_pmtu does not consider the L3 domain
      of the skb device if the socket is not bound. Update the function to
      set oif to the L3 master device if relevant.
      
      Fixes: ca254490 ("net: Add VRF support to IPv6 stack")
      Reported-by: default avatarPreethi Ramachandra <preethir@juniper.net>
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7ddacfa5
    • Shalom Toledo's avatar
      mlxsw: spectrum: Expose discard counters via ethtool · bae4e109
      Shalom Toledo authored
      Expose packets discard counters via ethtool to help with debugging.
      Signed-off-by: default avatarShalom Toledo <shalomt@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bae4e109
    • Eric Dumazet's avatar
      tun: use netdev_alloc_frag() in tun_napi_alloc_frags() · aa6daaca
      Eric Dumazet authored
      In order to cook skbs in the same way than Ethernet drivers,
      it is probably better to not use GFP_KERNEL, but rather
      use the GFP_ATOMIC and PFMEMALLOC mechanisms provided by
      netdev_alloc_frag().
      
      This would allow to use tun driver even in memory stress
      situations, especially if swap is used over this tun channel.
      
      Fixes: 90e33d45 ("tun: enable napi_gro_frags() for TUN/TAP driver")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Petar Penkov <peterpenkov96@gmail.com>
      Cc: Mahesh Bandewar <maheshb@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa6daaca
    • David S. Miller's avatar
      Merge branch 'IP101GR-devicetree-based-configuration-of-SEL_INTR32' · 05b0e1d6
      David S. Miller authored
      Martin Blumenstingl says:
      
      ====================
      IP101GR: devicetree based configuration of SEL_INTR32
      
      The IP101GR is a 32-pin QFN package variant of the IP101G/IP101GA
      Ethernet PHY. Due to it's limited amount of pins the RXER (receive
      error) and INTR32 (interrupt) functions share pin 21.
      
      The goal of this series is:
      - some small cleanups in patches 3, 4 and 5
      - allowing the kernel to detect IRQ floods on boards where the IP101GR
        is configured in RXER mode but the RXER line is configured on the
        host SoC as interrupt line (patch 6)
      - configuration of the SEL_INTR32 register so we can use the interrupt
        function on boards where the RXER/INTR32 pin (pin 21) is routed to
        one of the host SoC's interrupt inputs (patches 1, 2, 7)
      
      A use-case where this is needed is the Endless Mini (EC-100). I have
      tested my changes on that board. This also confirms that Heiner
      Kallweit's recent icplus.c PHY driver changes are working (at least on
      my setup).
      
      This series is based on net-next commit 7c460cf9 ("net: aquantia:
      fix spelling mistake "specfield" -> "specified"")
      
      Changes since v1 at [0]:
      - collected Andrew's Reviewed-by's (thank you!)
      - updated description of patch #2 to explain why two properties were
        added instead of adding an "this is a IP101GR" property
      - validate that there's no conflicting configuration in patch #7
      - rebased on top of latest net-next
      
      [0] https://patchwork.ozlabs.org/cover/999371/
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05b0e1d6
    • Martin Blumenstingl's avatar
      net: phy: icplus: allow configuring the interrupt function on IP101GR · f2f1a847
      Martin Blumenstingl authored
      The IP101GR is a 32-pin QFN package variant of the IP101G/IP101GA
      Ethernet PHY. Due to it's limited amount of pins the RXER (receive
      error) and INTR32 (interrupt) functions share pin 21.
      By default the PHY is configured to output the "receive error" status on
      pin 21. Depending on the board layout and requirements we may want to
      re-configure the PHY to output the interrupt signal there.
      
      The mode of pin 21 can be configured in the "Digital I/O Specific
      Control Register" (register 29), bit 2:
      - 0 = RXER function
      - 1 = INTR(32) function
      
      Depending on the devicetree configuration we will now:
      - change the mode to either ther RXER or INTR32 function
      - keep the SEL_INTR32 value set by the bootloader (default) if no
        configuration is provided (to ensure that we're not breaking existing
        boards)
      - error out if conflicting configuration is given (RXER and INTR32 mode
        are enabled at the same time)
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f2f1a847
    • Martin Blumenstingl's avatar
      net: phy: icplus: implement .did_interrupt for IP101A/G · f7e290fb
      Martin Blumenstingl authored
      The IP101A_G_IRQ_CONF_STATUS register has bits to detect which
      interrupts have fired. Implement the .did_interrupt callback to let the
      PHY core know whether the interrupt was for this specific PHY.
      
      This is useful for debugging interrupt problems with 32-pin IP101GR PHYs
      where the interrupt line is shared with the RX_ERR (receive error
      status) signal. The default values are:
      - RX_ERR is enabled by default (LOW means that there is no receive
        error)
      - the PHY's interrupt line is configured "active low" by default
      
      Without any additional changes there is a flood of interrupts if the
      RX_ERR/INTR32 signal is configured in RX_ERR mode (which is the
      default). Having a did_interrupt ensures that the PHY core returns
      IRQ_NONE instead of endlessly triggering the PHY state machine.
      Additionally the kernel will report this after a while:
        irq 28: nobody cared (try booting with the "irqpoll" option)
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f7e290fb
    • Martin Blumenstingl's avatar
      net: phy: icplus: rename IP101A_G_NO_IRQ to IP101A_G_IRQ_ALL_MASK · a872c388
      Martin Blumenstingl authored
      The datasheet uses the name "All Mask" for this bit. Change the name of
      our #define to be consistent with the datasheet. While here also replace
      the tab between the #define and IP101A_G_IRQ_ALL_MASK with a space.
      No functional changes.
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a872c388
    • Martin Blumenstingl's avatar
      net: phy: icplus: use the BIT macro where possible · ee336140
      Martin Blumenstingl authored
      This makes the code consistent by using the BIT() macro instead of
      manual bit-shifting for some of the fields. No functional changes.
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ee336140
    • Martin Blumenstingl's avatar
      net: phy: icplus: keep all ip101a_g functions together · 034289b2
      Martin Blumenstingl authored
      This simply moves ip101a_g_config_init right above
      ip101a_g_config_intr so all functions for the ICPlus IP101A/G PHYs are
      grouped together.
      No functional changes.
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      034289b2
    • Martin Blumenstingl's avatar
      dt-bindings: net: phy: add bindings for the IC Plus Corp. IP101A/G PHYs · fdc13a9e
      Martin Blumenstingl authored
      The IP101A and IP101G series both have various models. Depending on the
      board implementation we need a special property for the IP101GR (32-pin
      LQFP package) PHY:
      pin 21 ("RXER/INTR_32") outputs the "receive error" signal by default
      (LOW means "normal operation", HIGH means that there's either a decoding
      error of the received signal or that the PHY is receiving LPI). This pin
      can also be switched to INTR32 mode, where the interrupt signal is
      routed to this pin. The other PHYs don't need this special handling
      because they have more pins available so the interrupt function gets a
      dedicated pin.
      
      This adds two properties to either select the "receive error" or
      "interrupt" function of pin 21. Not specifying any function means that
      the default set by the bootloader is used. This is required because the
      IP101GR cannot be differentiated between other IP101 PHYs as the PHY
      identification registers on all of these is 0x02430c54.
      
      The IP101G (sold as die only, without package) may suffer from the same
      issue depending on how it's integrated into a multi chip package by
      another manufacturer. If only the RXER/INTR_32 pin is routed then the
      users of the die-only variant may also have to explicitly configure the
      mode of hte RXER/INTR_32 pin. This is the reason why no "is-ip101gr"
      property was added. I have no evidence though which would confirm this
      theory - so the binding itself is independent of that.
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fdc13a9e
    • Martin Blumenstingl's avatar
      dt-bindings: vendor-prefix: add prefix for IC Plus Corp. · 8a49f9db
      Martin Blumenstingl authored
      IC Plus Corp. has various Ethernet related products such as Ethernet
      transceivers, Ethernet controllers, Ethernet switches, etc.
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8a49f9db
  2. 18 Nov, 2018 21 commits