Re: [PATCH V3 1/6] IB Netlink Infrastructure

Jason Gunthorpe
2010-12-14T18:34:01Z

On Mon, Dec 13, 2010 at 06:22:45PM +0200, Nir Muchtar wrote:

> +int ibnl_add_client(int index, int nops,
> + int (*cb_table[])(struct sk_buff *skb,
> + struct netlink_callback *nlcb))

If you are going this way, then I think it would be better to have
netlink_dump_start be optional - not many calls need it.

ibnl_add_client(const struct ibnl_desc *desc);

struct inl_op
{
int (*dump_start)(sk_buff *skb,struct netlink_callback *nlcb);
int (*get)(...);
};
struct ibnl_desc
{
int index;
int ops;
const struct ibnl_op *ops;
};

Or something.

In any event cb_table[] needs to be const.

Jason