From: Sean Hefty Date: Mon, 12 Aug 2013 17:22:02 +0000 (-0700) Subject: commit X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=27fce2f4181cce36c7bc78b3dcddcd666b1b0134;p=~shefty%2Fibacm.git commit --- diff --git a/meta b/meta index c2ca6f6..bd21690 100644 --- a/meta +++ b/meta @@ -1,16 +1,7 @@ Version: 1 -Previous: 3fcacbc4ade737fab12dc975d13415180db3959a +Previous: aa4123d02458515e36d46d2b4a36bd242b178422 Head: f50963e207d6848a22a2132fa417e75fc6aadf61 Applied: - ibacm-acm-c-handle-client-rere: 029f4747c252d785d3050125f17fb24bb9632fbc - ibacm-1-8-libacm-c-remove-unne: 366b35d4b7c16fd82f20f7d1baec5ce7334d6486 - ibacm-2-8-acm-c-in-acm_port_up: 236a5d678b15c54f529b843ae45de749256807bf - ibacm-3-8-acm-c-invalid-pkey-h: 0450c59bd93b62c0e4b5f42c59fba48c75d037eb - ibacm-4-8-acm-c-fix-endian-of-: ec6c0f68d02802f47d3d3f3f36ba29ae60a3a614 - ibacm-5-8-acm-c-make-sure-mgid: 9e8ee9875ccdf8192f8e291e96f4818eac5b293d - ibacm-6-8-acm-c-send-multicast: 5f4d229c74e45810c9cd2c5291c4a800c63dd5f3 - ibacm-7-8-acm-c-fix-endian-of-: 11ddb7e4eab4cafbfe31f84f420afb94bd0691c6 - ibacm-8-8-acm-c-in-acm_join_gr: f50963e207d6848a22a2132fa417e75fc6aadf61 Unapplied: dev-name2ip: 8e00708e882239292492e13aa51c82042255933c dev-addrsize: 8de02c47fbf595132105a7050ad6f755f49f9a7a diff --git a/patches/ibacm-1-8-libacm-c-remove-unne b/patches/ibacm-1-8-libacm-c-remove-unne deleted file mode 100644 index 551ed97..0000000 --- a/patches/ibacm-1-8-libacm-c-remove-unne +++ /dev/null @@ -1,41 +0,0 @@ -Bottom: 66039c9ef02633d16d4d3e3473e04744dfe5e69c -Top: a0e70b1757e9d104dcc91529d158fb69622f3981 -Author: Hal Rosenstock -Date: 2013-08-06 07:45:14 -0400 - -libacm.c: Remove unneeded structures - -acm_port and acm_device are not used/needed - -Signed-off-by: Hal Rosenstock -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/libacm.c b/src/libacm.c -index 1bf7030..4e42233 100644 ---- a/src/libacm.c -+++ b/src/libacm.c -@@ -40,21 +40,6 @@ - #include - #include - --struct acm_port { -- uint8_t port_num; -- uint16_t lid; -- union ibv_gid gid; -- int pkey_cnt; -- uint16_t pkey[4]; --}; -- --struct acm_device { -- struct ibv_context *verbs; -- uint64_t guid; -- int port_cnt; -- struct acm_port *ports; --}; -- - extern lock_t lock; - static SOCKET sock = INVALID_SOCKET; - static short server_port = 6125; diff --git a/patches/ibacm-2-8-acm-c-in-acm_port_up b/patches/ibacm-2-8-acm-c-in-acm_port_up deleted file mode 100644 index 18f35e5..0000000 --- a/patches/ibacm-2-8-acm-c-in-acm_port_up +++ /dev/null @@ -1,55 +0,0 @@ -Bottom: a0e70b1757e9d104dcc91529d158fb69622f3981 -Top: 5016e961b43726e60e38a399b5930cef3ebdacfa -Author: Hal Rosenstock -Date: 2013-08-06 07:45:17 -0400 - -acm.c: In acm_port_up, handle noncontiguous pkeys - -There can be "holes" in pkey table although this is not usually the case -but since IBA spec allows for this, it should be handled. - -Signed-off-by: Hal Rosenstock -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/acm.c b/src/acm.c -index c1d6955..2eb0e22 100644 ---- a/src/acm.c -+++ b/src/acm.c -@@ -120,7 +120,6 @@ struct acm_port { - enum ibv_rate rate; - int subnet_timeout; - int gid_cnt; -- uint16_t pkey_cnt; - uint16_t lid; - uint16_t lid_mask; - uint8_t port_num; -@@ -3192,11 +3191,6 @@ static void acm_port_up(struct acm_port *port) - break; - } - -- for (port->pkey_cnt = 0;; port->pkey_cnt++) { -- ret = ibv_query_pkey(port->dev->verbs, port->port_num, port->pkey_cnt, &pkey); -- if (ret || !pkey) -- break; -- } - port->lid = attr.lid; - port->lid_mask = 0xffff - ((1 << attr.lmc) - 1); - -@@ -3214,8 +3208,12 @@ static void acm_port_up(struct acm_port *port) - return; - - atomic_set(&port->sa_dest.refcnt, 1); -- for (i = 0; i < port->pkey_cnt; i++) -- acm_ep_up(port, (uint16_t) i); -+ for (i = 0; i < attr.pkey_tbl_len; i++) { -+ ret = ibv_query_pkey(port->dev->verbs, port->port_num, i, &pkey); -+ if (ret || !pkey) -+ continue; -+ acm_ep_up(port, (uint16_t) i); -+ } - - acm_port_join(port); - port->state = IBV_PORT_ACTIVE; diff --git a/patches/ibacm-3-8-acm-c-invalid-pkey-h b/patches/ibacm-3-8-acm-c-invalid-pkey-h deleted file mode 100644 index 4f4fcef..0000000 --- a/patches/ibacm-3-8-acm-c-invalid-pkey-h +++ /dev/null @@ -1,28 +0,0 @@ -Bottom: 5016e961b43726e60e38a399b5930cef3ebdacfa -Top: e233b34f0e9a137c7e0a76af5009b7ca79ef0c3f -Author: Hal Rosenstock -Date: 2013-08-06 07:45:22 -0400 - -acm.c: Invalid pkey has low order 15 bits 0 - -so add in handling for pkey 0x8000 as well as 0 for invalid - -Signed-off-by: Hal Rosenstock -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/acm.c b/src/acm.c -index 2eb0e22..45ed133 100644 ---- a/src/acm.c -+++ b/src/acm.c -@@ -3210,7 +3210,7 @@ static void acm_port_up(struct acm_port *port) - atomic_set(&port->sa_dest.refcnt, 1); - for (i = 0; i < attr.pkey_tbl_len; i++) { - ret = ibv_query_pkey(port->dev->verbs, port->port_num, i, &pkey); -- if (ret || !pkey) -+ if (ret || !(ntohs(pkey) & 0x7fff)) - continue; - acm_ep_up(port, (uint16_t) i); - } diff --git a/patches/ibacm-4-8-acm-c-fix-endian-of- b/patches/ibacm-4-8-acm-c-fix-endian-of- deleted file mode 100644 index 19cc313..0000000 --- a/patches/ibacm-4-8-acm-c-fix-endian-of- +++ /dev/null @@ -1,46 +0,0 @@ -Bottom: e233b34f0e9a137c7e0a76af5009b7ca79ef0c3f -Top: 4df6bee9529676281cca8d198642f9ef351b2ee6 -Author: Hal Rosenstock -Date: 2013-08-06 07:45:28 -0400 - -acm.c: Fix endian of transaction ID - -It should be in network rather than host endian. - -Signed-off-by: Hal Rosenstock -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/acm.c b/src/acm.c -index 45ed133..bc59e5c 100644 ---- a/src/acm.c -+++ b/src/acm.c -@@ -838,7 +838,7 @@ static void acm_init_path_query(struct ib_sa_mad *mad) - mad->mgmt_class = IB_MGMT_CLASS_SA; - mad->class_version = 2; - mad->method = IB_METHOD_GET; -- mad->tid = (uint64_t) atomic_inc(&tid); -+ mad->tid = htonll((uint64_t) atomic_inc(&tid)); - mad->attr_id = IB_SA_ATTR_PATH_REC; - } - -@@ -1482,7 +1482,7 @@ static void acm_init_join(struct ib_sa_mad *mad, union ibv_gid *port_gid, - mad->mgmt_class = IB_MGMT_CLASS_SA; - mad->class_version = 2; - mad->method = IB_METHOD_SET; -- mad->tid = (uint64_t) atomic_inc(&tid); -+ mad->tid = htonll((uint64_t) atomic_inc(&tid)); - mad->attr_id = IB_SA_ATTR_MC_MEMBER_REC; - mad->comp_mask = - IB_COMP_MASK_MC_MGID | IB_COMP_MASK_MC_PORT_GID | -@@ -1952,7 +1952,7 @@ acm_send_resolve(struct acm_ep *ep, struct acm_dest *dest, - mad->class_version = 1; - mad->method = IB_METHOD_GET; - mad->control = ACM_CTRL_RESOLVE; -- mad->tid = (uint64_t) atomic_inc(&tid); -+ mad->tid = htonll((uint64_t) atomic_inc(&tid)); - - rec = (struct acm_resolve_rec *) mad->data; - rec->src_type = (uint8_t) saddr->type; diff --git a/patches/ibacm-5-8-acm-c-make-sure-mgid b/patches/ibacm-5-8-acm-c-make-sure-mgid deleted file mode 100644 index 8c55b2a..0000000 --- a/patches/ibacm-5-8-acm-c-make-sure-mgid +++ /dev/null @@ -1,28 +0,0 @@ -Bottom: 4df6bee9529676281cca8d198642f9ef351b2ee6 -Top: 4add6013b0f40f87144fed14ece4653ea3528d08 -Author: Hal Rosenstock -Date: 2013-08-06 07:45:31 -0400 - -acm.c: Make sure MGID has full member pkey bit on - -even when limited member of partition - -Signed-off-by: Hal Rosenstock -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/acm.c b/src/acm.c -index bc59e5c..f7fa34f 100644 ---- a/src/acm.c -+++ b/src/acm.c -@@ -1492,7 +1492,7 @@ static void acm_init_join(struct ib_sa_mad *mad, union ibv_gid *port_gid, - IB_COMP_MASK_MC_SCOPE | IB_COMP_MASK_MC_JOIN_STATE; - - mc_rec = (struct ib_mc_member_rec *) mad->data; -- acm_format_mgid(&mc_rec->mgid, pkey, tos, rate, mtu); -+ acm_format_mgid(&mc_rec->mgid, pkey | 0x8000, tos, rate, mtu); - mc_rec->port_gid = *port_gid; - mc_rec->qkey = ACM_QKEY; - mc_rec->mtu = 0x80 | mtu; diff --git a/patches/ibacm-6-8-acm-c-send-multicast b/patches/ibacm-6-8-acm-c-send-multicast deleted file mode 100644 index d7814bc..0000000 --- a/patches/ibacm-6-8-acm-c-send-multicast +++ /dev/null @@ -1,66 +0,0 @@ -Bottom: 4add6013b0f40f87144fed14ece4653ea3528d08 -Top: 673955be272cf849d197d530548f0eab174fb3a0 -Author: Hal Rosenstock -Date: 2013-08-06 07:45:37 -0400 - -acm.c: Send multicast joins to SA on default partition - -rather than on EP partition - -Prefer full default partition in case both full and limited -pkeys for default partition are in pkey table. - -Signed-off-by: Hal Rosenstock -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/acm.c b/src/acm.c -index f7fa34f..2a0f94b 100644 ---- a/src/acm.c -+++ b/src/acm.c -@@ -120,6 +120,7 @@ struct acm_port { - enum ibv_rate rate; - int subnet_timeout; - int gid_cnt; -+ uint16_t default_pkey_ix; - uint16_t lid; - uint16_t lid_mask; - uint8_t port_num; -@@ -1523,7 +1524,7 @@ static void acm_join_group(struct acm_ep *ep, union ibv_gid *port_gid, - port = ep->port; - umad->addr.qpn = htonl(port->sa_dest.remote_qpn); - umad->addr.qkey = htonl(ACM_QKEY); -- umad->addr.pkey_index = ep->pkey_index; -+ umad->addr.pkey_index = port->default_pkey_ix; - umad->addr.lid = htons(port->sa_dest.av.dlid); - umad->addr.sl = port->sa_dest.av.sl; - umad->addr.path_bits = port->sa_dest.av.src_path_bits; -@@ -3169,6 +3170,7 @@ static void acm_port_up(struct acm_port *port) - union ibv_gid gid; - uint16_t pkey; - int i, ret; -+ int is_full_default_pkey_set = 0; - - acm_log(1, "%s %d\n", port->dev->verbs->device->name, port->port_num); - ret = ibv_query_port(port->dev->verbs, port->port_num, &attr); -@@ -3210,8 +3212,18 @@ static void acm_port_up(struct acm_port *port) - atomic_set(&port->sa_dest.refcnt, 1); - for (i = 0; i < attr.pkey_tbl_len; i++) { - ret = ibv_query_pkey(port->dev->verbs, port->port_num, i, &pkey); -- if (ret || !(ntohs(pkey) & 0x7fff)) -+ if (ret) -+ continue; -+ pkey = ntohs(pkey); -+ if (!(pkey & 0x7fff)) - continue; -+ -+ /* Determine pkey index for default partition with preference for full membership */ -+ if (!is_full_default_pkey_set && (pkey & 0x7fff) == 0x7fff) { -+ port->default_pkey_ix = i; -+ if (pkey & 0x8000) -+ is_full_default_pkey_set = 1; -+ } - acm_ep_up(port, (uint16_t) i); - } diff --git a/patches/ibacm-7-8-acm-c-fix-endian-of- b/patches/ibacm-7-8-acm-c-fix-endian-of- deleted file mode 100644 index d8a0c4f..0000000 --- a/patches/ibacm-7-8-acm-c-fix-endian-of- +++ /dev/null @@ -1,26 +0,0 @@ -Bottom: 673955be272cf849d197d530548f0eab174fb3a0 -Top: 33cb7532f4665cf34319bbf178fb2a9d5c1f93dc -Author: Hal Rosenstock -Date: 2013-08-06 07:45:40 -0400 - -acm.c: Fix endian of qkey in MCMemberRecord in acm_init_join - -Signed-off-by: Hal Rosenstock -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/acm.c b/src/acm.c -index 2a0f94b..613fe9b 100644 ---- a/src/acm.c -+++ b/src/acm.c -@@ -1495,7 +1495,7 @@ static void acm_init_join(struct ib_sa_mad *mad, union ibv_gid *port_gid, - mc_rec = (struct ib_mc_member_rec *) mad->data; - acm_format_mgid(&mc_rec->mgid, pkey | 0x8000, tos, rate, mtu); - mc_rec->port_gid = *port_gid; -- mc_rec->qkey = ACM_QKEY; -+ mc_rec->qkey = htonl(ACM_QKEY); - mc_rec->mtu = 0x80 | mtu; - mc_rec->tclass = tclass; - mc_rec->pkey = htons(pkey); diff --git a/patches/ibacm-8-8-acm-c-in-acm_join_gr b/patches/ibacm-8-8-acm-c-in-acm_join_gr deleted file mode 100644 index 06dff5e..0000000 --- a/patches/ibacm-8-8-acm-c-in-acm_join_gr +++ /dev/null @@ -1,25 +0,0 @@ -Bottom: 33cb7532f4665cf34319bbf178fb2a9d5c1f93dc -Top: d9550a0f4af3070ab99ce5250a4a5e97797c39fc -Author: Hal Rosenstock -Date: 2013-08-06 07:45:43 -0400 - -acm.c: In acm_join_group, no need to set qkey in umad addr to send to SA - -Signed-off-by: Hal Rosenstock -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/acm.c b/src/acm.c -index 613fe9b..0f77f5f 100644 ---- a/src/acm.c -+++ b/src/acm.c -@@ -1523,7 +1523,6 @@ static void acm_join_group(struct acm_ep *ep, union ibv_gid *port_gid, - - port = ep->port; - umad->addr.qpn = htonl(port->sa_dest.remote_qpn); -- umad->addr.qkey = htonl(ACM_QKEY); - umad->addr.pkey_index = port->default_pkey_ix; - umad->addr.lid = htons(port->sa_dest.av.dlid); - umad->addr.sl = port->sa_dest.av.sl; diff --git a/patches/ibacm-acm-c-handle-client-rere b/patches/ibacm-acm-c-handle-client-rere deleted file mode 100644 index d7020a7..0000000 --- a/patches/ibacm-acm-c-handle-client-rere +++ /dev/null @@ -1,34 +0,0 @@ -Bottom: 40a738464f4149e1d69afcf8e104cb064253e968 -Top: 66039c9ef02633d16d4d3e3473e04744dfe5e69c -Author: Hal Rosenstock -Date: 2013-08-02 08:00:37 -0400 - -acm.c: Handle client reregister local event - -When client reregister is requested, ACM should rejoin/recreate -ACM multicast groups. - -Signed-off-by: Hal Rosenstock -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/acm.c b/src/acm.c -index 0da20f8..c1d6955 100644 ---- a/src/acm.c -+++ b/src/acm.c -@@ -3282,6 +3282,13 @@ static void CDECL_FUNC acm_event_handler(void *context) - if (dev->port[i].state == IBV_PORT_ACTIVE) - acm_port_down(&dev->port[i]); - break; -+ case IBV_EVENT_CLIENT_REREGISTER: -+ if (dev->port[i].state == IBV_PORT_ACTIVE) { -+ acm_port_join(&dev->port[i]); -+ acm_log(1, "%s %d has reregistered\n", -+ dev->verbs->device->name, i + 1); -+ } -+ break; - default: - break; - }