27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

25 Jun, 2011

20 commits

  • Simplifies the creation of connection protocol messages by eliminating
    the passing of information that is no longer required, is constant,
    or is contained within the port structure that is issuing the message.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Modifies the logic that creates a connection termination payload
    message so that it no longer (mis)uses a routine that creates a
    connection protocol message. The revised code is now more easily
    understood, and avoids setting several fields that are either not
    present in payload messages or were being set more than once.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Restructures the logic used in tipc_port_recv_proto_msg() to ensure
    that incoming connection protocol messages are handled properly. The
    routine now uses a two-stage process that first ensures the message
    applies on an existing connection and then processes the request.
    This corrects a loophole that allowed a connection probe request to
    be processed if it was sent to an unconnected port that had no names
    bound to it.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Speeds up the creation of the FIN message that terminates a TIPC
    connection. The typical peer termination message is now created by
    duplicating the terminating port's standard payload message header
    and adjusting the message size, importance, and error code fields,
    rather than building all fields of the message from scratch. A FIN
    message that is directed to the port itself is created the same way.
    but also requires swapping the origin and destination address fields.

    In addition to reducing the work required to create FIN messages,
    these changes eliminate several instances of duplicated code,

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Performs cosmetic cleanup of the symbolic names used to specify TIPC
    payload message header sizes. The revised names now more accurately
    reflect the payload messages in which they can appear. In addition,
    several places where these payload message symbol names were being used
    to create non-payload messages have been updated to use the proper
    internal message symbolic name.

    No functional changes are introduced by this rework.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Gets rid of code that allows tipc_msg_init() to create a short
    payload message header. This optimization is possible because
    there are no longer any callers who require this capability.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Eliminates a pair of #include statements for files that are brought in
    automatically by including core.h.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Gets rid of counter that records the number of times a bearer has
    resumed after congestion or blocking, since the value is never
    referenced anywhere.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Fixes a minor error in the title of one of the message size profiling
    values printed as part of TIPC's link statistics.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Gets rid of a pair of checks to see if a name sequence entry in
    TIPC's name table has an empty zone list. These checks are pointless
    since the zone list can never be empty (i.e. as soon as the list
    becomes empty the associated name sequence entry is deleted).

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Modifies the main circular linked lists of publications used in TIPC's
    name table to use the standard kernel linked list type. This change
    simplifies the deletion of an existing publication by eliminating
    the need to search up to three lists to locate the publication.
    The use of standard list routines also helps improve the readability
    of the name table code by make it clearer what each list operation
    being performed is actually doing.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Modifies the name table array structure that contains the name
    sequence instances for a given name type so that the publication
    lists associated with a given instance are stored in a dynamically
    allocated structure, rather than being embedded within the array
    entry itself. This change is being done for several reasons:

    1) It reduces the amount of data that needs to be copied whenever
    a given array is expanded or contracted to accommodate the first
    publication of a new name sequence or the removal of the last
    publication of an existing name sequence.

    2) It reduces the amount of memory associated with array entries that
    are currently unused.

    3) It facilitates the upcoming conversion of the publication lists
    from TIPC-specific circular lists to standard kernel lists. (Standard
    lists cannot be used with the former array structure because the
    relocation of array entries during array expansion and contraction
    would corrupt the lists.)

    Note that, aside from introducing a small amount of code to dynamically
    allocate and free the structure that now holds publication list info,
    this change is largely a simple renaming exercise that replaces
    references to "sseq->LIST" with "sseq->info->LIST" (or "info->LIST").

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Gets rid of unnecessary masking in two routines that set TIPC message
    header fields. (The msg_set_bits() routine already takes care of
    masking the new value to the correct size.)

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Gets rid of a pair of routines that provide support for temporarily
    caching the destination node for a message in the associated message
    buffer's application handle, since this capability is no longer used.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Optimizes the creation of a returned payload message by duplicating
    the original message and then updating the small number of fields
    that need to be adjusted, rather than building the new message header
    from scratch. In addition, certain operations that are not always
    required are relocated so that they are only done if needed.

    These optimizations also have the effect of addressing other issues
    that were present previously:

    1) Fixes a bug that caused the socket send routines to return the
    size of the returned message, rather than the size of the sent
    message, when a returnable payload message was sent to a non-existent
    destination port.

    2) The message header of the returned message now matches that of
    the original message more closely. The header is now always the same
    size as the original header, and some message header fields that
    weren't being initialized in the returned message header are now
    populated correctly -- namely the "d" and "s" bits, and the upper
    bound of a multicast name instance (where present).

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Reduces the work involved in transmitting a returned payload message
    by doing only the work necessary to route such a message directly to
    the specified destination port, rather than invoking the code used
    to route an arbitrary message to an arbitrary destination.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Introduces an internal sanity check to ensure that the only undeliverable
    messages TIPC attempts to return to their origin are application payload
    messages.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Modifies the routine that handles the rejection of payload messages
    so that it has a single exit point that frees up the rejected message,
    thereby eliminating some duplicated code.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Eliminates a TIPC-specific assert() macro that is no longer used.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Modifies the existing broadcast link sanity check that detects an
    attempt to send a message off-node when there are no available
    destinations so that it no longer causes a kernel panic; instead,
    the check now issues a warning and stack trace and then returns
    without sending the message anywhere.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     

11 May, 2011

19 commits

  • Revises the algorithm governing the sending of link request messages
    to take into account the number of nodes each bearer is currently in
    contact with, and to ensure more rapid rediscovery of neighboring nodes
    if a bearer fails and then recovers.

    The discovery object now sends requests at least once a second if it
    is not in contact with any other nodes, and at least once a minute if
    it has at least one neighbor; if contact with the only neighbor is
    lost, the object immediately reverts to its initial rapid-fire search
    timing to accelerate the rediscovery process.

    In addition, the discovery object now stops issuing link request
    messages if it is in contact with the only neighboring node it is
    configured to communicate with, since further searching is unnecessary.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Augments TIPC's discovery object to track the number of neighboring nodes
    having an active link to the associated bearer.

    This means tipc_disc_update_link_req() becomes either one of:

    tipc_disc_add_dest()
    or:
    tipc_disc_remove_dest()

    depending on the code flow direction of things.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Augments TIPC's discovery object to send its initial neighbor discovery
    request message as soon as the associated bearer is created, rather than
    waiting for its first periodic timeout to occur, thereby speeding up the
    discovery process. Also adds a check to suppress the initial request or
    subsequent requests if the bearer is blocked at the time the request is
    scheduled for transmission.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Modifies bearer creation and deletion code to improve handling of
    scenarios when a neighbor discovery object cannot be created. The
    creation routine now aborts the creation of a bearer if its discovery
    object cannot be created, and deletes the newly created bearer, rather
    than failing quietly and leaving an unusable bearer hanging around.

    Since the exit via the goto label really isn't a definitive failure
    in all cases, relabel it appropriately.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Create a helper routine to enqueue a chain of sk_buffs to a link's
    transmit queue. It improves readability and the new function is
    anticipated to be used more than just once in the future as well.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Rework TIPC's message sending routines to take advantage of the total
    amount of data value passed to it by the kernel socket infrastructure.
    This change eliminates the need for TIPC to compute the size of outgoing
    messages itself, as well as the check for an oversize message in
    tipc_msg_build(). In addition, this change warrants an explanation:

    - res = send_packet(NULL, sock, &my_msg, 0);
    + res = send_packet(NULL, sock, &my_msg, bytes_to_send);

    Previously, the final argument to send_packet() was ignored (since the
    amount of data being sent was recalculated by a lower-level routine)
    and we could just pass in a dummy value (0). Now that the
    recalculation is being eliminated, the argument value being passed to
    send_packet() is significant and we have to supply the actual amount
    of data we want to send.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Adds checks to TIPC's socket send routines to promptly detect and
    abort attempts to send more than 66,000 bytes in a single TIPC
    message or more than 2**31-1 bytes in a single TIPC byte stream request.
    In addition, this ensures that the number of iovecs in a send request
    does not exceed the limits of a standard integer variable.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Enhances existing checks on the discovery domain associated with a TIPC
    bearer. A bearer can no longer be configured to accept links from itself
    only (which would be pointless), or to nodes outside its own cluster
    (since multi-cluster support has now been removed from TIPC). Also, the
    neighbor discovery routine now validates link setup requests against the
    configured discovery domain for the bearer, rather than simply ensuring
    the requesting node belongs to the node's own cluster.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • This allows them to be available for easy re-use in other places
    and avoids trivial mistakes caused by "count the f's and 0's".

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • Modifies a TIPC send routine that did not discard the outgoing sk_buff
    if it was not transmitted because of link congestion; this eliminates
    the potential for buffer leakage in the many callers who did not clean up
    the unsent buffer. (The two routines that previously did discard the unsent
    buffer have been updated to eliminate their now-redundant clean up.)

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Sets the destination node field of an incoming multicast message
    to the receiving node's network address before handing off the message
    to each receiving port. This ensures that, in the event the destination
    port returns the message to the sender, the sender can identify which
    node the destination port belonged to.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Set the destination node and destination port fields of an outgoing
    multicast message header to zero; this is necessary to ensure that
    the receiving node can route the message properly if it was packed
    into a bundle due to link congestion. (Previously, there was a chance
    that the receiving node would send the unbundled message to a random
    node & port, rather than processing the message itself.)

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Ensures that all outgoing data messages have the "name lookup scope"
    field of their header set correctly; that is, named multicast messages
    now specify cluster-wide name lookup, while messages not using TIPC
    naming zero out the lookup field. (Previously, the lookup scope specified
    for these types of messages was inherited from the last message sent
    by the sending port.)

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Modifies the routine that fragments an existing message buffer to
    use similar logic to that used when generating fragments from an iovec.
    The routine now creates a complete chain of fragments and adds them to
    the link transmit queue as a unit, so that the link sends all fragments
    or none; this prevents the incomplete transmission of a fragmented
    message that might otherwise result because of link congestion or
    memory exhaustion. This change also ensures that the counter recording
    the number of fragmented messages sent by the link is now incremented
    only if the message is actually sent.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Eliminates code that restricts a link's counter of its fragmented
    messages to a 16-bit value, since the counter value is automatically
    restricted to this range when it is written into the message header.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Eliminates code that sets the link selector field in the header of
    fragmented messages, since this information is never referenced.
    (The unnecessary initialization was harmless as it was over-written
    by the fragmented message identifier value before the fragments were
    transmitted.)

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Eliminates optional code used to test TIPC's ability to recover
    from lost broadcast messages. This code duplicates functionality
    already provided by the network stack's QoS option "network emulator".

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Half of the #define entries in msg.h were down at the bottom
    of the header, instead of up at the top before any of the static
    inlines etc. Relocate them up to the top, to be consistent with
    the other normal linux header file layout conventions.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Gets rid of unused constants defining the types used in routing
    messages. These messages no longer exist in TIPC now that multicluster
    and multizone support has been eliminated.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens