]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: relocate common functions from media to bearer
authorYing Xue <ying.xue@windriver.com>
Wed, 11 Dec 2013 04:45:42 +0000 (20:45 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Dec 2013 05:17:43 +0000 (00:17 -0500)
commit88de837f2cedd494e2095d5f2d156d882f8297ff
tree5087be7329e5f2fd83c0f92e5cade64fd3c0d545
parentb1cfd98382e2b334c48e9194e94a6aa5142fd27c
tipc: relocate common functions from media to bearer

Currently, registering a TIPC stack handler in the network device layer
is done twice, once for Ethernet (eth_media) and Infiniband (ib_media)
repectively. But, as this registration is not media specific, we can
avoid some code duplication by moving the registering function to
the generic bearer layer, to the file bearer.c, and call it only once.
The same is true for the network device event notifier.

As a side effect, the two workqueues we are using for for setting up/
cleaning up media can now be eliminated. Furthermore, the array for
storing the specific media type structs, media_array[], can be entirely
deleted.

Note that the eth_started and ib_started flags were removed during the
code relocation.  There is now only one call to bearer_setup and
bearer_cleanup, and these can logically not race against each other.

Despite its size, this cleanup work incurs no functional changes in TIPC.
In particular, it should be noted that the sequence ordering of received
packets is unaffected by this change, since packet reception never was
subject to any work queue handling in the first place.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/bearer.c
net/tipc/bearer.h
net/tipc/core.c
net/tipc/eth_media.c
net/tipc/ib_media.c