RE: [PATCH rdma-next V1 1/5] RDMA/netlink: Remove netlink clients infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

Steve.

--
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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux