Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1340008 > unrolled thread
| Started by | James Simmons <jsimmons@infradead.org> |
|---|---|
| First post | 2016-02-22 23:30 +0100 |
| Last post | 2016-02-22 23:40 +0100 |
| Articles | 3 on this page of 23 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 00/24] Second batch of LNet updates James Simmons <jsimmons@infradead.org> - 2016-02-22 23:30 +0100
[PATCH 17/24] staging: lustre: prevent assert on LNet module unload James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 24/24] staging: lustre: Remove LASSERTS from router checker James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 19/24] staging: lustre: remove unnecessary EXPORT_SYMBOL from lnet layer James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 01/24] staging: lustre: Dynamic LNet Configuration (DLC) IOCTL changes James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 07/24] staging: lustre: improve LNet clean up code and API James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 23/24] staging: lustre: Use lnet_is_route_alive for router aliveness James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 22/24] staging: lustre: Allocate the correct number of rtr buffers James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 20/24] staging: lustre: avoid race during lnet acceptor thread termination James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 11/24] staging: lustre: startup lnet acceptor thread dynamically James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 09/24] staging: lustre: make some lnet functions static James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 04/24] staging: lustre: DLC user/kernel space glue code James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 13/24] staging: lustre: return -EEXIST if NI is not unique James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 03/24] staging: lustre: fix crash due to NULL networks string James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 21/24] staging: lustre: use sock.h in only acceptor.c James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 18/24] staging: lustre: remove messages from lazy portal on NI shutdown James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 05/24] staging: lustre: make local functions static for LNet ni James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 06/24] staging: lustre: remove LUSTRE_{,SRV_}LNET_PID James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 16/24] staging: lustre: assume a kernel build James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 10/24] staging: lustre: missed a few cases of using NULL instead of 0 James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 14/24] staging: lustre: handle lnet_check_routes() errors James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 08/24] staging: lustre: return appropriate errno when adding route James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
[PATCH 12/24] staging: lustre: reject invalid net configuration for lnet James Simmons <jsimmons@infradead.org> - 2016-02-22 23:40 +0100
Page 2 of 2 — ← Prev page 1 [2]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2016-02-22 23:40 +0100 |
| Subject | [PATCH 14/24] staging: lustre: handle lnet_check_routes() errors |
| Message-ID | <r57j6-4kk-79@gated-at.bofh.it> |
| In reply to | #1340008 |
From: Amir Shehata <amir.shehata@intel.com>
After adding a route, lnet_check_routes() is called to ensure that
the route added doesn't invalidate the routing configuration. If
lnet_check_routes() fails then the route just added, which caused the
current configuration to be invalidated is deleted, and an error
is returned to the user.
Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6218
Reviewed-on: http://review.whamcloud.com/13445
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
drivers/staging/lustre/lnet/lnet/api-ni.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index ccd7dcd..ed121a8 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1907,8 +1907,14 @@ LNetCtl(unsigned int cmd, void *arg)
config->cfg_config_u.cfg_route.rtr_hop,
config->cfg_nid,
config->cfg_config_u.cfg_route.rtr_priority);
+ if (!rc) {
+ rc = lnet_check_routes();
+ if (rc)
+ lnet_del_route(config->cfg_net,
+ config->cfg_nid);
+ }
mutex_unlock(&the_lnet.ln_api_mutex);
- return rc ? rc : lnet_check_routes();
+ return rc;
case IOC_LIBCFS_DEL_ROUTE:
config = arg;
--
1.7.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2016-02-22 23:40 +0100 |
| Subject | [PATCH 08/24] staging: lustre: return appropriate errno when adding route |
| Message-ID | <r57j6-4kk-77@gated-at.bofh.it> |
| In reply to | #1340008 |
From: Amir Shehata <amir.shehata@intel.com>
When adding route it ignored specific scenarios, namely:
1. route already exists
2. route is on a local net
3. route is unreacheable
This patch returns the appropriate return codes from the lower level
function lnet_add_route(), and then ignores the above case from the
calling function, lnet_parse_route(). This is needed so we don't
halt processing routes in the module parameters.
However, we can now add routes dynamically, and it should be returned
to the user whether adding the requested route succeeded or failed.
In userspace it is determined whether to continue adding routes or to
halt processing. Currently "lnetctl import < config" continues
adding the rest of the configuration and reports at the end which
operations passed and which ones failed.
Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6045
Reviewed-on: http://review.whamcloud.com/13116
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
drivers/staging/lustre/lnet/lnet/config.c | 2 +-
drivers/staging/lustre/lnet/lnet/router.c | 11 +++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c
index c04a0ef..8c80625 100644
--- a/drivers/staging/lustre/lnet/lnet/config.c
+++ b/drivers/staging/lustre/lnet/lnet/config.c
@@ -769,7 +769,7 @@ lnet_parse_route(char *str, int *im_a_router)
}
rc = lnet_add_route(net, hops, nid, priority);
- if (rc) {
+ if (rc && rc != -EEXIST && rc != -EHOSTUNREACH) {
CERROR("Can't create route to %s via %s\n",
libcfs_net2str(net),
libcfs_nid2str(nid));
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c
index d748931..511e446 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -317,7 +317,7 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway,
return -EINVAL;
if (lnet_islocalnet(net)) /* it's a local network */
- return 0; /* ignore the route entry */
+ return -EEXIST;
/* Assume net, route, all new */
LIBCFS_ALLOC(route, sizeof(*route));
@@ -348,7 +348,7 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway,
LIBCFS_FREE(rnet, sizeof(*rnet));
if (rc == -EHOSTUNREACH) /* gateway is not on a local net */
- return 0; /* ignore the route entry */
+ return rc; /* ignore the route entry */
CERROR("Error %d creating route %s %d %s\n", rc,
libcfs_net2str(net), hops,
libcfs_nid2str(gateway));
@@ -395,14 +395,17 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway,
/* -1 for notify or !add_route */
lnet_peer_decref_locked(route->lr_gateway);
lnet_net_unlock(LNET_LOCK_EX);
+ rc = 0;
- if (!add_route)
+ if (!add_route) {
+ rc = -EEXIST;
LIBCFS_FREE(route, sizeof(*route));
+ }
if (rnet != rnet2)
LIBCFS_FREE(rnet, sizeof(*rnet));
- return 0;
+ return rc;
}
int
--
1.7.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2016-02-22 23:40 +0100 |
| Subject | [PATCH 12/24] staging: lustre: reject invalid net configuration for lnet |
| Message-ID | <r57j6-4kk-73@gated-at.bofh.it> |
| In reply to | #1340008 |
From: Amir Shehata <amir.shehata@intel.com>
Currently if there exists a route that goes over a
remote net and then this net is added dynamically as
a local net, then traffic stops because the code in
lnet_send() determines that the destination nid
can be reached from another local_ni, but the src_nid
is still stuck on the earlier NI, because the src_nid
is stored in the ptlrpc layer and is not updated
when a local NI is configured.
Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5874
Reviewed-on: http://review.whamcloud.com/12912
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
drivers/staging/lustre/lnet/lnet/api-ni.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 9497ce1..62a9e45 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1756,6 +1756,7 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets,
lnet_handle_md_t md_handle;
struct lnet_ni *ni;
struct list_head net_head;
+ lnet_remotenet_t *rnet;
int rc;
INIT_LIST_HEAD(&net_head);
@@ -1772,12 +1773,27 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets,
goto failed0;
}
+ ni = list_entry(net_head.next, struct lnet_ni, ni_list);
+
+ lnet_net_lock(LNET_LOCK_EX);
+ rnet = lnet_find_net_locked(LNET_NIDNET(ni->ni_nid));
+ lnet_net_unlock(LNET_LOCK_EX);
+ /*
+ * make sure that the net added doesn't invalidate the current
+ * configuration LNet is keeping
+ */
+ if (rnet) {
+ CERROR("Adding net %s will invalidate routing configuration\n",
+ nets);
+ rc = -EUSERS;
+ goto failed0;
+ }
+
rc = lnet_ping_info_setup(&pinfo, &md_handle, 1 + lnet_get_ni_count(),
false);
if (rc)
goto failed0;
- ni = list_entry(net_head.next, struct lnet_ni, ni_list);
list_del_init(&ni->ni_list);
rc = lnet_startup_lndni(ni, peer_timeout, peer_cr,
--
1.7.1
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web