On Mon, Jun 12, 2017 at 11:49:25AM -0500, Steve Wise wrote: > Hey Leon: > > > diff --git a/drivers/infiniband/core/netlink.c > b/drivers/infiniband/core/netlink.c > > index fcc9702efd38..7f498ecc0f0b 100644 > > --- a/drivers/infiniband/core/netlink.c > > +++ b/drivers/infiniband/core/netlink.c > > @@ -38,16 +38,13 @@ > > #include <net/sock.h> > > #include <rdma/rdma_netlink.h> > > > > -struct ibnl_client { > > - struct list_head list; > > - int index; > > - int nops; > > - const struct ibnl_client_cbs *cb_table; > > -}; > > +#include "core_priv.h" > > > > -static DEFINE_MUTEX(ibnl_mutex); > > +static DEFINE_MUTEX(rdma_nl_mutex); > > static struct sock *nls; > > -static LIST_HEAD(client_list); > > +static struct { > > + const struct ibnl_client_cbs *cb_table; > > +} rdma_nl_types[RDMA_NL_NUM_CLIENTS]; > > > > int ibnl_chk_listeners(unsigned int group) > > { > > @@ -57,58 +54,74 @@ int ibnl_chk_listeners(unsigned int group) > > } > > EXPORT_SYMBOL(ibnl_chk_listeners); > > > > -int ibnl_add_client(int index, int nops, > > - const struct ibnl_client_cbs cb_table[]) > > +static bool is_nl_msg_valid(unsigned int type, unsigned int op) > > { > > - struct ibnl_client *cur; > > - struct ibnl_client *nl_client; > > + unsigned int max_num_ops[RDMA_NL_NUM_CLIENTS - 1] = { > > + RDMA_NL_RDMA_CM_NUM_OPS, > > + RDMA_NL_IWPM_NUM_OPS, > > + 0, > > + RDMA_NL_LS_NUM_OPS, > > + 0 }; > > Why build max_num_ops on every call to is_nl_msg_valid()? Shouldn't it be > global and static and const? Should and will :) It is my fault, I'll post new version. Thanks > > Steve. >
Attachment:
signature.asc
Description: PGP signature