aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorFaisal Latif <faisal.latif@intel.com>2009-04-27 16:37:34 -0400
committerRoland Dreier <rolandd@cisco.com>2009-04-27 16:37:34 -0400
commit53094c388f11d79f742eaf743c9fd740a881f2c0 (patch)
treefc6532504678f4b5e52ec89fb1be26af31ac9435 /drivers/infiniband/hw
parent1f0dba1e51cfc93bf4545811839a84c879086fd4 (diff)
RDMA/nes: Do not set apbvt entry for loopback
When a connect request comes, apbvt should only be set for non-loopback connections. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 7da5437d9859..1efe0beca063 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -2955,6 +2955,7 @@ int nes_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
2955 struct nes_device *nesdev; 2955 struct nes_device *nesdev;
2956 struct nes_cm_node *cm_node; 2956 struct nes_cm_node *cm_node;
2957 struct nes_cm_info cm_info; 2957 struct nes_cm_info cm_info;
2958 int apbvt_set = 0;
2958 2959
2959 ibqp = nes_get_qp(cm_id->device, conn_param->qpn); 2960 ibqp = nes_get_qp(cm_id->device, conn_param->qpn);
2960 if (!ibqp) 2961 if (!ibqp)
@@ -2992,9 +2993,11 @@ int nes_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
2992 conn_param->private_data_len); 2993 conn_param->private_data_len);
2993 2994
2994 if (cm_id->local_addr.sin_addr.s_addr != 2995 if (cm_id->local_addr.sin_addr.s_addr !=
2995 cm_id->remote_addr.sin_addr.s_addr) 2996 cm_id->remote_addr.sin_addr.s_addr) {
2996 nes_manage_apbvt(nesvnic, ntohs(cm_id->local_addr.sin_port), 2997 nes_manage_apbvt(nesvnic, ntohs(cm_id->local_addr.sin_port),
2997 PCI_FUNC(nesdev->pcidev->devfn), NES_MANAGE_APBVT_ADD); 2998 PCI_FUNC(nesdev->pcidev->devfn), NES_MANAGE_APBVT_ADD);
2999 apbvt_set = 1;
3000 }
2998 3001
2999 /* set up the connection params for the node */ 3002 /* set up the connection params for the node */
3000 cm_info.loc_addr = htonl(cm_id->local_addr.sin_addr.s_addr); 3003 cm_info.loc_addr = htonl(cm_id->local_addr.sin_addr.s_addr);
@@ -3011,8 +3014,7 @@ int nes_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
3011 conn_param->private_data_len, (void *)conn_param->private_data, 3014 conn_param->private_data_len, (void *)conn_param->private_data,
3012 &cm_info); 3015 &cm_info);
3013 if (!cm_node) { 3016 if (!cm_node) {
3014 if (cm_id->local_addr.sin_addr.s_addr != 3017 if (apbvt_set)
3015 cm_id->remote_addr.sin_addr.s_addr)
3016 nes_manage_apbvt(nesvnic, ntohs(cm_id->local_addr.sin_port), 3018 nes_manage_apbvt(nesvnic, ntohs(cm_id->local_addr.sin_port),
3017 PCI_FUNC(nesdev->pcidev->devfn), 3019 PCI_FUNC(nesdev->pcidev->devfn),
3018 NES_MANAGE_APBVT_DEL); 3020 NES_MANAGE_APBVT_DEL);
@@ -3021,7 +3023,7 @@ int nes_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
3021 return -ENOMEM; 3023 return -ENOMEM;
3022 } 3024 }
3023 3025
3024 cm_node->apbvt_set = 1; 3026 cm_node->apbvt_set = apbvt_set;
3025 nesqp->cm_node = cm_node; 3027 nesqp->cm_node = cm_node;
3026 cm_node->nesqp = nesqp; 3028 cm_node->nesqp = nesqp;
3027 nes_add_ref(&nesqp->ibqp); 3029 nes_add_ref(&nesqp->ibqp);