[ewg] Re: [PATCH] rdmaoe/libibverbs: handle binary compatibility

Jason Gunthorpe jgunthorpe at obsidianresearch.com
Thu Dec 10 09:33:53 PST 2009


On Thu, Dec 10, 2009 at 07:05:36PM +0200, Eli Cohen wrote:

> here is the patch I prepared based on the discussions we had. The patch is based on the last
> rdmaoe/libibverbs patch I sent. libmlx4 was modified too, a trivial
> change that changes name. Both fixes were push to OFED. I will send a
> new patch set in a few days.

Could you prepare this based on Roland's tree? This patch won't apply.

Why are things still going into OFED so quickly? Shouldn't Roland
accept this stuff before it gets to OFED - or at least review it once..

> +static inline int ___ibv_query_port(struct ibv_context *context,
> +				    uint8_t port_num,
> +				    struct ibv_port_attr *port_attr)
> +{
> +	uint8_t *padp;
> +	int padsize;
> +
> +	port_attr->link_layer = IBV_LINK_LAYER_UNSPECIFIED;
> +	padp = &port_attr->link_layer + sizeof port_attr->link_layer;
> +	padsize = sizeof(int) - ((unsigned long)padp & (sizeof(int) - 1));
> +	memset(padp, 0, padsize);
> +
> +	return context->ops.query_port(context, port_num, port_attr);
> +}

You should explicity declare the padding, like ibv_query_port_resp
does, the above is very fragile.

Jason



More information about the ewg mailing list