mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 21:56:31 +00:00
Handle iWARP devices graciously - ib_srpt does not work with at least Intel
iWARP devices. Reported-by: Frank Zago <fzago@systemfabricworks.com>. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2950 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+10
-13
@@ -3508,7 +3508,7 @@ static void srpt_add_one(struct ib_device *device)
|
||||
|
||||
sdev = kzalloc(sizeof *sdev, GFP_KERNEL);
|
||||
if (!sdev)
|
||||
return;
|
||||
goto err;
|
||||
|
||||
sdev->scst_tgt = scst_register_target(&srpt_template, NULL);
|
||||
if (!sdev->scst_tgt) {
|
||||
@@ -3610,8 +3610,6 @@ static void srpt_add_one(struct ib_device *device)
|
||||
for (i = 0; i < sdev->srq_size; ++i)
|
||||
srpt_post_recv(sdev, sdev->ioctx_ring[i]);
|
||||
|
||||
ib_set_client_data(device, &srpt_client, sdev);
|
||||
|
||||
WARN_ON(sdev->device->phys_port_cnt
|
||||
> sizeof(sdev->port)/sizeof(sdev->port[0]));
|
||||
|
||||
@@ -3636,13 +3634,14 @@ static void srpt_add_one(struct ib_device *device)
|
||||
}
|
||||
|
||||
atomic_inc(&srpt_device_count);
|
||||
out:
|
||||
ib_set_client_data(device, &srpt_client, sdev);
|
||||
|
||||
TRACE_EXIT();
|
||||
|
||||
return;
|
||||
|
||||
err_ring:
|
||||
ib_set_client_data(device, &srpt_client, NULL);
|
||||
srpt_free_ioctx_ring((struct srpt_ioctx **)sdev->ioctx_ring, sdev,
|
||||
sdev->srq_size, srp_max_req_size,
|
||||
DMA_FROM_DEVICE);
|
||||
@@ -3666,8 +3665,10 @@ unregister_tgt:
|
||||
scst_unregister_target(sdev->scst_tgt);
|
||||
free_dev:
|
||||
kfree(sdev);
|
||||
|
||||
TRACE_EXIT();
|
||||
err:
|
||||
sdev = NULL;
|
||||
PRINT_INFO("%s(%s) failed.", __func__, device->name);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3681,14 +3682,10 @@ static void srpt_remove_one(struct ib_device *device)
|
||||
TRACE_ENTRY();
|
||||
|
||||
sdev = ib_get_client_data(device, &srpt_client);
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
|
||||
WARN_ON(!sdev);
|
||||
if (!sdev)
|
||||
if (!sdev) {
|
||||
PRINT_INFO("%s(%s): nothing to do.", __func__, device->name);
|
||||
return;
|
||||
#else
|
||||
if (WARN_ON(!sdev))
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
srpt_unregister_mad_agent(sdev);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user