11 May, 2011

20 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
     
  • Removes comments in TIPC's message header include file that are
    outdated and/or unnecessary. Also introduces short comments (or
    supplements existing ones) to better describe several set of existing
    symbolic constants.

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

    Allan Stephens
     

10 May, 2011

1 commit

  • The kernel already prints its build timestamp during boot, no need to
    repeat it in random drivers and produce different object files each
    time.

    Signed-off-by: Michal Marek
    Cc: Jon Maloy
    Cc: netdev@vger.kernel.org
    Cc: tipc-discussion@lists.sourceforge.net
    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Michal Marek
     

31 Mar, 2011

1 commit


15 Mar, 2011

1 commit


14 Mar, 2011

17 commits

  • Eliminates a routine that is used in handling messages arriving from
    another cluster or zone. Such messages can no longer be received by TIPC
    now that multi-cluster and multi-zone network support has been eliminated.

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

    Allan Stephens
     
  • Gets rid of all remaining code relating to ROUTE_DISTRIBUTOR messages.
    These messages were only used in multi-cluster and multi-zone networks,
    which TIPC no longer supports. (For safety, TIPC now treats such messages
    the same way that it handles other unrecognized messages.)

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

    Allan Stephens
     
  • Eliminates the flag in the TIPC bearer structure that indicates if
    the bearer supports broadcasting, since the flag is always set to 1
    and serves no useful purpose.

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

    Allan Stephens
     
  • Adds a check to prevent TIPC from trying to respond to an incoming
    LINK_CONFIG request message if the associated bearer is currently
    prohibited from sending messages.

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

    Allan Stephens
     
  • Eliminates an unnecessary constant that defines the size of a LINK_CONFIG
    message, and uses one of the existing standard message size symbols in
    its place. (The defunct constant was located in the wrong place anyway,
    since it was grouped with other constants that define message users instead
    of message sizes.)

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

    Allan Stephens
     
  • Eliminates a field in TIPC's bearer objects that is set, but never
    referenced.

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

    Allan Stephens
     
  • Renames items that are improperly labelled as "network scope" items
    (which are represented by simple integer values) rather than "network
    domain" items (which are represented by -type network addresses).
    This change is purely cosmetic, and does not affect the operation of TIPC.

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

    Allan Stephens
     
  • Enhances link creation code as follows:

    1) Detects illegal attempts to add a requested link earlier in the
    link creation process. This prevents TIPC from wasting time
    initializing a link object it then throws away, and also eliminates
    the code needed to do the throwing away.

    2) Passes in the node object associated with the requested link.
    This allows TIPC to eliminate a search to locate the node object,
    as well as code that attempted to create the node if it doesn't
    exist.

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

    Allan Stephens
     
  • Delay releasing the node lock when processing a neighbor discovery
    message until after the optional discovery response message has been
    sent. This helps ensure that any link protocol messages sent by a
    link endpoint created as a result of a neighbor discovery request
    are received after the discovery response is received, thereby
    giving the receiving node a chance to create a peer link endpoint to
    consume those link protocol messages, if one does not already exist.

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

    Allan Stephens
     
  • Reworks the appearance of the routine that processes incoming
    LINK_CONFIG messages to keep the main logic flow at a consistent level
    of indentation, and to add comments outlining the various phases involved
    in processing each message. This rework is being done to allow upcoming
    enhancements to this routine to be integrated more cleanly.

    The diff isn't really readable, so know that it was a case of the
    old code being like:

    tipc_disc_recv_msg(..)
    {
    if (in_own_cluster(orig)) {
    ...
    lines and lines of stuff
    ...
    }
    }

    which is now replaced with the more sane:

    tipc_disc_recv_msg(..)
    {
    if (!in_own_cluster(orig))
    return;
    ...
    lines and lines of stuff
    ...
    }

    Instances of spin locking within the reindented block were replaced with
    the identical tipc_node_[un]lock() abstractions. Note that all these
    changes are cosmetic in nature, and do not change the way LINK_CONFIG
    messages are processed.

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

    Allan Stephens
     
  • Ensures that the "redundant link exists" field of the LINK_PROTOCOL
    messages sent by a link endpoint is set if and only if the sending
    node has at least one other working link to the peer node. Previously,
    the bit was set only if there were at least 2 working links to the peer
    node, meaning the bit was incorrectly left unset in messages sent by a
    non-working link endpoint when exactly one alternate working link was
    available. The revised code now takes the state of the link sending
    the message into account when deciding if an alternate link exists.

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

    Allan Stephens
     
  • All the other boolean like msg_set_X(m) operations don't
    export both a msg_set_X(a) and a msg_clear_X(m), but instead
    just have the single msg_set_X(m, val) variant.

    Make the redundant_link one consistent by having the set take
    a value, and delete the msg_clear_redundant_link() anomoly.
    This is a cosmetic change and should not change behaviour.

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

    Allan Stephens
     
  • Function names like "tipc_node_has_redundant_links" are unweildy
    and result in long lines even for simple lines. The "has" doesn't
    contribute any value add, so dropping that is a slight step in the
    right direction. This is a cosmetic change, basic result of:

    for i in `grep -l tipc_node_has_ *` ; do sed -i s/tipc_node_has_/tipc_node_/ $i ; done

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • Removes support for the timestamp field of TIPC's link protocol messages.

    This field was previously used to hold an OS-dependent timestamp value
    that was used to assist in debugging early versions of TIPC. The field
    has now been deemed unnecessary and has been removed from the latest TIPC
    specification. This change has no impact on the operation of TIPC since
    the field was set by TIPC, but never referenced.

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

    Allan Stephens
     
  • Relocates network-related variables into the subsystem files where
    they are now primarily used (following the recent rework of TIPC's
    node table), and converts globals into locals where possible. Changes
    the initialization of tipc_num_links from run-time to compile-time,
    and eliminates the net_start routine that becomes empty as a result.
    Also eliminates the corresponding net_stop routine by moving its
    (trivial) content into the one location that called the routine.

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

    Allan Stephens
     
  • Replaces the dynamically allocated array of pointers to the cluster's
    node objects with a static hash table. Hash collisions are resolved
    using chaining, with a typical hash chain having only a single node,
    to avoid degrading performance during processing of incoming packets.
    The conversion to a hash table reduces the memory requirements for
    TIPC's node table to approximately the same size it had prior to
    the previous commit.

    In addition to the hash table itself, TIPC now also maintains a
    linked list for the node objects, sorted by ascending network address.
    This list allows TIPC to continue sending responses to user space
    applications that request node and link information in sorted order.
    The list also improves performance when name table update messages are
    sent by making it easier to identify the nodes that must be notified.

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

    Allan Stephens
     
  • Gets rid of the need for users to specify the maximum number of
    cluster nodes supported by TIPC. TIPC now automatically provides
    support for all 4K nodes allowed by its addressing scheme.

    Note: This change sets TIPC's memory usage to the amount used by
    a maximum size node table with 4K entries. An upcoming patch that
    converts the node table from a linear array to a hash table will
    compact the node table to a more efficient design, but for clarity
    it is nice to have all the Kconfig infrastruture go away separately.

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

    Allan Stephens