On Fri, Aug 14, 2015 at 08:52:09AM -0400, kaike.wan@xxxxxxxxx wrote: > +static LIST_HEAD(ib_nl_request_list); > +static DEFINE_SPINLOCK(ib_nl_request_lock); > +static atomic_t ib_nl_sa_request_seq; > +static struct workqueue_struct *ib_nl_wq; > +static struct delayed_work ib_nl_timed_work; > +static const struct nla_policy ib_nl_policy[LS_NLA_TYPE_MAX] = { > + [LS_NLA_TYPE_PATH_RECORD] = {.type = NLA_BINARY, > + .len = sizeof(struct ib_path_rec_data)}, > + [LS_NLA_TYPE_TIMEOUT] = {.type = NLA_U32}, > + [LS_NLA_TYPE_SERVICE_ID] = {.type = NLA_U64}, > + [LS_NLA_TYPE_DGID] = {.type = NLA_BINARY, > + .len = sizeof(struct rdma_nla_ls_gid)}, > + [LS_NLA_TYPE_SGID] = {.type = NLA_BINARY, > + .len = sizeof(struct rdma_nla_ls_gid)}, > + [LS_NLA_TYPE_TCLASS] = {.type = NLA_U8}, > + [LS_NLA_TYPE_PKEY] = {.type = NLA_U16}, > + [LS_NLA_TYPE_QOS_CLASS] = {.type = NLA_U16}, > +}; I'm not sure a single policy is the right way to use this API. The majority of cases seem to use a policy per message type. However, I can't think of a downside. I'd like to test this again here next week, but I think this is OK now. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html