[ofa-general] [PATCH 3/3 v2] ib/uverbs: add support for create_qp_expanded in uverbs
Jack Morgenstein
jackm at dev.mellanox.co.il
Thu Jul 24 01:30:26 PDT 2008
On Thursday 24 July 2008 11:06, Ron Livne wrote:
> > You're still not using a separate cmd structure for ib_uverbs_create_qp_expanded.
> > It is NOT a good idea to use the 8-bit reserved field for ib_uverbs_create_qp_expanded().
> > You should use a different struct (as I indicated in my previous mail).
>
> Sorry, I couldn't find the email you were talking about. can you
> please resend it to me?
> Why isn't it good to use the reserved field? Will it not just create
> code duplication for creating a regular qp, and qp_expanded?
It will create code duplication -- this is what I was referring to when I suggested that
you write a helper function in my e-mail of July 21 entitled
"Re: [ofa-general] [PATCH 3/3] ib/uverbs: add support for create_qp_expanded in uverbs".
When I wrote the following in my feedback for libibverbs of July 21 entitled
"Re: [ofa-general] [PATCH 1/3] libibverbs : add new verbs: create_qp_expanded":
You should not need to touch struct ibv_create_qp
You should define
struct ibv_create_qp_expanded {
...
__u8 sq_sig_all;
__u8 qp_type;
__u8 is_srq;
__u8 reserved;
__u32 create_flags;
__u32 reserved2;
__u64 driver_data[0];
};
and use that all along the way.
I meant that you should continue this into kernel space, and create a corresponding uverbs structure:
struct ib_uverbs_create_qp_expanded {
__u64 response;
__u64 user_handle;
__u32 pd_handle;
__u32 send_cq_handle;
__u32 recv_cq_handle;
__u32 srq_handle;
__u32 max_send_wr;
__u32 max_recv_wr;
__u32 max_send_sge;
__u32 max_recv_sge;
__u32 max_inline_data;
__u8 sq_sig_all;
__u8 qp_type;
__u8 is_srq;
__u8 reserved;
__u32 create_flags;
__u32 reserved2;
__u64 driver_data[0];
};
and use this in the ib_uverbs_create_qp_expanded function. You can filter out the
common elements in ib_uverbs_create_qp_expanded() and ib_uverbs_create_qp() and write
an ib_uverbs_create_qp_common() function so as not to duplicate things.
- Jack
More information about the general
mailing list