7.2.8-rc1 review
Greg Kroah-Hartman
maintainerPATCH 404/438 drm/msm/hdmi_phy: fix runtime PM cleanup on probe failure
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <[email protected]>
commit f4fae975db08a9aeec0b15e145c7d4d0fe02a0ec upstream.
msm_hdmi_phy_probe() enables runtime PM before enabling the PHY resources and initializing the PLL, but failures from either operation return without calling the matching pm_runtime_disable().
The remove path disables runtime PM, but it is not called when probe fails. As a result, runtime PM remains enabled after an unsuccessful probe.
Route failures after pm_runtime_enable() through a common error path and disable runtime PM before returning.
This issue was found by manual code inspection.
Patchwork: https://patchwork.freedesktop.org/patch/753043/
--- drivers/gpu/drm/msm/hdmi/hdmi_phy.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/hdmi/hdmi_phy.c +6 -2
@@ -168,13 +168,13 @@ static int msm_hdmi_phy_probe(struct pla ret =msm_hdmi_phy_resource_enable (phy);if (ret) -return ret; + goto err_pm_disable; ret =msm_hdmi_phy_pll_init (pdev, phy->cfg->type);if (ret) {DRM_DEV_ERROR (dev,"couldn't init PLL\n" );msm_hdmi_phy_resource_disable (phy); -return ret; + goto err_pm_disable; }msm_hdmi_phy_resource_disable (phy);
@@ -182,6 +182,10 @@ static int msm_hdmi_phy_probe(struct plaplatform_set_drvdata (pdev, phy);return 0 ; + +err_pm_disable: +pm_runtime_disable (dev); +return ret; }static void msm_hdmi_phy_remove (struct platform_device *pdev)
Greg Kroah-Hartman
maintainerPATCH 405/438 drm/msm: RCU-free the scheduler-containing ring and VM objects
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonghyuk Kim(MalHyuk) <[email protected]>
commit 01c8d1f385f788f1bbbbb7687c4386d614281218 upstream.
Both struct msm_ringbuffer and struct msm_gem_vm embed a struct drm_gpu_scheduler. msm_ringbuffer_destroy() and the VM free callback msm_gem_vm_free() call drm_sched_fini() on the embedded scheduler and then free the containing object with plain kfree().
drm_sched_fence_get_timeline_name() returns fence->sched->name, and the scheduler fence keeps a .release callback so it is not ops-detached on signalling. A finished fence exported to userspace (the submit out-fence, or a VM_BIND fence, via sync_file / drm_syncobj) keeps pointing at the embedded scheduler after the ring/VM is freed, so a later get_timeline_name() -- reachable unprivileged through SYNC_IOC_FILE_INFO -- dereferences freed slab memory (KASAN slab-use-after-free read).
Per the dma-fence lifetime contract the exporter must keep the data backing a signalled fence alive for an RCU grace period. Free the scheduler-containing objects with kfree_rcu() instead of kfree().
Patchwork: https://patchwork.freedesktop.org/patch/750234/
Message-ID: <[email protected]>
--- drivers/gpu/drm/msm/msm_gem.h | 3 +++ drivers/gpu/drm/msm/msm_gem_vma.c | 2 +- drivers/gpu/drm/msm/msm_ringbuffer.c | 2 +- drivers/gpu/drm/msm/msm_ringbuffer.h | 1 + 4 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_gem.h +3 -0
@@ -68,6 +68,9 @@ struct msm_gem_vm {/** @base: Inherit from drm_gpuvm. */ struct drm_gpuvm base; +/** @rcu: RCU-delayed free so an exported sched fence->sched stays valid. */ +struct rcu_head rcu; +/** * @sched: Scheduler used for asynchronous VM_BIND request. *
drivers/gpu/drm/msm/msm_gem_vma.c +1 -1
@@ -166,7 +166,7 @@ msm_gem_vm_free(struct drm_gpuvm *gpuvm)dma_fence_put (vm->last_fence);put_pid (vm->pid);kfree (vm->log); -kfree (vm); +kfree_rcu (vm, rcu); }/**
drivers/gpu/drm/msm/msm_ringbuffer.c +1 -1
@@ -140,5 +140,5 @@ void msm_ringbuffer_destroy(struct msm_rmsm_gem_kernel_put (ring->bo, ring->gpu->vm); -kfree (ring); +kfree_rcu (ring, rcu); }
drivers/gpu/drm/msm/msm_ringbuffer.h +1 -0
@@ -55,6 +55,7 @@ struct msm_ringbuffer {/* * The job scheduler for this ring. */ +struct rcu_head rcu;struct drm_gpu_scheduler sched;bool sched_initialized;
Greg Kroah-Hartman
maintainerPATCH 406/438 drm/sched: Fix virtual runtime race
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tvrtko Ursulin <[email protected]>
commit 2ab510e63197360945f915dd5631a77c63ac6b27 upstream.
Prevent pushing a new job to an entity seeing it being the first in the queue, and hence entering the drm_sched_rq_add_entity() path, if the pop side in drm_sched_entity_pop_job() has just de-queued the job but not yet updated the saved virtual time.
Restoring the unsaved virtual time, which is at this point not a delta but still an absolute value, pushes the said entity to the rear of the run queue for a potentially very long time.
We close this race by pulling the locked sections out to encompass both the queue push/pop and corresponding rbtree management.
This is aligned with the future direction to replace the current lockless job queue with one of the fully locked standard list primitives.
--- drivers/gpu/drm/scheduler/sched_entity.c | 8 +++++++- drivers/gpu/drm/scheduler/sched_rq.c | 20 +++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-)
drivers/gpu/drm/scheduler/sched_entity.c +7 -1
@@ -566,9 +566,10 @@ struct drm_sched_job *drm_sched_entity_p*/ smp_wmb (); +spin_lock (&entity->lock);spsc_queue_pop (&entity->job_queue); -drm_sched_rq_pop_entity (entity); +spin_unlock (&entity->lock);/* Jobs and entities might have different lifecycles. Since we're * removing the job from the entities queue, set the jobs entity pointer
@@ -654,6 +655,9 @@ void drm_sched_entity_push_job(struct dr* Make sure to set the submit_ts first, to avoid a race. */ sched_job->submit_ts = submit_ts =ktime_get (); + +spin_lock (&entity->lock); + first =spsc_queue_push (&entity->job_queue, &sched_job->queue_node);/* first job wakes up scheduler */
@@ -664,5 +668,7 @@ void drm_sched_entity_push_job(struct drif (sched)drm_sched_wakeup (sched); } + +spin_unlock (&entity->lock); }EXPORT_SYMBOL (drm_sched_entity_push_job);
drivers/gpu/drm/scheduler/sched_rq.c +9 -11
@@ -257,19 +257,17 @@ static ktime_t drm_sched_entity_get_job_struct drm_gpu_scheduler *drm_sched_rq_add_entity (struct drm_sched_entity *entity,ktime_t ts) { +struct drm_sched_rq *rq = entity->rq;struct drm_gpu_scheduler *sched; -struct drm_sched_rq *rq;/* Add the entity to the run queue */ -spin_lock (&entity->lock); -if (entity->stopped) { -spin_unlock (&entity->lock); +lockdep_assert_held (&entity->lock); +if (entity->stopped) {DRM_ERROR ("Trying to push to a killed entity\n" );return NULL ; } - rq = entity->rq;spin_lock (&rq->lock); sched = rq->sched;
@@ -289,7 +287,6 @@ drm_sched_rq_add_entity(struct drm_scheddrm_sched_rq_update_fifo_locked (entity, rq, ts);spin_unlock (&rq->lock); -spin_unlock (&entity->lock);return sched; }
@@ -343,16 +340,17 @@ drm_sched_rq_next_rr_ts(struct drm_sched*/ void drm_sched_rq_pop_entity (struct drm_sched_entity *entity) { +struct drm_sched_rq *rq = entity->rq;struct drm_sched_job *next_job; -struct drm_sched_rq *rq; + +lockdep_assert_held (&entity->lock); + +spin_lock (&rq->lock);/* * Update the entity's location in the min heap according to * the timestamp of the next job, if any. */ -spin_lock (&entity->lock); - rq = entity->rq; -spin_lock (&rq->lock); next_job =drm_sched_entity_queue_peek (entity);if (next_job) {ktime_t ts;
@@ -375,8 +373,8 @@ void drm_sched_rq_pop_entity(struct drm_drm_sched_entity_save_vruntime (entity, min_vruntime); } } +spin_unlock (&rq->lock); -spin_unlock (&entity->lock); }/**
Greg Kroah-Hartman
maintainerPATCH 407/438 drm/amdgpu: fix rmmio iounmap skipped on device removal
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengjun Yao <[email protected]>
commit 5155002b03b24ba3ef91c5c313b8cf0171b24904 upstream.
amdgpu_pci_remove() calls drm_dev_unplug() before fini_sw(), so drm_dev_enter() is already false there and the iounmap() guarded by it is skipped. This .remove path runs on both hot-unplug and plain rmmod, so the register BAR ioremap mapping leaks one instance per unload.
Unmap rmmio unconditionally (guard only on non-NULL) and drop the now unused idx.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -4
@@ -4344,7 +4344,7 @@ void amdgpu_device_fini_hw(struct amdgpuvoid amdgpu_device_fini_sw (struct amdgpu_device *adev) { -int i, idx; +int i;bool px;amdgpu_device_ip_fini (adev);
@@ -4386,11 +4386,9 @@ void amdgpu_device_fini_sw(struct amdgpuif ((adev->pdev->class >>8 ) ==PCI_CLASS_DISPLAY_VGA )vga_client_unregister (adev->pdev); -if (drm_dev_enter (adev_to_drm (adev), &idx)) { - +if (adev->rmmio) {iounmap (adev->rmmio); adev->rmmio =NULL ; -drm_dev_exit (idx); }if (IS_ENABLED (CONFIG_PERF_EVENTS ))
Greg Kroah-Hartman
maintainerPATCH 408/438 drm/amdgpu: hold a runtime PM reference for P2P dma-buf attachments
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Lothian <[email protected]>
commit 636139603b99d2e3a18a46cf3f8d39313ce8042e upstream.
amdgpu_dma_buf_map() adds VRAM to the allowed domains for a peer2peer attachment. GTT is only a fallback placement when VRAM is preferred, so ttm_bo_validate() migrates the buffer from GTT into VRAM. While the exporting device is runtime suspended its SDMA rings are down and the move fails:
amdgpu: Move buffer fallback to memcpy unavailable
An importer on a second GPU reaches this holding no runtime PM reference on the exporter, e.g. a compositor on the APU submitting a frame that references a buffer exported by an idle dGPU:
amdgpu_cs_ioctl -> amdgpu_cs_parser_bos -> amdgpu_cs_bo_validate
-> ttm_bo_validate -> amdgpu_bo_move -> dma_buf_map_attachment
-> amdgpu_dma_buf_map -> ttm_bo_validate -> amdgpu_bo_movePinning a dma-buf into VRAM has the same requirement, which commit 030631e97b20 ("drm/amdgpu: revert "take runtime pm reference when we attach a buffer" v2") called out as the one case that would need the reference back.
Take it in attach and drop it in detach. pm_runtime_get_if_active() never resumes the device, so it cannot deadlock against the reservation taken during resume, which is why the old pm_runtime_get_sync() had to go. If the device is not active, clear peer2peer instead: the buffer then stays in GTT, which remains accessible while the GPU is powered down. If runtime PM is disabled, take a plain reference so the put in detach stays balanced.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 43 +++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +42 -1
@@ -43,6 +43,7 @@#include <linux/dma-buf.h> #include <linux/dma-fence-array.h> #include <linux/pci-p2pdma.h> +#include <linux/pm_runtime.h> static const struct dma_buf_attach_ops amdgpu_dma_buf_attach_ops;
@@ -100,15 +101,54 @@ static int amdgpu_dma_buf_attach(struct pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0) attach->peer2peer = false; +/* +* Only allow P2P while the exporter is active, and keep it active +* until detach. With runtime PM disabled take a plain reference so +* the put in detach stays balanced. +*/ +if (attach->peer2peer) { +struct device *dev =adev_to_drm (adev)->dev; +int ret =pm_runtime_get_if_active (dev); + +if (!ret) + attach->peer2peer = false; +else if (ret <0 ) +pm_runtime_get_noresume (dev); + } + r =dma_resv_lock (bo->tbo.base.resv,NULL );if (r) -return r; + goto err_pm_put;amdgpu_vm_bo_update_shared (bo);dma_resv_unlock (bo->tbo.base.resv);return 0 ; + +err_pm_put: +if (attach->peer2peer) +pm_runtime_put_autosuspend (adev_to_drm (adev)->dev); +return r; +} + +/** +* amdgpu_dma_buf_detach - &dma_buf_ops.detach implementation +* +* @dmabuf: DMA-buf where we remove the attachment from +* @attach: the attachment to remove +* +* Drop the runtime PM reference taken in amdgpu_dma_buf_attach(). +*/ +static void amdgpu_dma_buf_detach (struct dma_buf *dmabuf, +struct dma_buf_attachment *attach) +{ +struct drm_gem_object *obj = dmabuf->priv; +struct amdgpu_bo *bo =gem_to_amdgpu_bo (obj); +struct amdgpu_device *adev =amdgpu_ttm_adev (bo->tbo.bdev); + +if (attach->peer2peer) +pm_runtime_put_autosuspend (adev_to_drm (adev)->dev); }/**
@@ -350,6 +390,7 @@ static void amdgpu_dma_buf_vunmap(structconst struct dma_buf_ops amdgpu_dmabuf_ops = { .attach = amdgpu_dma_buf_attach, + .detach = amdgpu_dma_buf_detach, .pin = amdgpu_dma_buf_pin, .unpin = amdgpu_dma_buf_unpin, .map_dma_buf = amdgpu_dma_buf_map,
Greg Kroah-Hartman
maintainerPATCH 409/438 drm/amdgpu: Skip KFD mapping clear before initialization
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit 7f9caa70aef0950e06d395ca0035831214d88187 upstream.
amdgpu_amdkfd_clear_kfd_mapping() assumes that a non-NULL kfd_dev has a fully populated node array. This is not true when KFD device initialization fails after probe.
For example, kgd2kfd_device_init() sets num_nodes before checking PCIe atomics support. On Polaris systems without the required atomics, it returns before allocating nodes[0], but the kfd_dev remains attached to the amdgpu device. A later GPU reset then dereferences nodes[0]->id.
Require the authoritative KFD initialization flag before walking the node array, matching the existing KFD reset and teardown paths.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +1 -1
@@ -329,7 +329,7 @@ void amdgpu_amdkfd_clear_kfd_mapping(strstruct kfd_dev *kfd = adev->kfd.dev;unsigned int i; -if (!kfd) +if (!kfd || !kfd->init_complete)return ;for (i =0 ; i < kfd->num_nodes; i++) {
Greg Kroah-Hartman
maintainerPATCH 410/438 drm/amdkfd: Avoid integer underflow in EOP ring size calculation.
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Francis <[email protected]>
commit 8ee521b8b189799e361d4233c5180ba56656d4d4 upstream.
The low 6 bits of cp_hqd_eop_control store the base-2 logarithm of the EOP ring size. This was calculated as
order_base_2(q->eop_ring_buffer_size / 4) - 1
But order_base_2 can in theory return 0, so this could underflow (although in practice the ring buffer size cannot be less than 4096).
Change this to
order_base_2(q->eop_ring_buffer_size / 8)
using properties of logarithms.
Also add to the above comment to make the mathematics more clear.
--- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 6 +++++- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +5 -1
@@ -299,6 +299,10 @@ static void update_mqd(struct mqd_manage1 <<CP_HQD_IB_CONTROL__IB_EXE_DISABLE__SHIFT ;/* +* The lowest 6 bits of eop_control store the EOP ring size. If +* their value is X, the ring size is 2^(X + 1) dwords, or +* 2^(X + 3) bytes. +* * HW does not clamp this field correctly. Maximum EOP queue size * is constrained by per-SE EOP done signal count, which is 8-bit. * Limit is 0xFF EOP entries (= 0x7F8 dwords). CP will not submit
@@ -310,7 +314,7 @@ static void update_mqd(struct mqd_manage* */ m->cp_hqd_eop_control = q->eop_ring_buffer_size ? -min (0xA ,order_base_2 (q->eop_ring_buffer_size /4 ) -1 ) :0 ; +min (0xA ,order_base_2 (q->eop_ring_buffer_size /8 )) :0 ; m->cp_hqd_eop_base_addr_lo =lower_32_bits (q->eop_ring_buffer_address >>8 );
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c +4 -1
@@ -208,6 +208,9 @@ static void __update_mqd(struct mqd_mana mtype <<CP_HQD_IB_CONTROL__MTYPE__SHIFT ;/* +* The lowest 6 bits of eop_control store the EOP ring size. If +* their value is X, the ring size is 2^(X + 1) dwords, or +* 2^(X + 3) bytes. * HW does not clamp this field correctly. Maximum EOP queue size * is constrained by per-SE EOP done signal count, which is 8-bit. * Limit is 0xFF EOP entries (= 0x7F8 dwords). CP will not submit
@@ -215,7 +218,7 @@ static void __update_mqd(struct mqd_mana* is safe, giving a maximum field value of 0xA. */ m->cp_hqd_eop_control |= q->eop_ring_buffer_size ?min (0xA , -order_base_2 (q->eop_ring_buffer_size /4 ) -1 ) :0 ; +order_base_2 (q->eop_ring_buffer_size /8 )) :0 ; m->cp_hqd_eop_base_addr_lo =lower_32_bits (q->eop_ring_buffer_address >>8 ); m->cp_hqd_eop_base_addr_hi =
Greg Kroah-Hartman
maintainerPATCH 411/438 drm/amdkfd: Avoid integer underflow with ffs in EOP ring size calc
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Francis <[email protected]>
commit c883d0a132d430ef7ebb23fd94323be94d0fbdb8 upstream.
The low 6 bits of cp_hqd_eop_control store the base-2 logarithm of the EOP ring size. This was calculated as
ffs(q->eop_ring_buffer_size / sizeof(unsigned int)) - 1 - 1
But ffs can in theory return 1 or 0, so this could underflow (although in practice the ring buffer size cannot be less than 4096).
Change this to
ffs(q->eop_ring_buffer_size / sizeof(unsigned int) / 4)
using properties of logarithms.
--- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +1 -1
@@ -204,7 +204,7 @@ static void update_mqd(struct mqd_manage* is safe, giving a maximum field value of 0xA. */ m->cp_hqd_eop_control = q->eop_ring_buffer_size ?min (0xA , -ffs (q->eop_ring_buffer_size /sizeof (unsigned int )) -1 -1 ) :0 ; +ffs (q->eop_ring_buffer_size /sizeof (unsigned int ) /4 )) :0 ; m->cp_hqd_eop_base_addr_lo =lower_32_bits (q->eop_ring_buffer_address >>8 ); m->cp_hqd_eop_base_addr_hi =
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +1 -1
@@ -242,7 +242,7 @@ static void update_mqd(struct mqd_manage* is safe, giving a maximum field value of 0xA. */ m->cp_hqd_eop_control = q->eop_ring_buffer_size ?min (0xA , -ffs (q->eop_ring_buffer_size /sizeof (unsigned int )) -1 -1 ) :0 ; +ffs (q->eop_ring_buffer_size /sizeof (unsigned int ) /4 )) :0 ; m->cp_hqd_eop_base_addr_lo =lower_32_bits (q->eop_ring_buffer_address >>8 ); m->cp_hqd_eop_base_addr_hi =
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c +1 -1
@@ -217,7 +217,7 @@ static void update_mqd(struct mqd_manage* is safe, giving a maximum field value of 0xA. */ m->cp_hqd_eop_control = q->eop_ring_buffer_size ?min (0xA , -ffs (q->eop_ring_buffer_size /sizeof (unsigned int )) -1 -1 ) :0 ; +ffs (q->eop_ring_buffer_size /sizeof (unsigned int ) /4 )) :0 ; m->cp_hqd_eop_base_addr_lo =lower_32_bits (q->eop_ring_buffer_address >>8 ); m->cp_hqd_eop_base_addr_hi =
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c +1 -1
@@ -295,7 +295,7 @@ static void update_mqd(struct mqd_manage* is safe, giving a maximum field value of 0xA. */ m->cp_hqd_eop_control = q->eop_ring_buffer_size ?min (0xA , -ffs (q->eop_ring_buffer_size /sizeof (unsigned int )) -1 -1 ) :0 ; +ffs (q->eop_ring_buffer_size /sizeof (unsigned int ) /4 )) :0 ; m->cp_hqd_eop_base_addr_lo =lower_32_bits (q->eop_ring_buffer_address >>8 ); m->cp_hqd_eop_base_addr_hi =
Greg Kroah-Hartman
maintainerPATCH 412/438 drm/amdkfd: implement restore_mqd callbacks for GFX12/12.1
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Marioukhine <[email protected]>
commit 5f28bb1c2cd9dcdb76a20d61b3ea069b85893c59 upstream.
kfd_mqd_manager_v12.c (GFX 12.0) and kfd_mqd_manager_v12_1.c (GFX 12.1) do not implement restore_mqd callbacks, leaving the function pointers NULL and causing CRIU restore to return -EOPNOTSUPP on GFX12.
Implement restore_mqd for both compute and SDMA queues in kfd_mqd_manager_v12.c and kfd_mqd_manager_v12_1.c, modeled after the GFX 11 implementation with the following improvements:
- update cp_mqd_base_addr_lo/hi to the newly allocated MQD address, fixing a pre-existing gap shared with v11 where the in-MQD copy still pointed at the old checkpoint-time address after restore
- memset the full allocation before memcpy for compute queues to avoid stale data in the GTT sub-allocator tail; SDMA MQDs use sizeof(*m) since they are packed at mqd_size stride in a shared BO
checkpoint_mqd registration is deferred to a follow-up patch that also implements get_checkpoint_info, so that checkpoint and restore are enabled together as a complete and testable unit.
Note: GFX12.1 restore handles XCC0 only. Multi-XCC CRIU restore is currently unreachable due to a separate validation issue in kfd_criu_restore_queue(). A pr_warn_once() is emitted if a multi-XCC device is encountered.
--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 7 + drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c | 59 +++++++++++++++ drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c | 68 ++++++++++++++++++ 3 files changed, 132 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +5 -2
@@ -797,10 +797,12 @@ static int create_queue_nocpsch(struct d mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type ( q->properties.type)];if (qd && !mqd_mgr->restore_mqd) { -pr_debug ("restore_mqd not implemented for this GPU\n" ); +pr_debug ("restore_mqd not implemented for queue type %d\n" , + q->properties.type); retval = -EOPNOTSUPP ; goto deallocate_vmid; } +if (q->properties.type ==KFD_QUEUE_TYPE_COMPUTE ) { retval =allocate_hqd (dqm, q);if (retval)
@@ -2168,7 +2170,8 @@ static int create_queue_cpsch(struct dev mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type ( q->properties.type)];if (qd && !mqd_mgr->restore_mqd) { -pr_debug ("restore_mqd not implemented for this GPU\n" ); +pr_debug ("restore_mqd not implemented for queue type %d\n" , + q->properties.type); retval = -EOPNOTSUPP ; goto out_deallocate_doorbell; }
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c +59 -0
77 lines not on this page · raw message
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c +68 -0
86 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 413/438 smb: client: cancel reconnect work in clean_demultiplex_info()
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
commit c65eae6f61d1778ff7a82e4aae4080e26f486af1 upstream.
clean_demultiplex_info() cancels server->echo delayed work but not server->reconnect, which can cause a use-after-free when the demultiplex thread exits while a reconnect work is still queued:
cifs_demultiplex_thread()
cifs_readv_from_socket()
cifs_reconnect()
__cifs_reconnect()
cifs_queue_server_reconn()
mod_delayed_work(cifsiod_wq, &server->reconnect, 0)
clean_demultiplex_info()
cancel_delayed_work_sync(&server->echo) // echo canceled
// reconnect NOT canceled
kfree_sensitive(server) // server freed ...later, on cifsiod_wq:
smb2_reconnect_server()
server->srv_count // UAF read of freed server
Fix this by canceling server->reconnect delayed work in clean_demultiplex_info() before the server is freed, the same way cifs_put_tcp_session() already does.
--- fs/smb/client/connect.c | 1 + 1 file changed, 1 insertion(+)
fs/smb/client/connect.c +1 -0
@@ -1067,6 +1067,7 @@ clean_demultiplex_info(struct TCP_Serverspin_unlock (&server->srv_lock);cancel_delayed_work_sync (&server->echo); +cancel_delayed_work_sync (&server->reconnect);spin_lock (&server->srv_lock); server->tcpStatus = CifsExiting;
Greg Kroah-Hartman
maintainerPATCH 414/438 smb/client: send lease break ACKs thru correct session for multiuser mounts
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: April Cardenas <[email protected]>
commit ebc5660132ddd244b57f03ed324922013a3d7363 upstream.
Currently, when cifs_oplock_break handles a break request from the server it searches for the appropriate tlink to handle the request but incorrectly uses the current fsuid as the search key, eventually causing read errors for users with multiuser mounts on NetApp. Fix this by using the tlink from the cfile struct instead to respond through the correct session.
As breaks are handled in a worker thread, the current fsuid isn't guaranteed to match the session that the break is intended for. This means that cifs_sb_tlink may search the rbtree using the wrong fsuid, and return a tlink with an incorrect session than
the lease break was intended for. As a result, the breaks
may be ACKed through an incorrect session.
While it seems that Samba/Windows Servers 2016-2025 ignore this as long as the lease key is correct, we ran into a case where if you're using NetApp ONTAP or Azure NetApp Files they will reject the ACK and return STATUS_LOCK_NOT_GRANTED errors on any future read requests a user may initiate through their still held open file handle, and the server will eventually close the file.
In the dmesg logs, the user may see errors like these:
CIFS: Status code returned 0xc0000128 STATUS_FILE_CLOSED
CIFS: VFS: Send error in read = -9
With a multiuser mount using NetApp, this issue is really easy for users to hit on a wide variety of kernel versions by attempting to copy a file from the share
to the local machine through GNOME Files/Nautilus.
This copy will always result in Nautilus throwing
a Bad File Descriptor error to the user and fail. With this fix, you can copy files through Nautilus without issue.
Quoted 1 line
From looking at the traces, it seems that glib will
open the file first, and call listxattr before actually attempting to copy the file data. The listxattr call always triggers a break, causing the copy to fail.
The proposed fix returns to the way the client grabbed the tlink before commit e8f5f849ffce2 ("cifs: fix potential oops in cifs_oplock_break").
The bulk of that commit (checking for list empty) remains untouched, and I think the change to using cifs_sb_tlink was intended to avoid a NULL/ERR deference on the tlink as well as update the reference count.
I believe this fix should preserve those safety properties, but of course I'd appreciate any corrections here.
--- fs/smb/client/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/smb/client/file.c +2 -2
@@ -3330,8 +3330,8 @@ void cifs_oplock_break(struct work_strucwait_on_bit (&cinode->flags,CIFS_INODE_PENDING_WRITERS ,TASK_UNINTERRUPTIBLE ); - tlink =cifs_sb_tlink (cifs_sb); -if (IS_ERR (tlink)) { + tlink =cifs_get_tlink (cfile->tlink); +if (IS_ERR_OR_NULL (tlink)) {/* drop the reference taken when the break was queued */ _cifsFileInfo_put (cfile, false/* do not wait for ourself */ , false); goto out;
Greg Kroah-Hartman
maintainerPATCH 415/438 smb: client: fix rlist race and missing initialization
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
commit 5f270f091256da1338c3631083e15d7f83cc05e1 upstream.
TCP_Server_Info.rlist is allocated via kzalloc which zeros both ->next and ->prev to NULL instead of pointing to itself, making list_empty() always return false and list_add() dereference a NULL ->prev pointer.
Also, cifs_signal_cifsd_for_reconnect() can be called concurrently from multiple cifsd threads, allowing the same server's rlist node to be added twice into the local list, corrupting it.
--- fs/smb/client/connect.c | 7 +++++++ 1 file changed, 7 insertions(+)
fs/smb/client/connect.c +7 -0
@@ -174,6 +174,8 @@ cifs_signal_cifsd_for_reconnect(struct T nserver = ses->chans[i].server;if (!nserver)continue ; +if (!list_empty (&nserver->rlist)) +continue ; nserver->srv_count++;list_add (&nserver->rlist, &reco); }
@@ -182,11 +184,15 @@ cifs_signal_cifsd_for_reconnect(struct T } } +spin_lock (&cifs_tcp_ses_lock);list_for_each_entry_safe (server, nserver, &reco, rlist) {list_del_init (&server->rlist);set_need_reco (server); +spin_unlock (&cifs_tcp_ses_lock);cifs_put_tcp_session (server,0 ); +spin_lock (&cifs_tcp_ses_lock); } +spin_unlock (&cifs_tcp_ses_lock); }/*
@@ -1824,6 +1830,7 @@ cifs_get_tcp_session(struct smb3_fs_contspin_lock_init (&tcp_ses->mid_counter_lock);INIT_LIST_HEAD (&tcp_ses->tcp_ses_list);INIT_LIST_HEAD (&tcp_ses->smb_ses_list); +INIT_LIST_HEAD (&tcp_ses->rlist);INIT_DELAYED_WORK (&tcp_ses->echo, cifs_echo_request);INIT_DELAYED_WORK (&tcp_ses->reconnect, smb2_reconnect_server);mutex_init (&tcp_ses->reconnect_mutex);
Greg Kroah-Hartman
maintainerPATCH 416/438 smb: client: fix use-after-free of iface in cifs_try_adding_channels()
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <[email protected]>
commit d034e836eefd7ce75e588f7031cffbeec594f5ac upstream.
cifs_try_adding_channels() iterates ses->iface_list with list_for_each_entry_safe_from(), which captures the next entry (niface) under iface_lock. The loop body then drops iface_lock for the whole duration of cifs_ses_add_channel().
A concurrent interface refresh (SMB3_request_interfaces() -> parse_server_interfaces()) marks all ifaces inactive and removes and frees any that are not re-advertised via list_del() + kref_put(), where release_iface() is a bare kfree(). Since niface typically has no channel holding a reference, the list reference is its last and it can be freed inside the unlocked window. On continue, the iterator advance step then dereferences niface->iface_head.next, and the loop body reads iface->rdma_capable/is_active, both on freed memory.
Fix this by never keeping an unreferenced list pointer across the unlocked window. Each channel attempt now re-scans the list from the head under iface_lock, takes a kref on the selected candidate, and passes only that referenced candidate to cifs_ses_add_channel(). weight_fulfilled still tracks selection progress, so restarting the scan preserves the original weighted distribution and the weight_fulfilled-before-kref_put ordering on the failure path.
Add a per-pass attempts cap so a flapping interface refresh cannot keep the inner loop spinning within a single tries increment.
--- fs/smb/client/sess.c | 106 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 64 insertions(+), 42 deletions(-)
fs/smb/client/sess.c +64 -42
@@ -149,9 +149,9 @@ int cifs_try_adding_channels(struct cifsint old_chan_count, new_chan_count;int left;int rc =0 ; -int tries =0 ; +int tries =0 , attempts;size_t iface_weight =0 , iface_min_speed =0 ; -struct cifs_server_iface *iface =NULL , *niface =NULL ; +struct cifs_server_iface *iface =NULL , *candidate =NULL ;struct cifs_server_iface *last_iface =NULL ;spin_lock (&ses->chan_lock);
@@ -197,67 +197,89 @@ int cifs_try_adding_channels(struct cifsbreak ; } -if (!iface) - iface = list_first_entry(&ses->iface_list, struct cifs_server_iface, - iface_head); last_iface = list_last_entry(&ses->iface_list, struct cifs_server_iface, iface_head); iface_min_speed = last_iface->speed; +spin_unlock (&ses->iface_lock); -list_for_each_entry_safe_from (iface, niface, &ses->iface_list, - iface_head) { -/* do not mix rdma and non-rdma interfaces */ -if (iface->rdma_capable != ses->server->rdma) -continue ; - -/* skip ifaces that are unusable */ -if (!iface->is_active || - (is_ses_using_iface (ses, iface) && - !iface->rss_capable)) -continue ; + attempts =0 ; +while (left >0 ) { +spin_lock (&ses->iface_lock); -/* check if we already allocated enough channels */ - iface_weight = iface->speed / iface_min_speed; +/* +* iface_lock must be dropped while opening a channel, +* and a concurrent interface refresh may remove and +* free entries during that window, so no list entry +* may be kept across it without a reference. Scan +* the list from the beginning each time and only pass +* a referenced candidate to cifs_ses_add_channel(); +* weight_fulfilled tracks the progress so that no +* iface is selected beyond its weight. +*/ + candidate =NULL ; +list_for_each_entry (iface, &ses->iface_list, iface_head) { +/* do not mix rdma and non-rdma interfaces */ +if (iface->rdma_capable != ses->server->rdma) +continue ; + +/* skip ifaces that are unusable */ +if (!iface->is_active || + (is_ses_using_iface (ses, iface) && + !iface->rss_capable)) +continue ; + +/* check if we already allocated enough channels */ + iface_weight = iface->speed / iface_min_speed; + +if (iface->weight_fulfilled >= iface_weight) +continue ; + +/* take ref before unlock */ +kref_get (&iface->refcount); + candidate = iface; +break ; + } -if (iface->weight_fulfilled >= iface_weight) -continue ; +if (!candidate) { +/* no usable iface. reset weight_fulfilled and start over */ +list_for_each_entry (iface, &ses->iface_list, iface_head) + iface->weight_fulfilled =0 ; +spin_unlock (&ses->iface_lock); +break ; + } -/* take ref before unlock */ -kref_get (&iface->refcount); + attempts++; +if (attempts >3 * ses->chan_max) { +kref_put (&candidate->refcount, release_iface); +spin_unlock (&ses->iface_lock); +break ; + }spin_unlock (&ses->iface_lock); - rc =cifs_ses_add_channel (ses, iface); + rc =cifs_ses_add_channel (ses, candidate);spin_lock (&ses->iface_lock);if (rc) {cifs_dbg (VFS ,"failed to open extra channel on iface:%pIS rc=%d\n" , - &iface->sockaddr, + &candidate->sockaddr, rc);/* failure to add chan should increase weight */ - iface->weight_fulfilled++; -kref_put (&iface->refcount, release_iface); + candidate->weight_fulfilled++; +kref_put (&candidate->refcount, release_iface); +spin_unlock (&ses->iface_lock);continue ; } - iface->num_channels++; - iface->weight_fulfilled++; + candidate->num_channels++; + candidate->weight_fulfilled++;cifs_info ("successfully opened new channel on iface:%pIS\n" , - &iface->sockaddr); -break ; - } - -/* reached end of list. reset weight_fulfilled and start over */ -if (list_entry_is_head (iface, &ses->iface_list, iface_head)) { -list_for_each_entry (iface, &ses->iface_list, iface_head) - iface->weight_fulfilled =0 ; + &candidate->sockaddr);spin_unlock (&ses->iface_lock); - iface =NULL ; -continue ; - } -spin_unlock (&ses->iface_lock); - left--; - new_chan_count++; + left--; + new_chan_count++; +break ; + } }return new_chan_count - old_chan_count;
Greg Kroah-Hartman
maintainerPATCH 417/438 smb: client: reject short Next offsets in parse_server_interfaces()
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <[email protected]>
commit 1b3221bb121079ad79a1f3c3aa360ba649832e7a upstream.
In parse_server_interfaces(), the server-supplied Next offset is validated against bytes_left, but not against the size of the interface structure itself.
A small, non-zero Next value can pass the bounds check but advance the pointer by less than sizeof(*p). This causes the next iteration of the loop to read misaligned, overlapping structure fields.
Fix this by ensuring the Next offset is at least sizeof(*p).
--- fs/smb/client/smb2ops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/smb/client/smb2ops.c +3 -3
@@ -785,9 +785,9 @@ next_iface:break ; }/* Validate that Next doesn't point beyond the buffer */ -if (next > bytes_left) { -cifs_dbg (VFS ,"%s: invalid Next pointer %zu > %zd\n" , - __func__, next, bytes_left); +if (next <sizeof (*p) || next > bytes_left) { +cifs_dbg (VFS ,"%s: invalid Next pointer %zu out of range [%zu, %zd]\n" , + __func__, next,sizeof (*p), bytes_left); rc = -EINVAL ; goto out; }
Greg Kroah-Hartman
maintainerPATCH 418/438 smb: client: fix smbd_connection leak on cifs_get_tcp_session() error
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
commit e75c96157d45e498970158c8f7373d90102e33b9 upstream.
When an RDMA connection is successfully established via smbd_get_connection() but cifs_get_tcp_session() later fails (e.g. kthread_create() returns an error), the error path frees tcp_ses without first destroying the smbd_connection.
Fix this by calling smbd_destroy() in the out_err cleanup path before kfree(tcp_ses). smbd_destroy() safely handles the case where smbd_conn is NULL, so it can be called unconditionally.
--- fs/smb/client/connect.c | 1 + 1 file changed, 1 insertion(+)
fs/smb/client/connect.c +1 -0
@@ -1934,6 +1934,7 @@ out_err:kfree (tcp_ses->leaf_fullpath);if (tcp_ses->ssocket)sock_release (tcp_ses->ssocket); +smbd_destroy (tcp_ses);kfree (tcp_ses); }return ERR_PTR (rc);
Greg Kroah-Hartman
maintainerPATCH 419/438 smb: client: fix unaligned access in WSL reparse point parser
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
commit e1aeaf79dea51e6065da56924bc07e22d59012ac upstream.
When wsl_to_fattr() parses WSL extended attributes, it computes a payload pointer from ea->ea_data + ea_name_length + 1. Since the smb2_file_full_ea_info struct is __packed and all WSL xattr names are 6 bytes long, the value pointer always lands at an odd byte offset, never satisfying __le32 or __le64 alignment requirements.
The code then casts this pointer to __le32 * or __le64 * and dereferences it directly, which may cause alignment faults on some architectures.
Replace all such casts with get_unaligned_le32() and get_unaligned_le64() in reparse_mkdev(), wsl_make_kuid(), wsl_make_kgid() and wsl_to_fattr().
--- fs/smb/client/reparse.c | 4 ++-- fs/smb/client/reparse.h | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)
fs/smb/client/reparse.c +2 -2
@@ -1201,9 +1201,9 @@ static bool wsl_to_fattr(struct cifs_ope fattr->cf_gid =wsl_make_kgid (cifs_sb, v); }else if (!strncmp (name,SMB2_WSL_XATTR_MODE , nlen)) {/* File type in reparse point tag and in xattr mode must match. */ -if (S_DT (fattr->cf_mode) !=S_DT (le32_to_cpu (*(__le32 *)v))) +if (S_DT (fattr->cf_mode) !=S_DT (get_unaligned_le32 (v)))return false; - fattr->cf_mode = (umode_t )le32_to_cpu (*(__le32 *)v); + fattr->cf_mode = (umode_t )get_unaligned_le32 (v); }else if (!strncmp (name,SMB2_WSL_XATTR_DEV , nlen)) { fattr->cf_rdev =reparse_mkdev (v); have_xattr_dev = true;
fs/smb/client/reparse.h +4 -3
@@ -9,6 +9,7 @@#include <linux/fs.h> #include <linux/stat.h> #include <linux/uidgid.h> +#include <linux/unaligned.h> #include "fs_context.h" #include "cifsglob.h" #include "../common/smbfsctl.h"
@@ -23,7 +24,7 @@static inline dev_t reparse_mkdev (void *ptr) { -u64 v =le64_to_cpu (*(__le64 *)ptr); +u64 v =get_unaligned_le64 (ptr);return MKDEV (v &0xffffffff , v >>32 ); }
@@ -31,7 +32,7 @@ static inline dev_t reparse_mkdev(void *static inline kuid_t wsl_make_kuid (struct cifs_sb_info *cifs_sb,void *ptr) { -u32 uid =le32_to_cpu (*(__le32 *)ptr); +u32 uid =get_unaligned_le32 (ptr);if (cifs_sb_flags (cifs_sb) &CIFS_MOUNT_OVERR_UID )return cifs_sb->ctx->linux_uid;
@@ -41,7 +42,7 @@ static inline kuid_t wsl_make_kuid(strucstatic inline kgid_t wsl_make_kgid (struct cifs_sb_info *cifs_sb,void *ptr) { -u32 gid =le32_to_cpu (*(__le32 *)ptr); +u32 gid =get_unaligned_le32 (ptr);if (cifs_sb_flags (cifs_sb) &CIFS_MOUNT_OVERR_GID )return cifs_sb->ctx->linux_gid;
Greg Kroah-Hartman
maintainerPATCH 420/438 smb: client: fix fattr leaking on wsl_to_fattr() failure
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
commit e1253a82bb4c0fed6706a5839fc8b6e01be1abe2 upstream.
wsl_to_fattr() mutates fattr fields as it parses each WSL EA. If validation later fails, the function returns false with partially mutated fattr fields that callers do not reset.
Fix this by parsing into local variables and only committing them to fattr on success.
--- fs/smb/client/reparse.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-)
fs/smb/client/reparse.c +19 -15
@@ -1149,29 +1149,30 @@ static bool wsl_to_fattr(struct cifs_ope u32 tag, struct cifs_fattr *fattr) {unsigned int sbflags =cifs_sb_flags (cifs_sb); +kuid_t uid = cifs_sb->ctx->linux_uid; +kgid_t gid = cifs_sb->ctx->linux_gid;struct smb2_file_full_ea_info *ea;bool have_xattr_dev = false; +dev_t rdev =0 ; +umode_t mode;u32 next =0 ; - fattr->cf_uid = cifs_sb->ctx->linux_uid; - fattr->cf_gid = cifs_sb->ctx->linux_gid; - - fattr->cf_mode &= ~S_IFMT ; + mode = fattr->cf_mode & ~S_IFMT ;switch (tag) {case IO_REPARSE_TAG_LX_SYMLINK : - fattr->cf_mode |=S_IFLNK ; + mode |=S_IFLNK ;break ;case IO_REPARSE_TAG_LX_FIFO : - fattr->cf_mode |=S_IFIFO ; + mode |=S_IFIFO ;break ;case IO_REPARSE_TAG_AF_UNIX : - fattr->cf_mode |=S_IFSOCK ; + mode |=S_IFSOCK ;break ;case IO_REPARSE_TAG_LX_CHR : - fattr->cf_mode |=S_IFCHR ; + mode |=S_IFCHR ;break ;case IO_REPARSE_TAG_LX_BLK : - fattr->cf_mode |=S_IFBLK ; + mode |=S_IFBLK ;break ; }
@@ -1195,26 +1196,29 @@ static bool wsl_to_fattr(struct cifs_opeif (!strncmp (name,SMB2_WSL_XATTR_UID , nlen)) {if (!(sbflags &CIFS_MOUNT_OVERR_UID )) - fattr->cf_uid =wsl_make_kuid (cifs_sb, v); + uid =wsl_make_kuid (cifs_sb, v); }else if (!strncmp (name,SMB2_WSL_XATTR_GID , nlen)) {if (!(sbflags &CIFS_MOUNT_OVERR_GID )) - fattr->cf_gid =wsl_make_kgid (cifs_sb, v); + gid =wsl_make_kgid (cifs_sb, v); }else if (!strncmp (name,SMB2_WSL_XATTR_MODE , nlen)) {/* File type in reparse point tag and in xattr mode must match. */ -if (S_DT (fattr->cf_mode) !=S_DT (get_unaligned_le32 (v))) +if (S_DT (mode) !=S_DT (get_unaligned_le32 (v)))return false; - fattr->cf_mode = (umode_t )get_unaligned_le32 (v); + mode =get_unaligned_le32 (v); }else if (!strncmp (name,SMB2_WSL_XATTR_DEV , nlen)) { - fattr->cf_rdev =reparse_mkdev (v); + rdev =reparse_mkdev (v); have_xattr_dev = true; } }while (next); out: -/* Major and minor numbers for char and block devices are mandatory. */ if (!have_xattr_dev && (tag ==IO_REPARSE_TAG_LX_CHR || tag ==IO_REPARSE_TAG_LX_BLK ))return false; + fattr->cf_uid = uid; + fattr->cf_gid = gid; + fattr->cf_mode = mode; + fattr->cf_rdev = rdev;return true; }
Greg Kroah-Hartman
maintainerPATCH 421/438 smb: client: fix next_buffer UAF and NextCommand bounds in compound PDUs
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <[email protected]>
commit 05762c5bc1cfdcac36747994fde2c04387a457f1 upstream.
Fix several related bounds checking and pointer lifecycle issues in receive_encrypted_standard()'s handling of compound encrypted frames:
- Clear next_buffer after assigning it to server->bigbuf. A stale next_buffer pointer can lead to a use-after-free on subsequent error paths.
- Update pdu_length to the decrypted plaintext size (buf_size). Using the pre-decryption length allows NextCommand to point into stale ciphertext residue.
- Reject next_cmd values smaller than MID_HEADER_SIZE(server).
- Fix an integer overflow in the upper bound check by verifying pdu_length - next_cmd < MID_HEADER_SIZE(server), ensuring the trailing slice is large enough for a header.
--- fs/smb/client/smb2ops.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
fs/smb/client/smb2ops.c +10 -1
@@ -5362,6 +5362,7 @@ receive_encrypted_standard(struct TCP_Se length =decrypt_raw_data (server, buf, buf_size,NULL , false);if (length)return length; + pdu_length = buf_size; next_is_large = server->large_buf; one_more:
@@ -5374,8 +5375,15 @@ one_more: }if (next_cmd) { -if (WARN_ON_ONCE (next_cmd > pdu_length)) +if (next_cmd <MID_HEADER_SIZE (server) || + next_cmd > pdu_length || + pdu_length - next_cmd <MID_HEADER_SIZE (server)) { +unsigned int max_next = pdu_length > (unsigned int )MID_HEADER_SIZE (server) ? + pdu_length - (unsigned int )MID_HEADER_SIZE (server) :0 ; +cifs_server_dbg (VFS ,"invalid NextCommand offset %u out of range [%zu, %u]\n" , + next_cmd,MID_HEADER_SIZE (server), max_next);return -1 ; + }if (next_is_large) next_buffer = (char *)cifs_buf_get ();else
@@ -5411,6 +5419,7 @@ one_more: server->bigbuf = buf = next_buffer; else server->smallbuf = buf = next_buffer; + next_buffer =NULL ; goto one_more; }else if (ret !=0 ) {/*
Greg Kroah-Hartman
maintainerPATCH 422/438 smb: client: fix OOB struct field reads in move_smb2_ea_to_cifs()
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <[email protected]>
commit eeb5ef6083e1cefa2ef75041b5597ff228b8d7bb upstream.
In move_smb2_ea_to_cifs(), the while (src_size > 0) loop condition is insufficient. It allows iteration to continue even if the remaining src_size is too small to contain a complete smb2_ea_info structure. Consequently, reads of ea_name_length and ea_value_length can occur out-of-bounds.
Fix this by ensuring src_size >= sizeof(*src) before attempting to read any structure fields. Additionally, reject any next_entry_offset that is smaller than sizeof(*src) or that would advance the pointer beyond the available buffer.
Note that for calls where the server returns a malformed EA list, the error returned to userspace changes from -ENODATA (getxattr) or -ERANGE (listxattr) to -EIO. This correctly signals a server protocol error rather than misleadingly indicating "attribute not present" or "output buffer too small".
--- fs/smb/client/smb2ops.c | 25 +++++++++++++++++-------- fs/smb/client/trace.h | 1 + 2 files changed, 18 insertions(+), 8 deletions(-)
fs/smb/client/smb2ops.c +17 -8
@@ -1053,8 +1053,9 @@ move_smb2_ea_to_cifs(char *dst, size_t dchar *name, *value;size_t buf_size = dst_size;size_t name_len, value_len, user_name_len; +u32 next_off; -while (src_size >0 ) { +while (src_size >=sizeof (*src)) { name_len = (size_t )src->ea_name_length; value_len = (size_t )le16_to_cpu (src->ea_value_length);
@@ -1110,14 +1111,22 @@ move_smb2_ea_to_cifs(char *dst, size_t dif (!src->next_entry_offset)break ; -if (src_size <le32_to_cpu (src->next_entry_offset)) { -/* stop before overrun buffer */ - rc = -ERANGE ; -break ; + next_off =le32_to_cpu (src->next_entry_offset); +if (next_off <sizeof (*src) || src_size < next_off) { +cifs_dbg (FYI ,"EA next_entry_offset %u out of range [%zu, %zu]\n" , + next_off,sizeof (*src), src_size); + rc =smb_EIO2 (smb_eio_trace_ea_next_offset, + next_off, src_size); + goto out; + } + src_size -= next_off; + src = (void *)((char *)src + next_off); +if (src_size >0 && src_size <sizeof (*src)) { +cifs_dbg (FYI ,"EA next_entry_offset %u left truncated entry (%zu bytes)\n" , + next_off, src_size); + rc =smb_EIO2 (smb_eio_trace_ea_next_offset, next_off, src_size); + goto out; } - src_size -=le32_to_cpu (src->next_entry_offset); - src = (void *)((char *)src + -le32_to_cpu (src->next_entry_offset)); }/* didn't find the named attribute */
fs/smb/client/trace.h +1 -0
@@ -27,6 +27,7 @@ EM(smb_eio_trace_copychunk_overcopy_c, "copychunk_overcopy_c") \ EM(smb_eio_trace_create_rsp_too_small, "create_rsp_too_small") \ EM(smb_eio_trace_dfsref_no_rsp, "dfsref_no_rsp") \ + EM(smb_eio_trace_ea_next_offset, "ea_next_offset") \ EM(smb_eio_trace_ea_overrun, "ea_overrun") \ EM(smb_eio_trace_extract_will_pin, "extract_will_pin") \EM (smb_eio_trace_forced_shutdown,"forced_shutdown" ) \
Greg Kroah-Hartman
maintainerPATCH 423/438 smb: client: fix potential OOB read in smb3_enum_snapshots()
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <[email protected]>
commit 4775c3b7a597907e0b97556c7986fda238a377ae upstream.
If snapshot_array_size is smaller than GMT_TOKEN_SIZE, smb3_enum_snapshots() sets ret_data_len tosizeof(struct smb_snapshot_array) without verifying the actual length of the server's reply.
Because SMB2_ioctl() places no lower bound on the server-supplied OutputCount and allocates retbuf to exactly that length, a short reply results in ret_data_len exceeding the size of retbuf. The subsequent copy_to_user() then reads past the end of retbuf, leaking adjacent slab memory to userspace. The subsequent clamp check is ineffective as it only reduces ret_data_len.
Fix this by rejecting replies shorter thansizeof(struct smb_snapshot_array) with -EIO. Note that the bound is set to the 12-byte struct size rather than the 16-byte MIN_SNAPSHOT_ARRAY_SIZE defined in MS-SMB2 3.3.5.15.1, because 12 bytes is exactly what copy_to_user() attempts to read.
--- fs/smb/client/smb2ops.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
fs/smb/client/smb2ops.c +7 -1
@@ -2460,8 +2460,14 @@ smb3_enum_snapshots(const unsigned int x* and retry the ioctl again with larger array size sufficient * to hold all of the snapshot GMT tokens on the second try. */ -if (snapshot_in.snapshot_array_size <GMT_TOKEN_SIZE ) +if (snapshot_in.snapshot_array_size <GMT_TOKEN_SIZE ) { +if (ret_data_len <sizeof (struct smb_snapshot_array )) { + rc = -EIO ; +kfree (retbuf); +return rc; + } ret_data_len =sizeof (struct smb_snapshot_array ); + }/* * We return struct SRV_SNAPSHOT_ARRAY, followed by
Greg Kroah-Hartman
maintainerPATCH 424/438 smb: client: fix reparse buffer bounds in cifs_query_reparse_point()
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <[email protected]>
commit 5f0306e731e2f46e91419eae57eee3a241c055e0 upstream.
In cifs_query_reparse_point(), the start >= end check before casting to struct reparse_data_buffer * only ensures the start pointer is within the response. It fails to verify that there is enough space remaining for the fixed 8-byte header of the structure.
If a server provides a DataOffset that leaves less than 8 bytes remaining, the check passes, but subsequent reads of ReparseTag and ReparseDataLength will occur out-of-bounds.
Fix this by ensuring the remaining space is at least the size of the reparse_data_buffer structure before accessing its fields.
--- fs/smb/client/cifssmb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/cifssmb.c +1 -1
@@ -3080,7 +3080,7 @@ int cifs_query_reparse_point(const unsig end =2 +get_bcc (&io_rsp->hdr) + (__u8 *)&io_rsp->ByteCount; start = (__u8 *)&io_rsp->hdr.Protocol + data_offset; -if (start >= end) { +if (start >= end || (size_t )(end - start) <sizeof (*buf)) { rc =smb_EIO2 (smb_eio_trace_qreparse_data_area, (unsigned long )start - (unsigned long )io_rsp, (unsigned long )end - (unsigned long )io_rsp);
Greg Kroah-Hartman
maintainerPATCH 425/438 smb: client: fix server->total_read for compound encrypted PDUs
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <[email protected]>
commit f73726b83e4756fdaa099e1bc1143293bd57ad79 upstream.
In receive_encrypted_standard(), server->total_read is left at the full decrypted frame size when walking sub-PDUs of a compound encrypted frame. As a result, cifs_handle_standard() passes this full size to smb2_check_message(), causing the PDU length guards to incorrectly validate the entire compound frame instead of the current sub-PDU.
This allows truncated non-last sub-PDUs to bypass length validation, leading to out-of-bounds reads in smb2_get_data_area_len().
Fix this by setting server->total_read to the true length of the current sub-PDU: next_cmd for non-last sub-PDUs, and the remaining pdu_length for the last one.
--- fs/smb/client/smb2ops.c | 1 + 1 file changed, 1 insertion(+)
fs/smb/client/smb2ops.c +1 -0
@@ -5383,6 +5383,7 @@ receive_encrypted_standard(struct TCP_Se one_more: shdr = (struct smb2_hdr *)buf; next_cmd =le32_to_cpu (shdr->NextCommand); + server->total_read = next_cmd ? next_cmd : pdu_length;if (*num_mids >=MAX_COMPOUND ) {cifs_server_dbg (VFS ,"too many PDUs in compound\n" );
Greg Kroah-Hartman
maintainerPATCH 426/438 smb: client: fix missing lower-bound check on DFS referral string offsets
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <[email protected]>
commit e83330c55edc0c3ac08aa6c95e49e4694c65523b upstream.
parse_dfs_referrals() checks that DfsPathOffset and NetworkAddressOffset do not exceed the buffer end, but fails to check that they don't point inside the referral header itself.
If a server provides an offset smaller thansizeof(struct dfs_referral_level_3), the derived string pointer overlaps with the struct fields, causing cifs_strndup_from_utf16() to interpret header data as UTF-16 strings.
Fix this by enforcing that string offsets are at least sizeof(*ref).
--- fs/smb/client/misc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
fs/smb/client/misc.c +10 -2
@@ -788,7 +788,11 @@ parse_dfs_referrals(struct get_dfs_refer node->ref_flag =le16_to_cpu (ref->ReferralEntryFlags);/* copy DfsPath */ -if (le16_to_cpu (ref->DfsPathOffset) > data_end - (char *)ref) { +if (le16_to_cpu (ref->DfsPathOffset) <sizeof (*ref) || +le16_to_cpu (ref->DfsPathOffset) > data_end - (char *)ref) { +cifs_dbg (VFS ,"%s: DfsPathOffset %u out of range [%zu, %td]\n" , + __func__,le16_to_cpu (ref->DfsPathOffset), +sizeof (*ref), data_end - (char *)ref); rc = -EINVAL ; goto parse_DFS_referrals_exit; }
@@ -802,7 +806,11 @@ parse_dfs_referrals(struct get_dfs_refer }/* copy link target UNC */ -if (le16_to_cpu (ref->NetworkAddressOffset) > data_end - (char *)ref) { +if (le16_to_cpu (ref->NetworkAddressOffset) <sizeof (*ref) || +le16_to_cpu (ref->NetworkAddressOffset) > data_end - (char *)ref) { +cifs_dbg (VFS ,"%s: NetworkAddressOffset %u out of range [%zu, %td]\n" , + __func__,le16_to_cpu (ref->NetworkAddressOffset), +sizeof (*ref), data_end - (char *)ref); rc = -EINVAL ; goto parse_DFS_referrals_exit; }
Greg Kroah-Hartman
maintainerPATCH 427/438 smb: client: fix missing iov bounds check in parse_posix_sids()
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <[email protected]>
commit b09d092eb24ad0110f16a9b7c1ed5d2a0c1733dc upstream.
In parse_posix_sids(), sidsbuf_end is calculated using the server-supplied out_len without being validated against the actual length of the received iov (iov_len).
If a server provides an inflated out_len, sidsbuf_end will point past the end of the iov. This defeats the bounds guards in posix_info_sid_size(), allowing out-of-bounds reads into adjacent kernel memory.
Fix this by rejecting responses where the calculated sidsbuf_end would exceed the received iov boundaries or cause pointer wraparound.
--- fs/smb/client/smb2inode.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
fs/smb/client/smb2inode.c +11 -0
@@ -76,6 +76,17 @@ static int parse_posix_sids(struct cifs_ sidsbuf = (u8 *)qi +le16_to_cpu (qi->OutputBufferOffset) + qi_len; sidsbuf_end = sidsbuf + out_len - qi_len; +if (sidsbuf_end < sidsbuf) { +cifs_dbg (VFS ,"%s: server-supplied out_len %u caused pointer wraparound\n" , + __func__, out_len); +return -EINVAL ; + } +if (sidsbuf_end > (u8 *)rsp_iov->iov_base + rsp_iov->iov_len) { +cifs_dbg (VFS ,"%s: server-supplied out_len %u overruns iov by %td bytes\n" , + __func__, out_len, + sidsbuf_end - ((u8 *)rsp_iov->iov_base + rsp_iov->iov_len)); +return -EINVAL ; + } owner_len =posix_info_sid_size (sidsbuf, sidsbuf_end);if (owner_len ==-1 )
Greg Kroah-Hartman
maintainerPATCH 428/438 fs/super: skip non-memcg-aware nr_cached_objects in memcg slab shrink
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Usama Arif <[email protected]>
[ Upstream commit 0baad6f9b9970c6e3f1d33dbfd17d1a77702771d ]
The super_block shrinker is registered with SHRINKER_MEMCG_AWARE because its dentry and inode LRUs are memcg-aware (via list_lru). But the optional ->nr_cached_objects() hooks that the shrinker also drives are not memcg-aware:
btrfs extent maps and xfs inode reclaim operate on filesystem-global state, and shmem's unused-huge shrinker walks a per-superblock shrinklist. None of them filter by sc->memcg.
The mismatch shows up under memcg-heavy slab reclaim. shrink_slab_memcg() calls do_shrink_slab() once per (memcg, NUMA node) pair for every memcg whose bit is set in the per-superblock shrinker bitmap, which on a busy host means hundreds of calls per reclaim pass. Each scan queues the same global shrinker work item that's already kicked from the root path.
Because btrfs/xfs global count is typically non-zero on any in-use filesystem, the returned total stays positive even if a memcg's own dentry/inode LRUs are empty. shrink_slab_memcg() therefore never clears the SB shrinker bit in the memcg bitmap, so subsequent reclaim passes from the same memcg re-enter super_cache_count() and pay for the global counter walk again.
Restrict ->nr_cached_objects() to the global shrink path (sc->memcg NULL or root). The memcg-aware dentry/inode LRUs keep being counted and scanned per memcg as before; only the global fs-specific hooks are skipped. The root/global shrink path still drives those hooks; only their invocation from non-root memcg slab reclaim is removed.
Stable-dep-of: 641aade99f06 ("fs: fix missed removal of super_fs_objects_eligible()")
--- fs/super.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
fs/super.c +17 -2
@@ -24,6 +24,7 @@#include <linux/export.h> #include <linux/slab.h> #include <linux/blkdev.h> +#include <linux/memcontrol.h> #include <linux/mount.h> #include <linux/security.h> #include <linux/writeback.h> /* for the emergency remount stuff */
@@ -170,6 +171,19 @@ static void super_wake(struct super_bloc }/* +* The s_op->nr_cached_objects hooks (used for example by btrfs and xfs) +* operate on filesystem-global state and ignore sc->memcg. Driving them +* from per-memcg shrink_slab_memcg() invocations only burns CPU walking +* per-cpu counters and queueing duplicate work: the actual reclaim happens on +* the global path (kswapd or root direct reclaim) regardless. Restrict them +* to that path. +*/ +static inline bool super_fs_objects_eligible (struct shrink_control *sc) +{ +return !sc->memcg ||mem_cgroup_is_root (sc->memcg); +} + +/* * One thing we have to be careful of with a per-sb shrinker is that we don't * drop the last active reference to the superblock from within the shrinker. * If that happens we could trigger unregistering the shrinker from within the
@@ -198,7 +212,7 @@ static unsigned long super_cache_scan(stif (!super_trylock_shared (sb))return SHRINK_STOP ; -if (sb->s_op->nr_cached_objects) +if (sb->s_op->nr_cached_objects &&super_fs_objects_eligible (sc)) fs_objects = sb->s_op->nr_cached_objects (sb, sc); inodes =list_lru_shrink_count (&sb->s_inode_lru, sc);
@@ -259,7 +273,8 @@ static unsigned long super_cache_count(sreturn 0 ;smp_rmb (); -if (sb->s_op && sb->s_op->nr_cached_objects) +if (sb->s_op && sb->s_op->nr_cached_objects && +super_fs_objects_eligible (sc)) total_objects = sb->s_op->nr_cached_objects (sb, sc); total_objects +=list_lru_shrink_count (&sb->s_dentry_lru, sc);
Greg Kroah-Hartman
maintainerPATCH 429/438 fs: fix missed removal of super_fs_objects_eligible()
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qi Zheng <[email protected]>
[ Upstream commit 641aade99f06df0037e52b5c81645461b7132947 ]
Commit 0ef8faff490be ("fs: push nr_cached_objects memcg gating into individual filesystems") was meant to drop the blanket memcg gate in fs/super.c and let each ->nr_cached_objects() implementation decide for itself whether it is meaningful in per-memcg reclaim. However, when that patch was applied the removal of super_fs_objects_eligible() and its two call sites in super_cache_scan() / super_cache_count() was lost, so the helper is still gating every ->nr_cached_objects() hook and 0ef8faff490be is effectively a no-op.
Consequences of the leftover gate:
- XFS's inode-reclaim hook, which is intentionally driven from per-memcg contexts to free memcg-charged slab, is still short-circuited in fs/super.c exactly the regression from commit 0baad6f9b997 ("fs/super: skip non-memcg-aware nr_cached_objects in memcg slab shrink") that 0ef8faff490be was written to undo. Memcg-charged XFS inode slab therefore keeps piling up under per-memcg pressure until global reclaim kicks in.
- Any future ->nr_cached_objects()/->free_cached_objects() that grows memcg awareness is likewise blocked before it can run, so filesystems cannot opt in to per-memcg reclaim on their own defeating the whole point of pushing the gating decision down into the callbacks.
Drop the leftover helper and its call sites so the intent of 0ef8faff490be actually takes effect.
--- fs/super.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)
fs/super.c +2 -16
@@ -171,19 +171,6 @@ static void super_wake(struct super_bloc }/* -* The s_op->nr_cached_objects hooks (used for example by btrfs and xfs) -* operate on filesystem-global state and ignore sc->memcg. Driving them -* from per-memcg shrink_slab_memcg() invocations only burns CPU walking -* per-cpu counters and queueing duplicate work: the actual reclaim happens on -* the global path (kswapd or root direct reclaim) regardless. Restrict them -* to that path. -*/ -static inline bool super_fs_objects_eligible (struct shrink_control *sc) -{ -return !sc->memcg ||mem_cgroup_is_root (sc->memcg); -} - -/* * One thing we have to be careful of with a per-sb shrinker is that we don't * drop the last active reference to the superblock from within the shrinker. * If that happens we could trigger unregistering the shrinker from within the
@@ -212,7 +199,7 @@ static unsigned long super_cache_scan(stif (!super_trylock_shared (sb))return SHRINK_STOP ; -if (sb->s_op->nr_cached_objects &&super_fs_objects_eligible (sc)) +if (sb->s_op->nr_cached_objects) fs_objects = sb->s_op->nr_cached_objects (sb, sc); inodes =list_lru_shrink_count (&sb->s_inode_lru, sc);
@@ -273,8 +260,7 @@ static unsigned long super_cache_count(sreturn 0 ;smp_rmb (); -if (sb->s_op && sb->s_op->nr_cached_objects && -super_fs_objects_eligible (sc)) +if (sb->s_op && sb->s_op->nr_cached_objects) total_objects = sb->s_op->nr_cached_objects (sb, sc); total_objects +=list_lru_shrink_count (&sb->s_dentry_lru, sc);
Greg Kroah-Hartman
maintainerPATCH 430/438 scsi: fnic: Make debug logging protocol independent
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karan Tilak Kumar <[email protected]>
[ Upstream commit b93c38a9f2ce5441c90de55776f8df97679cf8a2 ]
Make the fnic debug macros take struct fnic instead of struct Scsi_Host so FCP and NVMe initiator roles can share the same logging interface.
Add fnic_printk() to route FCP initiator messages through shost_printk() and non-SCSI role messages through printk(). Add role and non-SCSI role messages through printk(). Add role predicates and separate FDLS, FIP, and NVMe logging masks.
Convert FCS, FIP, SCSI, ISR, and main debug call sites to pass the fnic instance directly, and keep FIP VLAN MAC descriptors skipped while reporting unexpected descriptor types.
Stable-dep-of: 0cb1fd924126 ("scsi: fnic: Fix missed link-up when critical IRQ targets offline CPU")
--- drivers/scsi/fnic/fdls_disc.c | 726 +++++++++++++++++++++--------------------- drivers/scsi/fnic/fip.c | 117 +++--- drivers/scsi/fnic/fip.h | 2 drivers/scsi/fnic/fnic.h | 74 ++-- drivers/scsi/fnic/fnic_fcs.c | 126 +++---- drivers/scsi/fnic/fnic_isr.c | 28 - drivers/scsi/fnic/fnic_main.c | 56 +-- drivers/scsi/fnic/fnic_scsi.c | 210 ++++++------ 8 files changed, 675 insertions(+), 664 deletions(-)
drivers/scsi/fnic/fdls_disc.c +369 -357
@@ -104,7 +104,7 @@ uint8_t *fdls_alloc_frame(struct fnic_ip frame =mempool_alloc (fnic->frame_pool,GFP_ATOMIC );if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame" );return NULL ; }
@@ -136,7 +136,7 @@ uint16_t fdls_alloc_oxid(struct fnic_ipo*/ idx =find_next_zero_bit (oxid_pool->bitmap,FNIC_OXID_POOL_SZ , oxid_pool->next_idx);if (idx ==FNIC_OXID_POOL_SZ ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Alloc oxid: all oxid slots are busy iport state:%d\n" , iport->state);return FNIC_UNASSIGNED_OXID ;
@@ -148,7 +148,7 @@ uint16_t fdls_alloc_oxid(struct fnic_ipo oxid =FNIC_OXID_ENCODE (idx, oxid_frame_type); *active_oxid = oxid; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"alloc oxid: 0x%x, iport state: %d\n" , oxid, iport->state);return oxid;
@@ -169,7 +169,7 @@ static void fdls_free_oxid_idx(struct fnlockdep_assert_held (&fnic->fnic_lock); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"free oxid idx: 0x%x\n" , oxid_idx);WARN_ON (!test_and_clear_bit (oxid_idx, oxid_pool->bitmap));
@@ -194,7 +194,7 @@ void fdls_reclaim_oxid_handler(struct wostruct reclaim_entry_s *reclaim_entry, *next;unsigned long delay_j, cur_jiffies; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Reclaim oxid callback\n" );spin_lock_irqsave (&fnic->fnic_lock, fnic->lock_flags);
@@ -223,7 +223,7 @@ void fdls_reclaim_oxid_handler(struct wo delay_j = reclaim_entry->expires - cur_jiffies;schedule_delayed_work (&oxid_pool->oxid_reclaim_work, delay_j); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Scheduling next callback at:%ld jiffies\n" , delay_j); }
@@ -266,7 +266,7 @@ void fdls_schedule_oxid_free(struct fniclockdep_assert_held (&fnic->fnic_lock); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Schedule oxid free. oxid: 0x%x\n" , *active_oxid); *active_oxid =FNIC_UNASSIGNED_OXID ;
@@ -275,7 +275,7 @@ void fdls_schedule_oxid_free(struct fnic kzalloc_obj(struct reclaim_entry_s, GFP_ATOMIC);if (!reclaim_entry) { -FNIC_FCS_DBG (KERN_WARNING , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_WARNING , fnic,"Failed to allocate memory for reclaim struct for oxid idx: %d\n" , oxid_idx);
@@ -313,7 +313,7 @@ void fdls_schedule_oxid_free_retry_work(for_each_set_bit (idx, oxid_pool->pending_schedule_free,FNIC_OXID_POOL_SZ ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Schedule oxid free. oxid idx: %d\n" , idx); reclaim_entry =kzalloc_obj (*reclaim_entry);
@@ -416,7 +416,7 @@ fdls_start_fabric_timer(struct fnic_iporstruct fnic *fnic = iport->fnic;if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport fcid: 0x%x: Canceling fabric disc timer\n" , iport->fcid);fnic_del_fabric_timer_sync (fnic);
@@ -429,7 +429,7 @@ fdls_start_fabric_timer(struct fnic_ipor fabric_tov = jiffies +msecs_to_jiffies (timeout);mod_timer (&iport->fabric.retry_timer,round_jiffies (fabric_tov)); iport->fabric.timer_pending =1 ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"fabric timer is %d " , timeout); }
@@ -441,7 +441,7 @@ fdls_start_tport_timer(struct fnic_iportstruct fnic *fnic = iport->fnic;if (tport->timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport fcid 0x%x: Canceling disc timer\n" , tport->fcid);fnic_del_tport_timer_sync (fnic, tport);
@@ -575,7 +575,7 @@ fdls_send_rscn_resp(struct fnic_iport_s frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send RSCN response" );return ; }
@@ -588,7 +588,7 @@ fdls_send_rscn_resp(struct fnic_iport_s oxid =FNIC_STD_GET_OX_ID (rscn_fchdr);FNIC_STD_SET_OX_ID (pels_acc->fchdr, oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send RSCN response with oxid: 0x%x" , iport->fcid, oxid);
@@ -608,7 +608,7 @@ fdls_send_logo_resp(struct fnic_iport_s frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send LOGO response" );return ; }
@@ -621,7 +621,7 @@ fdls_send_logo_resp(struct fnic_iport_s oxid =FNIC_STD_GET_OX_ID (req_fchdr);FNIC_STD_SET_OX_ID (plogo_resp->fchdr, oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send LOGO response with oxid: 0x%x" , iport->fcid, oxid);
@@ -642,7 +642,7 @@ fdls_send_tport_abts(struct fnic_iport_s frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send tport ABTS" );return ; }
@@ -665,7 +665,7 @@ fdls_send_tport_abts(struct fnic_iport_sFNIC_STD_SET_OX_ID (*ptport_abts, tport->active_oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send tport abts: tport->state: %d " , iport->fcid, tport->state);
@@ -687,7 +687,7 @@ static void fdls_send_fabric_abts(struct frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send fabric ABTS" );return ; }
@@ -750,7 +750,7 @@ static void fdls_send_fabric_abts(struct oxid = iport->active_oxid_fabric_req;FNIC_STD_SET_OX_ID (*pfabric_abts, oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send fabric abts. iport->fabric.state: %d oxid: 0x%x" , iport->fcid, iport->fabric.state, oxid);
@@ -773,7 +773,7 @@ static uint8_t *fdls_alloc_init_fdmi_abt frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send FDMI ABTS" );return NULL ; }
@@ -802,7 +802,7 @@ static void fdls_send_fdmi_abts(struct fif (frame ==NULL )return ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send FDMI PLOGI abts. iport->fabric.state: %d oxid: 0x%x" , iport->fcid, iport->fabric.state, iport->active_oxid_fdmi_plogi);fnic_send_fcoe_frame (iport, frame, frame_size);
@@ -813,7 +813,7 @@ static void fdls_send_fdmi_abts(struct fif (frame ==NULL )return ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send FDMI RHBA abts. iport->fabric.state: %d oxid: 0x%x" , iport->fcid, iport->fabric.state, iport->active_oxid_fdmi_rhba);fnic_send_fcoe_frame (iport, frame, frame_size);
@@ -828,7 +828,7 @@ static void fdls_send_fdmi_abts(struct freturn ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send FDMI RPA abts. iport->fabric.state: %d oxid: 0x%x" , iport->fcid, iport->fabric.state, iport->active_oxid_fdmi_rpa);fnic_send_fcoe_frame (iport, frame, frame_size);
@@ -840,7 +840,7 @@ arm_timer:mod_timer (&iport->fabric.fdmi_timer,round_jiffies (fdmi_tov)); iport->fabric.fdmi_pending |=FDLS_FDMI_ABORT_PENDING ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: iport->fabric.fdmi_pending: 0x%x" , iport->fcid, iport->fabric.fdmi_pending); }
@@ -856,7 +856,7 @@ static void fdls_send_fabric_flogi(struc frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send FLOGI" ); iport->fabric.flags |=FNIC_FDLS_RETRY_FRAME ; goto err_out;
@@ -885,7 +885,7 @@ static void fdls_send_fabric_flogi(struc &iport->active_oxid_fabric_req);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send FLOGI" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -894,7 +894,7 @@ static void fdls_send_fabric_flogi(struc }FNIC_STD_SET_OX_ID (pflogi->fchdr, oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send fabric FLOGI with oxid: 0x%x" , iport->fcid, oxid);
@@ -916,7 +916,7 @@ static void fdls_send_fabric_plogi(struc frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send PLOGI" ); iport->fabric.flags |=FNIC_FDLS_RETRY_FRAME ; goto err_out;
@@ -928,7 +928,7 @@ static void fdls_send_fabric_plogi(struc oxid =fdls_alloc_oxid (iport,FNIC_FRAME_TYPE_FABRIC_PLOGI , &iport->active_oxid_fabric_req);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send fabric PLOGI" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -937,7 +937,7 @@ static void fdls_send_fabric_plogi(struc }FNIC_STD_SET_OX_ID (pplogi->fchdr, oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send fabric PLOGI with oxid: 0x%x" , iport->fcid, oxid);
@@ -962,7 +962,7 @@ static void fdls_send_fdmi_plogi(struct frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send FDMI PLOGI" ); goto err_out; }
@@ -974,7 +974,7 @@ static void fdls_send_fdmi_plogi(struct &iport->active_oxid_fdmi_plogi);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send FDMI PLOGI" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -985,7 +985,7 @@ static void fdls_send_fdmi_plogi(structhton24 (d_id,FC_FID_MGMT_SERV );FNIC_STD_SET_D_ID (pplogi->fchdr, d_id); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send FDMI PLOGI with oxid: 0x%x" , iport->fcid, oxid);
@@ -1009,7 +1009,7 @@ static void fdls_send_rpn_id(struct fnic frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send RPN_ID" ); iport->fabric.flags |=FNIC_FDLS_RETRY_FRAME ; goto err_out;
@@ -1036,7 +1036,7 @@ static void fdls_send_rpn_id(struct fnic &iport->active_oxid_fabric_req);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send RPN_ID" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1045,7 +1045,7 @@ static void fdls_send_rpn_id(struct fnic }FNIC_STD_SET_OX_ID (prpn_id->fchdr, oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send RPN ID with oxid: 0x%x" , iport->fcid, oxid);
@@ -1068,7 +1068,7 @@ static void fdls_send_scr(struct fnic_ip frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send SCR" ); iport->fabric.flags |=FNIC_FDLS_RETRY_FRAME ; goto err_out;
@@ -1090,7 +1090,7 @@ static void fdls_send_scr(struct fnic_ip oxid =fdls_alloc_oxid (iport,FNIC_FRAME_TYPE_FABRIC_SCR , &iport->active_oxid_fabric_req);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send SCR" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1099,7 +1099,7 @@ static void fdls_send_scr(struct fnic_ip }FNIC_STD_SET_OX_ID (pscr->fchdr, oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send SCR with oxid: 0x%x" , iport->fcid, oxid);
@@ -1123,7 +1123,7 @@ static void fdls_send_gpn_ft(struct fnic frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send GPN FT" ); iport->fabric.flags |=FNIC_FDLS_RETRY_FRAME ; goto err_out;
@@ -1148,7 +1148,7 @@ static void fdls_send_gpn_ft(struct fnic &iport->active_oxid_fabric_req);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send GPN FT" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1157,7 +1157,7 @@ static void fdls_send_gpn_ft(struct fnic }FNIC_STD_SET_OX_ID (pgpn_ft->fchdr, oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send GPN FT with oxid: 0x%x" , iport->fcid, oxid);
@@ -1183,7 +1183,7 @@ fdls_send_tgt_adisc(struct fnic_iport_s frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send TGT ADISC" ); tport->flags |=FNIC_FDLS_RETRY_FRAME ; goto err_out;
@@ -1203,7 +1203,7 @@ fdls_send_tgt_adisc(struct fnic_iport_s oxid =fdls_alloc_oxid (iport,FNIC_FRAME_TYPE_TGT_ADISC , &tport->active_oxid);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send TGT ADISC" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1222,7 +1222,7 @@ fdls_send_tgt_adisc(struct fnic_iport_s padisc->els.adisc_cmd =ELS_ADISC ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send ADISC to tgt fcid: 0x%x" , iport->fcid, tport->fcid);
@@ -1242,7 +1242,7 @@ bool fdls_delete_tport(struct fnic_iportif ((tport->state ==FDLS_TGT_STATE_OFFLINING ) || (tport->state ==FDLS_TGT_STATE_OFFLINE )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport fcid 0x%x: tport state is offlining/offline\n" , tport->fcid);return false;
@@ -1257,7 +1257,7 @@ bool fdls_delete_tport(struct fnic_iport tport->flags |=FNIC_FDLS_TPORT_TERMINATING ;if (tport->timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport fcid 0x%x: Canceling disc timer\n" , tport->fcid);fnic_del_tport_timer_sync (fnic, tport);
@@ -1272,9 +1272,9 @@ bool fdls_delete_tport(struct fnic_iport tport_del_evt = kzalloc_obj(struct fnic_tport_event_s, GFP_ATOMIC);if (!tport_del_evt) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, -"Failed to allocate memory for tport fcid: 0x%0x\n" , - tport->fcid); +FNIC_FCS_DBG (KERN_INFO , fnic, +"iport: 0x%x tport 0x%x: Failed to allocate memory\n" , + iport->fcid, tport->fcid);return false; } tport_del_evt->event =TGT_EV_RPORT_DEL ;
@@ -1282,9 +1282,9 @@ bool fdls_delete_tport(struct fnic_iportlist_add_tail (&tport_del_evt->links, &fnic->tport_event_list);queue_work (fnic_event_queue, &fnic->tport_work); }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, -"tport 0x%x not reg with scsi_transport. Freeing locally" , - tport->fcid); +FNIC_FCS_DBG (KERN_INFO , fnic, +"tport 0x%x not registered, freeing locally\n" , + tport->fcid);list_del (&tport->links);kfree (tport); }
@@ -1305,7 +1305,7 @@ fdls_send_tgt_plogi(struct fnic_iport_s frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send TGT PLOGI" ); tport->flags |=FNIC_FDLS_RETRY_FRAME ; goto err_out;
@@ -1316,7 +1316,7 @@ fdls_send_tgt_plogi(struct fnic_iport_s oxid =fdls_alloc_oxid (iport,FNIC_FRAME_TYPE_TGT_PLOGI , &tport->active_oxid);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate oxid to send PLOGI to fcid: 0x%x" , iport->fcid, tport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1330,7 +1330,7 @@ fdls_send_tgt_plogi(struct fnic_iport_shton24 (d_id, tport->fcid);FNIC_STD_SET_D_ID (pplogi->fchdr, d_id); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send tgt PLOGI to tgt: 0x%x with oxid: 0x%x" , iport->fcid, tport->fcid, oxid);
@@ -1353,7 +1353,7 @@ fnic_fc_plogi_rsp_rdf(struct fnic_iport_be16_to_cpu (plogi_rsp->els.fl_cssp[2 ].cp_rdfs) &FNIC_FC_C3_RDF ;struct fnic *fnic = iport->fnic; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"MFS: b2b_rdf_size: 0x%x spc3_rdf_size: 0x%x" , b2b_rdf_size, spc3_rdf_size);
@@ -1372,7 +1372,7 @@ static void fdls_send_register_fc4_types frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send RFT" );return ; }
@@ -1396,7 +1396,7 @@ static void fdls_send_register_fc4_types &iport->active_oxid_fabric_req);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send RFT" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1404,15 +1404,18 @@ static void fdls_send_register_fc4_types }FNIC_STD_SET_OX_ID (prft_id->fchdr, oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, -"0x%x: FDLS send RFT with oxid: 0x%x" , iport->fcid, - oxid); prft_id->rft_id.fr_fts.ff_type_map[0 ] =cpu_to_be32 (1 <<FC_TYPE_FCP ); prft_id->rft_id.fr_fts.ff_type_map[1 ] =cpu_to_be32 (1 << (FC_TYPE_CT %FC_NS_BPW )); +FNIC_FCS_DBG (KERN_INFO , fnic, +"0x%x: FDLS send RFT 0x%08x 0x%08x 0x%08x with oxid: 0x%x" , + iport->fcid, prft_id->rft_id.fr_fts.ff_type_map[0 ], + prft_id->rft_id.fr_fts.ff_type_map[1 ], + prft_id->rft_id.fr_fts.ff_type_map[2 ], + oxid);fnic_send_fcoe_frame (iport, frame, frame_size);
@@ -1432,7 +1435,7 @@ static void fdls_send_register_fc4_featu frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send RFF" );return ; }
@@ -1458,7 +1461,7 @@ static void fdls_send_register_fc4_featu &iport->active_oxid_fabric_req);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send RFF" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1466,12 +1469,13 @@ static void fdls_send_register_fc4_featu }FNIC_STD_SET_OX_ID (prff_id->fchdr, oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, -"0x%x: FDLS send RFF with oxid: 0x%x" , iport->fcid, - oxid); - prff_id->rff_id.fr_type =FC_TYPE_FCP ; +FNIC_FCS_DBG (KERN_INFO , fnic, +"0x%x: FDLS send RFF with oxid: 0x%x type 0%x feat 0%x" , + iport->fcid, oxid, prff_id->rff_id.fr_type, + prff_id->rff_id.fr_feat); +fnic_send_fcoe_frame (iport, frame, frame_size);/* Even if fnic_send_fcoe_frame() fails we want to retry after timeout */
@@ -1493,7 +1497,7 @@ fdls_send_tgt_prli(struct fnic_iport_s * frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send TGT PRLI" ); tport->flags |=FNIC_FDLS_RETRY_FRAME ; goto err_out;
@@ -1513,7 +1517,7 @@ fdls_send_tgt_prli(struct fnic_iport_s * oxid =fdls_alloc_oxid (iport,FNIC_FRAME_TYPE_TGT_PRLI , &tport->active_oxid);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"0x%x: Failed to allocate OXID to send TGT PRLI to 0x%x" , iport->fcid, tport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1530,7 +1534,7 @@ fdls_send_tgt_prli(struct fnic_iport_s *FNIC_STD_SET_S_ID (pprli->fchdr, s_id);FNIC_STD_SET_D_ID (pprli->fchdr, d_id); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send PRLI to tgt: 0x%x with oxid: 0x%x" , iport->fcid, tport->fcid, oxid);
@@ -1564,7 +1568,7 @@ void fdls_send_fabric_logo(struct fnic_i frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send fabric LOGO" );return ; }
@@ -1576,7 +1580,7 @@ void fdls_send_fabric_logo(struct fnic_i &iport->active_oxid_fabric_req);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send fabric LOGO" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1589,7 +1593,7 @@ void fdls_send_fabric_logo(struct fnic_i iport->fabric.flags &= ~FNIC_FDLS_FABRIC_ABORT_ISSUED ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send fabric LOGO with oxid: 0x%x" , iport->fcid, oxid);
@@ -1621,7 +1625,7 @@ void fdls_tgt_logout(struct fnic_iport_s frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send fabric LOGO" );return ; }
@@ -1631,7 +1635,7 @@ void fdls_tgt_logout(struct fnic_iport_s oxid =fdls_alloc_oxid (iport,FNIC_FRAME_TYPE_TGT_LOGO , &tport->active_oxid);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send tgt LOGO" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1642,7 +1646,7 @@ void fdls_tgt_logout(struct fnic_iport_shton24 (d_id, tport->fcid);FNIC_STD_SET_D_ID (plogo->fchdr, d_id); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send tgt LOGO with oxid: 0x%x" , iport->fcid, oxid);
@@ -1657,7 +1661,7 @@ static void fdls_tgt_discovery_start(stru32 old_link_down_cnt = iport->fnic->link_down_cnt;struct fnic *fnic = iport->fnic; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Starting FDLS target discovery" , iport->fcid);list_for_each_entry_safe (tport, next, &iport->tport_list, links) {
@@ -1711,7 +1715,7 @@ static void fdls_target_restart_nexus(ststruct fnic *fnic = iport->fnic;bool retval = true; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport fcid: 0x%x state: %d restart_count: %d" , tport->fcid, tport->state, tport->nexus_restart_count);
@@ -1721,13 +1725,13 @@ static void fdls_target_restart_nexus(st retval =fdls_delete_tport (iport, tport);if (retval != true) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Error deleting tport: 0x%x" , fcid);return ; }if (nexus_restart_count >=FNIC_TPORT_MAX_NEXUS_RESTART ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Exceeded nexus restart retries tport: 0x%x" , fcid);return ;
@@ -1744,7 +1748,7 @@ static void fdls_target_restart_nexus(st*/ new_tport =fdls_create_tport (iport, fcid, wwpn);if (!new_tport) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Error creating new tport: 0x%x" , fcid);return ; }
@@ -1773,12 +1777,12 @@ static struct fnic_tport_s *fdls_create_struct fnic_tport_s *tport;struct fnic *fnic = iport->fnic; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDLS create tport: fcid: 0x%x wwpn: 0x%llx" , fcid, wwpn); tport = kzalloc_obj(struct fnic_tport_s, GFP_ATOMIC);if (!tport) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Memory allocation failure while creating tport: 0x%x\n" , fcid);return NULL ;
@@ -1791,12 +1795,12 @@ static struct fnic_tport_s *fdls_create_ tport->wwpn = wwpn; tport->iport = iport; -FNIC_FCS_DBG (KERN_DEBUG , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_DEBUG , fnic,"Need to setup tport timer callback" );timer_setup (&tport->retry_timer, fdls_tport_timer_callback,0 ); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Added tport 0x%x" , tport->fcid);fdls_set_tport_state (tport,FDLS_TGT_STATE_INIT );list_add_tail (&tport->links, &iport->tport_list);
@@ -1847,7 +1851,7 @@ static void fdls_fdmi_register_hba(struc frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send FDMI RHBA" );return ; }
@@ -1875,7 +1879,7 @@ static void fdls_fdmi_register_hba(struc &iport->active_oxid_fdmi_rhba);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send FDMI RHBA" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -1896,14 +1900,14 @@ static void fdls_fdmi_register_hba(strucfnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_NODE_NAME ,FNIC_FDMI_NN_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"NN set, off=%d" , attr_off_bytes);strscpy_pad (data,FNIC_FDMI_MANUFACTURER ,FNIC_FDMI_MANU_LEN );fnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_MANUFACTURER ,FNIC_FDMI_MANU_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"MFG set <%s>, off=%d" , data, attr_off_bytes); err =vnic_dev_fw_info (fnic->vdev, &fw_info);
@@ -1912,7 +1916,7 @@ static void fdls_fdmi_register_hba(struc FNIC_FDMI_SERIAL_LEN);fnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_SERIAL_NUMBER ,FNIC_FDMI_SERIAL_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"SERIAL set <%s>, off=%d" , data, attr_off_bytes); }
@@ -1923,21 +1927,21 @@ static void fdls_fdmi_register_hba(strucfnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_MODEL ,FNIC_FDMI_MODEL_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"MODEL set <%s>, off=%d" , data, attr_off_bytes);strscpy_pad (data,FNIC_FDMI_MODEL_DESCRIPTION ,FNIC_FDMI_MODEL_DES_LEN );fnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_MODEL_DES ,FNIC_FDMI_MODEL_DES_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"MODEL_DESC set <%s>, off=%d" , data, attr_off_bytes);if (!err) {strscpy_pad (data, fw_info->hw_version,FNIC_FDMI_HW_VER_LEN );fnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_HARDWARE_VERSION ,FNIC_FDMI_HW_VER_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"HW_VER set <%s>, off=%d" , data, attr_off_bytes); }
@@ -1946,14 +1950,14 @@ static void fdls_fdmi_register_hba(strucfnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_DRIVER_VERSION ,FNIC_FDMI_DR_VER_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"DRV_VER set <%s>, off=%d" , data, attr_off_bytes);strscpy_pad (data,"N/A" ,FNIC_FDMI_ROM_VER_LEN );fnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_ROM_VERSION ,FNIC_FDMI_ROM_VER_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"ROM_VER set <%s>, off=%d" , data, attr_off_bytes);if (!err) {
@@ -1961,14 +1965,14 @@ static void fdls_fdmi_register_hba(strucfnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_FIRMWARE_VERSION ,FNIC_FDMI_FW_VER_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FW_VER set <%s>, off=%d" , data, attr_off_bytes); } len =sizeof (struct fc_std_fdmi_rhba ) + attr_off_bytes; frame_size += len; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send FDMI RHBA with oxid: 0x%x fs: %d" , iport->fcid, oxid, frame_size);
@@ -1992,7 +1996,7 @@ static void fdls_fdmi_register_pa(struct frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send FDMI RPA" );return ; }
@@ -2020,7 +2024,7 @@ static void fdls_fdmi_register_pa(struct &iport->active_oxid_fdmi_rpa);if (oxid ==FNIC_UNASSIGNED_OXID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Failed to allocate OXID to send FDMI RPA" , iport->fcid);mempool_free (frame, fnic->frame_pool);
@@ -2085,7 +2089,7 @@ static void fdls_fdmi_register_pa(structfnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_OS_NAME ,FNIC_FDMI_OS_NAME_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"OS name set <%s>, off=%d" , data, attr_off_bytes);sprintf (fc_host_system_hostname (fnic->host),"%s" ,utsname ()->nodename);
@@ -2094,13 +2098,13 @@ static void fdls_fdmi_register_pa(structfnic_fdmi_attr_set (fdmi_attr,FNIC_FDMI_TYPE_HOST_NAME ,FNIC_FDMI_HN_LEN , data, &attr_off_bytes); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Host name set <%s>, off=%d" , data, attr_off_bytes); len =sizeof (struct fc_std_fdmi_rpa ) + attr_off_bytes; frame_size += len; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send FDMI RPA with oxid: 0x%x fs: %d" , iport->fcid, oxid, frame_size);
@@ -2117,7 +2121,7 @@ void fdls_fabric_timer_callback(struct tstruct fnic *fnic = iport->fnic;unsigned long flags; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tp: %d fab state: %d fab retry counter: %d max_flogi_retries: %d" , iport->fabric.timer_pending, iport->fabric.state, iport->fabric.retry_counter, iport->max_flogi_retries);
@@ -2132,7 +2136,7 @@ void fdls_fabric_timer_callback(struct tif (iport->fabric.del_timer_inprogress) { iport->fabric.del_timer_inprogress =0 ;spin_unlock_irqrestore (&fnic->fnic_lock, flags); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"fabric_del_timer inprogress(%d). Skip timer cb" , iport->fabric.del_timer_inprogress);return ;
@@ -2160,7 +2164,7 @@ void fdls_fabric_timer_callback(struct t iport->fabric.flags &= ~FNIC_FDLS_FABRIC_ABORT_ISSUED ;fdls_send_fabric_flogi (iport); }else -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Exceeded max FLOGI retries" ); }break ;
@@ -2182,7 +2186,7 @@ void fdls_fabric_timer_callback(struct t iport->fabric.flags &= ~FNIC_FDLS_FABRIC_ABORT_ISSUED ;fdls_send_fabric_plogi (iport); }else -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Exceeded max PLOGI retries" ); }break ;
@@ -2213,7 +2217,7 @@ void fdls_fabric_timer_callback(struct telse {/* ABTS has timed out */ fdls_schedule_oxid_free (iport, &iport->active_oxid_fabric_req); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"ABTS timed out. Starting PLOGI: %p" , iport);fnic_fdls_start_plogi (iport); }
@@ -2230,7 +2234,7 @@ void fdls_fabric_timer_callback(struct t }else {/* ABTS has timed out */ fdls_schedule_oxid_free (iport, &iport->active_oxid_fabric_req); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"ABTS timed out. Starting PLOGI: %p" , iport);fnic_fdls_start_plogi (iport);/* go back to fabric Plogi */ }
@@ -2247,7 +2251,7 @@ void fdls_fabric_timer_callback(struct telse {/* ABTS has timed out */ fdls_schedule_oxid_free (iport, &iport->active_oxid_fabric_req); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"ABTS timed out. Starting PLOGI %p" , iport);fnic_fdls_start_plogi (iport);/* go back to fabric Plogi */ }
@@ -2269,7 +2273,7 @@ void fdls_fabric_timer_callback(struct tif (iport->fabric.retry_counter <FDLS_RETRY_COUNT ) {fdls_send_gpn_ft (iport, iport->fabric.state); }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"ABTS timeout for fabric GPN_FT. Check name server: %p" , iport); }
@@ -2289,7 +2293,7 @@ void fdls_fdmi_retry_plogi(struct fnic_i/* If max retries not exhausted, start over from fdmi plogi */ if (iport->fabric.fdmi_retry <FDLS_FDMI_MAX_RETRY ) { iport->fabric.fdmi_retry++; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Retry FDMI PLOGI. FDMI retry: %d" , iport->fabric.fdmi_retry);fdls_send_fdmi_plogi (iport);
@@ -2307,7 +2311,7 @@ void fdls_fdmi_timer_callback(struct timspin_lock_irqsave (&fnic->fnic_lock, flags); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport->fabric.fdmi_pending: 0x%x\n" , iport->fabric.fdmi_pending);if (!iport->fabric.fdmi_pending) {
@@ -2315,7 +2319,7 @@ void fdls_fdmi_timer_callback(struct timspin_unlock_irqrestore (&fnic->fnic_lock, flags);return ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport->fabric.fdmi_pending: 0x%x\n" , iport->fabric.fdmi_pending);/* if not abort pending, send an abort */
@@ -2324,7 +2328,7 @@ void fdls_fdmi_timer_callback(struct timspin_unlock_irqrestore (&fnic->fnic_lock, flags);return ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport->fabric.fdmi_pending: 0x%x\n" , iport->fabric.fdmi_pending);/* ABTS pending for an active fdmi request that is pending.
@@ -2332,29 +2336,36 @@ void fdls_fdmi_timer_callback(struct tim* Schedule to free the OXID after 2*r_a_tov and proceed */ if (iport->fabric.fdmi_pending &FDLS_FDMI_PLOGI_PENDING ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDMI PLOGI ABTS timed out. Schedule oxid free: 0x%x\n" , iport->active_oxid_fdmi_plogi);fdls_schedule_oxid_free (iport, &iport->active_oxid_fdmi_plogi); }else {if (iport->fabric.fdmi_pending &FDLS_FDMI_REG_HBA_PENDING ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDMI RHBA ABTS timed out. Schedule oxid free: 0x%x\n" , iport->active_oxid_fdmi_rhba);fdls_schedule_oxid_free (iport, &iport->active_oxid_fdmi_rhba); }if (iport->fabric.fdmi_pending &FDLS_FDMI_RPA_PENDING ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDMI RPA ABTS timed out. Schedule oxid free: 0x%x\n" , iport->active_oxid_fdmi_rpa);fdls_schedule_oxid_free (iport, &iport->active_oxid_fdmi_rpa); } } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport->fabric.fdmi_pending: 0x%x\n" , iport->fabric.fdmi_pending); -fdls_fdmi_retry_plogi (iport); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, + iport->fabric.fdmi_pending =0 ; +/* If max retries not exhaused, start over from fdmi plogi */ +if (iport->fabric.fdmi_retry <FDLS_FDMI_MAX_RETRY ) { + iport->fabric.fdmi_retry++; +FNIC_FCS_DBG (KERN_INFO , fnic, +"retry fdmi timer %d" , iport->fabric.fdmi_retry); +fdls_send_fdmi_plogi (iport); + } +FNIC_FCS_DBG (KERN_INFO , fnic,"iport->fabric.fdmi_pending: 0x%x\n" , iport->fabric.fdmi_pending);spin_unlock_irqrestore (&fnic->fnic_lock, flags); }
@@ -2367,7 +2378,7 @@ static void fdls_send_delete_tport_msg(s tport_del_evt = kzalloc_obj(struct fnic_tport_event_s, GFP_ATOMIC);if (!tport_del_evt) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Failed to allocate memory for tport event fcid: 0x%x" , tport->fcid);return ;
@@ -2400,13 +2411,13 @@ static void fdls_tport_timer_callback(stif (tport->del_timer_inprogress) { tport->del_timer_inprogress =0 ;spin_unlock_irqrestore (&fnic->fnic_lock, flags); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport_del_timer inprogress. Skip timer cb tport fcid: 0x%x\n" , tport->fcid);return ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport fcid: 0x%x timer pending: %d state: %d retry counter: %d" , tport->fcid, tport->timer_pending, tport->state, tport->retry_counter);
@@ -2467,15 +2478,16 @@ static void fdls_tport_timer_callback(st }else {/* exceeded retry count */ fdls_schedule_oxid_free (iport, &tport->active_oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"ADISC not responding. Deleting target port: 0x%x" , tport->fcid);fdls_send_delete_tport_msg (tport); }break ;default : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, -"oxid: 0x%x Unknown tport state: 0x%x" , oxid, tport->state); +FNIC_FCS_DBG (KERN_INFO , fnic, +"0x%x timeout tport 0x%x oxid 0x%x state %d\n" , + iport->fcid, tport->fcid, oxid, tport->state);break ; }spin_unlock_irqrestore (&fnic->fnic_lock, flags);
@@ -2524,26 +2536,26 @@ fdls_process_tgt_adisc_rsp(struct fnic_i tport =fnic_find_tport_by_fcid (iport, tgt_fcid);if (!tport) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Tgt ADISC response tport not found: 0x%x" , tgt_fcid);return ; }if ((iport->state !=FNIC_IPORT_STATE_READY ) || (tport->state !=FDLS_TGT_STATE_ADISC ) || (tport->flags &FNIC_FDLS_TGT_ABORT_ISSUED )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Dropping this ADISC response" ); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport state: %d tport state: %d Is abort issued on PRLI? %d" , iport->state, tport->state, (tport->flags &FNIC_FDLS_TGT_ABORT_ISSUED ));return ; }if (FNIC_STD_GET_OX_ID (fchdr) != tport->active_oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Dropping frame from target: 0x%x" , tgt_fcid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Reason: Stale ADISC/Aborted ADISC/OOO frame delivery" );return ; }
@@ -2555,7 +2567,7 @@ fdls_process_tgt_adisc_rsp(struct fnic_icase ELS_LS_ACC :atomic64_inc (&iport->iport_stats.tport_adisc_ls_accepts);if (tport->timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport 0x%p Canceling fabric disc timer\n" , tport);fnic_del_tport_timer_sync (fnic, tport);
@@ -2565,12 +2577,12 @@ fdls_process_tgt_adisc_rsp(struct fnic_i frame_wwnn =get_unaligned_be64 (&adisc_rsp->els.adisc_wwnn); frame_wwpn =get_unaligned_be64 (&adisc_rsp->els.adisc_wwpn);if ((frame_wwnn == tport->wwnn) && (frame_wwpn == tport->wwpn)) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"ADISC accepted from target: 0x%x. Target logged in" , tgt_fcid);fdls_set_tport_state (tport,FDLS_TGT_STATE_READY ); }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Error mismatch frame: ADISC" ); }break ;
@@ -2580,14 +2592,14 @@ fdls_process_tgt_adisc_rsp(struct fnic_iif (((els_rjt->rej.er_reason ==ELS_RJT_BUSY ) || (els_rjt->rej.er_reason ==ELS_RJT_UNAB )) && (tport->retry_counter <FDLS_RETRY_COUNT )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"ADISC ret ELS_LS_RJT BUSY. Retry from timer routine: 0x%x" , tgt_fcid);/* Retry ADISC again from the timer routine. */ tport->flags |=FNIC_FDLS_RETRY_FRAME ; }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"ADISC returned ELS_LS_RJT from target: 0x%x" , tgt_fcid);fdls_delete_tport (iport, tport);
@@ -2611,33 +2623,33 @@ fdls_process_tgt_plogi_rsp(struct fnic_i fcid =FNIC_STD_GET_S_ID (fchdr); tgt_fcid =ntoh24 (fcid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDLS processing target PLOGI response: tgt_fcid: 0x%x" , tgt_fcid); tport =fnic_find_tport_by_fcid (iport, tgt_fcid);if (!tport) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport not found: 0x%x" , tgt_fcid);return ; }if ((iport->state !=FNIC_IPORT_STATE_READY ) || (tport->flags &FNIC_FDLS_TGT_ABORT_ISSUED )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Dropping frame! iport state: %d tport state: %d" , iport->state, tport->state);return ; }if (tport->state !=FDLS_TGT_STATE_PLOGI ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PLOGI rsp recvd in wrong state. Drop the frame and restart nexus" );fdls_target_restart_nexus (tport);return ; }if (FNIC_STD_GET_OX_ID (fchdr) != tport->active_oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PLOGI response from target: 0x%x. Dropping frame" , tgt_fcid);return ;
@@ -2649,7 +2661,7 @@ fdls_process_tgt_plogi_rsp(struct fnic_iswitch (plogi_rsp->els.fl_cmd) {case ELS_LS_ACC :atomic64_inc (&iport->iport_stats.tport_plogi_ls_accepts); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PLOGI accepted by target: 0x%x" , tgt_fcid);break ;
@@ -2658,14 +2670,14 @@ fdls_process_tgt_plogi_rsp(struct fnic_iif (((els_rjt->rej.er_reason ==ELS_RJT_BUSY ) || (els_rjt->rej.er_reason ==ELS_RJT_UNAB )) && (tport->retry_counter < iport->max_plogi_retries)) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PLOGI ret ELS_LS_RJT BUSY. Retry from timer routine: 0x%x" , tgt_fcid);/* Retry plogi again from the timer routine. */ tport->flags |=FNIC_FDLS_RETRY_FRAME ;return ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PLOGI returned ELS_LS_RJT from target: 0x%x" , tgt_fcid);fdls_delete_tport (iport, tport);
@@ -2673,18 +2685,18 @@ fdls_process_tgt_plogi_rsp(struct fnic_idefault :atomic64_inc (&iport->iport_stats.tport_plogi_misc_rejects); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PLOGI not accepted from target fcid: 0x%x" , tgt_fcid);return ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Found the PLOGI target: 0x%x and state: %d" , (unsigned int ) tgt_fcid, tport->state);if (tport->timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport fcid 0x%x: Canceling disc timer\n" , tport->fcid);fnic_del_tport_timer_sync (fnic, tport);
@@ -2702,13 +2714,13 @@ fdls_process_tgt_plogi_rsp(struct fnic_imin (max_payload_size, iport->max_payload_size);if (tport->max_payload_size <FNIC_MIN_DATA_FIELD_SIZE ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"MFS: tport max frame size below spec bounds: %d" , tport->max_payload_size); tport->max_payload_size =FNIC_MIN_DATA_FIELD_SIZE ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"MAX frame size: %u iport max_payload_size: %d tport mfs: %d" , max_payload_size, iport->max_payload_size, tport->max_payload_size);
@@ -2736,12 +2748,12 @@ fdls_process_tgt_prli_rsp(struct fnic_ip fcid =FNIC_STD_GET_S_ID (fchdr); tgt_fcid =ntoh24 (fcid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDLS process tgt PRLI response: 0x%x" , tgt_fcid); tport =fnic_find_tport_by_fcid (iport, tgt_fcid);if (!tport) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport not found: 0x%x" , tgt_fcid);/* Handle or just drop? */ return ;
@@ -2749,24 +2761,24 @@ fdls_process_tgt_prli_rsp(struct fnic_ipif ((iport->state !=FNIC_IPORT_STATE_READY ) || (tport->flags &FNIC_FDLS_TGT_ABORT_ISSUED )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Dropping frame! iport st: %d tport st: %d tport fcid: 0x%x" , iport->state, tport->state, tport->fcid);return ; }if (tport->state !=FDLS_TGT_STATE_PRLI ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PRLI rsp recvd in wrong state. Drop frame. Restarting nexus" );fdls_target_restart_nexus (tport);return ; }if (FNIC_STD_GET_OX_ID (fchdr) != tport->active_oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Dropping PRLI response from target: 0x%x " , tgt_fcid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Reason: Stale PRLI response/Aborted PDISC/OOO frame delivery" );return ; }
@@ -2777,11 +2789,11 @@ fdls_process_tgt_prli_rsp(struct fnic_ipswitch (prli_rsp->els_prli.prli_cmd) {case ELS_LS_ACC :atomic64_inc (&iport->iport_stats.tport_prli_ls_accepts); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PRLI accepted from target: 0x%x" , tgt_fcid);if (prli_rsp->sp.spp_type !=FC_FC4_TYPE_SCSI ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"mismatched target zoned with FC SCSI initiator: 0x%x" , tgt_fcid); mismatched_tgt = true;
@@ -2798,7 +2810,7 @@ fdls_process_tgt_prli_rsp(struct fnic_ip || (els_rjt->rej.er_reason == ELS_RJT_UNAB)) && (tport->retry_counter < FDLS_RETRY_COUNT)) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PRLI ret ELS_LS_RJT BUSY. Retry from timer routine: 0x%x" , tgt_fcid);
@@ -2806,7 +2818,7 @@ fdls_process_tgt_prli_rsp(struct fnic_ip tport->flags |=FNIC_FDLS_RETRY_FRAME ;return ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PRLI returned ELS_LS_RJT from target: 0x%x" , tgt_fcid);
@@ -2815,17 +2827,17 @@ fdls_process_tgt_prli_rsp(struct fnic_ipreturn ;default :atomic64_inc (&iport->iport_stats.tport_prli_misc_rejects); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PRLI not accepted from target: 0x%x" , tgt_fcid);return ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Found the PRLI target: 0x%x and state: %d" , (unsigned int ) tgt_fcid, tport->state);if (tport->timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport fcid 0x%x: Canceling disc timer\n" , tport->fcid);fnic_del_tport_timer_sync (fnic, tport);
@@ -2841,7 +2853,7 @@ fdls_process_tgt_prli_rsp(struct fnic_ip/* Check if the device plays Target Mode Function */ if (!(tport->fcp_csp &FCP_PRLI_FUNC_TARGET )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Remote port(0x%x): no target support. Deleting it\n" , tgt_fcid);fdls_tgt_logout (iport, tport);
@@ -2854,16 +2866,16 @@ fdls_process_tgt_prli_rsp(struct fnic_ip/* Inform the driver about new target added */ tport_add_evt = kzalloc_obj(struct fnic_tport_event_s, GFP_ATOMIC);if (!tport_add_evt) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, -"tport event memory allocation failure: 0x%0x\n" , - tport->fcid); +FNIC_FCS_DBG (KERN_INFO , fnic, +"iport fcid: 0x%x tport event memory allocation failure: 0x%0x\n" , + iport->fcid, tport->fcid);return ; } tport_add_evt->event =TGT_EV_RPORT_ADD ; tport_add_evt->arg1 = (void *) tport; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, -"iport fcid: 0x%x add tport event fcid: 0x%x\n" , - tport->fcid, iport->fcid); +FNIC_FCS_DBG (KERN_INFO , fnic, +"iport fcid: 0x%x add tport event fcid: 0x%x\n" , + tport->fcid, iport->fcid);list_add_tail (&tport_add_evt->links, &fnic->tport_event_list);queue_work (fnic_event_queue, &fnic->tport_work); }
@@ -2881,21 +2893,21 @@ fdls_process_rff_id_rsp(struct fnic_iporuint16_t oxid =FNIC_STD_GET_OX_ID (fchdr);if (fdls_get_state (fdls) !=FDLS_STATE_REGISTER_FC4_FEATURES ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RFF_ID resp recvd in state(%d). Dropping." ,fdls_get_state (fdls));return ; }if (iport->active_oxid_fabric_req != oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Incorrect OXID in response. state: %d, oxid recvd: 0x%x, active oxid: 0x%x\n" ,fdls_get_state (fdls), oxid, iport->active_oxid_fabric_req);return ; } rsp =FNIC_STD_GET_FC_CT_CMD ((&rff_rsp->fc_std_ct_hdr)); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS process RFF ID response: 0x%04x" , iport->fcid, (uint32_t ) rsp);
@@ -2904,7 +2916,7 @@ fdls_process_rff_id_rsp(struct fnic_iporswitch (rsp) {case FC_FS_ACC :if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Canceling fabric disc timer %p\n" , iport);fnic_del_fabric_timer_sync (fnic); }
@@ -2918,18 +2930,18 @@ fdls_process_rff_id_rsp(struct fnic_iporif (((reason_code ==FC_FS_RJT_BSY ) || (reason_code ==FC_FS_RJT_UNABL )) && (fdls->retry_counter <FDLS_RETRY_COUNT )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RFF_ID ret ELS_LS_RJT BUSY. Retry from timer routine %p" , iport);/* Retry again from the timer routine */ fdls->flags |=FNIC_FDLS_RETRY_FRAME ; }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RFF_ID returned ELS_LS_RJT. Halting discovery %p" , iport);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Canceling fabric disc timer %p\n" , iport);fnic_del_fabric_timer_sync (fnic); }
@@ -2954,14 +2966,14 @@ fdls_process_rft_id_rsp(struct fnic_iporuint16_t oxid =FNIC_STD_GET_OX_ID (fchdr);if (fdls_get_state (fdls) !=FDLS_STATE_REGISTER_FC4_TYPES ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RFT_ID resp recvd in state(%d). Dropping." ,fdls_get_state (fdls));return ; }if (iport->active_oxid_fabric_req != oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Incorrect OXID in response. state: %d, oxid recvd: 0x%x, active oxid: 0x%x\n" ,fdls_get_state (fdls), oxid, iport->active_oxid_fabric_req);return ;
@@ -2969,7 +2981,7 @@ fdls_process_rft_id_rsp(struct fnic_ipor rsp =FNIC_STD_GET_FC_CT_CMD ((&rft_rsp->fc_std_ct_hdr)); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS process RFT ID response: 0x%04x" , iport->fcid, (uint32_t ) rsp);
@@ -2978,7 +2990,7 @@ fdls_process_rft_id_rsp(struct fnic_iporswitch (rsp) {case FC_FS_ACC :if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Canceling fabric disc timer %p\n" , iport);fnic_del_fabric_timer_sync (fnic); }
@@ -2992,19 +3004,19 @@ fdls_process_rft_id_rsp(struct fnic_iporif (((reason_code ==FC_FS_RJT_BSY ) || (reason_code ==FC_FS_RJT_UNABL )) && (fdls->retry_counter <FDLS_RETRY_COUNT )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: RFT_ID ret ELS_LS_RJT BUSY. Retry from timer routine" , iport->fcid);/* Retry again from the timer routine */ fdls->flags |=FNIC_FDLS_RETRY_FRAME ; }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: RFT_ID REJ. Halting discovery reason %d expl %d" , iport->fcid, reason_code, rft_rsp->fc_std_ct_hdr.ct_explan);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Canceling fabric disc timer %p\n" , iport);fnic_del_fabric_timer_sync (fnic); }
@@ -3029,20 +3041,20 @@ fdls_process_rpn_id_rsp(struct fnic_iporuint16_t oxid =FNIC_STD_GET_OX_ID (fchdr);if (fdls_get_state (fdls) !=FDLS_STATE_RPN_ID ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RPN_ID resp recvd in state(%d). Dropping." ,fdls_get_state (fdls));return ; }if (iport->active_oxid_fabric_req != oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Incorrect OXID in response. state: %d, oxid recvd: 0x%x, active oxid: 0x%x\n" ,fdls_get_state (fdls), oxid, iport->active_oxid_fabric_req);return ; } rsp =FNIC_STD_GET_FC_CT_CMD ((&rpn_rsp->fc_std_ct_hdr)); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS process RPN ID response: 0x%04x" , iport->fcid, (uint32_t ) rsp);fdls_free_oxid (iport, oxid, &iport->active_oxid_fabric_req);
@@ -3050,7 +3062,7 @@ fdls_process_rpn_id_rsp(struct fnic_iporswitch (rsp) {case FC_FS_ACC :if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Canceling fabric disc timer %p\n" , iport);fnic_del_fabric_timer_sync (fnic); }
@@ -3064,17 +3076,17 @@ fdls_process_rpn_id_rsp(struct fnic_iporif (((reason_code ==FC_FS_RJT_BSY ) || (reason_code ==FC_FS_RJT_UNABL )) && (fdls->retry_counter <FDLS_RETRY_COUNT )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RPN_ID returned REJ BUSY. Retry from timer routine %p" , iport);/* Retry again from the timer routine */ fdls->flags |=FNIC_FDLS_RETRY_FRAME ; }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RPN_ID ELS_LS_RJT. Halting discovery %p" , iport);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Canceling fabric disc timer %p\n" , iport);fnic_del_fabric_timer_sync (fnic); }
@@ -3097,18 +3109,18 @@ fdls_process_scr_rsp(struct fnic_iport_sstruct fnic *fnic = iport->fnic;uint16_t oxid =FNIC_STD_GET_OX_ID (fchdr); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDLS process SCR response: 0x%04x" , (uint32_t ) scr_rsp->scr.scr_cmd);if (fdls_get_state (fdls) !=FDLS_STATE_SCR ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"SCR resp recvd in state(%d). Dropping." ,fdls_get_state (fdls));return ; }if (iport->active_oxid_fabric_req != oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Incorrect OXID in response. state: %d, oxid recvd: 0x%x, active oxid: 0x%x\n" ,fdls_get_state (fdls), oxid, iport->active_oxid_fabric_req); }
@@ -3119,7 +3131,7 @@ fdls_process_scr_rsp(struct fnic_iport_scase ELS_LS_ACC :atomic64_inc (&iport->iport_stats.fabric_scr_ls_accepts);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Canceling fabric disc timer %p\n" , iport);fnic_del_fabric_timer_sync (fnic); }
@@ -3133,17 +3145,17 @@ fdls_process_scr_rsp(struct fnic_iport_sif (((els_rjt->rej.er_reason ==ELS_RJT_BUSY ) || (els_rjt->rej.er_reason ==ELS_RJT_UNAB )) && (fdls->retry_counter <FDLS_RETRY_COUNT )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"SCR ELS_LS_RJT BUSY. Retry from timer routine %p" , iport);/* Retry again from the timer routine */ fdls->flags |=FNIC_FDLS_RETRY_FRAME ; }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"SCR returned ELS_LS_RJT. Halting discovery %p" , iport);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Canceling fabric disc timer %p\n" , iport);fnic_del_fabric_timer_sync (fnic);
@@ -3171,7 +3183,7 @@ fdls_process_gpn_ft_tgt_list(struct fnicu32 old_link_down_cnt = iport->fnic->link_down_cnt;struct fnic *fnic = iport->fnic; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS process GPN_FT tgt list" , iport->fcid); gpn_ft_tgt =
@@ -3185,7 +3197,7 @@ fdls_process_gpn_ft_tgt_list(struct fnic fcid =ntoh24 (gpn_ft_tgt->fcid); wwpn =be64_to_cpu (gpn_ft_tgt->wwpn); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"tport: 0x%x: ctrl:0x%x" , fcid, gpn_ft_tgt->ctrl);if (fcid == iport->fcid) {
@@ -3232,7 +3244,7 @@ fdls_process_gpn_ft_tgt_list(struct fnic rem_len -=sizeof (struct fc_gpn_ft_rsp_iu ); }if (rem_len <=0 ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"GPN_FT response: malformed/corrupt frame rxlen: %d remlen: %d" , len, rem_len); }
@@ -3242,7 +3254,7 @@ fdls_process_gpn_ft_tgt_list(struct fniclist_for_each_entry_safe (tport, next, &iport->tport_list, links) {if (!(tport->flags &FNIC_FDLS_TPORT_IN_GPN_FT_LIST )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Remove port: 0x%x not found in GPN_FT list" , tport->fcid);fdls_delete_tport (iport, tport);
@@ -3271,7 +3283,7 @@ fdls_process_gpn_ft_rsp(struct fnic_iporstruct fnic *fnic = iport->fnic;uint16_t oxid =FNIC_STD_GET_OX_ID (fchdr); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDLS process GPN_FT response: iport state: %d len: %d" , iport->state, len);
@@ -3291,14 +3303,14 @@ fdls_process_gpn_ft_rsp(struct fnic_ipor && ((fdls_get_state(fdls) == FDLS_STATE_RSCN_GPN_FT) || (fdls_get_state(fdls) == FDLS_STATE_SEND_GPNFT) || (fdls_get_state(fdls) == FDLS_STATE_TGT_DISCOVERY))))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"GPNFT resp recvd in fab state(%d) iport_state(%d). Dropping." ,fdls_get_state (fdls), iport->state);return ; }if (iport->active_oxid_fabric_req != oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Incorrect OXID in response. state: %d, oxid recvd: 0x%x, active oxid: 0x%x\n" ,fdls_get_state (fdls), oxid, iport->active_oxid_fabric_req); }
@@ -3311,10 +3323,10 @@ fdls_process_gpn_ft_rsp(struct fnic_iporswitch (rsp) {case FC_FS_ACC : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: GPNFT_RSP accept" , iport->fcid);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Canceling fabric disc timer\n" , iport->fcid);fnic_del_fabric_timer_sync (fnic);
@@ -3329,7 +3341,7 @@ fdls_process_gpn_ft_rsp(struct fnic_ipor* that will be taken care in next link up event */ if (iport->state !=FNIC_IPORT_STATE_READY ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Halting target discovery: fab st: %d iport st: %d " ,fdls_get_state (fdls), iport->state);break ;
@@ -3339,22 +3351,22 @@ fdls_process_gpn_ft_rsp(struct fnic_iporcase FC_FS_RJT : reason_code = gpn_ft_rsp->fc_std_ct_hdr.ct_reason; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: GPNFT_RSP Reject reason: %d" , iport->fcid, reason_code);if (((reason_code ==FC_FS_RJT_BSY ) || (reason_code ==FC_FS_RJT_UNABL )) && (fdls->retry_counter <FDLS_RETRY_COUNT )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: GPNFT_RSP ret REJ/BSY. Retry from timer routine" , iport->fcid);/* Retry again from the timer routine */ fdls->flags |=FNIC_FDLS_RETRY_FRAME ; }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: GPNFT_RSP reject" , iport->fcid);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Canceling fabric disc timer\n" , iport->fcid);fnic_del_fabric_timer_sync (fnic);
@@ -3368,7 +3380,7 @@ fdls_process_gpn_ft_rsp(struct fnic_ipor count =0 ;list_for_each_entry_safe (tport, next, &iport->tport_list, links) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"GPN_FT_REJECT: Remove port: 0x%x" , tport->fcid);fdls_delete_tport (iport, tport);
@@ -3378,7 +3390,7 @@ fdls_process_gpn_ft_rsp(struct fnic_ipor } count++; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"GPN_FT_REJECT: Removed (0x%x) ports" , count); }break ;
@@ -3403,7 +3415,7 @@ fdls_process_fabric_logo_rsp(struct fnicuint16_t oxid =FNIC_STD_GET_OX_ID (fchdr);if (iport->active_oxid_fabric_req != oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Incorrect OXID in response. state: %d, oxid recvd: 0x%x, active oxid: 0x%x\n" ,fdls_get_state (fdls), oxid, iport->active_oxid_fabric_req); }
@@ -3412,7 +3424,7 @@ fdls_process_fabric_logo_rsp(struct fnicswitch (flogo_rsp->els.fl_cmd) {case ELS_LS_ACC :if (iport->fabric.state !=FDLS_STATE_FABRIC_LOGO ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Flogo response. Fabric not in LOGO state. Dropping! %p" , iport);return ;
@@ -3422,25 +3434,25 @@ fdls_process_fabric_logo_rsp(struct fnic iport->state =FNIC_IPORT_STATE_LINK_WAIT ;if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport 0x%p Canceling fabric disc timer\n" , iport);fnic_del_fabric_timer_sync (fnic); } iport->fabric.timer_pending =0 ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Flogo response from Fabric for did: 0x%x" ,ntoh24 (fchdr->fh_d_id));return ;case ELS_LS_RJT : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Flogo response from Fabric for did: 0x%x returned ELS_LS_RJT" ,ntoh24 (fchdr->fh_d_id));return ;default : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FLOGO response not accepted or rejected: 0x%x" , flogo_rsp->els.fl_cmd); }
@@ -3458,17 +3470,17 @@ fdls_process_flogi_rsp(struct fnic_iportstruct fnic *fnic = iport->fnic;uint16_t oxid =FNIC_STD_GET_OX_ID (fchdr); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS processing FLOGI response" , iport->fcid);if (fdls_get_state (fabric) !=FDLS_STATE_FABRIC_FLOGI ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FLOGI response received in state (%d). Dropping frame" ,fdls_get_state (fabric));return ; }if (iport->active_oxid_fabric_req != oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Incorrect OXID in response. state: %d, oxid recvd: 0x%x, active oxid: 0x%x\n" ,fdls_get_state (fabric), oxid, iport->active_oxid_fabric_req);return ;
@@ -3480,7 +3492,7 @@ fdls_process_flogi_rsp(struct fnic_iportcase ELS_LS_ACC :atomic64_inc (&iport->iport_stats.fabric_flogi_ls_accepts);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport fcid: 0x%x Canceling fabric disc timer\n" , iport->fcid);fnic_del_fabric_timer_sync (fnic);
@@ -3490,7 +3502,7 @@ fdls_process_flogi_rsp(struct fnic_iport iport->fabric.retry_counter =0 ; fcid =FNIC_STD_GET_D_ID (fchdr); iport->fcid =ntoh24 (fcid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FLOGI response accepted" , iport->fcid);/* Learn the Service Params */
@@ -3500,7 +3512,7 @@ fdls_process_flogi_rsp(struct fnic_iport iport->max_payload_size =min (rdf_size, iport->max_payload_size); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"max_payload_size from fabric: %u set: %d" , rdf_size, iport->max_payload_size);
@@ -3510,7 +3522,7 @@ fdls_process_flogi_rsp(struct fnic_iportif (FNIC_LOGI_FEATURES (flogi_rsp->els) &FNIC_FC_EDTOV_NSEC ) iport->e_d_tov = iport->e_d_tov /FNIC_NSEC_TO_MSEC ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"From fabric: R_A_TOV: %d E_D_TOV: %d" , iport->r_a_tov, iport->e_d_tov);
@@ -3521,13 +3533,13 @@ fdls_process_flogi_rsp(struct fnic_iportfnic_fdls_learn_fcoe_macs (iport, rx_frame, fcid);if (fnic_fdls_register_portid (iport, iport->fcid, rx_frame) !=0 ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FLOGI registration failed" , iport->fcid);break ; }memcpy (&fcmac[3 ], fcid,3 ); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Adding vNIC device MAC addr: %02x:%02x:%02x:%02x:%02x:%02x" , fcmac[0 ], fcmac[1 ], fcmac[2 ], fcmac[3 ], fcmac[4 ], fcmac[5 ]);
@@ -3535,7 +3547,7 @@ fdls_process_flogi_rsp(struct fnic_iportif (fdls_get_state (fabric) ==FDLS_STATE_FABRIC_FLOGI ) {fnic_fdls_start_plogi (iport); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FLOGI response received. Starting PLOGI" ); }else {/* From FDLS_STATE_FABRIC_FLOGI state fabric can only go to
@@ -3543,7 +3555,7 @@ fdls_process_flogi_rsp(struct fnic_iport* state, hence we don't have to worry about undoing: * the fnic_fdls_register_portid and vnic_dev_add_addr */ -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FLOGI response received in state (%d). Dropping frame" ,fdls_get_state (fabric)); }
@@ -3552,7 +3564,7 @@ fdls_process_flogi_rsp(struct fnic_iportcase ELS_LS_RJT :atomic64_inc (&iport->iport_stats.fabric_flogi_ls_rejects);if (fabric->retry_counter < iport->max_flogi_retries) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FLOGI returned ELS_LS_RJT BUSY. Retry from timer routine %p" , iport);
@@ -3560,11 +3572,11 @@ fdls_process_flogi_rsp(struct fnic_iport fabric->flags |=FNIC_FDLS_RETRY_FRAME ; }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FLOGI returned ELS_LS_RJT. Halting discovery %p" , iport);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport 0x%p Canceling fabric disc timer\n" , iport);fnic_del_fabric_timer_sync (fnic);
@@ -3575,7 +3587,7 @@ fdls_process_flogi_rsp(struct fnic_iportbreak ;default : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FLOGI response not accepted: 0x%x" , flogi_rsp->els.fl_cmd);atomic64_inc (&iport->iport_stats.fabric_flogi_misc_rejects);
@@ -3594,13 +3606,13 @@ fdls_process_fabric_plogi_rsp(struct fniuint16_t oxid =FNIC_STD_GET_OX_ID (fchdr);if (fdls_get_state ((&iport->fabric)) !=FDLS_STATE_FABRIC_PLOGI ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Fabric PLOGI response received in state (%d). Dropping frame" ,fdls_get_state (&iport->fabric));return ; }if (iport->active_oxid_fabric_req != oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Incorrect OXID in response. state: %d, oxid recvd: 0x%x, active oxid: 0x%x\n" ,fdls_get_state (fdls), oxid, iport->active_oxid_fabric_req);return ;
@@ -3611,7 +3623,7 @@ fdls_process_fabric_plogi_rsp(struct fnicase ELS_LS_ACC :atomic64_inc (&iport->iport_stats.fabric_plogi_ls_accepts);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport fcid: 0x%x fabric PLOGI response: Accepted\n" , iport->fcid);fnic_del_fabric_timer_sync (fnic);
@@ -3626,15 +3638,15 @@ fdls_process_fabric_plogi_rsp(struct fniif (((els_rjt->rej.er_reason ==ELS_RJT_BUSY ) || (els_rjt->rej.er_reason ==ELS_RJT_UNAB )) && (iport->fabric.retry_counter < iport->max_plogi_retries)) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Fabric PLOGI ELS_LS_RJT BUSY. Retry from timer routine" , iport->fcid); }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Fabric PLOGI ELS_LS_RJT. Halting discovery" , iport->fcid);if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport fcid: 0x%x Canceling fabric disc timer\n" , iport->fcid);fnic_del_fabric_timer_sync (fnic);
@@ -3645,7 +3657,7 @@ fdls_process_fabric_plogi_rsp(struct fni }break ;default : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PLOGI response not accepted: 0x%x" , plogi_rsp->els.fl_cmd);atomic64_inc (&iport->iport_stats.fabric_plogi_misc_rejects);
@@ -3664,7 +3676,7 @@ static void fdls_process_fdmi_plogi_rsp(uint16_t oxid =FNIC_STD_GET_OX_ID (fchdr);if (iport->active_oxid_fdmi_plogi != oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Incorrect OXID in response. state: %d, oxid recvd: 0x%x, active oxid: 0x%x\n" ,fdls_get_state (fdls), oxid, iport->active_oxid_fdmi_plogi);return ;
@@ -3678,9 +3690,9 @@ static void fdls_process_fdmi_plogi_rsp( iport->fabric.fdmi_pending =0 ;switch (plogi_rsp->els.fl_cmd) {case ELS_LS_ACC : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDLS process fdmi PLOGI response status: ELS_LS_ACC\n" ); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Sending fdmi registration for port 0x%x\n" , iport->fcid);
@@ -3691,7 +3703,7 @@ static void fdls_process_fdmi_plogi_rsp( round_jiffies(fdmi_tov));break ;case ELS_LS_RJT : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Fabric FDMI PLOGI returned ELS_LS_RJT reason: 0x%x" , els_rjt->rej.er_reason);
@@ -3715,7 +3727,7 @@ static void fdls_process_fdmi_reg_ack(stuint16_t oxid;if (!iport->fabric.fdmi_pending) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Received FDMI ack while not waiting: 0x%x\n" ,FNIC_STD_GET_OX_ID (fchdr));return ;
@@ -3725,7 +3737,7 @@ static void fdls_process_fdmi_reg_ack(stif ((iport->active_oxid_fdmi_rhba != oxid) && (iport->active_oxid_fdmi_rpa != oxid)) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Incorrect OXID in response. oxid recvd: 0x%x, active oxids(rhba,rpa): 0x%x, 0x%x\n" , oxid, iport->active_oxid_fdmi_rhba, iport->active_oxid_fdmi_rpa);return ;
@@ -3738,13 +3750,13 @@ static void fdls_process_fdmi_reg_ack(stfdls_free_oxid (iport, oxid, &iport->active_oxid_fdmi_rpa); } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport fcid: 0x%x: Received FDMI registration ack\n" , iport->fcid);if (!iport->fabric.fdmi_pending) {timer_delete_sync (&iport->fabric.fdmi_timer); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"iport fcid: 0x%x: Canceling FDMI timer\n" , iport->fcid); }
@@ -3760,7 +3772,7 @@ static void fdls_process_fdmi_abts_rsp(s s_id =ntoh24 (FNIC_STD_GET_S_ID (fchdr));if (!(s_id !=FC_FID_MGMT_SERV )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received abts rsp with invalid SID: 0x%x. Dropping frame" , s_id);return ;
@@ -3770,23 +3782,23 @@ static void fdls_process_fdmi_abts_rsp(sswitch (FNIC_FRAME_TYPE (oxid)) {case FNIC_FRAME_TYPE_FDMI_PLOGI : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received FDMI PLOGI ABTS rsp with oxid: 0x%x" , oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: iport->fabric.fdmi_pending: 0x%x" , iport->fcid, iport->fabric.fdmi_pending);fdls_free_oxid (iport, oxid, &iport->active_oxid_fdmi_plogi); iport->fabric.fdmi_pending &= ~FDLS_FDMI_PLOGI_PENDING ; iport->fabric.fdmi_pending &= ~FDLS_FDMI_ABORT_PENDING ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: iport->fabric.fdmi_pending: 0x%x" , iport->fcid, iport->fabric.fdmi_pending);break ;case FNIC_FRAME_TYPE_FDMI_RHBA : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received FDMI RHBA ABTS rsp with oxid: 0x%x" , oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: iport->fabric.fdmi_pending: 0x%x" , iport->fcid, iport->fabric.fdmi_pending);
@@ -3800,14 +3812,14 @@ static void fdls_process_fdmi_abts_rsp(s iport->fabric.fdmi_pending &= ~FDLS_FDMI_ABORT_PENDING ;fdls_free_oxid (iport, oxid, &iport->active_oxid_fdmi_rhba); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: iport->fabric.fdmi_pending: 0x%x" , iport->fcid, iport->fabric.fdmi_pending);break ;case FNIC_FRAME_TYPE_FDMI_RPA : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received FDMI RPA ABTS rsp with oxid: 0x%x" , oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: iport->fabric.fdmi_pending: 0x%x" , iport->fcid, iport->fabric.fdmi_pending);
@@ -3821,12 +3833,12 @@ static void fdls_process_fdmi_abts_rsp(s iport->fabric.fdmi_pending &= ~FDLS_FDMI_ABORT_PENDING ;fdls_free_oxid (iport, oxid, &iport->active_oxid_fdmi_rpa); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: iport->fabric.fdmi_pending: 0x%x" , iport->fcid, iport->fabric.fdmi_pending);break ;default : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received abts rsp with invalid oxid: 0x%x. Dropping frame" , oxid);break ;
@@ -3861,7 +3873,7 @@ fdls_process_fabric_abts_rsp(struct fnicif (!((s_id ==FC_FID_DIR_SERV ) || (s_id ==FC_FID_FLOGI ) || (s_id ==FC_FID_FCTRL ))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received abts rsp with invalid SID: 0x%x. Dropping frame" , s_id);return ;
@@ -3869,14 +3881,14 @@ fdls_process_fabric_abts_rsp(struct fnic oxid =FNIC_STD_GET_OX_ID (fchdr);if (iport->active_oxid_fabric_req != oxid) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received abts rsp with invalid oxid: 0x%x. Dropping frame" , oxid);return ; }if (iport->fabric.timer_pending) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Canceling fabric disc timer %p\n" , iport);fnic_del_fabric_timer_sync (fnic); }
@@ -3884,11 +3896,11 @@ fdls_process_fabric_abts_rsp(struct fnic iport->fabric.flags &= ~FNIC_FDLS_FABRIC_ABORT_ISSUED ;if (fchdr->fh_r_ctl ==FC_RCTL_BA_ACC ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received abts rsp BA_ACC for fabric_state: %d OX_ID: 0x%x" , fabric_state,be16_to_cpu (ba_acc->acc.ba_ox_id)); }else if (fchdr->fh_r_ctl ==FC_RCTL_BA_RJT ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"BA_RJT fs: %d OX_ID: 0x%x rc: 0x%x rce: 0x%x" , fabric_state,FNIC_STD_GET_OX_ID (&ba_rjt->fchdr), ba_rjt->rjt.br_reason, ba_rjt->rjt.br_explan);
@@ -3903,7 +3915,7 @@ fdls_process_fabric_abts_rsp(struct fnicif (iport->fabric.retry_counter < iport->max_flogi_retries)fdls_send_fabric_flogi (iport);else -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Exceeded max FLOGI retries" );break ;case FNIC_FRAME_TYPE_FABRIC_LOGO :
@@ -3914,7 +3926,7 @@ fdls_process_fabric_abts_rsp(struct fnicif (iport->fabric.retry_counter < iport->max_plogi_retries)fdls_send_fabric_plogi (iport);else -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Exceeded max PLOGI retries" );break ;case FNIC_FRAME_TYPE_FABRIC_RPN :
@@ -3928,7 +3940,7 @@ fdls_process_fabric_abts_rsp(struct fnicif (iport->fabric.retry_counter <FDLS_RETRY_COUNT )fdls_send_scr (iport);else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"SCR exhausted retries. Start fabric PLOGI %p" , iport);fnic_fdls_start_plogi (iport);/* go back to fabric Plogi */
@@ -3938,7 +3950,7 @@ fdls_process_fabric_abts_rsp(struct fnicif (iport->fabric.retry_counter <FDLS_RETRY_COUNT )fdls_send_register_fc4_types (iport);else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RFT exhausted retries. Start fabric PLOGI %p" , iport);fnic_fdls_start_plogi (iport);/* go back to fabric Plogi */
@@ -3948,7 +3960,7 @@ fdls_process_fabric_abts_rsp(struct fnicif (iport->fabric.retry_counter <FDLS_RETRY_COUNT )fdls_send_register_fc4_features (iport);else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RFF exhausted retries. Start fabric PLOGI %p" , iport);fnic_fdls_start_plogi (iport);/* go back to fabric Plogi */
@@ -3958,7 +3970,7 @@ fdls_process_fabric_abts_rsp(struct fnicif (iport->fabric.retry_counter <=FDLS_RETRY_COUNT )fdls_send_gpn_ft (iport, fabric_state);else -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"GPN FT exhausted retries. Start fabric PLOGI %p" , iport);break ;
@@ -3967,7 +3979,7 @@ fdls_process_fabric_abts_rsp(struct fnic* We should not be here since we already validated rx oxid with * our active_oxid_fabric_req */ -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Invalid OXID/active oxid 0x%x\n" , oxid);WARN_ON (true);return ;
@@ -3987,7 +3999,7 @@ fdls_process_abts_req(struct fnic_iport_sizeof (struct fc_std_abts_ba_acc ); nport_id =ntoh24 (fchdr->fh_s_id); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received abort from SID 0x%8x" , nport_id); tport =fnic_find_tport_by_fcid (iport, nport_id);
@@ -4000,7 +4012,7 @@ fdls_process_abts_req(struct fnic_iport_ frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"0x%x: Failed to allocate frame to send response for ABTS req" , iport->fcid);return ;
@@ -4021,7 +4033,7 @@ fdls_process_abts_req(struct fnic_iport_ pba_acc->acc.ba_rx_id =cpu_to_be16 (FNIC_STD_GET_RX_ID (fchdr)); pba_acc->acc.ba_ox_id =cpu_to_be16 (FNIC_STD_GET_OX_ID (fchdr)); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS send BA ACC with oxid: 0x%x" , iport->fcid, oxid);
@@ -4041,7 +4053,7 @@ fdls_process_unsupported_els_req(structsizeof (struct fc_std_els_rjt_rsp );if (iport->fcid != d_id) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Dropping unsupported ELS with illegal frame bits 0x%x\n" , d_id);atomic64_inc (&iport->iport_stats.unsupported_frames_dropped);
@@ -4050,7 +4062,7 @@ fdls_process_unsupported_els_req(structif ((iport->state !=FNIC_IPORT_STATE_READY ) && (iport->state !=FNIC_IPORT_STATE_FABRIC_DISC )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Dropping unsupported ELS request in iport state: %d" , iport->state);atomic64_inc (&iport->iport_stats.unsupported_frames_dropped);
@@ -4059,7 +4071,7 @@ fdls_process_unsupported_els_req(struct frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send response to unsupported ELS request" );return ; }
@@ -4067,7 +4079,7 @@ fdls_process_unsupported_els_req(struct pls_rsp = (struct fc_std_els_rjt_rsp *) (frame +FNIC_ETH_FCOE_HDRS_OFFSET );fdls_init_els_rjt_frame (frame, iport); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Process unsupported ELS request from SID: 0x%x" , iport->fcid,ntoh24 (fchdr->fh_s_id));
@@ -4094,12 +4106,12 @@ fdls_process_rls_req(struct fnic_iport_suint16_t frame_size =FNIC_ETH_FCOE_HDRS_OFFSET +sizeof (struct fc_std_rls_acc ); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Process RLS request %d" , iport->fnic->fnic_num);if ((iport->state !=FNIC_IPORT_STATE_READY ) && (iport->state !=FNIC_IPORT_STATE_FABRIC_DISC )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received RLS req in iport state: %d. Dropping the frame." , iport->state);return ;
@@ -4107,7 +4119,7 @@ fdls_process_rls_req(struct fnic_iport_s frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send RLS accept" );return ; }
@@ -4148,33 +4160,33 @@ fdls_process_els_req(struct fnic_iport_sif ((iport->state !=FNIC_IPORT_STATE_READY ) && (iport->state !=FNIC_IPORT_STATE_FABRIC_DISC )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Dropping ELS frame type: 0x%x in iport state: %d" , type, iport->state);return ; }switch (type) {case ELS_ECHO : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"sending LS_ACC for ECHO request %d\n" , iport->fnic->fnic_num);break ;case ELS_RRQ : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"sending LS_ACC for RRQ request %d\n" , iport->fnic->fnic_num);break ;default : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"sending LS_ACC for 0x%x ELS frame\n" , type);break ; } frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send ELS response for 0x%x" , type);return ;
@@ -4220,17 +4232,17 @@ fdls_process_tgt_abts_rsp(struct fnic_ip tport =fnic_find_tport_by_fcid (iport, s_id);if (!tport) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Received tgt abts rsp with invalid SID: 0x%x" , s_id);return ; }if (tport->timer_pending) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"tport 0x%p Canceling fabric disc timer\n" , tport);fnic_del_tport_timer_sync (fnic, tport); }if (iport->state !=FNIC_IPORT_STATE_READY ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Received tgt abts rsp in iport state(%d). Dropping." , iport->state);return ;
@@ -4245,15 +4257,15 @@ fdls_process_tgt_abts_rsp(struct fnic_ipswitch (frame_type) {case FNIC_FRAME_TYPE_TGT_ADISC :if (fchdr->fh_r_ctl ==FC_RCTL_BA_ACC ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"OX_ID: 0x%x tgt_fcid: 0x%x rcvd tgt adisc abts resp BA_ACC" ,be16_to_cpu (ba_acc->acc.ba_ox_id), tport->fcid); }else if (fchdr->fh_r_ctl ==FC_RCTL_BA_RJT ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"ADISC BA_RJT rcvd tport_fcid: 0x%x tport_state: %d " , tport->fcid, tport_state); -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"reason code: 0x%x reason code explanation:0x%x " , ba_rjt->rjt.br_reason, ba_rjt->rjt.br_explan);
@@ -4265,7 +4277,7 @@ fdls_process_tgt_abts_rsp(struct fnic_ipreturn ; }fdls_free_oxid (iport, oxid, &tport->active_oxid); -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"ADISC not responding. Deleting target port: 0x%x" , tport->fcid);fdls_delete_tport (iport, tport);
@@ -4278,14 +4290,14 @@ fdls_process_tgt_abts_rsp(struct fnic_ipbreak ;case FNIC_FRAME_TYPE_TGT_PLOGI :if (fchdr->fh_r_ctl ==FC_RCTL_BA_ACC ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Received tgt PLOGI abts response BA_ACC tgt_fcid: 0x%x" , tport->fcid); }else if (fchdr->fh_r_ctl ==FC_RCTL_BA_RJT ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PLOGI BA_RJT received for tport_fcid: 0x%x OX_ID: 0x%x" , tport->fcid,FNIC_STD_GET_OX_ID (fchdr)); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"reason code: 0x%x reason code explanation: 0x%x" , ba_rjt->rjt.br_reason, ba_rjt->rjt.br_explan);
@@ -4308,14 +4320,14 @@ fdls_process_tgt_abts_rsp(struct fnic_ipbreak ;case FNIC_FRAME_TYPE_TGT_PRLI :if (fchdr->fh_r_ctl ==FC_RCTL_BA_ACC ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Received tgt PRLI abts response BA_ACC" , tport->fcid); }else if (fchdr->fh_r_ctl ==FC_RCTL_BA_RJT ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PRLI BA_RJT received for tport_fcid: 0x%x OX_ID: 0x%x " , tport->fcid,FNIC_STD_GET_OX_ID (fchdr)); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"reason code: 0x%x reason code explanation: 0x%x" , ba_rjt->rjt.br_reason, ba_rjt->rjt.br_explan);
@@ -4331,7 +4343,7 @@ fdls_process_tgt_abts_rsp(struct fnic_ipfdls_set_tport_state (tport,FDLS_TGT_STATE_PLOGI );break ;default : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received ABTS response for unknown frame %p" , iport);break ; }
@@ -4351,14 +4363,14 @@ fdls_process_plogi_req(struct fnic_iportsizeof (struct fc_std_els_rjt_rsp );if (iport->fcid != d_id) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received PLOGI with illegal frame bits. Dropping frame from 0x%x" , d_id);return ; }if (iport->state !=FNIC_IPORT_STATE_READY ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received PLOGI request in iport state: %d Dropping frame" , iport->state);return ;
@@ -4366,7 +4378,7 @@ fdls_process_plogi_req(struct fnic_iport frame =fdls_alloc_frame (iport);if (frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send response to PLOGI request" );return ; }
@@ -4374,7 +4386,7 @@ fdls_process_plogi_req(struct fnic_iport pplogi_rsp = (struct fc_std_els_rjt_rsp *) (frame +FNIC_ETH_FCOE_HDRS_OFFSET );fdls_init_els_rjt_frame (frame, iport); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: Process PLOGI request from SID: 0x%x" , iport->fcid,ntoh24 (fchdr->fh_s_id));
@@ -4404,11 +4416,11 @@ fdls_process_logo_req(struct fnic_iport_ nport_id =ntoh24 (logo->els.fl_n_port_id); nport_name =be64_to_cpu (logo->els.fl_n_port_wwn); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Process LOGO request from fcid: 0x%x" , nport_id);if (iport->state !=FNIC_IPORT_STATE_READY ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Dropping LOGO req from 0x%x in iport state: %d" , nport_id, iport->state);return ;
@@ -4418,19 +4430,19 @@ fdls_process_logo_req(struct fnic_iport_if (!tport) {/* We are not logged in with the nport, log and drop... */ -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Received LOGO from an nport not logged in: 0x%x(0x%llx)" , nport_id, nport_name);return ; }if (tport->fcid != nport_id) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Received LOGO with invalid target port fcid: 0x%x(0x%llx)" , nport_id, nport_name);return ; }if (tport->timer_pending) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"tport fcid 0x%x: Canceling disc timer\n" , tport->fcid);fnic_del_tport_timer_sync (fnic, tport);
@@ -4447,7 +4459,7 @@ fdls_process_logo_req(struct fnic_iport_if ((iport->state ==FNIC_IPORT_STATE_READY ) && (fdls_get_state (&iport->fabric) !=FDLS_STATE_SEND_GPNFT ) && (fdls_get_state (&iport->fabric) !=FDLS_STATE_RSCN_GPN_FT )) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Sending GPNFT in response to LOGO from Target:0x%x" , nport_id);fdls_send_gpn_ft (iport,FDLS_STATE_SEND_GPNFT );
@@ -4460,7 +4472,7 @@ fdls_process_logo_req(struct fnic_iport_fdls_send_logo_resp (iport, &logo->fchdr);if ((fdls_get_state (&iport->fabric) !=FDLS_STATE_SEND_GPNFT ) && (fdls_get_state (&iport->fabric) !=FDLS_STATE_RSCN_GPN_FT )) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Sending GPNFT in response to LOGO from Target:0x%x" , nport_id);fdls_send_gpn_ft (iport,FDLS_STATE_SEND_GPNFT );
@@ -4487,11 +4499,11 @@ fdls_process_rscn(struct fnic_iport_s *iatomic64_inc (&iport->iport_stats.num_rscns); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDLS process RSCN %p" , iport);if (iport->state !=FNIC_IPORT_STATE_READY ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDLS RSCN received in state(%d). Dropping" ,fdls_get_state (fdls));return ;
@@ -4508,18 +4520,18 @@ fdls_process_rscn(struct fnic_iport_s *iif ((rscn_payload_len ==0xFFFF ) && (sid ==FC_FID_FCTRL )) { rscn_type =PC_RSCN ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"pcrscn: PCRSCN received. sid: 0x%x payload len: 0x%x" , sid, rscn_payload_len); }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RSCN payload_len: 0x%x page_len: 0x%x" , rscn_payload_len, rscn->els.rscn_page_len);/* if this happens then we need to send ADISC to all the tports. */ list_for_each_entry_safe (tport, next, &iport->tport_list, links) {if (tport->state ==FDLS_TGT_STATE_READY ) tport->flags |=FNIC_FDLS_TPORT_SEND_ADISC ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RSCN for port id: 0x%x" , tport->fcid); } }/* end else */
@@ -4527,7 +4539,7 @@ fdls_process_rscn(struct fnic_iport_s *i num_ports = (rscn_payload_len -4 ) / rscn->els.rscn_page_len; rscn_port = (struct fc_els_rscn_page *)(rscn +1 ); } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RSCN received for num_ports: %d payload_len: %d page_len: %d " , num_ports, rscn_payload_len, rscn->els.rscn_page_len);
@@ -4551,14 +4563,14 @@ fdls_process_rscn(struct fnic_iport_s *iif (tport->state ==FDLS_TGT_STATE_READY ) tport->flags |=FNIC_FDLS_TPORT_SEND_ADISC ; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RSCN for port id: 0x%x" , tport->fcid); }break ; } tport =fnic_find_tport_by_fcid (iport, nport_id); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"RSCN port id list: 0x%x" , nport_id);if (!tport) {
@@ -4573,13 +4585,13 @@ fdls_process_rscn(struct fnic_iport_s *i rscn_type == PC_RSCN && fnic->role == FNIC_ROLE_FCP_INITIATOR) {if (fnic->pc_rscn_handling_status ==PC_RSCN_HANDLING_IN_PROGRESS ) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"PCRSCN handling already in progress. Skip host reset: %d" , iport->fnic->fnic_num);return ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Processing PCRSCN. Queuing fnic for host reset: %d" , iport->fnic->fnic_num); fnic->pc_rscn_handling_status =PC_RSCN_HANDLING_IN_PROGRESS ;
@@ -4595,7 +4607,7 @@ fdls_process_rscn(struct fnic_iport_s *iqueue_work (reset_fnic_work_queue, &reset_fnic_work);spin_lock_irqsave (&fnic->fnic_lock, fnic->lock_flags); }else { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"FDLS process RSCN sending GPN_FT: newports: %d" , newports);fdls_send_gpn_ft (iport,FDLS_STATE_RSCN_GPN_FT );fdls_send_rscn_resp (iport, fchdr);
@@ -4644,20 +4656,20 @@ fdls_process_adisc_req(struct fnic_iportuint16_t acc_frame_size =FNIC_ETH_FCOE_HDRS_OFFSET +sizeof (struct fc_std_els_adisc ); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Process ADISC request %d" , iport->fnic->fnic_num); fcid =FNIC_STD_GET_S_ID (fchdr); tgt_fcid =ntoh24 (fcid); tport =fnic_find_tport_by_fcid (iport, tgt_fcid);if (!tport) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"tport for fcid: 0x%x not found. Dropping ADISC req." , tgt_fcid);return ; }if (iport->state !=FNIC_IPORT_STATE_READY ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Dropping ADISC req from fcid: 0x%x in iport state: %d" , tgt_fcid, iport->state);return ;
@@ -4668,16 +4680,16 @@ fdls_process_adisc_req(struct fnic_iportif ((frame_wwnn != tport->wwnn) || (frame_wwpn != tport->wwpn)) {/* send reject */ -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"ADISC req from fcid: 0x%x mismatch wwpn: 0x%llx wwnn: 0x%llx" , tgt_fcid, frame_wwpn, frame_wwnn); -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"local tport wwpn: 0x%llx wwnn: 0x%llx. Sending RJT" , tport->wwpn, tport->wwnn); rjt_frame =fdls_alloc_frame (iport);if (rjt_frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate rjt_frame to send response to ADISC request" );return ; }
@@ -4700,7 +4712,7 @@ fdls_process_adisc_req(struct fnic_iport acc_frame =fdls_alloc_frame (iport);if (acc_frame ==NULL ) { -FNIC_FCS_DBG (KERN_ERR , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_ERR , fnic,"Failed to allocate frame to send ADISC accept" );return ; }
@@ -4754,7 +4766,7 @@ fnic_fdls_validate_and_get_frame_type(st/* some common validation */ if (fdls_get_state (fabric) >FDLS_STATE_FABRIC_FLOGI ) {if (iport->fcid != d_id || (!FNIC_FC_FRAME_CS_CTL (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"invalid frame received. Dropping frame" );return -1 ; }
@@ -4764,14 +4776,14 @@ fnic_fdls_validate_and_get_frame_type(stif ((fchdr->fh_r_ctl ==FC_RCTL_BA_ACC ) || (fchdr->fh_r_ctl ==FC_RCTL_BA_RJT )) {if (!(FNIC_FC_FRAME_TYPE_BLS (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received ABTS invalid frame. Dropping frame" );return -1 ; }if (fdls_is_oxid_fabric_req (oxid)) {if (!(iport->fabric.flags &FNIC_FDLS_FABRIC_ABORT_ISSUED )) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received unexpected ABTS RSP(oxid:0x%x) from 0x%x. Dropping frame" , oxid, s_id);return -1 ;
@@ -4782,7 +4794,7 @@ fnic_fdls_validate_and_get_frame_type(st }else if (fdls_is_oxid_tgt_req (oxid)) {return FNIC_TPORT_BLS_ABTS_RSP ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received ABTS rsp with unknown oxid(0x%x) from 0x%x. Dropping frame" , oxid, s_id);return -1 ;
@@ -4791,7 +4803,7 @@ fnic_fdls_validate_and_get_frame_type(st/* BLS ABTS Req */ if ((fchdr->fh_r_ctl ==FC_RCTL_BA_ABTS ) && (FNIC_FC_FRAME_TYPE_BLS (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Receiving Abort Request from s_id: 0x%x" , s_id);return FNIC_BLS_ABTS_REQ ; }
@@ -4803,7 +4815,7 @@ fnic_fdls_validate_and_get_frame_type(stif ((!FNIC_FC_FRAME_FCTL_FIRST_LAST_SEQINIT (fchdr)) || (!FNIC_FC_FRAME_UNSOLICITED (fchdr)) || (!FNIC_FC_FRAME_TYPE_ELS (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received LOGO invalid frame. Dropping frame" );return -1 ; }
@@ -4812,12 +4824,12 @@ fnic_fdls_validate_and_get_frame_type(stif ((!FNIC_FC_FRAME_FCTL_FIRST_LAST_SEQINIT (fchdr)) || (!FNIC_FC_FRAME_TYPE_ELS (fchdr)) || (!FNIC_FC_FRAME_UNSOLICITED (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received RSCN invalid FCTL. Dropping frame" );return -1 ; }if (s_id !=FC_FID_FCTRL ) -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received RSCN from target FCTL: 0x%x type: 0x%x s_id: 0x%x." , fchdr->fh_f_ctl[0 ], fchdr->fh_type, s_id);return FNIC_ELS_RSCN_REQ ;
@@ -4832,7 +4844,7 @@ fnic_fdls_validate_and_get_frame_type(stcase ELS_RRQ :return FNIC_ELS_RRQ ;default : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Unsupported frame (type:0x%02x) from fcid: 0x%x" , type, s_id);return FNIC_ELS_UNSUPPORTED_REQ ;
@@ -4841,14 +4853,14 @@ fnic_fdls_validate_and_get_frame_type(st/* solicited response from fabric or target */ oxid_frame_type =FNIC_FRAME_TYPE (oxid); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"oxid frame code: 0x%x, oxid: 0x%x\n" , oxid_frame_type, oxid);switch (oxid_frame_type) {case FNIC_FRAME_TYPE_FABRIC_FLOGI :if (type ==ELS_LS_ACC ) {if ((s_id !=FC_FID_FLOGI ) || (!FNIC_FC_FRAME_TYPE_ELS (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received unknown frame. Dropping frame" );return -1 ; }
@@ -4859,7 +4871,7 @@ fnic_fdls_validate_and_get_frame_type(stif (type ==ELS_LS_ACC ) {if ((s_id !=FC_FID_DIR_SERV ) || (!FNIC_FC_FRAME_TYPE_ELS (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received unknown frame. Dropping frame" );return -1 ; }
@@ -4870,7 +4882,7 @@ fnic_fdls_validate_and_get_frame_type(stif (type ==ELS_LS_ACC ) {if ((s_id !=FC_FID_FCTRL ) || (!FNIC_FC_FRAME_TYPE_ELS (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received unknown frame. Dropping frame" );return -1 ; }
@@ -4879,7 +4891,7 @@ fnic_fdls_validate_and_get_frame_type(stcase FNIC_FRAME_TYPE_FABRIC_RPN :if ((s_id !=FC_FID_DIR_SERV ) || (!FNIC_FC_FRAME_TYPE_FC_GS (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received unknown frame. Dropping frame" );return -1 ; }
@@ -4887,7 +4899,7 @@ fnic_fdls_validate_and_get_frame_type(stcase FNIC_FRAME_TYPE_FABRIC_RFT :if ((s_id !=FC_FID_DIR_SERV ) || (!FNIC_FC_FRAME_TYPE_FC_GS (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received unknown frame. Dropping frame" );return -1 ; }
@@ -4895,7 +4907,7 @@ fnic_fdls_validate_and_get_frame_type(stcase FNIC_FRAME_TYPE_FABRIC_RFF :if ((s_id !=FC_FID_DIR_SERV ) || (!FNIC_FC_FRAME_TYPE_FC_GS (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received unknown frame. Dropping frame" );return -1 ; }
@@ -4903,7 +4915,7 @@ fnic_fdls_validate_and_get_frame_type(stcase FNIC_FRAME_TYPE_FABRIC_GPN_FT :if ((s_id !=FC_FID_DIR_SERV ) || (!FNIC_FC_FRAME_TYPE_FC_GS (fchdr))) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received unknown frame. Dropping frame" );return -1 ; }
@@ -4925,7 +4937,7 @@ fnic_fdls_validate_and_get_frame_type(streturn FNIC_TPORT_ADISC_RSP ;case FNIC_FRAME_TYPE_TGT_LOGO :if (!FNIC_FC_FRAME_TYPE_ELS (fchdr)) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Dropping Unknown frame in tport solicited exchange range type: 0x%x." , fchdr->fh_type);return -1 ;
@@ -4933,7 +4945,7 @@ fnic_fdls_validate_and_get_frame_type(streturn FNIC_TPORT_LOGO_RSP ;default :/* Drop the Rx frame and log/stats it */ -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Solicited response: unknown OXID: 0x%x" , oxid);return -1 ; }
@@ -5003,7 +5015,7 @@ void fnic_fdls_recv_frame(struct fnic_ipbreak ;case FNIC_TPORT_LOGO_RSP :/* Logo response from tgt which we have deleted */ -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Logo response from tgt: 0x%x" ,ntoh24 (fchdr->fh_s_id));break ;
@@ -5046,9 +5058,9 @@ void fnic_fdls_recv_frame(struct fnic_ipfdls_process_fdmi_reg_ack (iport, fchdr, frame_type);break ;default : -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"s_id: 0x%x d_did: 0x%x" , s_id, d_id); -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"Received unknown FCoE frame of len: %d. Dropping frame" , len);break ; }
@@ -5065,7 +5077,7 @@ void fnic_fdls_link_down(struct fnic_ipostruct fnic_tport_s *tport, *next;struct fnic *fnic = iport->fnic; -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS processing link down" , iport->fcid);fdls_set_state ((&iport->fabric),FDLS_STATE_LINKDOWN );
@@ -5075,7 +5087,7 @@ void fnic_fdls_link_down(struct fnic_ipofnic_fcpio_reset (iport->fnic);spin_lock_irqsave (&fnic->fnic_lock, fnic->lock_flags);list_for_each_entry_safe (tport, next, &iport->tport_list, links) { -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"removing rport: 0x%x" , tport->fcid);fdls_delete_tport (iport, tport); }
@@ -5088,6 +5100,6 @@ void fnic_fdls_link_down(struct fnic_ipo iport->flags &= ~FNIC_FDMI_ACTIVE ; } -FNIC_FCS_DBG (KERN_INFO , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_INFO , fnic,"0x%x: FDLS finish processing link down" , iport->fcid); }
drivers/scsi/fnic/fip.c +54 -63
379 lines not on this page · raw message
drivers/scsi/fnic/fip.h +1 -1
@@ -142,7 +142,7 @@ fnic_debug_dump_fip_frame(struct fnic *fu16 op =be16_to_cpu (fiph->fip_op);u8 sub = fiph->fip_subcode; -FNIC_FCS_DBG (KERN_DEBUG , fnic->host, fnic->fnic_num, +FNIC_FCS_DBG (KERN_DEBUG , fnic,"FIP %s packet contents: op: 0x%x sub: 0x%x (len = %d)" , pfx, op, sub, len);
drivers/scsi/fnic/fnic.h +41 -33
2 lines not on this page · raw message
drivers/scsi/fnic/fnic_fcs.c +63 -63
126 lines not on this page · raw message
drivers/scsi/fnic/fnic_isr.c +14 -14
Lines of this file are not shown. View the raw message.
drivers/scsi/fnic/fnic_main.c +29 -27
56 lines not on this page · raw message
drivers/scsi/fnic/fnic_scsi.c +104 -106
210 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Greg Kroah-Hartman
maintainerPATCH 431/438 scsi: fnic: Bump up version number
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karan Tilak Kumar <[email protected]>
[ Upstream commit 2265541d221dc550dc89b52e49e9d9eb2f824996 ]
Bump up version number to 1.9.0.0.
Stable-dep-of: 0cb1fd924126 ("scsi: fnic: Fix missed link-up when critical IRQ targets offline CPU")
--- drivers/scsi/fnic/fnic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/fnic/fnic.h +1 -1
@@ -30,7 +30,7 @@#define DRV_NAME "fnic"#define DRV_DESCRIPTION "Cisco FCoE HBA Driver" -#define DRV_VERSION "1.8.0.3" +#define DRV_VERSION "1.9.0.0"#define PFX DRV_NAME ": "#define DFX DRV_NAME "%d: "
Greg Kroah-Hartman
maintainerPATCH 432/438 scsi: fnic: Fix missed link-up when critical IRQ targets offline CPU
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arun Easi <[email protected]>
[ Upstream commit 0cb1fd924126f1f581621a5e804df98a02be9dff ]
When CPU Hyper Threading is disabled, sibling CPUs remain present but are reported offline. Managed MSI-X IRQs can still receive affinity masks that include those offline CPUs. If a driver-critical vector is managed, it can be parked on an offline CPU and the driver may miss critical events such as link-up.
Keep driver-critical vectors unmanaged so they can be migrated by the IRQ core when their target CPU is offlined.
Since HWQ-0 is unmanaged now, in some queue combinations there can be no mappings to it in mq_map. So without the blk-mq fix mentioned below, system may crash during cpu offline/online tests.
Depends-on: commit 10845a105bbc ("blk-mq: skip CPU offline notify on unmapped hctx")
--- drivers/scsi/fnic/fnic.h | 2 +- drivers/scsi/fnic/fnic_isr.c | 13 ++++++++++--- drivers/scsi/fnic/fnic_main.c | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 5 deletions(-)
drivers/scsi/fnic/fnic.h +1 -1
@@ -30,7 +30,7 @@#define DRV_NAME "fnic"#define DRV_DESCRIPTION "Cisco FCoE HBA Driver" -#define DRV_VERSION "1.9.0.0" +#define DRV_VERSION "1.9.0.1"#define PFX DRV_NAME ": "#define DFX DRV_NAME "%d: "
drivers/scsi/fnic/fnic_isr.c +10 -3
@@ -245,7 +245,14 @@ int fnic_set_intr_mode_msix(struct fnicunsigned int m =ARRAY_SIZE (fnic->wq);unsigned int o =ARRAY_SIZE (fnic->hw_copy_wq);unsigned int min_irqs = n + m +1 +1 ;/*rq, raw wq, wq, err*/ - +/* +* Make driver critical vectors unmanaged, or else it can get tied +* to an offline CPU. This can happen when hyper-threading is off. +*/ +struct irq_affinity affd = { + .pre_vectors = n + m +1 ,/* rq, raw wq, 1 ioq */ + .post_vectors =1 ,/* err */ + };/* * We need n RQs, m WQs, o Copy WQs, n+m+o CQs, and n+m+o+1 INTRs * (last INTR is used for WQ/RQ errors and notification area)
@@ -263,8 +270,8 @@ int fnic_set_intr_mode_msix(struct fnicint vec_count =0 ;int vecs = fnic->rq_count + fnic->raw_wq_count + fnic->wq_copy_count +1 ; - vec_count =pci_alloc_irq_vectors (fnic->pdev, min_irqs, vecs, -PCI_IRQ_MSIX |PCI_IRQ_AFFINITY ); + vec_count =pci_alloc_irq_vectors_affinity (fnic->pdev, min_irqs, + vecs,PCI_IRQ_MSIX |PCI_IRQ_AFFINITY , &affd);FNIC_ISR_DBG (KERN_INFO , fnic,"allocated %d MSI-X vectors\n" , vec_count);
drivers/scsi/fnic/fnic_main.c +32 -1
@@ -680,6 +680,8 @@ static int fnic_scsi_drv_init(struct fnivoid fnic_mq_map_queues_cpus (struct Scsi_Host *host) { +const struct cpumask *mask; +unsigned int queue, cpu;struct fnic *fnic = *((struct fnic **)shost_priv (host));struct pci_dev *l_pdev = fnic->pdev;int intr_mode = fnic->config.intr_mode;
@@ -700,7 +702,36 @@ void fnic_mq_map_queues_cpus(struct Scsireturn ; } -blk_mq_map_hw_queues (qmap, &l_pdev->dev,FNIC_PCI_OFFSET ); +for_each_possible_cpu (cpu) + qmap->mq_map[cpu] =0 ; + +/* +* Setup CPU to Queue mapping for all managed MSI-X IRQs. +* Q0 is driver critical and non-managed, hence start from Q1. +*/ +for (queue =1 ; queue < qmap->nr_queues; queue++) { +int irq_num =pci_irq_vector (fnic->pdev, + queue +FNIC_PCI_OFFSET ); + +if (irq_num <0 ) +continue ; + + mask =pci_irq_get_affinity (fnic->pdev, + queue +FNIC_PCI_OFFSET ); +if (!mask) { +shost_printk (KERN_ERR , host, +"failed to get irq_affinity map for queue:%d\n" , irq_num); +continue ; + } +FNIC_MAIN_DBG (KERN_INFO , fnic, +"got irq_affinity map for %d:\n" , irq_num); +for_each_cpu (cpu, mask) { + qmap->mq_map[cpu] = qmap->queue_offset + queue; +FNIC_MAIN_DBG (KERN_INFO , fnic, +"[Q%d] cpu:%d <=> irq:%d\n" , + queue, cpu, irq_num); + } + } }static int fnic_probe (struct pci_dev *pdev,const struct pci_device_id *ent)
Greg Kroah-Hartman
maintainerPATCH 433/438 drm/amdgpu: reduce early full GPU access during SR-IOV init
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: chong li <[email protected]>
[ Upstream commit cba4928cdffaa0f9012acff0ec4f896320107077 ]
Allow early FB reads to fall back to BAR0 when the VRAM aperture is not ready. This lets SR-IOV VFs consume host-provided init data before requesting full GPU access.
For ASICs that support request_init_data,
defer full GPU access until after non-GPU early init to shorten the full-access window.
Legacy ASICs(before NV12) do not send request_init_data; the host dumps init data only during full GPU access, so keep the original early full-access request path for them.
Stable-dep-of: 04de4007d323 ("drm/amdgpu: Fix GPU PCIe link capability reporting")
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 88 +++++++++++++++++++++++++++-- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 7 +- 2 files changed, 88 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +83 -5
@@ -750,6 +750,64 @@ void amdgpu_device_mm_access(struct amdgdrm_dev_exit (idx); } +#ifdef CONFIG_64BIT +/* +* During early SR-IOV VF init, host-provided init data can live in FB before +* the normal VRAM aperture mapping is ready. Use a temporary BAR0 mapping for +* reads only, and verify it matches the VRAM aperture when aperture information +* is already available. +*/ +static int amdgpu_device_read_fb_via_bar0 (struct amdgpu_device *adev, +u64 offset,void *buf,size_t size) +{ +resource_size_t aper_base, aper_size, bar_start, bar_size, map_base; +void __iomem *vram; +size_t map_offset, map_size; +unsigned long flags; +u64 end; + +if (!buf || !size) +return -EINVAL ; + + flags =pci_resource_flags (adev->pdev,0 ); +if ((flags &IORESOURCE_UNSET ) || !(flags &IORESOURCE_MEM )) +return -EINVAL ; + + bar_start =pci_resource_start (adev->pdev,0 ); + bar_size =pci_resource_len (adev->pdev,0 ); +if (!bar_size) +return -ENODEV ; + + aper_base = adev->gmc.aper_base; + aper_size = adev->gmc.visible_vram_size ? adev->gmc.visible_vram_size : + adev->gmc.aper_size; + +if (aper_base || aper_size) { +if (aper_base != bar_start || aper_size > bar_size) +return -EINVAL ; + }else { + aper_base = bar_start; + aper_size = bar_size; + } + +if (check_add_overflow (offset, size, &end) || end > aper_size) +return -EINVAL ; + + map_offset =offset_in_page (offset); + map_base = aper_base + (offset &PAGE_MASK ); + map_size =PAGE_ALIGN (map_offset + size); + + vram =ioremap_wc (map_base, map_size); +if (!vram) +return -ENOMEM ; + +memcpy_fromio (buf, (u8 __iomem *)vram + map_offset, size); +iounmap (vram); + +return 0 ; +} +#endif +/** * amdgpu_device_aper_access - access vram by vram aperture *
@@ -769,8 +827,12 @@ size_t amdgpu_device_aper_access(structsize_t count =0 ;uint64_t last; -if (!adev->mman.aper_base_kaddr) +if (!adev->mman.aper_base_kaddr) { +/* Writes still require the regular aperture/MM path. */ +if (!write && !amdgpu_device_read_fb_via_bar0 (adev, pos, buf, size)) +return size;return 0 ; + } last =min (pos + size, adev->gmc.visible_vram_size);if (last > pos) {
@@ -2011,16 +2073,25 @@ static int amdgpu_device_ip_early_init(s {struct amdgpu_ip_block *ip_block;struct pci_dev *parent; -bool total, skip_bios; +bool total, skip_bios, early_full_gpu_access = false;uint32_t bios_flags;int i, r;amdgpu_device_enable_virtual_display (adev);if (amdgpu_sriov_vf (adev)) { - r =amdgpu_virt_request_full_gpu (adev, true); -if (r) -return r; +/* +* Legacy hosts do not provide init data before early init, so +* keep the original early full GPU access request for them. Newer +* hosts publish the init data through VF FB, which lets us defer +* full GPU access until after non-GPU early init work is done. +*/ + early_full_gpu_access = (adev->virt.req_init_data_ver ==0 ); +if (early_full_gpu_access) { + r =amdgpu_virt_request_full_gpu (adev, true); +if (r) +return r; + } r =amdgpu_virt_init_critical_region (adev);if (r)
@@ -2183,6 +2254,13 @@ static int amdgpu_device_ip_early_init(sif (!total)return -ENODEV ; +/* Request full GPU access only for the remaining SR-IOV init work. */ +if (amdgpu_sriov_vf (adev) && !early_full_gpu_access) { + r =amdgpu_virt_request_full_gpu (adev, true); +if (r) +return r; + } +if (adev->gmc.xgmi.supported)amdgpu_xgmi_early_init (adev);
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +5 -2
@@ -185,8 +185,11 @@ static int xgpu_ai_send_access_requests( }else if (req ==IDH_REQ_GPU_INIT_DATA ){/* Dummy REQ_GPU_INIT_DATA handling */ r =xgpu_ai_poll_msg (adev,IDH_REQ_GPU_INIT_DATA_READY ); -/* version set to 0 since dummy */ - adev->virt.req_init_data_ver =0 ; +/* +* AI uses the GPU_CRIT_REGION_V1 layout in practice, so fix the +* dummy version value to match the actual init-data format. +*/ + adev->virt.req_init_data_ver =GPU_CRIT_REGION_V1 ; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 434/438 drm/amdgpu: Fix GPU PCIe link capability reporting
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
[ Upstream commit 04de4007d32385b8b6a5dd72bff3146dfdc592c3 ]
Commit eb53125a7ad9 ("drm/amd: Add dedicated helper for amdgpu_device_find_parent()") made amdgpu_device_gpu_bandwidth() query the first device outside the dGPU. That is the host side of the physical link, not the GPU side.
As a result, the ASIC and platform capability masks can both be based on the host port. drm_amdgpu_info_device then exposes the host capabilities to userspace, such as Gen5 x16 for a Gen4 x8 GPU.
Cache both ends of the physical link during device initialization. Use link_dev for the GPU capability and link_partner for the platform capability and _PR3 detection.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 48 ++++++++++------------------- 2 files changed, 20 insertions(+), 31 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +3 -0
@@ -822,6 +822,9 @@ enum amdgpu_enforce_isolation_mode {struct amdgpu_device {struct device *dev;struct pci_dev *pdev; +/* The two ends of the physical PCIe link outside the device. */ +struct pci_dev *link_dev; +struct pci_dev *link_partner;struct drm_device ddev;#ifdef CONFIG_DRM_AMD_ACP
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +17 -31
90 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 435/438 ntsync: reject wait ioctls with zero owner
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Iván Ezequiel Rodriguez <[email protected]>
commit 61611481f7b599e0526a3782c626b1a9deeb48bd upstream.
setup_wait() already validates pad and flags but not owner, while Documentation/userspace-api/ntsync.rst requires EINVAL when owner is zero. Reject early before queueing waiters.
--- drivers/misc/ntsync.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/misc/ntsync.c +3 -0
@@ -875,6 +875,9 @@ static int setup_wait(struct ntsync_deviif (args->pad || (args->flags & ~NTSYNC_WAIT_REALTIME ))return -EINVAL ; +if (!args->owner) +return -EINVAL ; +if (size >=sizeof (fds))return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 436/438 drm/ttm: fix swapped-out resources never leaving their bulk_move range
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vadim Nikitushkin <[email protected]>
commit 3db7d7d583419f7b1f2e141e36418802dbb25cf8 upstream.
ttm_tt_swapout() returns the number of pages swapped out on success and a negative error code on failure; for a populated ttm it never returns zero. Commit b2ed01e7ad3d ("drm/ttm: Fix ttm_bo_swapout() infinite LRU walk on swapout failure") moved the bulk_move bookkeeping in ttm_bo_swapout_cb() under "if (!ret)", so the ttm_resource_del_bulk_move_unevictable() / ttm_resource_move_to_lru_tail() pair is now skipped on every successful swapout. The equivalent change for the shrinker in commit 1d59f36e95f7 ("drm/ttm: Fix ttm_bo_shrink() infinite LRU walk on backup failure") tests "lret > 0", which is what was intended here as well.
Before b2ed01e7ad3d the resource was taken off the bulk_move before the swapout; since then a swapped-out resource stays inside its BO's bulk_move range (and on the manager LRU) although it is unevictable. When it is later freed or the BO leaves the bulk_move (ttm_resource_free(), ttm_bo_set_bulk_move() via amdgpu_vm_bo_del()), ttm_resource_del_bulk_move() skips it because of its !ttm_resource_unevictable() guard, so a range endpoint in pos->first / pos->last is left pointing at freed memory. The next ttm_lru_bulk_move_tail() or ttm_resource_add_bulk_move() on that cursor is a use-after-free, seen as the resv WARN in ttm_lru_bulk_move_add(), "list_del corruption" in ttm_resource_move_to_lru_tail() or a NULL dereference in ttm_resource_manager_next() -- minutes to hours after a hibernation, or at process exit / reboot following one. Samuel Ainsworth's analysis of drm/amd issue 5387 (see Link) identified the dangling cursor; the missing removal at swapout time is the reason it dangles.
Testing the condition for success restores the removal. On an AMD Phoenix APU (ASUS UM3406GA, gfx1103) running suspend-then-hibernate on a 7.0.y stable kernel carrying the backport (Ubuntu 7.0.0-31) the bug crashed 5 of 18 hibernation cycles; a function profile of one hibernation showed 336 ttm_tt_swapout() calls and zero ttm_resource_del_bulk_move_unevictable() calls. With this change the removal happens for every swapped-out resource and 12 further cycles were clean.
[ Squashed with commit fcfe64715b425262af1b36f498f9197f3537ceed
("drm/ttm: apply the swapout bulk_move fix to the intended condition"):
upstream 3db7d7d58341 was applied to the "if (ret)" after ttm_resource_try_charge() in ttm_bo_alloc_at_place() instead of the "if (!ret)" after ttm_tt_swapout() in ttm_bo_swapout_cb(), and fcfe64715b42 restored the former and changed the latter. 7.2.y has no ttm_resource_try_charge() (dmem cgroup charging is 7.3 material), so neither commit applies on its own; the net effect of the two is the single hunk below, which is the change the changelog describes. ]
--- drivers/gpu/drm/ttm/ttm_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -1
@@ -1178,7 +1178,7 @@ ttm_bo_swapout_cb(struct ttm_lru_walk *wif (ttm_tt_is_populated (tt)) { ret =ttm_tt_swapout (bdev, tt, swapout_walk->gfp_flags); -if (!ret) { +if (ret >0 ) {spin_lock (&bdev->lru_lock);ttm_resource_del_bulk_move_unevictable (bo->resource, bo);ttm_resource_move_to_lru_tail (bo->resource);
Greg Kroah-Hartman
maintainerPATCH 437/438 drm/amdgpu: restrict BAR0 fallback read to SR-IOV VFs only
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit bd1f08246b8a2564d8ac61df715b6bcd5f994729 upstream.
The BAR0 fallback read path was introduced as a workaround for SR-IOV VFs where the VRAM aperture is not available during early init. Restrict this workaround to only SR-IOV VFs where it's needed.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
@@ -769,6 +769,9 @@ static int amdgpu_device_read_fb_via_barif (!buf || !size)return -EINVAL ; +if (!amdgpu_sriov_vf (adev)) +return -EINVAL ; + flags =pci_resource_flags (adev->pdev,0 );if ((flags &IORESOURCE_UNSET ) || !(flags &IORESOURCE_MEM ))return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 438/438 ksmbd: fix partial normalized name responses
In reply to Greg Kroah-Hartman7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit f4fafaf02174c32bce2f9bb4196fadf13f1fd96e upstream.
Windows may request FILE_NORMALIZED_NAME_INFORMATION with an output buffer that only fits the fixed portion of the variable-length response. Treat the fixed portion as FILE_NORMALIZED_NAME_INFORMATION_SIZE so ksmbd returns STATUS_BUFFER_OVERFLOW instead of STATUS_INFO_LENGTH_MISMATCH.
This avoids rejecting valid partial normalized-name responses.
--- fs/smb/server/smb2pdu.c | 3 +++ fs/smb/server/smb2pdu.h | 1 + 2 files changed, 4 insertions(+)
fs/smb/server/smb2pdu.c +3 -0
@@ -6531,6 +6531,9 @@ static int smb2_get_info_file(struct ksmcase FILE_ALTERNATE_NAME_INFORMATION : fixed_len =FILE_ALTERNATE_NAME_INFORMATION_SIZE ;break ; +case FILE_NORMALIZED_NAME_INFORMATION : + fixed_len =FILE_NORMALIZED_NAME_INFORMATION_SIZE ; +break ;case FILE_STREAM_INFORMATION : fixed_len =FILE_STREAM_INFORMATION_SIZE ;break ;
fs/smb/server/smb2pdu.h +1 -0
@@ -197,6 +197,7 @@ struct file_sparse {#define FILE_ALLOCATION_INFORMATION_SIZE 19#define FILE_END_OF_FILE_INFORMATION_SIZE 20#define FILE_ALTERNATE_NAME_INFORMATION_SIZE 8 +#define FILE_NORMALIZED_NAME_INFORMATION_SIZE 8#define FILE_STREAM_INFORMATION_SIZE 32#define FILE_PIPE_INFORMATION_SIZE 23#define FILE_PIPE_LOCAL_INFORMATION_SIZE 24
# Librecast Test Results
020/020 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 7.2.8-rc1-g54e8ef17140e #2 SMP PREEMPT_DYNAMIC Wed Sep 23 14:52:16 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Hi
kernel build / boot test on x86_64 (Intel).
No regressions here.
Thanks
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.2.8 release. There are 438 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 25 Sep 2026 14:05:46 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.2.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.2.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Am 23.09.2026 um 16:00 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 7.2.8 release. There are 438 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.2.8 release. There are 438 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 25 Sep 2026 14:05:46 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.2.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.2.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 7.2.8 release. There are 438 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-7.2.y
Best regards,
Pavel
Hi Greg
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.2.8 release. There are 438 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 25 Sep 2026 14:05:46 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.2.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.2.y
and the diffstat can be found below.thanks,
greg k-h
Linux version 7.2.8-rc1 tested.
Build successfully completed.
Boot successfully completed.
No dmesg regressions.
Video output normal.
Sound output normal.
Lenovo ThinkPad X1 Carbon Gen10(Intel i7-1260P(x86_64) arch linux)
[ 0.000000] Linux version 7.2.8-rc1rv-g54e8ef17140e
(takeshi@ThinkPadX1Gen10J0764) (gcc (GCC) 16.2.1 20260810, GNU ld (GNU Binutils) 2.47) #1 SMP PREEMPT_DYNAMIC Thu Sep 24 19:15:39 JST 2026
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.2.8 release. There are 438 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 25 Sep 2026 14:05:46 +0000. Anything received after that time might be too late.
7.2.8-rc1 compiles on x86_64 (Xeon E5-1620 v2, Slackware64-15.0), and boots & runs on x86_64 (AMD Ryzen 5 7520U, Slackware64-current). No regressions observed during boot & my custom tests.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.2.8 release. There are 438 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 25 Sep 2026 14:05:46 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.2.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.2.y
and the diffstat can be found below.thanks,
greg k-h
Tested rc1 against the Fedora build system (aarch64, ppc64le, s390x, x86_64), and boot tested x86_64. No regressions noted.
Build tested in our x86 config successfully without error.
Best Regards
Wentao Guan
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.2.8 release. There are 438 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Build and boot tested with QEMU for x86_64, i386, arm64, and riscv across multiple configurations, and boots on AMD Ryzen 7 5800H. No regressions observed.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.2.8 release. There are 438 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 25 Sep 2026 14:05:46 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.2.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.2.y
and the diffstat can be found below.thanks,
greg k-h
On 3 amd64 systems and 1 arm64 virtual machine, I tested 7.2.7 + stable-queue as of commit b1b54c5d771a22b69e435ef44b5fe9ac1e714703 ("drop 3 patches and reorder one 6.18 patch based on RC review feedback").
Working well, no regressions observed.
Signature · 1 line
-Barry K. Nathan <[email protected]>