1. 19 Feb, 2017 29 commits
    • Xin Long's avatar
      sctp: sctp_transport_dst_check should check if transport pmtu is dst mtu · a4d69a4c
      Xin Long authored
      Now when sending a packet, sctp_transport_dst_check will check if dst
      is obsolete by calling ipv4/ip6_dst_check. But they return obsolete
      only when adding a new cache, after that when the cache's pmtu is
      updated again, it will not trigger transport->dst/pmtu's update.
      
      It can be reproduced by reducing route's pmtu twice. At the 1st time
      client will add a new cache, and transport->pathmtu gets updated as
      sctp_transport_dst_check finds it's obsolete. But at the 2nd time,
      cache's mtu is updated, sctp client will never send out any packet,
      because transport->pmtu has no chance to update.
      
      This patch is to fix this by also checking if transport pmtu is dst
      mtu in sctp_transport_dst_check, so that transport->pmtu can be
      updated on time.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4d69a4c
    • David S. Miller's avatar
      Merge branch 'sctp-rcv-side-stream-reconf-ssn-reset-req-chunk' · 585396bc
      David S. Miller authored
      Xin Long says:
      
      ====================
      sctp: add receiver-side procedures for stream reconf ssn reset request chunk
      
      Patch 3/7 and 4/7 are to implement receiver-side procedures for the
      Outgoing and Incoming SSN Reset Request Parameter described in rfc6525
      section 5.2.2 and 5.2.3
      
      Patch 1/7 and 2/7 are ahead of them to define some apis.
      
      Patch 5/7-7/7 are to add the process of reconf chunk event in rx path.
      
      Note that with this patchset, asoc->reconf_enable has no chance yet to
      be set, until the patch "sctp: add get and set sockopt for reconf_enable"
      is applied in the future. As we can not just enable it when sctp is not
      capable of processing reconf chunk yet.
      
      v1->v2:
        - re-split the patchset and make sure it has no dead codes for review.
        - rename the titles of the commits and improve some changelogs.
        - drop __packed from some structures in patch 1/7.
        - fix some kbuild warnings in patch 3/7 by initializing str_p = NULL.
        - sctp_chunk_lookup_strreset_param changes to return sctp_paramhdr_t *
          and uses sctp_strreset_tsnreq to access request_seq in patch 3/7.
        - use __u<size> in uapi sctp.h in patch 1/7.
        - do str_list endian conversion when generating stream_reset_event in patch
          2/7.
        - remove str_list endian conversion, pass resp_seq param with network endian
          to lookup_strreset_param in 3/7.
        - move str_list endian conversion out of sctp_make_strreset_req, so that
          sctp_make_strreset_req can be used more conveniently to process inreq in
          patch 4/7.
        - remove sctp_merge_reconf_chunk and not support response with multiparam
          in patch 6/7.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      585396bc
    • Xin Long's avatar
      sctp: add reconf chunk event · d884aa63
      Xin Long authored
      This patch is to add reconf chunk event based on the sctp event
      frame in rx path, it will call sctp_sf_do_reconf to process the
      reconf chunk.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d884aa63
    • Xin Long's avatar
      sctp: add reconf chunk process · 2040d3d7
      Xin Long authored
      This patch is to add a function to process the incoming reconf chunk,
      in which it verifies the chunk, and traverses the param and process
      it with the right function one by one.
      
      sctp_sf_do_reconf would be the process function of reconf chunk event.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2040d3d7
    • Xin Long's avatar
      sctp: add a function to verify the sctp reconf chunk · ea625043
      Xin Long authored
      This patch is to add a function sctp_verify_reconf to do some length
      check and multi-params check for sctp stream reconf according to rfc6525
      section 3.1.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ea625043
    • Xin Long's avatar
      sctp: implement receiver-side procedures for the Incoming SSN Reset Request Parameter · 16e1a919
      Xin Long authored
      This patch is to implement Receiver-Side Procedures for the Incoming
      SSN Reset Request Parameter described in rfc6525 section 5.2.3.
      
      It's also to move str_list endian conversion out of sctp_make_strreset_req,
      so that sctp_make_strreset_req can be used more conveniently to process
      inreq.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16e1a919
    • Xin Long's avatar
      sctp: implement receiver-side procedures for the Outgoing SSN Reset Request Parameter · 81054476
      Xin Long authored
      This patch is to implement Receiver-Side Procedures for the Outgoing
      SSN Reset Request Parameter described in rfc6525 section 5.2.2.
      
      Note that some checks must be after request_seq check, as even those
      checks fail, strreset_inseq still has to be increase by 1.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      81054476
    • Xin Long's avatar
      sctp: add support for generating stream ssn reset event notification · 35ea82d6
      Xin Long authored
      This patch is to add Stream Reset Event described in rfc6525
      section 6.1.1.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      35ea82d6
    • Xin Long's avatar
      sctp: add support for generating stream reconf resp chunk · bd4b9f8b
      Xin Long authored
      This patch is to define Re-configuration Response Parameter described
      in rfc6525 section 4.4. As optional fields are only for SSN/TSN Reset
      Request Parameter, it uses another function to make that.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd4b9f8b
    • Jason Wang's avatar
      virtio-net: batch stats updating · 61845d20
      Jason Wang authored
      We already have counters for sent/recv packets and sent/recv bytes.
      Doing a batched update to reduce the number of
      u64_stats_update_begin/end().
      
      Take care not to bother with stats update when called
      speculatively.
      
      Cc: Willem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      61845d20
    • Eric Dumazet's avatar
      mlx4: fix potential divide by 0 in mlx4_en_auto_moderation() · f5a57723
      Eric Dumazet authored
      1) In the case where rate == priv->pkt_rate_low == priv->pkt_rate_high,
      mlx4_en_auto_moderation() does a divide by zero.
      
      2) We want to properly change the moderation parameters if rx_frames
      was changed (like in ethtool -C eth0 rx-frames 16)
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f5a57723
    • Dmitry V. Levin's avatar
      uapi: fix linux/rds.h userspace compilation error · 1786dbf3
      Dmitry V. Levin authored
      On the kernel side, sockaddr_storage is #define'd to
      __kernel_sockaddr_storage.  Replacing struct sockaddr_storage with
      struct __kernel_sockaddr_storage defined by <linux/socket.h> fixes
      the following linux/rds.h userspace compilation error:
      
      /usr/include/linux/rds.h:226:26: error: field 'dest_addr' has incomplete type
        struct sockaddr_storage dest_addr;
      Signed-off-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1786dbf3
    • Dmitry V. Levin's avatar
      uapi: fix linux/rds.h userspace compilation errors · feb0869d
      Dmitry V. Levin authored
      Consistently use types from linux/types.h to fix the following
      linux/rds.h userspace compilation errors:
      
      /usr/include/linux/rds.h:106:2: error: unknown type name 'uint8_t'
        uint8_t name[32];
      /usr/include/linux/rds.h:107:2: error: unknown type name 'uint64_t'
        uint64_t value;
      /usr/include/linux/rds.h:117:2: error: unknown type name 'uint64_t'
        uint64_t next_tx_seq;
      /usr/include/linux/rds.h:118:2: error: unknown type name 'uint64_t'
        uint64_t next_rx_seq;
      /usr/include/linux/rds.h:121:2: error: unknown type name 'uint8_t'
        uint8_t transport[TRANSNAMSIZ];  /* null term ascii */
      /usr/include/linux/rds.h:122:2: error: unknown type name 'uint8_t'
        uint8_t flags;
      /usr/include/linux/rds.h:129:2: error: unknown type name 'uint64_t'
        uint64_t seq;
      /usr/include/linux/rds.h:130:2: error: unknown type name 'uint32_t'
        uint32_t len;
      /usr/include/linux/rds.h:135:2: error: unknown type name 'uint8_t'
        uint8_t flags;
      /usr/include/linux/rds.h:139:2: error: unknown type name 'uint32_t'
        uint32_t sndbuf;
      /usr/include/linux/rds.h:144:2: error: unknown type name 'uint32_t'
        uint32_t rcvbuf;
      /usr/include/linux/rds.h:145:2: error: unknown type name 'uint64_t'
        uint64_t inum;
      /usr/include/linux/rds.h:153:2: error: unknown type name 'uint64_t'
        uint64_t       hdr_rem;
      /usr/include/linux/rds.h:154:2: error: unknown type name 'uint64_t'
        uint64_t       data_rem;
      /usr/include/linux/rds.h:155:2: error: unknown type name 'uint32_t'
        uint32_t       last_sent_nxt;
      /usr/include/linux/rds.h:156:2: error: unknown type name 'uint32_t'
        uint32_t       last_expected_una;
      /usr/include/linux/rds.h:157:2: error: unknown type name 'uint32_t'
        uint32_t       last_seen_una;
      /usr/include/linux/rds.h:164:2: error: unknown type name 'uint8_t'
        uint8_t  src_gid[RDS_IB_GID_LEN];
      /usr/include/linux/rds.h:165:2: error: unknown type name 'uint8_t'
        uint8_t  dst_gid[RDS_IB_GID_LEN];
      /usr/include/linux/rds.h:167:2: error: unknown type name 'uint32_t'
        uint32_t max_send_wr;
      /usr/include/linux/rds.h:168:2: error: unknown type name 'uint32_t'
        uint32_t max_recv_wr;
      /usr/include/linux/rds.h:169:2: error: unknown type name 'uint32_t'
        uint32_t max_send_sge;
      /usr/include/linux/rds.h:170:2: error: unknown type name 'uint32_t'
        uint32_t rdma_mr_max;
      /usr/include/linux/rds.h:171:2: error: unknown type name 'uint32_t'
        uint32_t rdma_mr_size;
      /usr/include/linux/rds.h:212:9: error: unknown type name 'uint64_t'
       typedef uint64_t rds_rdma_cookie_t;
      /usr/include/linux/rds.h:215:2: error: unknown type name 'uint64_t'
        uint64_t addr;
      /usr/include/linux/rds.h:216:2: error: unknown type name 'uint64_t'
        uint64_t bytes;
      /usr/include/linux/rds.h:221:2: error: unknown type name 'uint64_t'
        uint64_t cookie_addr;
      /usr/include/linux/rds.h:222:2: error: unknown type name 'uint64_t'
        uint64_t flags;
      /usr/include/linux/rds.h:228:2: error: unknown type name 'uint64_t'
        uint64_t  cookie_addr;
      /usr/include/linux/rds.h:229:2: error: unknown type name 'uint64_t'
        uint64_t  flags;
      /usr/include/linux/rds.h:234:2: error: unknown type name 'uint64_t'
        uint64_t flags;
      /usr/include/linux/rds.h:240:2: error: unknown type name 'uint64_t'
        uint64_t local_vec_addr;
      /usr/include/linux/rds.h:241:2: error: unknown type name 'uint64_t'
        uint64_t nr_local;
      /usr/include/linux/rds.h:242:2: error: unknown type name 'uint64_t'
        uint64_t flags;
      /usr/include/linux/rds.h:243:2: error: unknown type name 'uint64_t'
        uint64_t user_token;
      /usr/include/linux/rds.h:248:2: error: unknown type name 'uint64_t'
        uint64_t  local_addr;
      /usr/include/linux/rds.h:249:2: error: unknown type name 'uint64_t'
        uint64_t  remote_addr;
      /usr/include/linux/rds.h:252:4: error: unknown type name 'uint64_t'
          uint64_t compare;
      /usr/include/linux/rds.h:253:4: error: unknown type name 'uint64_t'
          uint64_t swap;
      /usr/include/linux/rds.h:256:4: error: unknown type name 'uint64_t'
          uint64_t add;
      /usr/include/linux/rds.h:259:4: error: unknown type name 'uint64_t'
          uint64_t compare;
      /usr/include/linux/rds.h:260:4: error: unknown type name 'uint64_t'
          uint64_t swap;
      /usr/include/linux/rds.h:261:4: error: unknown type name 'uint64_t'
          uint64_t compare_mask;
      /usr/include/linux/rds.h:262:4: error: unknown type name 'uint64_t'
          uint64_t swap_mask;
      /usr/include/linux/rds.h:265:4: error: unknown type name 'uint64_t'
          uint64_t add;
      /usr/include/linux/rds.h:266:4: error: unknown type name 'uint64_t'
          uint64_t nocarry_mask;
      /usr/include/linux/rds.h:269:2: error: unknown type name 'uint64_t'
        uint64_t flags;
      /usr/include/linux/rds.h:270:2: error: unknown type name 'uint64_t'
        uint64_t user_token;
      /usr/include/linux/rds.h:274:2: error: unknown type name 'uint64_t'
        uint64_t user_token;
      /usr/include/linux/rds.h:275:2: error: unknown type name 'int32_t'
        int32_t  status;
      Signed-off-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      feb0869d
    • Dmitry V. Levin's avatar
      uapi: fix linux/mroute.h userspace compilation errors · bcb41c6b
      Dmitry V. Levin authored
      Include <linux/in.h> to fix the following linux/mroute.h userspace
      compilation errors:
      
      /usr/include/linux/mroute.h:58:18: error: field 'vifc_lcl_addr' has incomplete type
        struct in_addr vifc_lcl_addr;     /* Local interface address */
      /usr/include/linux/mroute.h:61:17: error: field 'vifc_rmt_addr' has incomplete type
        struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */
      /usr/include/linux/mroute.h:72:17: error: field 'mfcc_origin' has incomplete type
        struct in_addr mfcc_origin;  /* Origin of mcast */
      /usr/include/linux/mroute.h:73:17: error: field 'mfcc_mcastgrp' has incomplete type
        struct in_addr mfcc_mcastgrp;  /* Group in question */
      /usr/include/linux/mroute.h:84:17: error: field 'src' has incomplete type
        struct in_addr src;
      /usr/include/linux/mroute.h:85:17: error: field 'grp' has incomplete type
        struct in_addr grp;
      /usr/include/linux/mroute.h:109:17: error: field 'im_src' has incomplete type
        struct in_addr im_src,im_dst;
      /usr/include/linux/mroute.h:109:24: error: field 'im_dst' has incomplete type
        struct in_addr im_src,im_dst;
      Signed-off-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bcb41c6b
    • Dmitry V. Levin's avatar
      uapi: fix linux/mroute6.h userspace compilation errors · 72aa107d
      Dmitry V. Levin authored
      Include <linux/in6.h> to fix the following linux/mroute6.h userspace
      compilation errors:
      
      /usr/include/linux/mroute6.h:80:22: error: field 'mf6cc_origin' has incomplete type
        struct sockaddr_in6 mf6cc_origin;  /* Origin of mcast */
      /usr/include/linux/mroute6.h:81:22: error: field 'mf6cc_mcastgrp' has incomplete type
        struct sockaddr_in6 mf6cc_mcastgrp;  /* Group in question */
      /usr/include/linux/mroute6.h:91:22: error: field 'src' has incomplete type
        struct sockaddr_in6 src;
      /usr/include/linux/mroute6.h:92:22: error: field 'grp' has incomplete type
        struct sockaddr_in6 grp;
      /usr/include/linux/mroute6.h:132:18: error: field 'im6_src' has incomplete type
        struct in6_addr im6_src, im6_dst;
      /usr/include/linux/mroute6.h:132:27: error: field 'im6_dst' has incomplete type
        struct in6_addr im6_src, im6_dst;
      Signed-off-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      72aa107d
    • Dmitry V. Levin's avatar
      uapi: fix linux/ipv6_route.h userspace compilation errors · 6c07ec0f
      Dmitry V. Levin authored
      Include <linux/in6.h> to fix the following linux/ipv6_route.h userspace
      compilation errors:
      
      /usr/include/linux/ipv6_route.h:42:19: error: field 'rtmsg_dst' has incomplete type
        struct in6_addr  rtmsg_dst;
      /usr/include/linux/ipv6_route.h:43:19: error: field 'rtmsg_src' has incomplete type
        struct in6_addr  rtmsg_src;
      /ust/include/linux/ipv6_route.h:44:19: error: field 'rtmsg_gateway' has incomplete type
        struct in6_addr  rtmsg_gateway;
      Signed-off-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c07ec0f
    • Thomas Falcon's avatar
      ibmvnic: Make CRQ interrupt tasklet wait for all capabilities crqs · 249168ad
      Thomas Falcon authored
      After sending device capability queries and requests to the vNIC Server,
      an interrupt is triggered and the responses are written to the driver's
      CRQ response buffer. Since the interrupt can be triggered before all
      responses are written and visible to the partition, there is a danger
      that the interrupt handler or tasklet can terminate before all responses
      are read, resulting in a failure to initialize the device.
      
      To avoid this scenario, when capability commands are sent, we set
      a flag that will be checked in the following interrupt tasklet that
      will handle the capability responses from the server. Once all
      responses have been handled, the flag is disabled; and the tasklet
      is allowed to terminate.
      Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      249168ad
    • Thomas Falcon's avatar
      ibmvnic: Use common counter for capabilities checks · 901e040a
      Thomas Falcon authored
      Two different counters were being used for capabilities
      requests and queries. These commands are not called
      at the same time so there is no reason a single counter
      cannot be used.
      Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      901e040a
    • Thomas Falcon's avatar
      ibmvnic: Handle processing of CRQ messages in a tasklet · 6c267b3d
      Thomas Falcon authored
      Create a tasklet to process queued commands or messages received from
      firmware instead of processing them in the interrupt handler. Note that
      this handler does not process network traffic, but communications related
      to resource allocation and device settings.
      Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c267b3d
    • Arun Easi's avatar
      qed: Add support for hardware offloaded FCoE. · 1e128c81
      Arun Easi authored
      This adds the backbone required for the various HW initalizations
      which are necessary for the FCoE driver (qedf) for QLogic FastLinQ
      4xxxx line of adapters - FW notification, resource initializations, etc.
      Signed-off-by: default avatarArun Easi <arun.easi@cavium.com>
      Signed-off-by: default avatarYuval Mintz <yuval.mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1e128c81
    • David S. Miller's avatar
    • Willem de Bruijn's avatar
      ipv6: release dst on error in ip6_dst_lookup_tail · 00ea1cee
      Willem de Bruijn authored
      If ip6_dst_lookup_tail has acquired a dst and fails the IPv4-mapped
      check, release the dst before returning an error.
      
      Fixes: ec5e3b0a ("ipv6: Inhibit IPv4-mapped src address on the wire.")
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00ea1cee
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 2763f92f
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "Two more bugfixes that came in during this week:
      
         - a defconfig change to enable a vital driver used on some Qualcomm
           based phones. This was already queued for 4.11, but the maintainer
           asked to have it in 4.10 after all.
      
         - a regression fix for the reset controller framework, this got
           broken by a typo in the 4.10 merge window"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: multi_v7_defconfig: enable Qualcomm RPMCC
        reset: fix shared reset triggered_count decrement on error
      2763f92f
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm · b92ce305
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "A couple of fixes from Kees concerning problems he spotted with our
        user access support"
      
      * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 8658/1: uaccess: fix zeroing of 64-bit get_user()
        ARM: 8657/1: uaccess: consistently check object sizes
      b92ce305
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 17a984bc
      Linus Torvalds authored
      Pull x86 fix from Thomas Gleixner:
       "Make the build clean by working around yet another GCC stupidity"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/vm86: Fix unused variable warning if THP is disabled
      17a984bc
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 244ff16f
      Linus Torvalds authored
      Pull locking fix from Thomas Gleixner:
       "Move the futex init function to core initcall so user mode helper does
        not run into an uninitialized futex syscall"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        futex: Move futex_init() to core_initcall
      244ff16f
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e602e700
      Linus Torvalds authored
      Pull timer fixes from Thomas Gleixner:
       "Two small fixes::
      
         - Prevent deadlock on the tick broadcast lock. Found and fixed by
           Mike.
      
         - Stop using printk() in the timekeeping debug code to prevent a
           deadlock against the scheduler"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        timekeeping: Use deferred printk() in debug code
        tick/broadcast: Prevent deadlock on tick_broadcast_lock
      e602e700
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 3dd9c127
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix leak in dpaa_eth error paths, from Dan Carpenter.
      
       2) Use after free when using IPV6_RECVPKTINFO, from Andrey Konovalov.
      
       3) fanout_release() cannot be invoked from atomic contexts, from Anoob
          Soman.
      
       4) Fix bogus attempt at lockdep annotation in IRDA.
      
       5) dev_fill_metadata_dst() can OOP on a NULL dst cache pointer, from
          Paolo Abeni.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        irda: Fix lockdep annotations in hashbin_delete().
        vxlan: fix oops in dev_fill_metadata_dst
        dccp: fix freeing skb too early for IPV6_RECVPKTINFO
        dpaa_eth: small leak on error
        packet: Do not call fanout_release from atomic contexts
      3dd9c127
    • Sergey Senozhatsky's avatar
      printk: use rcuidle console tracepoint · fc98c3c8
      Sergey Senozhatsky authored
      Use rcuidle console tracepoint because, apparently, it may be issued
      from an idle CPU:
      
        hw-breakpoint: Failed to enable monitor mode on CPU 0.
        hw-breakpoint: CPU 0 failed to disable vector catch
      
        ===============================
        [ ERR: suspicious RCU usage.  ]
        4.10.0-rc8-next-20170215+ #119 Not tainted
        -------------------------------
        ./include/trace/events/printk.h:32 suspicious rcu_dereference_check() usage!
      
        other info that might help us debug this:
      
        RCU used illegally from idle CPU!
        rcu_scheduler_active = 2, debug_locks = 0
        RCU used illegally from extended quiescent state!
        2 locks held by swapper/0/0:
         #0:  (cpu_pm_notifier_lock){......}, at: [<c0237e2c>] cpu_pm_exit+0x10/0x54
         #1:  (console_lock){+.+.+.}, at: [<c01ab350>] vprintk_emit+0x264/0x474
      
        stack backtrace:
        CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.10.0-rc8-next-20170215+ #119
        Hardware name: Generic OMAP4 (Flattened Device Tree)
          console_unlock
          vprintk_emit
          vprintk_default
          printk
          reset_ctrl_regs
          dbg_cpu_pm_notify
          notifier_call_chain
          cpu_pm_exit
          omap_enter_idle_coupled
          cpuidle_enter_state
          cpuidle_enter_state_coupled
          do_idle
          cpu_startup_entry
          start_kernel
      
      This RCU warning, however, is suppressed by lockdep_off() in printk().
      lockdep_off() increments the ->lockdep_recursion counter and thus
      disables RCU_LOCKDEP_WARN() and debug_lockdep_rcu_enabled(), which want
      lockdep to be enabled "current->lockdep_recursion == 0".
      
      Link: http://lkml.kernel.org/r/20170217015932.11898-1-sergey.senozhatsky@gmail.comSigned-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Reported-by: default avatarTony Lindgren <tony@atomide.com>
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Acked-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Russell King <rmk@armlinux.org.uk>
      Cc: <stable@vger.kernel.org> [3.4+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fc98c3c8
  2. 18 Feb, 2017 1 commit
  3. 17 Feb, 2017 10 commits
    • David S. Miller's avatar
      irda: Fix lockdep annotations in hashbin_delete(). · 4c03b862
      David S. Miller authored
      A nested lock depth was added to the hasbin_delete() code but it
      doesn't actually work some well and results in tons of lockdep splats.
      
      Fix the code instead to properly drop the lock around the operation
      and just keep peeking the head of the hashbin queue.
      Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Tested-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c03b862
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 6dc39c50
      Linus Torvalds authored
      Pull block layer fix from Jens Axboe:
       "A single fix for a lockdep splat reported by Thomas and Gabriel"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        cfq-iosched: don't call wbt_disable_default() with IRQs disabled
      6dc39c50
    • Paolo Abeni's avatar
      vxlan: fix oops in dev_fill_metadata_dst · 22f0708a
      Paolo Abeni authored
      Since the commit 0c1d70af ("net: use dst_cache for vxlan device")
      vxlan_fill_metadata_dst() calls vxlan_get_route() passing a NULL
      dst_cache pointer, so the latter should explicitly check for
      valid dst_cache ptr. Unfortunately the commit d71785ff ("net: add
      dst_cache to ovs vxlan lwtunnel") removed said check.
      
      As a result is possible to trigger a null pointer access calling
      vxlan_fill_metadata_dst(), e.g. with:
      
      ovs-vsctl add-br ovs-br0
      ovs-vsctl add-port ovs-br0 vxlan0 -- set interface vxlan0 \
      	type=vxlan options:remote_ip=192.168.1.1 \
      	options:key=1234 options:dst_port=4789 ofport_request=10
      ip address add dev ovs-br0 172.16.1.2/24
      ovs-vsctl set Bridge ovs-br0 ipfix=@i -- --id=@i create IPFIX \
      	targets=\"172.16.1.1:1234\" sampling=1
      iperf -c 172.16.1.1 -u -l 1000 -b 10M -t 1 -p 1234
      
      This commit addresses the issue passing to vxlan_get_route() the
      dst_cache already available into the lwt info processed by
      vxlan_fill_metadata_dst().
      
      Fixes: d71785ff ("net: add dst_cache to ovs vxlan lwtunnel")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Acked-by: default avatarJiri Benc <jbenc@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      22f0708a
    • Eric Dumazet's avatar
      tcp: use page_ref_inc() in tcp_sendmsg() · 4e33e346
      Eric Dumazet authored
      sk_page_frag_refill() allocates either a compound page or an order-0
      page. We can use page_ref_inc() which is slightly faster than get_page()
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e33e346
    • Cui, Cheng's avatar
      tcp: accommodate sequence number to a peer's shrunk receive window caused by... · a4ecb15a
      Cui, Cheng authored
      tcp: accommodate sequence number to a peer's shrunk receive window caused by precision loss in window scaling
      
      Prevent sending out a left-shifted sequence number from a Linux sender in
      response to a peer's shrunk receive-window caused by losing least significant
      bits in window-scaling.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: James Morris <jmorris@namei.org>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarCheng Cui <Cheng.Cui@netapp.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4ecb15a
    • David S. Miller's avatar
      Merge branch 'sfc-misc-fixes' · e606519e
      David S. Miller authored
      Edward Cree says:
      
      ====================
      sfc: misc. fixes
      
      Three largely unrelated fixes to increase robustness in rare edge cases.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e606519e
    • Peter Dunning's avatar
      sfc: do not device_attach if a reset is pending · 9c568fd8
      Peter Dunning authored
      efx_start_all can return without initialising queues as a reset is pending.
       This means that when netif_device_attach is called, the kernel can start
       sending traffic without having an initialised TX queue to send to.
      This patch avoids this by not calling netif_device_attach if there is a
       pending reset.
      
      Fixes: e283546c ("sfc:On MCDI timeout, issue an FLR (and mark MCDI to fail-fast)")
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c568fd8
    • Bert Kenward's avatar
      sfc: forget filters from sw table if hw replies ENOENT on removing them · 105eac6c
      Bert Kenward authored
      If the hw doesn't think they exist, we should defer to its authority.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      105eac6c
    • Jon Cooper's avatar
      sfc: fix filter_id misinterpretation in edge case · 0ccb998b
      Jon Cooper authored
      On EF10, hardware filter IDs are 13 bits, but in some places we store
       32-bit "full filter IDs" in which higher order bits encode the filter
       match-priority.  This could cause a filter to have a full filter ID of
       0xffff, which is also the value EFX_EF10_FILTER_ID_INVALID which we use
       in 16-bit "short" filter IDs (without match-priority bits).  This would
       occur if the hardware filter ID was 0x1fff and the match-priority was 7.
      Unfortunately, some code that checks for EFX_EF10_FILTER_ID_INVALID can
       be called on full filter IDs, and will WARN_ON if this ever happens.
      So, since we have plenty of spare bits in the full filter ID, this patch
       shifts the priority bits left one bit when constructing the full filter
       IDs, ensuring that the 0x2000 bit of a full filter ID will always be 0
       and thus no full filter ID can ever equal EFX_EF10_FILTER_ID_INVALID.
      
      This patch also replaces open-coded full<->short filter ID conversions
       with calls to functions, thus keeping the definition of the full filter
       ID format in one place.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ccb998b
    • Arnd Bergmann's avatar
      vmxnet3: prevent building with 64K pages · fbdf0e28
      Arnd Bergmann authored
      I got a warning about broken code on ARM64 with 64K pages:
      
      drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_rq_init':
      drivers/net/vmxnet3/vmxnet3_drv.c:1679:29: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
          rq->buf_info[0][i].len = PAGE_SIZE;
      
      'len' here is a 16-bit integer, so this clearly won't work. I don't think
      this driver is used much on anything other than x86, so there is no need
      to fix this properly and we can work around it with a Kconfig dependency
      to forbid known-broken configurations. qemu in theory supports it on
      other architectures too, but presumably only for compatibility with x86
      guests that also run on vmware.
      
      CONFIG_PAGE_SIZE_64KB is used on hexagon, mips, sh and tile, the other
      symbols are architecture-specific names for the same thing.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fbdf0e28