Commit bf90aadd authored by Michael J. Ruhl's avatar Michael J. Ruhl Committed by Doug Ledford

IB/hfi1: Send MAD traps until repressed

A trap should be sent to the FM until the FM sends a repress message.
This is in line with the IBTA 13.4.9.

Add the ability to resend traps until a repress message is received.
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: default avatarMichael N. Henry <michael.n.henry@intel.com>
Signed-off-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 2250563e
This diff is collapsed.
/* /*
* Copyright(c) 2015, 2016 Intel Corporation. * Copyright(c) 2015 - 2017 Intel Corporation.
* *
* This file is provided under a dual BSD/GPLv2 license. When using or * This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license. * redistributing this file, you may do so under either license.
...@@ -428,5 +428,6 @@ struct sc2vlnt { ...@@ -428,5 +428,6 @@ struct sc2vlnt {
COUNTER_MASK(1, 4)) COUNTER_MASK(1, 4))
void hfi1_event_pkey_change(struct hfi1_devdata *dd, u8 port); void hfi1_event_pkey_change(struct hfi1_devdata *dd, u8 port);
void hfi1_handle_trap_timer(unsigned long data);
#endif /* _HFI1_MAD_H */ #endif /* _HFI1_MAD_H */
...@@ -1535,6 +1535,11 @@ static void init_ibport(struct hfi1_pportdata *ppd) ...@@ -1535,6 +1535,11 @@ static void init_ibport(struct hfi1_pportdata *ppd)
ibp->sc_to_sl[i] = i; ibp->sc_to_sl[i] = i;
} }
for (i = 0; i < RVT_MAX_TRAP_LISTS ; i++)
INIT_LIST_HEAD(&ibp->rvp.trap_lists[i].list);
setup_timer(&ibp->rvp.trap_timer, hfi1_handle_trap_timer,
(unsigned long)ibp);
spin_lock_init(&ibp->rvp.lock); spin_lock_init(&ibp->rvp.lock);
/* Set the prefix to the default value (see ch. 4.1.1) */ /* Set the prefix to the default value (see ch. 4.1.1) */
ibp->rvp.gid_prefix = IB_DEFAULT_GID_PREFIX; ibp->rvp.gid_prefix = IB_DEFAULT_GID_PREFIX;
......
...@@ -57,11 +57,21 @@ ...@@ -57,11 +57,21 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/hash.h> #include <linux/hash.h>
#include <rdma/ib_verbs.h> #include <rdma/ib_verbs.h>
#include <rdma/ib_mad.h>
#include <rdma/rdmavt_mr.h> #include <rdma/rdmavt_mr.h>
#include <rdma/rdmavt_qp.h> #include <rdma/rdmavt_qp.h>
#define RVT_MAX_PKEY_VALUES 16 #define RVT_MAX_PKEY_VALUES 16
#define RVT_MAX_TRAP_LEN 100 /* Limit pending trap list */
#define RVT_MAX_TRAP_LISTS ((IB_NOTICE_TYPE_INFO & 0x0F) + 1)
#define RVT_TRAP_TIMEOUT 4096 /* 4.096 usec */
struct trap_list {
u32 list_len;
struct list_head list;
};
struct rvt_ibport { struct rvt_ibport {
struct rvt_qp __rcu *qp[2]; struct rvt_qp __rcu *qp[2];
struct ib_mad_agent *send_agent; /* agent for SMI (traps) */ struct ib_mad_agent *send_agent; /* agent for SMI (traps) */
...@@ -128,6 +138,13 @@ struct rvt_ibport { ...@@ -128,6 +138,13 @@ struct rvt_ibport {
u16 *pkey_table; u16 *pkey_table;
struct rvt_ah *sm_ah; struct rvt_ah *sm_ah;
/*
* Keep a list of traps that have not been repressed. They will be
* resent based on trap_timer.
*/
struct trap_list trap_lists[RVT_MAX_TRAP_LISTS];
struct timer_list trap_timer;
}; };
#define RVT_CQN_MAX 16 /* maximum length of cq name */ #define RVT_CQN_MAX 16 /* maximum length of cq name */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment