[ewg] [PATCH 1/10] nes: accelerated loopback fix
Glenn Grundstrom NetEffect
glenn at lists.openfabrics.org
Thu Dec 20 12:22:41 PST 2007
Accelerated loopback code did not properly handle private
data. Add loopback connection counter to ethtool stats.
Signed-off-by: Glenn Grundstrom <ggrundstrom at neteffect.com>
---
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 638bc51..79889a4 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -67,6 +67,7 @@ u32 cm_packets_received;
u32 cm_listens_created;
u32 cm_listens_destroyed;
u32 cm_backlog_drops;
+atomic_t cm_loopbacks;
atomic_t cm_nodes_created;
atomic_t cm_nodes_destroyed;
atomic_t cm_accel_dropped_pkts;
@@ -1638,6 +1639,7 @@ struct nes_cm_node * mini_cm_connect(struct nes_cm_core *cm_core,
if (loopbackremotelistener == NULL) {
create_event(cm_node, NES_CM_EVENT_ABORTED);
} else {
+ atomic_inc(&cm_loopbacks);
loopback_cm_info = *cm_info;
loopback_cm_info.loc_port = cm_info->rem_port;
loopback_cm_info.rem_port = cm_info->loc_port;
@@ -2445,7 +2447,13 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
cm_event.private_data = NULL;
cm_event.private_data_len = 0;
ret = cm_id->event_handler(cm_id, &cm_event);
- nes_debug(NES_DBG_CM, "OFA CM event_handler returned, ret=%d\n", ret);
+ if (cm_node->loopbackpartner) {
+ cm_node->loopbackpartner->mpa_frame_size = nesqp->private_data_len;
+ /* copy entire MPA frame to our cm_node's frame */
+ memcpy(cm_node->loopbackpartner->mpa_frame_buf, nesqp->ietf_frame->priv_data,
+ nesqp->private_data_len);
+ create_event(cm_node->loopbackpartner, NES_CM_EVENT_CONNECTED);
+ }
if (ret)
printk("%s[%u] OFA CM event_handler returned, ret=%d\n",
__FUNCTION__, __LINE__, ret);
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index e01aab4..810a9ae 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -114,6 +114,7 @@ extern u32 cm_packets_retrans;
extern u32 cm_listens_created;
extern u32 cm_listens_destroyed;
extern u32 cm_backlog_drops;
+extern atomic_t cm_loopbacks;
extern atomic_t cm_nodes_created;
extern atomic_t cm_nodes_destroyed;
extern atomic_t cm_accel_dropped_pkts;
@@ -967,7 +968,7 @@ void nes_netdev_exit(struct nes_vnic *nesvnic)
}
-#define NES_ETHTOOL_STAT_COUNT 54
+#define NES_ETHTOOL_STAT_COUNT 55
static const char nes_ethtool_stringset[NES_ETHTOOL_STAT_COUNT][ETH_GSTRING_LEN] = {
"Link Change Interrupts",
"Linearized SKBs",
@@ -1011,6 +1012,7 @@ static const char nes_ethtool_stringset[NES_ETHTOOL_STAT_COUNT][ETH_GSTRING_LEN]
"CM Listens Created",
"CM Listens Destroyed",
"CM Backlog Drops",
+ "CM Loopbacks",
"CM Nodes Created",
"CM Nodes Destroyed",
"CM Accel Drops",
@@ -1206,11 +1208,11 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev,
target_stat_values[39] = cm_listens_created;
target_stat_values[40] = cm_listens_destroyed;
target_stat_values[41] = cm_backlog_drops;
- target_stat_values[42] = atomic_read(&cm_nodes_created);
- target_stat_values[43] = atomic_read(&cm_nodes_destroyed);
- target_stat_values[44] = atomic_read(&cm_accel_dropped_pkts);
- target_stat_values[45] = atomic_read(&cm_resets_recvd);
- target_stat_values[46] = int_mod_timer_init;
+ target_stat_values[42] = atomic_read(&cm_loopbacks);
+ target_stat_values[43] = atomic_read(&cm_nodes_created);
+ target_stat_values[44] = atomic_read(&cm_nodes_destroyed);
+ target_stat_values[45] = atomic_read(&cm_accel_dropped_pkts);
+ target_stat_values[46] = atomic_read(&cm_resets_recvd);
target_stat_values[47] = int_mod_cq_depth_1;
target_stat_values[48] = int_mod_cq_depth_4;
target_stat_values[49] = int_mod_cq_depth_16;
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
index b6aa6d3..8d2c1ee 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -620,8 +620,6 @@ void nes_post_cqp_request(struct nes_device *nesdev,
}
-
-
/**
* nes_arp_table
*/
More information about the ewg
mailing list