1. 20 Feb, 2017 23 commits
  2. 19 Feb, 2017 17 commits
    • Xin Long's avatar
      sctp: check duplicate node before inserting a new transport · cd2b7087
      Xin Long authored
      sctp has changed to use rhlist for transport rhashtable since commit
      7fda702f ("sctp: use new rhlist interface on sctp transport
      rhashtable").
      
      But rhltable_insert_key doesn't check the duplicate node when inserting
      a node, unlike rhashtable_lookup_insert_key. It may cause duplicate
      assoc/transport in rhashtable. like:
      
       client (addr A, B)                 server (addr X, Y)
          connect to X           INIT (1)
                              ------------>
          connect to Y           INIT (2)
                              ------------>
                               INIT_ACK (1)
                              <------------
                               INIT_ACK (2)
                              <------------
      
      After sending INIT (2), one transport will be created and hashed into
      rhashtable. But when receiving INIT_ACK (1) and processing the address
      params, another transport will be created and hashed into rhashtable
      with the same addr Y and EP as the last transport. This will confuse
      the assoc/transport's lookup.
      
      This patch is to fix it by returning err if any duplicate node exists
      before inserting it.
      
      Fixes: 7fda702f ("sctp: use new rhlist interface on sctp transport rhashtable")
      Reported-by: default avatarFabio M. Di Nitto <fdinitto@redhat.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cd2b7087
    • David Daney's avatar
      of_mdio: Add "broadcom,bcm5241" to the whitelist. · 7e1392fb
      David Daney authored
      Some Cavium dev boards have firmware which doesn't supply a proper
      ethernet-phy-ieee802.3-c22" compatible property.  Restore these boards
      to working order by whitelisting this compatible value.
      Signed-off-by: default avatarDavid Daney <david.daney@cavium.com>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7e1392fb
    • david.wu's avatar
      net: ethernet: stmmac: dwmac-rk: Add RK3328 gmac support · d4ff816e
      david.wu authored
      Add constants and callback functions for the dwmac on rk3328 socs.
      As can be seen, the base structure is the same, only registers and the
      bits in them moved slightly.
      Signed-off-by: default avatardavid.wu <david.wu@rock-chips.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d4ff816e
    • 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