History log of /linux-master/drivers/scsi/qedf/qedf.h
Revision Date Author Comments
# ade4fb94 02-Oct-2023 Hannes Reinecke <hare@suse.de>

scsi: qedf: Use FC rport as argument for qedf_initiate_tmf()

When sending a TMF we're only concerned with the rport and the LUN ID, so
use struct fc_rport as argument for qedf_initiate_tmf().

Signed-off-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20231002154328.43718-5-hare@suse.de
Cc: Saurav Kashyap <skashyap@marvell.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 11443b53 22-Aug-2023 Yue Haibing <yuehaibing@huawei.com>

scsi: qedf: Remove unused declaration

This declaration was never implemented, remove it.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20230822143338.19120-1-yuehaibing@huawei.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# a33e7925 18-Feb-2022 Bart Van Assche <bvanassche@acm.org>

scsi: qedf: Stop using the SCSI pointer

Set .cmd_size in the SCSI host template instead of using the SCSI pointer
from struct scsi_cmnd. Remove the CMD_SCSI_STATUS() assignment because the
assigned value is not used.

This patch prepares for removal of the SCSI pointer from struct scsi_cmnd.

Link: https://lore.kernel.org/r/20220218195117.25689-30-bvanassche@acm.org
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 232cb469 12-Oct-2021 Bart Van Assche <bvanassche@acm.org>

scsi: qedf: Switch to attribute groups

struct device supports attribute groups directly but does not support
struct device_attribute directly. Hence switch to attribute groups.

Link: https://lore.kernel.org/r/20211012233558.4066756-38-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# fb09a1ed 04-Oct-2021 Shai Malin <smalin@marvell.com>

qed: Remove e4_ and _e4 from FW HSI

The existing qed/qede/qedr/qedi/qedf code uses chip-specific naming in
structures, functions, variables and defines in FW HSI (Hardware
Software Interface).

The new FW version introduced a generic naming convention in HSI
in-which the same code will be used across different versions
for simpler maintainability. It also eases in providing support for
new features.

With this patch every "_e4" or "e4_" prefix or suffix is not needed
anymore and it will be removed.

Reviewed-by: Manish Rangankar <mrangankar@marvell.com>
Reviewed-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Omkar Kulkarni <okulkarni@marvell.com>
Signed-off-by: Shai Malin <smalin@marvell.com>
Signed-off-by: Prabhakar Kushwaha <pkushwaha@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 4aab946f 31-Mar-2021 Javed Hasan <jhasan@marvell.com>

scsi: qedf: Enable devlink support

Devlink instance lifetime was linked to qed_dev object. That caused devlink
to be recreated on each recovery.

Change it by making higher level driver (qede) responsible for lifetime
management. This way devlink survives recoveries.

qede now stores devlink structure pointer as a part of its device object,
devlink private data contains a linkage structure, qed_devlink.

Link: https://lore.kernel.org/r/20210331164917.24662-2-jhasan@marvell.com
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# a1e9981b 01-Apr-2021 Tian Tao <tiantao6@hisilicon.com>

scsi: qedf: Remove unused include of linux/version.h

Remove unnecessary include of linux/version.h.

Link: https://lore.kernel.org/r/1617283618-19346-1-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# e31ac898 26-Oct-2020 Arnd Bergmann <arnd@arndb.de>

scsi: libfc: Move scsi/fc_encode.h to libfc

Most of this file is only used inside of libfc, so move it to where it is
actually used, with only fc_fill_fc_hdr() left inside of the header.

Link: https://lore.kernel.org/r/20201026160705.3706396-1-arnd@kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 55e04991 07-Sep-2020 Saurav Kashyap <skashyap@marvell.com>

scsi: qedf: Add schedule_hw_err_handler callback for fan failure

On fan failure, disable the PCI function and initiate recovery for ramrod
failure.

Link: https://lore.kernel.org/r/20200907121443.5150-7-jhasan@marvell.com
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 41715c62 07-Sep-2020 Javed Hasan <jhasan@marvell.com>

scsi: qedf: FDMI attributes correction

Correction in the FDMI attributes required for RHBA and RPA registration.

Link: https://lore.kernel.org/r/20200907121443.5150-5-jhasan@marvell.com
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# ad40f525 16-Apr-2020 Chad Dupuis <cdupuis@marvell.com>

scsi: qedf: Fix crash when MFW calls for protocol stats while function is still probing

The MFW may make a call to qed and then to qedf for protocol statistics
while the function is still probing. If this happens it's possible that
some members of the struct qedf_ctx may not be fully initialized which can
result in a NULL pointer dereference or general protection fault.

To prevent this, add a new flag call QEDF_PROBING and set it when the
__qedf_probe() function is active. Then in the qedf_get_protocol_tlv_data()
function we can check if the function is still probing and return
immediantely before any uninitialized structures can be touched.

Link: https://lore.kernel.org/r/20200416084314.18851-9-skashyap@marvell.com
Signed-off-by: Chad Dupuis <cdupuis@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# f6b172f2 16-Apr-2020 Chad Dupuis <cdupuis@marvell.com>

scsi: qedf: Add schedule recovery handler

Implement recovery handler to be used by QED to signal the need for
recovery to come out of an error condition like ramrod struck and firmware
context reset.

Link: https://lore.kernel.org/r/20200416084314.18851-8-skashyap@marvell.com
Signed-off-by: Chad Dupuis <cdupuis@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# b0c4187e 16-Apr-2020 Javed Hasan <jhasan@marvell.com>

scsi: qedf: Increase the upper limit of retry delay

Max time to hold the IO in case of SAM_STAT_TASK_SET_FULL or SAM_STAT_BUSY.

Link: https://lore.kernel.org/r/20200416084314.18851-3-skashyap@marvell.com
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# ab0a8299 16-Apr-2020 Saurav Kashyap <skashyap@marvell.com>

scsi: qedf: Keep track of num of pending flogi

If a port is brought down for an extended period of time, the fipvlan
counter gets exhausted and the driver will fall back to default VLAN 1002
and call fcoe_ctlr_link_up to log in. However, the switch will discard the
FLOGI attempt because the VLAN is now different.

Keep track of the number of FLOGI attempts and if a threshold of
QEDF_FLOGI_RETRY_CNT is exceeded, perform a context soft reset.

Link: https://lore.kernel.org/r/20200416084314.18851-2-skashyap@marvell.com
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# f6d63678 23-Aug-2019 Saurav Kashyap <skashyap@marvell.com>

scsi: qedf: Decrease the LL2 MTU size to 2500

Decrease the LL2 MTU size to 2500.

Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 3287e96a 01-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 440

Based on 1 normalized pattern(s):

this software is available under the terms of the gnu general public
license gpl version 2 available from the file copying in the main
directory of this source tree

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 35 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190531190115.411886531@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8b95b99c 21-Apr-2019 Saurav Kashyap <skashyap@marvell.com>

scsi: qedf: Add comment to display logging levels

Comment will help in decoding the logging level.

Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Chad Dupuis <cdupuis@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# faea5719 26-Mar-2019 Shyam Sundar <ssundar@marvell.com>

scsi: qedf: Cleanup rrq_work after QEDF_CMD_OUTSTANDING is cleared

Here is the relevant logs for the problem we are solving:

qedf_flush_active_ios:1707]:3: Flush active i/o's num=0x17 fcport=0xffff948168fbcc80 port_id=0x550200 scsi_id=0.
qedf_flush_active_ios:1708]:3: Locking flush mutex.
qedf_flush_active_ios:1758]:3: Not outstanding, xid=0xaaf, cmd_type=3 refcount=1.
qedf_flush_active_ios:1896]:3: Flushed 0x16 I/Os, active=0x1.
qedf_flush_active_ios:1901]:3: Flushed 0x16 I/Os, active=0x1 cnt=60.
qedf_send_rrq:295]:3: Sending RRQ orig io = ffffb48b8f7d7158, orig_xid = 0xaaf
qedf_initiate_els:37]:3: Sending ELS
qedf_initiate_els:68]:3: initiate_els els_req = 0xffffb48b8f6d3098 cb_arg = ffff948fd5e4de80 xid = 4c6
qedf_init_mp_req:2172]:3: Entered.
qedf_init_mp_task:727]:3: Initializing MP task for cmd_type=4
qedf_initiate_els:134]:3: Ringing doorbell for ELS req
qedf_flush_active_ios:1901]:3: Flushed 0x16 I/Os, active=0x2 cnt=20.
qedf_cmd_timeout:96]:3: ELS timeout, xid=0x4c6.
qedf_rrq_compl:186]:3: Entered.
qedf_rrq_compl:204]:3: rrq_compl: orig io = ffffb48b8f7d7158, orig xid = 0xaaf, rrq_xid = 0x4c6, refcount=1
qedf_flush_active_ios:1935]:3: Unlocking flush mutex.
qedf_upload_connection:1579]:3: Uploading connection port_id=550200.

We found an ABTS command for which CMD_OUTSTANDING was cleared (line 3).
For this command, delayed send_rrq was queued, but would take 10 secs to
execute. Adding capability to detect that (based on io_req->state that is
being introduced), and attempt to cancel rrq_work. If we succeed, we drop
the reference and free the io_req. If we cannot, then the els will get sent
out and we will wait for 10 secs for it to complete.

Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# a66c6cd2 26-Mar-2019 Chad Dupuis <cdupuis@marvell.com>

scsi: qedf: Wait for upload and link down processing during soft ctx reset

- Wait for all the connections to get uploaded.

Signed-off-by: Chad Dupuis <cdupuis@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 96b1765a 26-Mar-2019 Chad Dupuis <cdupuis@marvell.com>

scsi: qedf: Use a separate completion for cleanup commands

- If a TMF and cleanup are issued at the same time they could cause a call
trace if issued against the same xid as the io_req->tm_done completion
is used for both.

- Set and clear cleanup bit in cleanup routine.

Signed-off-by: Chad Dupuis <cdupuis@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 69ef2c69 26-Mar-2019 Saurav Kashyap <skashyap@marvell.com>

scsi: qedf: Modify abort and tmf handler to handle edge condition and flush

An I/O can be in any state when flush is called, it can be in abort,
waiting for abort, RRQ send and waiting or TMF send.

- HZ can be different on different architecture, correctly set abort
timeout value.

- Flush can complete the I/Os prematurely, handle refcount for aborted
I/Os and for which RRQ is pending.

- Differentiate LUN/TARGET reset, as cleanup needs to be send to firmware
accordingly.

- Add flush mutex to sync cleanup call from abort and flush routine.

- Clear abort/outstanding bit on timeout.

Signed-off-by: Shyam Sundar <shyam.sundar@marvell.com>
Signed-off-by: Chad Dupuis <cdupuis@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 5d5e5565 26-Mar-2019 Shyam Sundar <ssundar@marvell.com>

scsi: qedf: Modify flush routine to handle all I/Os and TMF

The purpose of flush routine is to cleanup I/Os to the firmware and
complete them to scsi middle layer. This routine is invoked before
connection is uploaded because of rport going away.

- Don't process any I/Os, aborts, TMFs coming when flush in progress.

- Add flags to handle cleanup and release of I/Os because flush can
prematurely complete I/Os.

- Original command can get completed to driver when cleanup for same is
posted to firmware, handle this condition.

- Modify flush to handle I/Os in all the states like abort, TMF, RRQ and
timeouts.

Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Chad Dupuis <cdupuis@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 3e2c11b3 26-Mar-2019 Chad Dupuis <cdupuis@marvell.com>

scsi: qedf: Simplify s/g list mapping

When mapping the pages from a scatter/gather list from the SCSI layer we
only need to follow these rules:

- Max SGEs for each I/O request is 256
- No size limit on each SGE
- No need to split OS provided SGEs to 4K before sending to firmware.
- Slow SGE is applicable only when:
- There are > 8 SGEs and any middle SGE is less than a page size (4K)

Make necessary changes so that driver follows these rules. Applicable only
for Write requests (not for Read requests). No need to check SGE address
alignment requirements (first, middle or last) before declaring slow SGE.

Signed-off-by: Chad Dupuis <cdupuis@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 650ce64c 26-Mar-2019 Chad Dupuis <cdupuis@marvell.com>

scsi: qedf: Correct xid range overlap between offloaded requests and libfc requests

There is currently an overlap where exchange IDs between what is used for
offloaded commands and by libfc for ELS commands. Correct this so that
exchange ID range is:

Offloaded requests: 0 to 0xfff
libfc requests: 0x1000 to 0xfffe

Signed-off-by: Chad Dupuis <cdupuis@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 8673daf4 22-May-2018 Chad Dupuis <chad.dupuis@cavium.com>

qedf: Add get_generic_tlv_data handler.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 642a0b37 22-May-2018 Chad Dupuis <chad.dupuis@cavium.com>

qedf: Add support for populating ethernet TLVs.

This patch adds callbacks for providing the ethernet protocol driver TLVs.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 5d1c8b5b 25-Apr-2018 Chad Dupuis <chad.dupuis@cavium.com>

scsi: qedf: Update copyright for 2018

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 4b9b7fab 25-Apr-2018 Chad Dupuis <chad.dupuis@cavium.com>

scsi: qedf: Improve firmware debug dump handling

Get all firmware debug data instead of just a grc dump.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 84b2ba6e 25-Apr-2018 Chad Dupuis <chad.dupuis@cavium.com>

scsi: qedf: Honor priority from DCBX FCoE App tag

We currently hard code the priority in the 8021q tag to 3 for FCoE
traffic. The vast majority of the time this is fine but if the priority
is something else besides 3, any VLAN ID comparison either in the
non-offload path or offload path will fail and cause dropped frames
where none are expected.

Change the behavior so that the driver default is 3 if we do not get any
DCBX convergence.

If DCBX does converge, then set the FIP/FCoE priority in the following
manner:

1. If the qedf_default_prio modparam is set use that
2. If the DCBX FCoE priority is not in range (0..7) use 3
3. Use the DCBX FCoE priority we get in the driver's DCBX handler

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 44c7c859 25-Apr-2018 Chad Dupuis <chad.dupuis@cavium.com>

scsi: qedf: Synchronize rport restarts when multiple ELS commands time out

If multiple ELS commands time out, such as aborts, they could all try to
restart the same rport and the same time. This could mean multiple
multiple processes trying to clean up any outstanding commands or trying
to upload the same port.

Add a new flag (QEDF_RPORT_IN_RESET) and check other fcport state flags
before trying to reset the port.

Fixes the crash:

[17501.824701] ------------[ cut here ]------------
[17501.824733] kernel BUG at include/asm-generic/dma-mapping-common.h:65!
[17501.824760] invalid opcode: 0000 [#1] SMP
[17501.824781] Modules linked in: xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter ses enclosure dm_service_time vfat fat sb_edac edac_core intel_powerclamp coretemp intel_rapl iosf_mbi kvm_intel kvm irqbypass joydev btrfs hpilo raid6_pq iTCO_wdt iTCO_vendor_support xor hpwdt ipmi_ssif sg crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul ioatdma lpc_ich glue_helper ablk_helper i2c_i801 shpchp cryptd ipmi_si pcspkr acpi_power_meter ipmi_devintf pcc_cpufreq dca wmi ipmi_msghandler dm_multipath nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c sr_mod cdrom sd_mod
[17501.825119] crc_t10dif crct10dif_generic mgag200 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm qedf(OE) drm libfcoe ahci qedi(OE) crct10dif_pclmul libfc libahci uio crct10dif_common crc32c_intel libiscsi libata scsi_transport_iscsi scsi_transport_fc tg3 qede(OE) scsi_tgt hpsa qed(OE) i2c_core ptp scsi_transport_sas pps_core iscsi_boot_sysfs dm_mirror dm_region_hash dm_log dm_mod
[17501.825292] CPU: 8 PID: 10531 Comm: kworker/u96:1 Tainted: G OE ------------ 3.10.0-693.el7.x86_64 #1
[17501.825330] Hardware name: HP ProLiant DL380 Gen9/ProLiant DL380 Gen9, BIOS P89 06/02/2016
[17501.825372] Workqueue: fc_rport_eq fc_rport_work [libfc]
[17501.825395] task: ffff88101bca8000 ti: ffff881025278000 task.ti: ffff881025278000
[17501.825424] RIP: 0010:[<ffffffffc042def9>] [<ffffffffc042def9>] qedf_unmap_sg_list.isra.15+0x89/0x90 [qedf]
[17501.825471] RSP: 0018:ffff88102527bb98 EFLAGS: 00010212
[17501.825493] RAX: ffff8800224eac00 RBX: ffffc9000cd05210 RCX: 0000000000001000
[17501.825520] RDX: 000000007e655e40 RSI: 0000000000001000 RDI: ffff88107fe3b098
[17501.826683] RBP: ffff88102527bba0 R08: ffffffff81a13200 R09: 0000000000000286
[17501.827747] R10: 0000000000000004 R11: 0000000000000005 R12: ffffc9000cd051b8
[17501.828804] R13: ffff881037640c28 R14: 0000000000000007 R15: ffffc9000cd05200
[17501.829850] FS: 0000000000000000(0000) GS:ffff88103fa00000(0000) knlGS:0000000000000000
[17501.830910] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[17501.831966] CR2: 00007f9b94005f38 CR3: 00000000019f2000 CR4: 00000000003407e0
[17501.833027] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[17501.834087] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[17501.835142] Stack:
[17501.836201] ffff881033ddbb80 ffff88102527bc30 ffffffffc042f834 0000000000002710
[17501.837264] ffff88102527bbd0 ffffffff8133d9dd ffffc9000cd052a0 ffff88102527bc30
[17501.838325] ffffffff816a9c65 0000000000000001 ffff88101bca8000 ffffffff810c4810
[17501.839388] Call Trace:
[17501.840446] [<ffffffffc042f834>] qedf_scsi_done+0x54/0x1d0 [qedf]
[17501.841504] [<ffffffff8133d9dd>] ? list_del+0xd/0x30
[17501.842537] [<ffffffff816a9c65>] ? wait_for_completion_timeout+0x125/0x140
[17501.843560] [<ffffffff810c4810>] ? wake_up_state+0x20/0x20
[17501.844577] [<ffffffffc0430311>] qedf_initiate_cleanup+0x2e1/0x310 [qedf]
[17501.845587] [<ffffffffc04305fe>] qedf_flush_active_ios+0x10e/0x260 [qedf]
[17501.846612] [<ffffffffc042892f>] qedf_cleanup_fcport+0x5f/0x370 [qedf]
[17501.847613] [<ffffffffc04292d8>] qedf_rport_event_handler+0x398/0x950 [qedf]
[17501.848602] [<ffffffff810cdc7c>] ? dequeue_entity+0x11c/0x5d0
[17501.849581] [<ffffffff81098a2b>] ? __internal_add_timer+0xab/0x130
[17501.850555] [<ffffffff810ce54e>] ? dequeue_task_fair+0x41e/0x660
[17501.851528] [<ffffffffc03241a4>] fc_rport_work+0xf4/0x6c0 [libfc]
[17501.852490] [<ffffffff810a881a>] process_one_work+0x17a/0x440
[17501.853446] [<ffffffff810a94e6>] worker_thread+0x126/0x3c0

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 21dd79e8 27-Dec-2017 Tomer Tayar <Tomer.Tayar@cavium.com>

qed*: HSI renaming for different types of HW

This patch renames defines and structures in the FW HSI files to allow a
distinction between different types of HW.

Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: Chad Dupuis <Chad.Dupuis@cavium.com>
Signed-off-by: Manish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# cf291163 15-Aug-2017 Chad Dupuis <chad.dupuis@cavium.com>

scsi: qedf: Corrent VLAN tag insertion in fallback VLAN case.

Currently in the driver the qedf_ctx attribute vlan_hw_insert is used to
which whether to insert a VLAN tag in FIP frames (except for FIP VLAN
request which is explicitly sent out untagged at least from the driver's
point of view).

When we receive a FIP VLAN response, we set qedf->vlan_hw_insert to 0 which
makes the qedf_fip_send function insert the VLAN. However when we exhaust
our FIP VLAN retries, we do not set qedf->vlan_hw_insert to 0 which means
that the driver will not tag the FIP frame with the correct VLAN ID. The
result that was observed on the wire is that some entity either in the LL2
or L2 firmware is adding a NULL VLAN tag which can cause FIP solicitation
to fail.

The offload FCoE frame function, qedf_xmit, does not use the vlan_hw_insert
attribute to decide whether to tag frames with the FIP/FCoE VLAN. Instead
it unilaterially tags the offload frames with the VLAN ID stored in
qedf->vlan_id. This is the correct behavior so the driver can guarantee
that non-offload FIP frames go out with the correct VLAN ID.

Also use the Linux network layer helpers instead of doing the VLAN insert
manually.

Also fix setting the fallback VLAN so that it used the module parameter and
is not hardcoded to 1002 (though 1002 is the default).

[mkp: fixed typo]

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# a3cd42a9 15-Aug-2017 Chad Dupuis <chad.dupuis@cavium.com>

scsi: qedf: Use granted MAC from the FCF for the FCoE source address if it is available.

Currently in the driver we've been using the fc_fcoe_set_mac() function to
set the source MAC for FCoE traffic. This works well in most cases as it
uses the spec. default FCF-MAC. However, if the administrator changes the
FCF-MAC switch, then any FCoE traffic we send will be dropped by the
switch.

Instead we should check the granted MAC from the FLOGI payload and use that
address if it is present. Otherwise, fall back to using the the default
FCF-MAC and the fabric ID of the port as the FCoE MAC address.

Once this address is known we need to set it when doing non-offload
traffic, offload traffic and setting the data_src_address libfcoe uses for
FIP keep alive messages.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 722477c4 25-Jul-2017 Thomas Bogendoerfer <tbogendoerfer@suse.de>

scsi: qedf: Limit number of CQs

FCOE offloading failed with:

[qed_sp_fcoe_func_start:150(sp-0-3b:00.02)]Cannot satisfy CQ amount. CQs
requested 8, CQs available 6. Aborting function start
[qed_fcoe_start:821()]Failed to start fcoe
[__qedf_probe:3041]:6: Cannot start FCoE function.

The reason is a newly introduced check in the qed main part. This change
also provides the information about how many CQs are available, so we
simply limit the number of requested CQs..

Fixes: 3c5da9427802 ("qed: Share additional information with qedf")
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 12d0b12c 31-May-2017 Chad Dupuis <chad.dupuis@cavium.com>

scsi: qedf: Update copyright to 2017.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 0d2fc3b4 03-May-2017 Dan Carpenter <dan.carpenter@oracle.com>

scsi: qedf: Cleanup the type of io_log->op

We store sc_cmd->cmnd[0] which is an unsigned char in io_log->op so
this should also be unsigned char. The other thing is that this is
displayed in the debugfs:

seq_printf(s, "0x%02x:", io_log->op);

Smatch complains that the formatting won't work for negative values so
changing it to unsigned silences that warning as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# be086e7c 11-Mar-2017 Mintz, Yuval <Yuval.Mintz@cavium.com>

qed*: Utilize Firmware 8.15.3.0

This patch advances the qed* drivers into using the newer firmware -
This solves several firmware bugs, mostly related [but not limited to]
various init/deinit issues in various offloaded protocols.

It also introduces a major 4-Cached SGE change in firmware, which can be
seen in the storage drivers' changes.

In addition, this firmware is required for supporting the new QL41xxx
series of adapters; While this patch doesn't add the actual support,
the firmware contains the necessary initialization & firmware logic to
operate such adapters [actual support would be added later on].

Changes from Previous versions:
-------------------------------
- V2 - fix kbuild-test robot warnings

Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Manish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: Chad Dupuis <Chad.Dupuis@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 61d8658b 15-Feb-2017 Dupuis, Chad <chad.dupuis@cavium.com>

scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.

The QLogic FastLinQ Driver for FCoE (qedf) is the FCoE specific module
for 41000 Series Converged Network Adapters by QLogic. This patch
consists of following changes:

- MAINTAINERS Makefile and Kconfig changes for qedf
- PCI driver registration
- libfc/fcoe host level initialization
- SCSI host template initialization and callbacks
- Debugfs and log level infrastructure
- Link handling
- Firmware interface structures
- QED core module initialization
- Light L2 interface callbacks
- I/O request initialization
- Firmware I/O completion handling
- Firmware ELS request/response handling
- FIP request/response handled by the driver itself

Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>
Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@cavium.com>
Signed-off-by: Arun Easi <arun.easi@cavium.com>
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>