mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 13:46:25 +00:00
ib_srpt: Builds again on kernel 3.1 and before / avoid uninitialized fields in srq_attr in case that structure is extended once more in the future
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4069 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -3776,12 +3776,15 @@ static void srpt_add_one(struct ib_device *device)
|
||||
sdev->srq_size = min(max(srpt_srq_size, MIN_SRPT_SRQ_SIZE),
|
||||
sdev->dev_attr.max_srq_wr);
|
||||
|
||||
memset(&srq_attr, 0, sizeof(srq_attr));
|
||||
srq_attr.event_handler = srpt_srq_event;
|
||||
srq_attr.srq_context = (void *)sdev;
|
||||
srq_attr.attr.max_wr = sdev->srq_size;
|
||||
srq_attr.attr.max_sge = 1;
|
||||
srq_attr.attr.srq_limit = 0;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
|
||||
srq_attr.srq_type = IB_SRQT_BASIC;
|
||||
#endif
|
||||
|
||||
sdev->srq = ib_create_srq(sdev->pd, &srq_attr);
|
||||
if (IS_ERR(sdev->srq)) {
|
||||
|
||||
Reference in New Issue
Block a user