[ofa-general] Re: Re: [PATCH 2/2] IB/mlx4: pass more data from user to kernel

Michael S. Tsirkin mst at dev.mellanox.co.il
Thu May 17 20:40:28 PDT 2007


> Quoting Roland Dreier <rdreier at cisco.com>:
> Subject: Re: Re: [PATCH 2/2] IB/mlx4: pass more data from user to kernel
> 
>  > struct mlx4_ib_create_qp {
>  > 	__u64	buf_addr;
>  > 	__u64	db_addr;
>  > 	__u32	rq_wqe_count;
>  > 	__u32	rq_wqe_shift;
>  > 	__u32	sq_wqebb_count;
>  > 	__u32	sq_wqebb_shift;
>  > };
> 
> Actually, on second thought maybe it's cleaner just to pass the SQ
> information from user->kernel?  There's not really anything that can
> go wrong with RQs, and it's probably safer not to have the same info
> passed in two different ways.
> 
> maybe something like
> 
> struct mlx4_ib_create_qp {
> 	__u64	buf_addr;
> 	__u64	db_addr;
>         __u8	log_sq_stride;	
>         __u8	log_sq_bb_per_wqe;
>         __u8	reserved[6];
> };
> 
> and then use the RQ and SQ sizes and number of gather entries from the
> normal part of the command to figure the rest out?
> 
> Any opinion on which is preferable?

I'm OK with what you say about RQ, but replacing sq_wqebb_count with log_sq_bb_per_wqe
looks like obfuscation to me: you still pass in 2 values, and the kernel does
not actually care about number of SQ WRs at all, it really only needs to look at
# of wqbbs.

-- 
MST



More information about the general mailing list