14 Jul, 2012

1 commit

  • 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
     

27 Apr, 2012

2 commits

  • 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
     
  • 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
     

20 Apr, 2012

1 commit

  • 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
     

25 Feb, 2012

2 commits

  • Removes all references to the global variable that records whether
    TIPC is running in "single node" mode or "network" mode, since this
    information can be easily deduced from the global variable that
    records TIPC's network address. (i.e. a non-zero network address
    means that TIPC is running in network mode.)

    The changes made update most existing mode-based checks to use the
    network address global variable. A few checks that are no longer
    needed are removed entirely, along with any associated code lying on
    non-executable control paths.

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

    Allan Stephens
     
  • Gets rid of two inlined routines that simply call existing sk_buff
    manipulation routines, since there is no longer any extra processing
    done by the helper routines.

    Note that these changes are essentially cosmetic in nature, and have
    no impact on the actual operation of TIPC.

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

    Allan Stephens
     

28 Dec, 2011

2 commits

  • Creates global variables to hold the broadcast link's pseudo-bearer and
    pseudo-link structures, rather than allocating them dynamically. There
    is only a single instance of each structure, and changing over to static
    allocation allows elimination of code to handle the cases where dynamic
    allocation was unsuccessful.

    The memset in the teardown code may look like they aren't used, but
    the same teardown code is run when there is a non-fatal error at
    init-time, so that stale data isn't present when the user fixes the
    cause of the soft error.

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

    Allan Stephens
     
  • Modifies TIPC's module unloading logic to switch itself into "single
    node" mode before starting to terminate networking support. This helps
    to ensure that no operations that require TIPC to be in "networking"
    mode can initiate once unloading starts.

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

    Allan Stephens
     

01 Sep, 2011

1 commit

  • Eliminates code that increments and validates the re-route count field
    of payload messages, since the elimination of multi-cluster support
    means that it is no longer necessary for TIPC to forward incoming messages
    to another node. (The obsolete code was incorrect anyway, since it
    incorrectly incremented the re-route count field of messages that
    originated on the node that forwarded the message.)

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

    Allan Stephens
     

15 Mar, 2011

1 commit


14 Mar, 2011

5 commits

  • 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
     
  • Converts the fields of the global "tipc_net" structure into individual
    variables. Since the struct was never referenced as a complete unit,
    its existence was pointless. This will facilitate upcoming changes to
    TIPC's node table and simpify upcoming relocation of the variables so
    they are only visible to the files that actually use them.

    This change is essentially cosmetic in nature, and doesn't affect the
    operation of TIPC.

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

    Allan Stephens
     
  • Removes a race condition that could cause TIPC's internal counter
    of the number of links it has to neighboring nodes to have the
    incorrect value if two independent threads of control simultaneously
    create new link endpoints connecting to two different nodes using two
    different bearers. Such under counting would result in TIPC failing to
    list the final link(s) in its response to a configuration request to
    list all of the node's links. The counter is now updated atomically
    to ensure that simultaneous increments do not interfere with each
    other.

    Thanks go to Peter Butler for his assistance in
    diagnosing and fixing this problem.

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

    Allan Stephens
     

02 Jan, 2011

5 commits


03 Dec, 2010

1 commit


14 Oct, 2010

1 commit

  • Remove all instances of legacy, or as yet to be implemented code
    that is currently living within an #if 0 ... #endif block.
    In the rare instance that some of it be needed in the future,
    it can still be dragged out of history, but there is no need
    for it to sit in mainline.

    Signed-off-by: Paul Gortmaker
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Paul Gortmaker
     

10 Sep, 2010

1 commit

  • Remove code that trimmed excess trailing info from incoming messages
    arriving over an Ethernet interface. TIPC now ignores the extra info
    while the message is being processed by the node, and only trims it off
    if the message is retransmitted to another node. (This latter step is
    done to ensure the extra info doesn't cause the sk_buff to exceed the
    outgoing interface's MTU limit.) The outgoing buffer is guaranteed to
    be linear.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker
    Signed-off-by: David S. Miller

    Paul Gortmaker
     

13 May, 2010

1 commit

  • These functions have enough code in them such that they
    seem like sensible targets for un-inlining. Prior to doing
    that, this adds the tipc_ prefix to the functions, so that
    in the event of a panic dump or similar, the subsystem from
    which the functions come from is immediately clear.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker
    Signed-off-by: David S. Miller

    Allan Stephens
     

31 Mar, 2010

1 commit


25 Mar, 2010

1 commit


04 Mar, 2010

1 commit

  • Fix TIPC to disallow sending to remote addresses prior to entering NET_MODE

    user programs can oops the kernel by sending datagrams via AF_TIPC prior to
    entering networked mode. The following backtrace has been observed:

    ID: 13459 TASK: ffff810014640040 CPU: 0 COMMAND: "tipc-client"
    [exception RIP: tipc_node_select_next_hop+90]
    RIP: ffffffff8869d3c3 RSP: ffff81002d9a5ab8 RFLAGS: 00010202
    RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000000001
    RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000001001001
    RBP: 0000000001001001 R8: 0074736575716552 R9: 0000000000000000
    R10: ffff81003fbd0680 R11: 00000000000000c8 R12: 0000000000000008
    R13: 0000000000000001 R14: 0000000000000001 R15: ffff810015c6ca00
    ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
    RIP: 0000003cbd8d49a3 RSP: 00007fffc84e0be8 RFLAGS: 00010206
    RAX: 000000000000002c RBX: ffffffff8005d116 RCX: 0000000000000000
    RDX: 0000000000000008 RSI: 00007fffc84e0c00 RDI: 0000000000000003
    RBP: 0000000000000000 R8: 00007fffc84e0c10 R9: 0000000000000010
    R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
    R13: 00007fffc84e0d10 R14: 0000000000000000 R15: 00007fffc84e0c30
    ORIG_RAX: 000000000000002c CS: 0033 SS: 002b

    What happens is that, when the tipc module in inserted it enters a standalone
    node mode in which communication to its own address is allowed but not
    to other addresses, since the appropriate data structures have not been
    allocated yet (specifically the tipc_net pointer). There is nothing stopping a
    client from trying to send such a message however, and if that happens, we
    attempt to dereference tipc_net.zones while the pointer is still NULL, and
    explode. The fix is pretty straightforward. Since these oopses all arise from
    the dereference of global pointers prior to their assignment to allocated
    values, and since these allocations are small (about 2k total), lets convert
    these pointers to static arrays of the appropriate size. All the accesses to
    these bits consider 0/NULL to be a non match when searching, so all the lookups
    still work properly, and there is no longer a chance of a bad dererence
    anywhere. As a bonus, this lets us eliminate the setup/teardown routines for
    those pointers, and elimnates the need to preform any locking around them to
    prevent access while their being allocated/freed.

    I've updated the tipc_net structure to behave this way to fix the exact reported
    problem, and also fixed up the tipc_bearers and media_list arrays to fix an
    obvious simmilar problem that arises from issuing tipc-config commands to
    manipulate bearers/links prior to entering networked mode

    I've tested this for a few hours by running the sanity tests and stress test
    with the tipcutils suite, and nothing has fallen over. There have been a few
    lockdep warnings, but those were there before, and can be addressed later, as
    they didn't actually result in any deadlock.

    Signed-off-by: Neil Horman
    CC: Allan Stephens
    CC: David S. Miller
    CC: tipc-discussion@lists.sourceforge.net

    bearer.c | 37 ++++++-------------------------------
    bearer.h | 2 +-
    net.c | 25 ++++---------------------
    3 files changed, 11 insertions(+), 53 deletions(-)
    Signed-off-by: David S. Miller

    Neil Horman
     

03 Sep, 2008

1 commit


15 Jul, 2008

1 commit

  • This patch corrects many places where TIPC routines indicated
    successful completion by returning TIPC_OK instead of 0.
    (The TIPC_OK symbol has the value 0, but it should only be used
    in contexts that deal with the error code field of a TIPC
    message header.)

    Signed-off-by: Allan Stephens
    Signed-off-by: David S. Miller

    Allan Stephens
     

22 May, 2008

1 commit

  • This patch ensures that TIPC's topology service and configuration
    service are shut down before switching into "network mode". This
    ensures that TIPC does not mistakenly try to send unnecessary
    "publication withdraw" messages to other nodes before it is fully
    initialized for sending off-node messages. Note that the node's
    current network address is now updated only after the two services
    are shut down; this ensures that any existing connections to the
    topology server are terminated correctly using the old address.

    Signed-off-by: Allan Stephens
    Signed-off-by: David S. Miller

    Allan Stephens
     

11 Feb, 2007

1 commit


22 Jul, 2006

1 commit


28 Jun, 2006

1 commit

  • locking init cleanups:

    - convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK()
    - convert rwlocks in a similar manner

    this patch was generated automatically.

    Motivation:

    - cleanliness
    - lockdep needs control of lock initialization, which the open-coded
    variants do not give
    - it's also useful for -rt and for lock debugging in general

    Signed-off-by: Ingo Molnar
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

21 Mar, 2006

2 commits

  • This patch contains the following possible cleanups:
    - make needlessly global code static
    - #if 0 the following unused global functions:
    - name_table.c: tipc_nametbl_print()
    - name_table.c: tipc_nametbl_dump()
    - net.c: tipc_net_next_node()

    Signed-off-by: Adrian Bunk
    Signed-off-by: Per Liden
    Signed-off-by: David S. Miller

    Adrian Bunk
     
  • Tried to run the new tipc stack through sparse.
    Following patch fixes all cases where 0 was used
    as replacement of NULL.
    Use NULL to document this is a pointer and to silence sparse.

    This brough sparse warning count down with 127 to 24 warnings.

    Signed-off-by: Sam Ravnborg
    Signed-off-by: Per Liden
    Signed-off-by: David S. Miller

    Sam Ravnborg
     

18 Jan, 2006

1 commit


13 Jan, 2006

4 commits