Version: 1
-Previous: e8b2cedc4176884375569f768de02046d2df902b
-Head: 51d39059c7fec3ee6e764fe2f473b5ce227a3967
+Previous: 2ef51322b98c08d6eda63413850f69cbff2db343
+Head: 50aabefea99c72aab693bcce9c8718ce9ee67874
Applied:
acm_snoop: 4241a1ee0838579443846233ba67f9f6464db855
log_lid: 9bc99c564c67392596986084c29697a4fb55d006
logging: 39170d53e725bd8dc493d1eea532c63fde504e61
dest_string: d234c9d83479e496fa925c7f46b806d07a35d3d4
loop: 51d39059c7fec3ee6e764fe2f473b5ce227a3967
+ refresh-temp: 50aabefea99c72aab693bcce9c8718ce9ee67874
Unapplied:
Hidden:
--- /dev/null
+Bottom: 586b39cacd2b705239045da946e474cb11840ae8
+Top: f753fc77ff0487c91ad6761d39d3786136eb1015
+Author: Sean Hefty <sean.hefty@intel.com>
+Date: 2010-11-16 15:01:58 -0800
+
+Refresh of loop
+
+---
+
+diff --git a/src/acm.c b/src/acm.c
+index 77194ff..754a74b 100644
+--- a/src/acm.c
++++ b/src/acm.c
+@@ -204,6 +204,7 @@ static char log_file[128] = "stdout";
+ static int log_level = 0;
+ static enum acm_addr_prot addr_prot = ACM_ADDR_PROT_ACM;
+ static enum acm_route_prot route_prot = ACM_ROUTE_PROT_ACM;
++static int loopback_prot = 0;
+ static short server_port = 6125;
+ static int timeout = 2000;
+ static int retries = 15;
+@@ -2294,6 +2295,37 @@ static int acm_assign_ep_names(struct acm_ep *ep)
+ return !index;
+ }
+
++static int acm_init_ep_loopback(struct acm_ep *ep)
++{
++ struct acm_dest *dest;
++ int i, ret;
++
++ for (i = 0; i < MAX_EP_ADDRESS && ep->addr_type[i]; i++) {
++ dest = acm_acquire_dest(ep, ep->addr_type[i], &ep->addr[i].addr);
++ if (!dest) {
++ acm_format_name(0, log_data, sizeof log_data,
++ ep->addr_type[i], &ep->addr[i].addr,
++ sizeof ep->addr[i].addr);
++ acm_log(0, "ERROR - unable to create loopback dest %s\n", log_data);
++ return -1;
++ }
++
++ ibv_query_gid(ep->port->dev->verbs, ep->port->port_num,
++ 0, &dest->path.sgid);
++
++ dest->path.dgid = dest->path.sgid;
++ dest->path.dlid = dest->path.slid = htons(ep->port->lid);
++ dest->path.reversible_numpath = IBV_PATH_RECORD_REVERSIBLE;
++ dest->path.pkey = htons(ep->pkey);
++ dest->path.mtu = (uint8_t) ep->port->mtu;
++ dest->path.rate = (uint8_t) ep->port->rate;
++
++ dest->state = ACM_READY;
++ acm_put_dest(dest);
++ }
++ retutn 0;
++}
++
+ static int acm_activate_ep(struct acm_port *port, struct acm_ep *ep, uint16_t pkey_index)
+ {
+ struct ibv_qp_init_attr init_attr;
+@@ -2323,6 +2355,12 @@ static int acm_activate_ep(struct acm_port *port, struct acm_ep *ep, uint16_t pk
+ return ret;
+ }
+
++ ret = acm_init_ep_loopback(ep);
++ if (ret) {
++ acm_log(0, "ERROR - unable to init loopback\n");
++ return ret;
++ }
++
+ sq_size = resolve_depth + sa_depth + send_depth;
+ ep->cq = ibv_create_cq(port->dev->verbs, sq_size + recv_depth,
+ ep, port->dev->channel, 0);
+@@ -2620,6 +2658,12 @@ static void acm_set_options(void)
+ }
+
+ fclose(f);
++
++ if (!(f = fopen("/sys/module/mlx4_core/parameters/block_loopback", "r")))
++ return;
++
++ fscanf(f, "%d", &loopback_prot);
++ fclose(f);
+ }
+
+ static void acm_log_options(void)