From 46679d63a612ad4bf38d04342c1af0fc2fc6e642 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 23 Feb 2011 15:00:54 -0800 Subject: [PATCH] refresh (create temporary patch) --- meta | 5 +++-- patches/refresh-temp | 46 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 patches/refresh-temp diff --git a/meta b/meta index c35300e..d84ad88 100644 --- a/meta +++ b/meta @@ -1,6 +1,6 @@ Version: 1 -Previous: 73340c690b53c966a9e6b28b98d9a00bbb4f6168 -Head: 62a69bb931e1d97ede91b2bec81040ae2fb56a54 +Previous: 3abaf19b7b3e3b1816614375e00a80dd5319226f +Head: e49c5718109383a66066cc63bb2eccd2661803ea Applied: addr_open: 1fd2bfd86e2e2fe78f9d5d6d39aa5502938923f0 open_dev: 4687a6571146acd8d9a1553a96e2e4f7e8318761 @@ -9,6 +9,7 @@ Applied: sm_lid_get: dc8017769d3dfcbd85ae7ec037c871ac476a4c2d port_events: 2c5102e66c464b5516c0042add768e774254b7ce port_down: 62a69bb931e1d97ede91b2bec81040ae2fb56a54 + refresh-temp: e49c5718109383a66066cc63bb2eccd2661803ea Unapplied: autoaddr: 36281f18de15f2482e21ae1304f2e34e9ecf187d async_mc: c51c6e84981821b2541daba97cee9a29cd1d3709 diff --git a/patches/refresh-temp b/patches/refresh-temp new file mode 100644 index 0000000..d7c31a1 --- /dev/null +++ b/patches/refresh-temp @@ -0,0 +1,46 @@ +Bottom: a26b996b6ad8b504352351b10c17639e2292c170 +Top: 2d113f8e7821e60a34f46c2176eed702bc10c893 +Author: Sean Hefty +Date: 2011-02-23 15:00:54 -0800 + +Refresh of port_down + +--- + +diff --git a/src/acm.c b/src/acm.c +index af18c3d..6a1d104 100644 +--- a/src/acm.c ++++ b/src/acm.c +@@ -2672,6 +2672,32 @@ static void acm_port_up(struct acm_port *port) + lock_release(&port->lock); + } + ++static void acm_port_down(struct acm_port *port) ++{ ++ struct ibv_port_attr attr; ++ union ibv_gid gid; ++ uint16_t pkey; ++ struct acm_ep *ep; ++ int i, ret; ++ ++ 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); ++ if (!ret && attr.state == IBV_PORT_ACTIVE) { ++ acm_log(1, "port active\n"); ++ return; ++ } ++ ++ lock_acquire(&port->lock); ++ port->state = attr.state; ++ lock_release(&port->lock); ++ ++ for (i = 0; i < port->pkey_cnt; i++) ++ acm_ep_down(port, i); ++ ++ /* TODO: wait for SA destination to be released */ ++ ibv_destroy_ah(port->sa_dest.ah); ++} ++ + /* + * There is one event handler thread per device. This is the only thread that + * modifies the port state or a port endpoint list. Other threads which access -- 2.46.0