14 Jul, 2012

6 commits

  • The internal log buffer handling functions can now safely be
    removed since there is no code using it anymore. Requests to
    interact with the internal tipc log buffer over netlink (in
    config.c) will report 'obsolete command'.

    This represents the final removal of any references to a
    struct print_buf, and the removal of the struct itself.
    We also get rid of a TIPC specific Kconfig in the process.

    Finally, log.h is removed since it is not needed anymore.

    Signed-off-by: Erik Hugne
    Signed-off-by: Jon Maloy
    Signed-off-by: Paul Gortmaker

    Erik Hugne
     
  • The tipc_printf is renamed to tipc_snprintf, as the new name
    describes more what the function actually does. It is also
    changed to take a buffer and length parameter and return
    number of characters written to the buffer. All callers of
    this function that used to pass a print_buf are updated.

    Final removal of the struct print_buf itself will be done
    synchronously with the pending removal of the deprecated
    logging code that also was using it.

    Functions that build up a response message with a list of
    ports, nametable contents etc. are changed to return the number
    of characters written to the output buffer. This information
    was previously hidden in a field of the print_buf struct, and
    the number of chars written was fetched with a call to
    tipc_printbuf_validate. This function is removed since it
    is no longer referenced nor needed.

    A generic max size ULTRA_STRING_MAX_LEN is defined, named
    in keeping with the existing TIPC_TLV_ULTRA_STRING, and the
    various definitions in port, link and nametable code that
    largely duplicated this information are removed. This means
    that amount of link statistics that can be returned is now
    increased from 2k to 32k.

    The buffer overflow check is now done just before the reply
    message is passed over netlink or TIPC to a remote node and
    the message indicating a truncated buffer is changed to a less
    dramatic one (less CAPS), placed at the end of the message.

    Signed-off-by: Erik Hugne
    Signed-off-by: Jon Maloy
    Signed-off-by: Paul Gortmaker

    Erik Hugne
     
  • tipc_printf was previously used both to construct debug traces
    and to append data to buffers that should be sent over netlink
    to the tipc-config application. A global print_buffer was
    used to format the string before it was copied to the actual
    output buffer. This could lead to concurrent access of the
    global print_buffer, which then had to be lock protected.
    This is simplified by changing tipc_printf to append data
    directly to the output buffer using vscnprintf.

    With the new implementation of tipc_printf, there is no longer
    any risk of concurrent access to the internal log buffer, so
    the lock (and the comments describing it) are no longer
    strictly necessary. However, there are still a few functions
    that do grab this lock before resizing/dumping the log
    buffer. We leave the lock, and these functions untouched since
    they will be removed with a subsequent commit that drops the
    deprecated log buffer handling code

    Signed-off-by: Erik Hugne
    Signed-off-by: Jon Maloy
    Signed-off-by: Paul Gortmaker

    Erik Hugne
     
  • To pave the way for a pending cleanup of tipc_printf, and
    removal of struct print_buf entirely, we make that task simpler
    by converting link_print to issue its messages with standard
    printk infrastructure. [Original idea separated from a larger
    patch from Erik Hugne ]

    Cc: Erik Hugne
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • The link queue traces and packet level debug functions served
    a purpose during early development, but are now redundant
    since there are other, more capable tools available for
    debugging at the packet level.

    The TIPC_DEBUG Kconfig option is removed since it does not
    provide any extra debugging features anymore.

    This gets rid of a lot of tipc_printf usages, which will
    make the pending cleanup work of that function easier.

    Signed-off-by: Erik Hugne
    Signed-off-by: Jon Maloy
    Signed-off-by: Paul Gortmaker

    Erik Hugne
     
  • All messages should go directly to the kernel log. The TIPC
    specific error, warning, info and debug trace macro's are
    removed and all references replaced with pr_err, pr_warn,
    pr_info and pr_debug.

    Commonly used sub-strings are explicitly declared as a const
    char to reduce .text size.

    Note that this means the debug messages (changed to pr_debug),
    are now enabled through dynamic debugging, instead of a TIPC
    specific Kconfig option (TIPC_DEBUG). The latter will be
    phased out completely

    Signed-off-by: Erik Hugne
    Signed-off-by: Jon Maloy
    [PG: use pr_fmt as suggested by Joe Perches ]
    Signed-off-by: Paul Gortmaker

    Erik Hugne
     

12 Jul, 2012

2 commits

  • With the default name table size of 1024, it is possible that
    the sanity check in tipc_nametbl_stop could spam out 1024
    essentially identical error messages if memory was corrupted
    or similar. Limit it to issuing no more than a single message.

    The actual chain number (i.e. 0 --> 1023) wouldn't provide any
    useful insight if/when such an instance happened, so don't
    bother printing out that value.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • This is done to improve readability, and so that we can give
    the struct a name that will allow us to declare a local
    pointer to it in code, instead of having to always redirect
    through the link struct to get to it.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

11 Jul, 2012

2 commits


04 Jun, 2012

1 commit

  • Adding casts of objects to the same type is unnecessary
    and confusing for a human reader.

    For example, this cast:

    int y;
    int *p = (int *)&y;

    I used the coccinelle script below to find and remove these
    unnecessary casts. I manually removed the conversions this
    script produces of casts with __force and __user.

    @@
    type T;
    T *p;
    @@

    - (T *)p
    + p

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

01 May, 2012

1 commit

  • Some of the comment blocks are floating in limbo between two
    functions, or between blocks of code. Delete the extra line
    feeds between any comment and its associated following block
    of code, to be consistent with the majority of the rest of
    the kernel. Also delete trailing newlines at EOF and fix
    a couple trivial typos in existing comments.

    This is a 100% cosmetic change with no runtime impact. We get
    rid of over 500 lines of non-code, and being blank line deletes,
    they won't even show up as noise in git blame.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

27 Apr, 2012

9 commits

  • Adds check to ensure TIPC sockets reject incoming payload messages
    that have an unrecognized message type.

    Remove the old open question about whether TIPC_ERR_NO_PORT is
    the proper return value. It is appropriate here since there are
    valid instances where another node can make use of the reply,
    and at this point in time the host is already broadcasting TIPC
    data, so there are no real security concerns.

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

    Allan Stephens
     
  • Consolidates validation of scope and name sequence range values into
    a single routine where it applies both to local name publications
    and to name publications issued by other nodes in the network. This
    change means that the scope value for non-local publications is now
    validated and the name sequence range for local publications is now
    validated only once. Additionally, a publication attempt that fails
    validation now creates an entry in the system log file only if debugging
    capabilities have been enabled; this prevents the system log from being
    cluttered up with messages caused by a defective application or network
    node.

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

    Allan Stephens
     
  • Replaces two identical chunks of code that delete an unused name
    sequence structure from TIPC's name table with calls to a new routine
    that performs this operation.

    This change is cosmetic and doesn't impact the operation of TIPC.

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

    Allan Stephens
     
  • Eliminate code to zero-out the main topology service structure,
    which is already zeroed-out.

    Get rid of a comment documenting a field of the main topology
    service structure that no longer exists.

    Both are cosmetic changes with no impact on runtime behaviour.

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

    Allan Stephens
     
  • Initialization now occurs in the calling thread of control,
    rather than being deferred to the TIPC tasklet. With the
    current codebase, the deferral is no longer necessary.

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

    Allan Stephens
     
  • Streamlines the job of re-initializing TIPC's network topology service
    when a node's network address is first assigned. Rather than destroying
    the topology server port and breaking its connections to existing
    subscribers, TIPC now simply lets the service continue running (since
    the change to the port identifier of each port used by the topology
    service no longer impacts the flow of messages between the service and
    its subscribers).

    This enhancement means that applications that utilize the topology
    service prior to the assignment of TIPC's network address no longer need
    to re-establish their subscriptions when the address is finally assigned.

    However, it is worth noting that any subsequent events for existing
    subscriptions report the new port identifier of the publishing port,
    rather than the original port identifier. (For example, a name that was
    previously reported as being published by may be subsequently
    withdrawn by .)

    This doesn't impact any of the existing known userspace in tipc-utils,
    since (a) TIPC continues to treat references to the original port ID
    correctly and (b) normal use cases assign an address before active use.

    However if there does happen to be some rare/custom application out
    there that was relying on this, they can simply bypass the enhancement
    by issuing a subscription to {0,0} and break its connection to the
    topology service, if an associated withdrawal event occurs.

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

    Allan Stephens
     
  • Termination no longer tests to see if the configuration service
    port was successfully created or not. In the unlikely event that the
    port was not created, attempting to delete the non-existent port is
    detected gracefully and causes no harm.

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

    Allan Stephens
     
  • Initialization now occurs in the calling thread of control,
    rather than being deferred to the TIPC tasklet. With the
    current codebase, the deferral is no longer necessary.

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

    Allan Stephens
     
  • Streamlines the job of re-initializing TIPC's configuration service
    when a node's network address is first assigned. Rather than destroying
    the configuration server port and then recreating it, TIPC now simply
    withdraws the existing {0,} name publication and creates a new
    {0,} name publication that identifies the node's network address
    to interested subscribers.

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

    Allan Stephens
     

24 Apr, 2012

2 commits

  • Untie gcc's hands and let it do what it wants within the
    individual source files. There are two files, node.c and
    port.c -- only the latter effectively changes (gcc-4.5.2).
    Objdump shows gcc deciding to not inline port_peernode().

    Suggested-by: David S. Miller
    Signed-off-by: Paul Gortmaker
    Signed-off-by: David S. Miller

    Paul Gortmaker
     
  • sk_add_backlog() & sk_rcvqueues_full() hard coded sk_rcvbuf as the
    memory limit. We need to make this limit a parameter for TCP use.

    No functional change expected in this patch, all callers still using the
    old sk_rcvbuf limit.

    Signed-off-by: Eric Dumazet
    Cc: Neal Cardwell
    Cc: Tom Herbert
    Cc: Maciej Żenczykowski
    Cc: Yuchung Cheng
    Cc: Ilpo Järvinen
    Cc: Rick Jones
    Signed-off-by: David S. Miller

    Eric Dumazet
     

20 Apr, 2012

14 commits

  • Enhances command validation done by TIPC's configuration service so
    that it works properly even if the node's network address is changed in
    mid-operation. The default node address of is now recognized as an
    alias for "this node" even after a new network address has been assigned.

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

    Allan Stephens
     
  • Revises handling of a rejected message to ensure that a locally
    originated message is returned properly even if the node's network
    address is changed in mid-operation. The routine now treats the
    default node address of as an alias for "this node" when
    determining where to send a returned message.

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

    Allan Stephens
     
  • Revises handling of send routines for payload messages to ensure that
    they are processed properly even if the node's network address is
    changed in mid-operation. The routines now treat the default node
    address of as an alias for "this node" when determining where
    to send an outgoing message.

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

    Allan Stephens
     
  • There are two send routines that might conceivably be asked by an
    application to send a message off-node when the node is still using
    the default network address. These now have an added check that
    detects this and rejects the message gracefully.

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

    Allan Stephens
     
  • The routine that changes the node's network address now takes TIPC's
    network lock in write mode while the main address variable and associated
    data structures are being changed; this is needed to ensure that the
    link subsystem won't attempt to send a message off-node until the sending
    port's message header template has been updated with the node's new
    network address.

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

    Allan Stephens
     
  • Revises routines that deal with connections between two ports on
    the same node to ensure the connection is not impacted if the node's
    network address is changed in mid-operation. The routines now treat
    the default node address of as an alias for "this node" in
    the following situations:

    1) Incoming messages destined to a connected port now handle the alias
    properly when validating that the message was sent by the expected
    peer port, ensuring that the message will be accepted regardless of
    whether it specifies the node's old network address or it's current one.

    2) The code which completes connection establishment now handles the
    alias properly when determining if the peer port is on the same node
    as the connected port.

    An added benefit of addressing issue 1) is that some peer port
    validation code has been relocated to TIPC's socket subsystem, which
    means that validation is no longer done twice when a message is
    sent to a non-socket port (such as TIPC's configuration service or
    network topology service).

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

    Allan Stephens
     
  • Prior to commit 23dd4cce387124ec3ea06ca30d17854ae4d9b772

    "tipc: Combine port structure with tipc_port structure"

    there was a need for the two sets of helper functions. But
    now they are just duplicates. Remove the globally visible
    ones, and mark the remaining ones as inline.

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

    Allan Stephens
     
  • Re-orders port creation logic so that the initialization of a new
    port's message header template occurs while the port list lock is
    held. This ensures that a change to the node's network address that
    occurs at the same time as the port is being created does not result
    in the template identifying the sender using the former network
    address. The new approach guarantees that the new port's template is
    using the current network address or that it will be updated when
    the address changes.

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

    Allan Stephens
     
  • Removes an unnecessary check in the logic that updates the message
    header template for existing ports when a node's network address is
    first assigned. There is no longer any need to check to see if the
    node's network address has actually changed since the calling routine
    has already verified that this is so.

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

    Allan Stephens
     
  • Revises routines that add and remove an entry from a node's name table
    so that the publication scope lists are updated properly even if the
    node's network address is changed in mid-operation. The routines now
    recognize the default node address of as an alias for "this node"
    even after a new network address has been assigned.

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

    Allan Stephens
     
  • Introduces routines that test whether a given network address is
    equal to a node's own network address or if it lies within the node's
    own network cluster, and which work properly regardless of whether
    the node is using the default network address or a non-zero
    network address that is assigned later on. In essence, these routines
    ensure that address is treated as an alias for "this node",
    regardless of which network address the node is actually using.

    Old users of the pre-existing more strict match in_own_cluster()
    have been accordingly redirected to what is now called
    in_own_cluster_exact() --- which does not extend matching to .

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

    Allan Stephens
     
  • No longer increments counter of number of publications by a node
    if an attempt to add a new publication fails. This prevents TIPC from
    incorrectly blocking future publications because the configured maximum
    number of publications has been reached.

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

    Allan Stephens
     
  • Ensures that node-scope name publications that exist prior to the
    configuration of a node's network address are properly re-initialized
    with that address when it is assigned. TIPC's node-scope publications
    are now tracked using a publications list like the lists used for
    cluster-scope and zone-scope publications so they can be easily updated
    when required.

    The inclusion of node scope name publications in a conventional publication
    list means that they must now also be withdrawn, just like cluster and zone
    scope publications are currently withdrawn. So some conditional tests on
    scope ==/!= TIPC_NODE_SCOPE are inserted/removed accordingly.

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

    Allan Stephens
     
  • Utilizes distinct lists to track zone-scope and cluster-scope names
    published by a node. For now, TIPC continues to process the entries
    in both lists in the same way; however, an upcoming patch will utilize
    the existence of the lists to prevent the sending of cluster-scope names
    to nodes that are not part of the local cluster.

    To achieve this, an array of publication lists is introduced, so
    that they can be iterated over and accessed via publ->scope as
    an index where convenient.

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

    Allan Stephens
     

18 Apr, 2012

2 commits

  • This is done so that it can be reused with differing publication
    lists, instead of being hard coded to the cluster publicaton list.

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

    Allan Stephens
     
  • There is currently a single list that is containing both cluster-scope and
    zone-scope publications, and the list count is a separate free floating
    variable. Create a struct to bind the count to the list, and to pave
    the way for factoring out the publications into zone/cluster/node scope.

    The current "publ_root" most matches what will be the cluster scope
    list, so it is named accordingly in this commit.

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

    Allan Stephens
     

16 Apr, 2012

1 commit