1. 29 Sep, 2018 10 commits
    • Vakul Garg's avatar
      tls: Remove redundant vars from tls record structure · 80ece6a0
      Vakul Garg authored
      Structure 'tls_rec' contains sg_aead_in and sg_aead_out which point
      to a aad_space and then chain scatterlists sg_plaintext_data,
      sg_encrypted_data respectively. Rather than using chained scatterlists
      for plaintext and encrypted data in aead_req, it is efficient to store
      aad_space in sg_encrypted_data and sg_plaintext_data itself in the
      first index and get rid of sg_aead_in, sg_aead_in and further chaining.
      
      This requires increasing size of sg_encrypted_data & sg_plaintext_data
      arrarys by 1 to accommodate entry for aad_space. The code which uses
      sg_encrypted_data and sg_plaintext_data has been modified to skip first
      index as it points to aad_space.
      Signed-off-by: default avatarVakul Garg <vakul.garg@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      80ece6a0
    • David S. Miller's avatar
      Merge branch 'tipc-next' · 6e9feb33
      David S. Miller authored
      Jon Maloy says:
      
      ====================
      tipc: make connection setup more robust
      
      In this series we make a few improvements to the connection setup and
      probing mechanism, culminating in the last commit where we make it
      possible for a client socket to make multiple setup attempts in case
      it encounters receive buffer overflow at the listener socket.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e9feb33
    • Tung Nguyen's avatar
      tipc: buffer overflow handling in listener socket · 67879274
      Tung Nguyen authored
      Default socket receive buffer size for a listener socket is 2Mb. For
      each arriving empty SYN, the linux kernel allocates a 768 bytes buffer.
      This means that a listener socket can serve maximum 2700 simultaneous
      empty connection setup requests before it hits a receive buffer
      overflow, and much fewer if the SYN is carrying any significant
      amount of data.
      
      When this happens the setup request is rejected, and the client
      receives an ECONNREFUSED error.
      
      This commit mitigates this problem by letting the client socket try to
      retransmit the SYN message multiple times when it sees it rejected with
      the code TIPC_ERR_OVERLOAD. Retransmission is done at random intervals
      in the range of [100 ms, setup_timeout / 4], as many times as there is
      room for within the setup timeout limit.
      Signed-off-by: default avatarTung Nguyen <tung.q.nguyen@dektech.com.au>
      Acked-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67879274
    • Jon Maloy's avatar
      tipc: add SYN bit to connection setup messages · 25b9221b
      Jon Maloy authored
      Messages intended for intitating a connection are currently
      indistinguishable from regular datagram messages. The TIPC
      protocol specification defines bit 17 in word 0 as a SYN bit
      to allow sanity check of such messages in the listening socket,
      but this has so far never been implemented.
      
      We do that in this commit.
      Acked-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      25b9221b
    • Jon Maloy's avatar
      tipc: refactor function tipc_sk_filter_connect() · 39fdc9c7
      Jon Maloy authored
      We refactor the function tipc_sk_filter_connect(), both to make it
      more readable and as a preparation for the next commit.
      Acked-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      39fdc9c7
    • Jon Maloy's avatar
      tipc: refactor function tipc_sk_timeout() · afe8792f
      Jon Maloy authored
      We refactor this function as a preparation for the coming commits in
      the same series.
      Acked-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      afe8792f
    • Jon Maloy's avatar
      tipc: refactor function tipc_msg_reverse() · 5cbdbd1a
      Jon Maloy authored
      The function tipc_msg_reverse() is reversing the header of a message
      while reusing the original buffer. We have seen at several occasions
      that this may have unfortunate side effects when the buffer to be
      reversed is a clone.
      
      In one of the following commits we will again need to reverse cloned
      buffers, so this is the right time to permanently eliminate this
      problem. In this commit we let the said function always consume the
      original buffer and replace it with a new one when applicable.
      Acked-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5cbdbd1a
    • Yuchung Cheng's avatar
      tcp: up initial rmem to 128KB and SYN rwin to around 64KB · a337531b
      Yuchung Cheng authored
      Previously TCP initial receive buffer is ~87KB by default and
      the initial receive window is ~29KB (20 MSS). This patch changes
      the two numbers to 128KB and ~64KB (rounding down to the multiples
      of MSS) respectively. The patch also simplifies the calculations s.t.
      the two numbers are directly controlled by sysctl tcp_rmem[1]:
      
        1) Initial receiver buffer budget (sk_rcvbuf): while this should
           be configured via sysctl tcp_rmem[1], previously tcp_fixup_rcvbuf()
           always override and set a larger size when a new connection
           establishes.
      
        2) Initial receive window in SYN: previously it is set to 20
           packets if MSS <= 1460. The number 20 was based on the initial
           congestion window of 10: the receiver needs twice amount to
           avoid being limited by the receive window upon out-of-order
           delivery in the first window burst. But since this only
           applies if the receiving MSS <= 1460, connection using large MTU
           (e.g. to utilize receiver zero-copy) may be limited by the
           receive window.
      
      With this patch TCP memory configuration is more straight-forward and
      more properly sized to modern high-speed networks by default. Several
      popular stacks have been announcing 64KB rwin in SYNs as well.
      Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarWei Wang <weiwan@google.com>
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a337531b
    • David S. Miller's avatar
      hns3: Another build fix. · 3ff6cde8
      David S. Miller authored
      drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c: In function ‘hclge_get_sset_count’:
      drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c:496:31: error: ‘HNAE3_REVISION_ID_21’ undeclared (first use in this function); did you mean ‘FADT2_REVISION_ID’?
         if (hdev->pdev->revision >= HNAE3_REVISION_ID_21 ||
                                     ^~~~~~~~~~~~~~~~~~~~
                                     FADT2_REVISION_ID
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ff6cde8
    • David S. Miller's avatar
      hns3: Fix the build. · d4017665
      David S. Miller authored
      drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c: In function ‘hns3_self_test’:
      drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c:278:15: error: ‘HNS3_SELF_TEST_TYPE_NUM’ undeclared (first use in this function); did you mean ‘HNS3_SELF_TEST_TPYE_NUM’?
        int st_param[HNS3_SELF_TEST_TYPE_NUM][2];
                     ^~~~~~~~~~~~~~~~~~~~~~~
                     HNS3_SELF_TEST_TPYE_NUM
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d4017665
  2. 28 Sep, 2018 30 commits