From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <allan.stephens@windriver.com>,
<jon.maloy@ericsson.com>, <erik.hugne@ericsson.com>,
<ying.xue@windriver.com>
Subject: [PATCH net-next 01/10] tipc: Optimize re-initialization of configuration service
Date: Mon, 30 Apr 2012 18:36:59 -0400 [thread overview]
Message-ID: <1335825428-16053-2-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1335825428-16053-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
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,<0.0.0>} name publication and creates a new
{0,<Z.C.N>} name publication that identifies the node's network address
to interested subscribers.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/config.c | 15 +++++++++++++++
net/tipc/config.h | 1 +
net/tipc/net.c | 3 +--
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/net/tipc/config.c b/net/tipc/config.c
index f5458ed..a4988cd 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -489,6 +489,21 @@ failed:
return res;
}
+void tipc_cfg_reinit(void)
+{
+ struct tipc_name_seq seq;
+ int res;
+
+ seq.type = TIPC_CFG_SRV;
+ seq.lower = seq.upper = 0;
+ tipc_withdraw(config_port_ref, TIPC_ZONE_SCOPE, &seq);
+
+ seq.lower = seq.upper = tipc_own_addr;
+ res = tipc_publish(config_port_ref, TIPC_ZONE_SCOPE, &seq);
+ if (res)
+ err("Unable to reinitialize configuration service\n");
+}
+
void tipc_cfg_stop(void)
{
if (config_port_ref) {
diff --git a/net/tipc/config.h b/net/tipc/config.h
index 80da6eb..1f252f3 100644
--- a/net/tipc/config.h
+++ b/net/tipc/config.h
@@ -66,6 +66,7 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd,
int headroom);
int tipc_cfg_init(void);
+void tipc_cfg_reinit(void);
void tipc_cfg_stop(void);
#endif
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 5fab4ff..f4a490b 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -176,7 +176,6 @@ int tipc_net_start(u32 addr)
char addr_string[16];
tipc_subscr_stop();
- tipc_cfg_stop();
write_lock_bh(&tipc_net_lock);
tipc_own_addr = addr;
@@ -186,7 +185,7 @@ int tipc_net_start(u32 addr)
write_unlock_bh(&tipc_net_lock);
tipc_k_signal((Handler)tipc_subscr_start, 0);
- tipc_k_signal((Handler)tipc_cfg_init, 0);
+ tipc_cfg_reinit();
info("Started in network mode\n");
info("Own node address %s, network identity %u\n",
--
1.7.9.6
next prev parent reply other threads:[~2012-04-30 22:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-30 22:36 [PATCH net-next 00/10] tipc: last batch from the sourceforge queue Paul Gortmaker
2012-04-30 22:36 ` Paul Gortmaker [this message]
2012-04-30 22:37 ` [PATCH net-next 02/10] tipc: Optimize initialization of configuration service Paul Gortmaker
2012-04-30 22:37 ` [PATCH net-next 03/10] tipc: Optimize termination " Paul Gortmaker
2012-04-30 22:37 ` [PATCH net-next 04/10] tipc: Enhance re-initialization of network topology service Paul Gortmaker
2012-04-30 22:37 ` [PATCH net-next 05/10] tipc: Optimize initialization " Paul Gortmaker
2012-04-30 22:37 ` [PATCH net-next 06/10] tipc: remove redundant memset and stale comment from subscr.c Paul Gortmaker
2012-04-30 22:37 ` [PATCH net-next 07/10] tipc: Create helper routine to delete unused name sequence structure Paul Gortmaker
2012-04-30 22:37 ` [PATCH net-next 08/10] tipc: Enhance error checking of published names Paul Gortmaker
2012-04-30 22:37 ` [PATCH net-next 09/10] tipc: Reject payload messages with invalid message type Paul Gortmaker
2012-04-30 22:37 ` [PATCH net-next 10/10] tipc: compress out gratuitous extra carriage returns Paul Gortmaker
2012-05-01 1:45 ` [PATCH net-next 00/10] tipc: last batch from the sourceforge queue David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335825428-16053-2-git-send-email-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=allan.stephens@windriver.com \
--cc=davem@davemloft.net \
--cc=erik.hugne@ericsson.com \
--cc=jon.maloy@ericsson.com \
--cc=netdev@vger.kernel.org \
--cc=ying.xue@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).