1. 28 6月, 2014 20 次提交
    • O
      tcp: add init_cookie_seq method to tcp_request_sock_ops · fb7b37a7
      Octavian Purdila 提交于
      Move the specific IPv4/IPv6 cookie sequence initialization to a new
      method in tcp_request_sock_ops in preparation for unifying
      tcp_v4_conn_request and tcp_v6_conn_request.
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fb7b37a7
    • O
      tcp: add init_req method to tcp_request_sock_ops · 16bea70a
      Octavian Purdila 提交于
      Move the specific IPv4/IPv6 intializations to a new method in
      tcp_request_sock_ops in preparation for unifying tcp_v4_conn_request
      and tcp_v6_conn_request.
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16bea70a
    • O
      net: remove inet6_reqsk_alloc · 476eab82
      Octavian Purdila 提交于
      Since pktops is only used for IPv6 only and opts is used for IPv4
      only, we can move these fields into a union and this allows us to drop
      the inet6_reqsk_alloc function as after this change it becomes
      equivalent with inet_reqsk_alloc.
      
      This patch also fixes a kmemcheck issue in the IPv6 stack: the flags
      field was not annotated after a request_sock was allocated.
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      476eab82
    • O
      tcp: tcp_v[46]_conn_request: fix snt_synack initialization · aa27fc50
      Octavian Purdila 提交于
      Commit 016818d0 (tcp: TCP Fast Open Server - take SYNACK RTT after
      completing 3WHS) changes the code to only take a snt_synack timestamp
      when a SYNACK transmit or retransmit succeeds. This behaviour is later
      broken by commit 843f4a55 (tcp: use tcp_v4_send_synack on first
      SYN-ACK), as snt_synack is now updated even if tcp_v4_send_synack
      fails.
      
      Also, commit 3a19ce0e (tcp: IPv6 support for fastopen server) misses
      the required IPv6 updates for 016818d0.
      
      This patch makes sure that snt_synack is updated only when the SYNACK
      trasnmit/retransmit succeeds, for both IPv4 and IPv6.
      
      Cc: Cardwell <ncardwell@google.com>
      Cc: Daniel Lee <longinus00@gmail.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aa27fc50
    • O
    • D
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next · c1c27fb9
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2014-06-26
      
      This series contains updates to i40e and i40evf.
      
      Kamil provides a cleanup patch to i40e where we do not need to acquire the
      NVM for shadow RAM checksum calculation, since we only read the shadow RAM
      through SRCTL register.
      
      Paul provides a fix for handling HMC for big endian architectures for i40e
      and i40evf.
      
      Mitch provides four cleanup and fixes for i40evf.  Fix an issue where if
      the VF driver fails to complete early init, then rmmod can cause a softlock
      when the driver tries to stop a watchdog timer that never got initialized.
      So add a check to see if the timer is actually initialized before stopping
      it.  Make the function i40evf_send_api_ver() return more useful information,
      instead of just returning -EIO by propagating firmware errors back to the
      caller and log a message if the PF sends an invalid reply.  Fix up a log
      message that was missing a word, which makes the log message more readable.
      Fix an initialization failure if many VFs are instantiated at the same time
      and the VF module is autoloaded by simply resending firmware request if
      there is no response the first time.
      
      Jacob does a rename of the function i40e_ptp_enable() to
      i40e_ptp_feature_enable(), like he did for ixgbe, to reduce possible
      confusion and ambugity in the purpose of the function.  Does follow on
      PTP work on i40e, like he did for ixgbe, by breaking the PTP hardware
      control from the ioctl command for timestamping mode.  By doing this,
      we can maintain state about the 1588 timestamping mode and properly
      re-enable to the last known mode during a re-initialization of 1588 bits.
      
      Anjali cleans up the i40e driver where TCP-IPv4 filters were being added
      twice, which seems to be left over from when we had to add two PTYPEs for
      one filter.  Fixes the flow director sideband logic to detect when there
      is a full flow director table.  Also fixes the programming of FDIR where
      a couple of fields in the descriptor setup that were not being
      programmed, which left the opportunity for stale data to be pushed as
      part of the descriptor next time it was used.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c1c27fb9
    • D
      Merge branch 'tipc-next' · 0ff9275a
      David S. Miller 提交于
      Jon Maloy says:
      
      ====================
      tipc: new unicast transmission code
      
      As a step towards making the data transmission code more maintainable
      and performant, we introduce a number of new functions, both for
      building, sending and rejecting messages. The new functions will
      eventually be used for alla data transmission, user data unicast,
      service internal messaging, and multicast/broadcast.
      
      We start with this series, where we introduce the functions, and
      let user data unicast and the internal connection protocol use them.
      The remaining users will come in a later series.
      
      There are only minor changes to data structures, and no protocol
      changes, so the older functions can still be used in parallel for
      some time. Until the old functions are removed, we use temporary
      names for the new functions, such as tipc_build_msg2, tipc_link_xmit2.
      
      It should be noted that the first two commits are unrelated to the
      rest of the series.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0ff9275a
    • J
      tipc: simplify connection congestion handling · 60120526
      Jon Paul Maloy 提交于
      As a consequence of the recently introduced serialized access
      to the socket in commit 8d94168a761819d10252bab1f8de6d7b202c3baa
      ("tipc: same receive code path for connection protocol and data
      messages") we can make a number of simplifications in the
      detection and handling of connection congestion situations.
      
      - We don't need to keep two counters, one for sent messages and one
        for acked messages. There is no longer any risk for races between
        acknowledge messages arriving in BH and data message sending
        running in user context. So we merge this into one counter,
        'sent_unacked', which is incremented at sending and subtracted
        from at acknowledge reception.
      
      - We don't need to set the 'congested' field in tipc_port to
        true before we sent the message, and clear it when sending
        is successful. (As a matter of fact, it was never necessary;
        the field was set in link_schedule_port() before any wakeup
        could arrive anyway.)
      
      - We keep the conditions for link congestion and connection connection
        congestion separated. There would otherwise be a risk that an arriving
        acknowledge message may wake up a user sleeping because of link
        congestion.
      
      - We can simplify reception of acknowledge messages.
      
      We also make some cosmetic/structural changes:
      
      - We rename the 'congested' field to the more correct 'link_cong´.
      
      - We rename 'conn_unacked' to 'rcv_unacked'
      
      - We move the above mentioned fields from struct tipc_port to
        struct tipc_sock.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      60120526
    • J
      tipc: clean up connection protocol reception function · ac0074ee
      Jon Paul Maloy 提交于
      We simplify the code for receiving connection probes, leveraging the
      recently introduced tipc_msg_reverse() function. We also stick to
      the principle of sending a possible response message directly from
      the calling (tipc_sk_rcv or backlog_rcv) functions, hence making
      the call chain shallower and easier to follow.
      
      We make one small protocol change here, allowed according to
      the spec. If a protocol message arrives from a remote socket that
      is not the one we are connected to, we are currently generating a
      connection abort message and send it to the source. This behavior
      is unnecessary, and might even be a security risk, so instead we
      now choose to only ignore the message. The consequnce for the sender
      is that he will need longer time to discover his mistake (until the
      next timeout), but this is an extreme corner case, and may happen
      anyway under other circumstances, so we deem this change acceptable.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ac0074ee
    • J
      tipc: same receive code path for connection protocol and data messages · ec8a2e56
      Jon Paul Maloy 提交于
      As a preparation to eliminate port_lock we need to bring reception
      of connection protocol messages under proper protection of bh_lock_sock
      or socket owner.
      
      We fix this by letting those messages follow the same code path as
      incoming data messages.
      
      As a side effect of this change, the last reference to the function
      net_route_msg() disappears, and we can eliminate that function.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec8a2e56
    • J
      tipc: let port protocol senders use new link send function · b786e2b0
      Jon Paul Maloy 提交于
      Several functions in port.c, related to the port protocol and
      connection shutdown, need to send messages. We now convert them
      to use the new link send function.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b786e2b0
    • J
      tipc: connection oriented transport uses new send functions · 4ccfe5e0
      Jon Paul Maloy 提交于
      We move the message sending across established connections
      to use the message preparation and send functions introduced
      earlier in this series. We now do the message preparation
      and call to the link send function directly from the socket,
      instead of going via the port layer.
      
      As a consequence of this change, the functions tipc_send(),
      tipc_port_iovec_rcv(), tipc_port_iovec_reject() and tipc_reject_msg()
      become unreferenced and can be eliminated from port.c. For the same
      reason, the functions tipc_link_xmit_fast(), tipc_link_iovec_xmit_long()
      and tipc_link_iovec_fast() can be eliminated from link.c.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4ccfe5e0
    • J
      tipc: RDM/DGRAM transport uses new fragmenting and sending functions · e2dafe87
      Jon Paul Maloy 提交于
      We merge the code for sending port name and port identity addressed
      messages into the corresponding send functions in socket.c, and start
      using the new fragmenting and transmit functions we just have introduced.
      
      This saves a call level and quite a few code lines, as well as making
      this part of the code easier to follow. As a consequence, the functions
      tipc_send2name() and tipc_send2port() in port.c can be removed.
      
      For practical reasons, we break out the code for sending multicast messages
      from tipc_sendmsg() and move it into a separate function, tipc_sendmcast(),
      but we do not yet convert it into using the new build/send functions.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e2dafe87
    • J
      tipc: introduce message evaluation function · 5a379074
      Jon Paul Maloy 提交于
      When a message arrives in a node and finds no destination
      socket, we may need to drop it, reject it, or forward it after
      a secondary destination lookup. The latter two cases currently
      results in a code path that is perceived as complex, because it
      follows a deep call chain via obscure functions such as
      net_route_named_msg() and net_route_msg().
      
      We now introduce a function, tipc_msg_eval(), that takes the
      decision about whether such a message should be rejected or
      forwarded, but leaves it to the caller to actually perform
      the indicated action.
      
      If the decision is 'reject', it is still the task of the recently
      introduced function tipc_msg_reverse() to take the final decision
      about whether the message is rejectable or not. In the latter case
      it drops the message.
      
      As a result of this change, we can finally eliminate the function
      net_route_named_msg(), and hence become independent of net_route_msg().
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a379074
    • J
      tipc: separate building and sending of rejected messages · 8db1bae3
      Jon Paul Maloy 提交于
      The way we build and send rejected message is currenty perceived as
      hard to follow, partly because we let the transmission go via deep
      call chains through functions such as tipc_reject_msg() and
      net_route_msg().
      
      We want to remove those functions, and make the call sequences shallower
      and simpler. For this purpose, we separate building and sending of
      rejected messages. We build the reject message using the new function
      tipc_msg_reverse(), and let the transmission go via the newly introduced
      tipc_link_xmit2() function, as all transmission eventually will do. We
      also ensure that all calls to tipc_link_xmit2() are made outside
      port_lock/bh_lock_sock.
      
      Finally, we replace all calls to tipc_reject_msg() with the two new
      calls at all locations in the code that we want to keep. The remaining
      calls are made from code that we are planning to remove, along with
      tipc_reject_msg() itself.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8db1bae3
    • J
      tipc: introduce direct iovec to buffer chain fragmentation function · 067608e9
      Jon Paul Maloy 提交于
      Fragmentation at message sending is currently performed in two
      places in link.c, depending on whether data to be transmitted
      is delivered in the form of an iovec or as a big sk_buff. Those
      functions are also tightly entangled with the send functions
      that are using them.
      
      We now introduce a re-entrant, standalone function, tipc_msg_build2(),
      that builds a packet chain directly from an iovec. Each fragment is
      sized according to the MTU value given by the caller, and is prepended
      with a correctly built fragment header, when needed. The function is
      independent from who is calling and where the chain will be delivered,
      as long as the caller is able to indicate a correct MTU.
      
      The function is tested, but not called by anybody yet. Since it is
      incompatible with the existing tipc_msg_build(), and we cannot yet
      remove that function, we have given it a temporary name.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      067608e9
    • J
      tipc: make link mtu easily accessible from socket · 16e166b8
      Jon Paul Maloy 提交于
      Message fragmentation is currently performed at link level, inside
      the protection of node_lock. This potentially binds up the sending
      link structure for a long time, instead of letting it do other tasks,
      such as handle reception of new packets.
      
      In this commit, we make the MTUs of each active link become easily
      accessible from the socket level, i.e., without taking any spinlock
      or dereferencing the target link pointer. This way, we make it possible
      to perform fragmentation in the sending socket, before sending the
      whole fragment chain to the link for transport.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16e166b8
    • J
      tipc: introduce send functions for chained buffers in link · 4f1688b2
      Jon Paul Maloy 提交于
      The current link implementation provides several different transmit
      functions, depending on the characteristics of the message to be
      sent: if it is an iovec or an sk_buff, if it needs fragmentation or
      not, if the caller holds the node_lock or not. The permutation of
      these options gives us an unwanted amount of unnecessarily complex
      code.
      
      As a first step towards simplifying the send path for all messages,
      we introduce two new send functions at link level, tipc_link_xmit2()
      and __tipc_link_xmit2(). The former looks up a link to the message
      destination, and if one is found, it grabs the node lock and calls
      the second function, which works exclusively inside the node lock
      protection. If no link is found, and the destination is on the same
      node, it delivers the message directly to the local destination
      socket.
      
      The new functions take a buffer chain where all packet headers are
      already prepared, and the correct MTU has been used. These two
      functions will later replace all other link-level transmit functions.
      
      The functions are not backwards compatible, so we have added them
      as new functions with temporary names. They are tested, but have no
      users yet. Those will be added later in this series.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f1688b2
    • J
      tipc: use negative error return values in functions · e4de5fab
      Jon Paul Maloy 提交于
      In some places, TIPC functions returns positive integers as return
      codes. This goes against standard Linux coding practice, and may
      even cause problems in some cases.
      
      We now change the return values of the functions filter_rcv()
      and filter_connect() to become signed integers, and return
      negative error codes when needed. The codes we use in these
      particular cases are still TIPC specific, since they are both
      part of the TIPC API and have no correspondence in errno.h
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e4de5fab
    • J
      tipc: eliminate case of writing to freed memory · 3d09fc42
      Jon Paul Maloy 提交于
      In the function tipc_nodesub_notify() we call a function pointer
      aggregated into the object to be notified, whereafter we set
      the function pointer to NULL. However, in some cases the function
      pointed to will free the struct containing the function pointer,
      resulting in a write to already freed memory.
      
      This bug seems to always have been there, without causing any
      notable harm.
      
      In this commit we fix the problem by inverting the order of the
      zeroing and the function call.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3d09fc42
  2. 27 6月, 2014 7 次提交
  3. 26 6月, 2014 13 次提交