summaryrefslogtreecommitdiff
path: root/drivers/scsi/fnic/fnic_fcs.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-13scsi: fnic: Move fnic_fnic_flush_tx() to a work queueLee Duncan1-2/+3
Rather than call 'fnic_flush_tx()' from interrupt context we should be moving it onto a work queue to avoid any locking issues. Fixes: 1a1975551943 ("scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock") Co-developed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Lee Duncan <lduncan@suse.com> Link: https://lore.kernel.org/r/ce5ffa5d0ff82c2b2e283b3b4bff23291d49b05c.1707500786.git.lduncan@suse.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-12-14scsi: fnic: Add and improve log messagesKaran Tilak Kumar1-28/+35
Add link related log messages in fnic_fcs.c, Improve log message in fnic_fcs.c, Add log message in vnic_dev.c. Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20231211173617.932990-4-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-09-27scsi: fnic: Clean up some inconsistent indentingJiapeng Chong1-5/+6
No functional modification involved. drivers/scsi/fnic/fnic_fcs.c:152 fnic_handle_link() warn: inconsistent indenting. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6678 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/20230922100657.14566-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-06-10treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_168.RULE ↵Thomas Gleixner1-13/+1
(part 1) Based on the normalized pattern: this program is free software you may redistribute it and/or modify it under the terms of the gnu general public license as published by the free software foundation version 2 of the license the software is provided as is without warranty of any kind express or implied including but not limited to the warranties of merchantability fitness for a particular purpose and noninfringement in no event shall the authors or copyright holders be liable for any claim damages or other liability whether in an action of contract tort or otherwise arising from out of or in connection with the software or the use or other dealings in the software extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-30scsi: fnic: Remove bogus ratelimit messagesLee Duncan1-6/+8
Commit b43abcbbd5b1 ("scsi: fnic: Ratelimit printks to avoid flooding when vlan is not set by the switch.i") added printk_ratelimit() in front of a couple of debug-mode messages to reduce logging overrun when debugging the driver. The code: > if (printk_ratelimit()) > FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, > "Start VLAN Discovery\n"); ends up calling printk_ratelimit() quite often, triggering many kernel messages about callbacks being supressed. The fix is to decompose FNIC_FCS_DBG(), then change the order of checks so that printk_ratelimit() is only called if driver debugging is enabled. Link: https://lore.kernel.org/r/20210323172756.5743-1-lduncan@suse.com Reviewed-by: Laurence Oberman <loberman@redhat.com> Signed-off-by: Lee Duncan <lduncan@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-03-19scsi: fnic: Kernel-doc headers must contain the function nameLee Jones1-1/+1
Fixes the following W=1 kernel build warning(s): drivers/scsi/fnic/fnic_fcs.c:308: warning: expecting prototype for Check if the Received FIP FLOGI frame is rejected(). Prototype was for is_fnic_fip_flogi_reject() instead Link: https://lore.kernel.org/r/20210317091230.2912389-19-lee.jones@linaro.org Cc: Satish Kharat <satishkh@cisco.com> Cc: Sesidhar Baddela <sebaddel@cisco.com> Cc: Karan Tilak Kumar <kartilak@cisco.com> Cc: "James E.J. Bottomley" <jejb@linux.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: linux-scsi@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-11-24scsi: fnic: Change shost_printk() to FNIC_MAIN_DBG()Karan Tilak Kumar1-1/+1
Replace shost_printk() with FNIC_MAIN_DBG() so that these log messages are controlled by fnic_log_level flag in fnic_handle_link. Link: https://lore.kernel.org/r/20201121013739.18701-1-kartilak@cisco.com Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-11-24scsi: fnic: Avoid looping in TRANS ETH on unloadKaran Tilak Kumar1-0/+2
Avoid looping in fnic_scsi_abort_io() before sending fw reset when fnic is in TRANS ETH state and when we have not received any link events. Link: https://lore.kernel.org/r/20201121012145.18522-1-kartilak@cisco.com Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-11-24scsi: fnic: Change shost_printk() to FNIC_FCS_DBG()Karan Tilak Kumar1-3/+3
Replacing shost_printk with FNIC_FCS_DBG() so that these log messages are controlled by fnic_log_level flag in fnic_fip_handler_timer. Bumping up version number from 47 to 49 to maintain same level as internal version. Link: https://lore.kernel.org/r/20201120220712.16708-1-kartilak@cisco.com Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-09-03scsi: fnic: Remove set but not used 'eth_hdrs_stripped'Jason Yan1-3/+0
This addresses the following gcc warning with "make W=1": drivers/scsi/fnic/fnic_fcs.c: In function ‘fnic_rq_cmpl_frame_recv’: drivers/scsi/fnic/fnic_fcs.c:840:15: warning: variable ‘eth_hdrs_stripped’ set but not used [-Wunused-but-set-variable] 840 | unsigned int eth_hdrs_stripped; | ^~~~~~~~~~~~~~~~~ Link: https://lore.kernel.org/r/20200831081126.3251288-5-yanaijie@huawei.com Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Jason Yan <yanaijie@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-09-03scsi: fnic: Remove set but not used 'fr_len'Jason Yan1-2/+0
This addresses the following gcc warning with "make W=1": drivers/scsi/fnic/fnic_fcs.c: In function ‘fnic_fcoe_send_vlan_req’: drivers/scsi/fnic/fnic_fcs.c:379:6: warning: variable ‘fr_len’ set but not used [-Wunused-but-set-variable] 379 | int fr_len; | ^~~~~~ Link: https://lore.kernel.org/r/20200831081126.3251288-4-yanaijie@huawei.com Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Jason Yan <yanaijie@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-09-03scsi: fnic: Remove set but not used variable in is_fnic_fip_flogi_reject()Jason Yan1-4/+0
This addresses the following gcc warning with "make W=1": drivers/scsi/fnic/fnic_fcs.c: In function ‘is_fnic_fip_flogi_reject’: drivers/scsi/fnic/fnic_fcs.c:317:9: warning: variable ‘els_len’ set but not used [-Wunused-but-set-variable] 317 | size_t els_len = 0; | ^~~~~~~ drivers/scsi/fnic/fnic_fcs.c:312:21: warning: variable ‘els_dtype’ set but not used [-Wunused-but-set-variable] 312 | enum fip_desc_type els_dtype = 0; | ^~~~~~~~~ Link: https://lore.kernel.org/r/20200831081126.3251288-3-yanaijie@huawei.com Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Jason Yan <yanaijie@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-08-30scsi: fnic: print port speed only at driver init or speed changeJohn Pittman1-4/+10
Port speed printing was added by commit d948e6383ec3 ("scsi: fnic: Add port speed stat to fnic debug stats"). As currently configured, this will cause the port speed to be printed to syslog every 2 seconds. To prevent log spamming, only print the vnic port speed at driver initialization and if the speed changes. Also clean up a small typo in fnic_trace.c. Fixes: d948e6383ec3 ("scsi: fnic: Add port speed stat to fnic debug stats") Signed-off-by: John Pittman <jpittman@redhat.com> Reviewed-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-01-23scsi: fnic: Add port speed stat to fnic debug statsSatish Kharat1-0/+6
This patch adds the current fnic port speed stat to fnic debug stats. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-01-23scsi: fnic: support to display 20G port speedSatish Kharat1-0/+4
This patch is to add fnic 20G port speed display in sysfs. [mkp: typo] Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-10-18scsi: fnic: switch to generic DMA APIChristoph Hellwig1-23/+18
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-01-17scsi: fnic: use kzalloc in fnic_fcoe_process_vlan_respRasmus Villemoes1-3/+1
This saves a little .text and gets rid of the unmotivated line break and the sizeof(...) style inconsistency. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-07-06Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds1-0/+24
Pull SCSI updates from James Bottomley: "This is mostly updates of the usual suspects: lpfc, qla2xxx, bnx2fc, qedf, hpsa, hisi_sas, smartpqi, cxlflash, aacraid, csiostor along with a host of minor and miscellaneous changes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (276 commits) qla2xxx: Fix NVMe entry_type for iocb packet on BE system scsi: qla2xxx: avoid unused-function warning scsi: snic: fix a couple of spelling mistakes/typos scsi: qla2xxx: fix a bunch of typos and spelling mistakes scsi: lpfc: don't double count abort errors scsi: lpfc: spin_lock_irq() is not nestable scsi: hisi_sas: optimise DMA slot memory scsi: ibmvfc: constify dev_pm_ops structures. scsi: ibmvscsi: constify dev_pm_ops structures. scsi: cxlflash: Update debug prints in reset handlers scsi: cxlflash: Update send_tmf() parameters scsi: cxlflash: Avoid double free of character device scsi: Add STARGET_CREATED_REMOVE state to scsi_target_state scsi: ses: do not add a device to an enclosure if enclosure_add_links() fails. scsi: ufs: flush eh_work when eh_work scheduled. scsi: qla2xxx: Protect access to qpair members with qpair->qp_lock scsi: sun_esp: fix device reference leaks scsi: fnic: changing queue command to return result DID_IMM_RETRY when rport is init scsi: fnic: correct speed display and add support for 25,40 and 100G scsi: fnic: added timestamp reporting in fnic debug stats ...
2017-06-28scsi: fnic: correct speed display and add support for 25,40 and 100GSatish Kharat1-0/+24
Setting speed based on the vinc device parameter read during linkup. Also adding support to display 25,40 and 100G Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-06-16networking: make skb_push & __skb_push return void pointersJohannes Berg1-4/+3
It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer was used directly, all done with the following spatch: @@ expression SKB, LEN; typedef u8; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) @@ expression SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - fn(SKB, LEN)[0] + *(u8 *)fn(SKB, LEN) Note that the last part there converts from push(...)[0] to the more idiomatic *(u8 *)push(...). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16networking: make skb_pull & friends return void pointersJohannes Berg1-1/+1
It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer was used directly, all done with the following spatch: @@ expression SKB, LEN; typedef u8; identifier fn = { skb_pull, __skb_pull, skb_pull_inline, __pskb_pull_tail, __pskb_pull, pskb_pull }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_pull, __skb_pull, skb_pull_inline, __pskb_pull_tail, __pskb_pull, pskb_pull }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-23scsi: fnic: bug fix for fip.fip_subcode in fnic_fcoe_send_vlan_reqSatish Kharat1-1/+1
This is a bug introduced when they moved the fip subcodes to central place. Was sending FIP_SC_VL_NOTE in fip.fip_subcode for VLAN request in fnic_fcoe_send_vlan_req. Change is to use FIP_SC_VL_REQ instead. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-03-23scsi: fnic: Ratelimit printks to avoid flooding when vlan is not set by the ↵Satish Kharat1-8/+13
switch.i This is to avoid the log from being filled with vlan discovery messages when there is no vlan configured on the switch. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-07-21fnic: pci_dma_mapping_error() doesn't return an error codeDan Carpenter1-4/+4
pci_dma_mapping_error() returns true on error and false on success. Fixes: fd6ddfa4c1dd ('fnic: check pci_map_single() return value') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-07-14fcoe: use enum for fip_modeHannes Reinecke1-1/+1
The FIP mode is independent on the FIP state machine, so use a separate enum for that instead of overloading it with state machine values. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-07-14fc_fip: Update to latest FC-BB-6 draftHannes Reinecke1-2/+2
Update to latest FC-BB-6 draft to include FIP VN2VN VLAN notifications and additional flags. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-10-27fnic: check pci_map_single() return valueMaurizio Lombardi1-8/+38
the kernel prints some warnings when compiled with CONFIG_DMA_API_DEBUG. This is because the fnic driver doesn't check the return value of pci_map_single(). [ 11.942770] scsi host12: fnic [ 11.950811] ------------[ cut here ]------------ [ 11.950818] WARNING: at lib/dma-debug.c:937 check_unmap+0x47b/0x920() [ 11.950821] fnic 0000:0c:00.0: DMA-API: device driver failed to check map error[device address=0x0000002020a30040] [size=44 bytes] [mapped as single] Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed By: Tomas Henzl <thenzl@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2014-11-20Fnic: For Standalone C series, "sending VLAN request" message seen even if ↵Hiral Shah1-0/+5
the link is down When physical link between standalone C series and switch is down, the fip timer is not turned off and timer expiration will keep sending vlan request. It can be fixed by stopping the fip_timer and it will be restarted automatically when Link is up. - Increment fnic version from 1.6.0.14 to 1.6.0.15 Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Anil Chintalapati <achintal@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-16fnic: assign FIP_ALL_FCF_MACS to fcoe_all_fcfsHiral Shah1-2/+3
1) Assgning FIP_ALL_FCF_MACS to fcoe_all_fcfs allows VLAN request to be sent to correct Mac address for VLAN Discovery otherwise VLAN request will be sent to invalid address hence FLOGI never happens. 2) Simplify the copy_and_format_trace_data code and log the correct Link event for fnic control path tracing in case of link status UP->UP. 3) Increment Fnic driver version Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-05-19fnic: fnic Control Path Trace UtilityHiral Shah1-2/+54
Fnic Ctlr Path Trace utility is a tracing functionality built directly into fnic driver to trace the control path frames like discovery, FLOGI request/reply, PLOGI request/reply, link event etc. It will be one trace file for all fnics. It will help us to debug and resolve the discovery and initialization related issues in more convenient way. This trace information includes time stamp, Host Number, Frame type, Frame Length and Frame. By default,64 pages are allocated but we can change the number of allocated pages by module parameter fnic_fc_trace_max_page. Each entry is of 256 byte and available entries are depends on allocated number of pages. We can turn on or off the fnic control path trace functionality by module paramter fc_trace_enable and/or reset the trace contain by module paramter fc_trace_clear. Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-05-19fnic: NoFIP solicitation frame in NONFIP mode and changed IO Throttle countHiral Shah1-5/+0
This patch contains following three minor fixes. 1) During Probe, fnic was sending FIP solicitation in Non FIP mode which is not expected, setting the internal fip state to Non FIP mode explicitly, avoids sending FIP frame. 2) When target goes offline, all outstanding IOs belong to the target will be terminated by driver, If the termination count is high, then it influences firmware responsiveness. To improve the responsiveness, default IO throttle count is reduced to 256. 3) Accessing Virtual Fabric Id (vfid) and fc_map of Fibre-Channel Forwarder(FCF) is invalid in fnic driver when Clear Virtual Link(CVL) is received prior to receiving flogi reject from switch. As CVL clears all FCFs. Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Narsimhulu Musini <nmusini@cisco.com> Signed-off-by: Anantha Tungarakodi <atungara@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2013-11-10Merge tag 'fcoe-3.13' into for-linusJames Bottomley1-3/+3
Pull Request for 3.13 for FCOE tree. Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-10-25[SCSI] fnic: Fnic Statistics CollectionHiral Patel1-0/+12
This feature gathers active and cumulative per fnic stats for io, abort, terminate, reset, vlan discovery path and it also includes various important stats for debugging issues. It also provided debugfs and ioctl interface for user to retrieve these stats. It also provides functionality to reset cumulative stats through user interface. Signed-off-by: Hiral Patel <hiralpat@cisco.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-10-14scsi: Convert uses of compare_ether_addr to ether_addr_equalJoe Perches1-3/+3
Preliminary to removing compare_ether_addr altogether: Use the new bool function ether_addr_equal to add some clarity and reduce the likelihood for misuse of compare_ether_addr for sorting. Done via cocci script: $ cat compare_ether_addr.cocci @@ expression a,b; @@ - !compare_ether_addr(a, b) + ether_addr_equal(a, b) @@ expression a,b; @@ - compare_ether_addr(a, b) + !ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) == 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) != 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) == 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) != 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !!ether_addr_equal(a, b) + ether_addr_equal(a, b) Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Robert Love <robert.w.love@intel.com>
2013-05-02[SCSI] fnic: Kernel panic due to FIP mode misconfigurationHiral Patel1-0/+6
If switch configured in FIP and adapter configured in non-fip mode, driver panics while queueing FIP frame in non-existing fip_frame_queue. Added config check before queueing FIP frame in misconfiguration case to avoid kernel panic. Signed-off-by: Hiral Patel <hiralpat@cisco.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-05-02[SCSI] fnic: FIP VLAN Discovery Feature SupportHiral Patel1-2/+556
FIP VLAN discovery discovers the FCoE VLAN that will be used by all other FIP protocols as well as by the FCoE encapsulation for Fibre Channel payloads on the established virtual link. One of the goals of FC-BB-5 was to be as nonintrusive as possible on initiators and targets, and therefore FIP VLAN discovery occurs in the native VLAN used by the initiator or target to exchange Ethernet traffic. The FIP VLAN discovery protocol is the only FIP protocol running on the native VLAN; all other FIP protocols run on the discovered FCoE VLANs. If an administrator has manually configured FCoE VLANs on ENodes and FCFs, there is no need to use this protocol. FIP and FCoE will run over the configured VLANs. An ENode without FCoE VLANs configuration would use this automated discovery protocol to discover over which VLANs FCoE is running. The ENode sends a FIP VLAN discovery request to a multicast MAC address called All-FCF-MACs, which is a multicast MAC address to which all FCFs listen. All FCFs that can be reached in the native VLAN of the ENode are expected to respond on the same VLAN with a response that lists one or more FCoE VLANs that are available for the ENode's VN_Port login. This protocol has the sole purpose of allowing the ENode to discover all the available FCoE VLANs. Now the ENode may enable a subset of these VLANs for FCoE Running the FIP protocol in these VLANs on a per VLAN basis. And FCoE data transactions also would occur on this VLAN. Hence, Except for FIP VLAN discovery, all other FIP and FCoE traffic runs on the selected FCoE VLAN. Its only the FIP VLAN Discovery protocol that is permitted to run on the Default native VLAN of the system. [**** NOTE ****] We are working on moving this feature definitions and functionality to libfcoe module. We need this patch to be approved, as Suse is looking forward to merge this feature in SLES 11 SP3 release. Once this patch is approved, we will submit patch which should move vlan discovery feature to libfoce. [Fengguang Wu <fengguang.wu@intel.com>: kmalloc cast removal] Signed-off-by: Anantha Prakash T <atungara@cisco.com> Signed-off-by: Hiral Patel <hiralpat@cisco.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-29[SCSI] fnic: fix for trusted cosHiral Patel1-2/+4
Modified fnic driver to let hardware insert the COS value. Set bit in descriptor to 0 telling hardware to use its lif COS configurations to insert the COS value in the frames. Signed-off-by: Narsimhulu Musini <nmusini@cisco.com> Signed-off-by: Hiral Patel <hiralpat@cisco.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-03-31Fix common misspellingsLucas De Marchi1-1/+1
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2010-04-11[SCSI] fnic: Change fnic_flush_tx() to flush tx instead of rx queueBrian Uchino1-1/+1
fnic_flush_tx() is used to send frames held while fabric login is in progress. The frames are held in tx_queue, but fnic_flush_tx() was incorrectly flushing from recv_queue which is used for received frames. Signed-off-by: Brian Uchino <buchino@cisco.com> Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo1-0/+1
implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2009-12-04[SCSI] fnic: Add FIP support to the fnic driverJoe Eykholt1-261/+238
Use libfcoe as a common FIP implementation with fcoe. FIP or non-FIP mode is fully automatic if the firmware supports and enables it. Even if FIP is not supported, this uses libfcoe for the non-FIP handling of FLOGI and its response. Use the new lport_set_port_id() notification to capture successful FLOGI responses and port_id resets. While transitioning between Ethernet and FC mode, all rx and tx FC frames are queued. In Ethernet mode, all frames are passed to the exchange manager to capture FLOGI responses. Change to set data_src_addr to the ctl_src_addr whenever it would have previously been zero because we're not logged in. This seems safer so we'll never send a frame with a 0 source MAC. This also eliminates a special case for sending FLOGI frames. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-23[SCSI] fcoe, fnic, libfc: modifies current code paths to use EM anchor listVasu Dev1-1/+1
Modifies current code to use EM anchor list in EM allocation, EM free, EM reset, exch allocation and exch lookup code paths. 1. Modifies fc_exch_mgr_alloc to accept EM match function and then have allocated EM added to the lport using fc_exch_mgr_add API while also updating EM kref for newly added EM. 2. Updates fc_exch_mgr_free API to accept only lport pointer instead EM and then have this API free all EMs of the lport from EM anchor list. 3. Removes single lport pointer link from the EM, which was used in associating lport pointer in newly allocated exchange. Instead have lport pointer passed along new exchange allocation call path and then store passed lport pointer in newly allocated exchange, this will allow a single EM instance to be used across more than one lport and used in EM reset to reset only lport specific exchanges. 4. Modifies fc_exch_mgr_reset to reset all EMs from the EM anchor list of the lport, adds additional exch lport pointer (ep->lp) check for shared EM case to reset exchange specific to a lport requested reset. 5. Updates exch allocation API fc_exch_alloc to use EM anchor list and its anchor match func pointer. The fc_exch_alloc will walk the list of EMs until it finds a match, a match will be either null match func pointer or call to match function returning true value. 6. Updates fc_exch_recv to accept incoming frame on local port using only lport pointer and frame pointer without specifying EM instance of incoming frame. Instead modified fc_exch_recv to locate EM for the incoming frame by matching xid of incoming frame against a EM xid range. This change was required to use EM list in libfc Rx path and after this change the lport fc_exch_mgr pointer emp is not needed anymore, so removed emp pointer. 7. Updates fnic for removed lport emp pointer and above modified libfc APIs fc_exch_recv, fc_exch_mgr_alloc and fc_exch_mgr_free. 8. Removes exch_get and exch_put from libfc_function_template as these are no longer needed with EM anchor list and its match function use. Also removes its default function fc_exch_get. A defect this patch introduced regarding the libfc initialization order in the fnic driver was fixed by Joe Eykholt <jeykholt@cisco.com>. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-05-14[SCSI] fnic: Add new Cisco PCI-Express FCoE HBAAbhijeet Joglekar1-0/+742
fnic is a driver for the Cisco PCI-Express FCoE HBA Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com> Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>