All of lore.kernel.org
 help / color / mirror / Atom feed
* [ANNOUNCE v2]: Broadcom (Emulex) FC Target driver - efct
@ 2018-12-18 18:05 James Smart
  2018-12-19 18:04 ` Aw: " Sebastian Herbszt
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: James Smart @ 2018-12-18 18:05 UTC (permalink / raw)
  To: target-devel

I'd like to announce the availability of the Broadcom (Emulex) FC target 
driver - efct.

This is the 2nd round of announcement.   In the first round, after 
discussion with community members, it was decided that the driver would 
consist of the following:
   - A SLI4-library that can be used by both an initiator driver and a 
target driver
   - A FC Discovery library that could be used by both an initiator 
driver and a target driver.
   - A SLI3-library that would be used by an initiator driver only
   - Delivery of a target driver that would support SCSI and NVME
   - Delivery of an initiator driver that would support SCSI and NVME  
(NVME on SLI-4 only).

As of this announcement the repository on gitlab 
(git@gitlab.com:jsmart/efct-Emulex_FC_Target.git)
contains:
  - the SLI-4 library
  - the FC Discovery library
  - the efct target driver that supports SCSI (lio)

Effort is underway on adding nvme target support to the efct driver, and 
after that, the initiator driver will be refactored.  The intent will be 
to move all elements into the upstream tree although it is expected the 
libraries and target components will be merged in a stage separate from 
the initiator components.

While those efforts are underway, we would like receive review comments 
on the code that is present. Comments can be sent to: 
ecd-efct.pdl@broadcom.com or myself

-- james



On 2/27/2017 3:28 PM, James Smart wrote:
> I'd like to announce the availability of the Broadcom (Emulex) FC 
> Target driver - efct.
> This driver has been part of the Emulex OneCore Storage SDK tool kit 
> for Emulex
> SLI-4 adapters. The SLI-4 adapters support 16Gb/s and higher adapters. 
> Although this
> kit has supported FCoE in the past, it is currently limited to FC 
> support.
>
> This driver provides the following:
> - Target mode operation:
>   - Functional with LIO-based interfaces
>   - Extensive use of hw offloads such as auto-xfer_rdy, auto-rsp, cmd 
> cpu spreading
>   - High login mode - thousands of logins
>   - T-10 DIF/PI support  (inline and separate)
>   - NPIV support
> - Concurrent Initiator support if needed
> - Discovery engine has F_Port and fabric services emulation.
> - Extended mgmt interfaces:
>   - firmware dump api, including dump to host memory for faster dumps
>   - Healthcheck operations and watchdogs
> - Extended driver behaviors such as:
>   - polled mode operation
>   - multi-queue: cpu, roundrobin, or priority  (but not tied  to scsi-mq)
>   - long chained sgl's
>   - extensive internal logging and statistics
>   - Tuning parameters on modes and resource allocation to different 
> features
>
> Broadcom is looking to upstream this driver and would like review and 
> feedback.
> The driver may be found at the following git repository:
> git@gitlab.com:jsmart/efct-Emulex_FC_Target.git
>
>
> Some of the key questions we have are with lpfc :
> 1) Coexistence vs integration
> Currently, the efct driver maps to a different set of PCI ids than lpfc.
> It's very clear there's an overlap with lpfc, both on SLI-4 hw as well 
> as initiator support.
> Although target mode support can be simplistically added to lpfc, what 
> we've found is
> that doing so means a lot of tradeoffs. Some of the target mode 
> features, when enabled,
> impact the initiator support and how it would operate.
>
> 2) SLI-3 support
> lpfc provides SLI-3 support so that all FC adapters are supported, 
> including the older ones.
> The form of the driver, based on its history, is SLI-3 with SLI-3 
> adapted to SLI-4 at the point
> it hits the hardware. efct does not support SLI-3.
>
> 3) complexity of configuration knobs caused by the kitchen-sink of 
> features in lpfc ?
> we are pushing the limit on needing per-instance attributes rather 
> than global module
> parameters.
>
> -- james
>
>


On 6/12/2017 4:08 PM, James Smart wrote:
> On 5/16/2017 12:59 PM, Roland Dreier wrote:
>> On Sun, Mar 5, 2017 at 8:35 AM, Sebastian Herbszt <herbszt@gmx.de> 
>> wrote:
>>> Just like Hannes I do favour integration. I guess it could be
>>> comparable to qla2xxx + tcm_qla2xxx, lpfc + lpfc_scst and
>>> lpfc + tcm_lpfc. That approach might even help Bart with his
>>> target driver unification if he didn't give up on that topic.
>> Resurrecting this old topic - sorry for not seeing this go by initially.
>>
>> For context, I have a lot of experience debugging the qla2xxx target
>> code - we did a lot of work to get error/exception paths correct.
>> Basic FC target support is pretty straightforward but handling SAN log
>> in / log out events and other strange things that initiators do took a
>> lot of effort.
>>
>> Anyway, my feeling is that the integration of tcm_qla2xxx and qla2xxx
>> was overall a net negative.  Having the target driver grafted onto the
>> side of an already-complex driver that has a bunch of code not
>> relevant to the target (SCSI error handling, logging into and timing
>> out remote target ports, etc) made the code harder to debug and harder
>> to get right.
>>
>> Of course I'm in favor of making common code really common.  So
>> certainly we should have a common library of SLI-4 code that both the
>> initiator and target driver share.  And if there is more commonality,
>> that's great.  But any code similar to "if (initiator) ... else ..."
>> is really suspect to me - grepping for "qla_ini_mode_enabled" shows
>> great examples like
>>
>> ...
>>
>> Handling "dual mode" (both initiator and target on the same port at
>> the same time) is a design challenge, but I don't think the current
>> qla2xxx driver is an example of a maintainable way to do that.
>>
>> (I'm agnostic about what to do about SLI-3 - perhaps the cleanest
>> thing to do is split the driver between SLI-4 and SLI-3, and handle
>> the initiator and target drivers for those two cases as appropriate)
>>
>> I'd love to discuss this further and come up with a design that meets
>> the concerns about integration but also learns the lessons from
>> tcm_qla2xxx.
>>
>>   - R.
>
>
> Thanks for the feedback.  I believe you echo many of our concerns as 
> we look at "merging them into one".  I agree with your statements on 
> the number of if-else roles and know that we made this even more 
> complicated by the driver doing fc-nvme initiator and fc-nvme target 
> as well.  Your small list of "mode_enabled" hits pales in comparison 
> to a hit list in the current driver if looking for SCSI initiator 
> support (LPFC_ENABLE_FCP), NVME initiator support (LPFC_ENABLE_NVME), 
> or NVME target support (phba->nvmet_support). And that's before adding 
> SCSI target support.   We're also concerned about the discovery 
> engines as not only are there lots of different paths for the 
> different roles as well as support for fcoe, but there are a lot of 
> carefully managed accommodations for various oem and switch 
> environments. It's very difficult to replicate and retest all these 
> different configurations and scenarios.
>
> Here's what I'd like to propose for a direction:
> 1) Create an initiator driver and a target driver.  For now, initiator 
> would support both SCSI and NVME initiator. Target would support SCSI 
> and NVME target.
> 2) SLI3 support would be contained only within the initiator driver 
> and limited to SCSI (as it is today in lpfc).
> 3) SLI4 support would be library-ized,so that the code can be shared 
> between the two drivers.  Library-izing SLI-4 means SLI-3 will also be 
> library-ized.
> 4) Discovery support would be librarized so it can be shared. As part 
> of this effort we will minimally move generic functions from the 
> library to drivers/scsi/libfc (example: setting RPA payloads, etc).  
> At this time, the drivers will not attempt to use libfc for discovery. 
> There is too much sensitive code tied to interlocks with adapter api 
> design that are visible in the discovery state machine. Use of libfc 
> can be a future, but for the short term, the goal is a single library 
> for the broadcom initiator/target drivers.
> 5) lpfc will be refactored, addressing concerns that have been desired 
> for a while.
>
>
> To start this effort, I'd like a bcmlpfc directory to be made within 
> the drivers staging tree. The directory would be populated with the 
> efct driver and a copy of the existing lpfc driver. Work can then 
> commence on refactoring lpfc and creating the libraries and 
> integrating the libraries into both drivers.  As lpfc is updated in 
> the main tree, patches would be posted to the staging version of lpfc 
> to keep them on par.
>
>
> Questions:
> a) How best to deal with overlapping pci id's ?  E.g. if we do (1) and 
> we have an initiator and target driver, there is a lot of adapters 
> that are fully functional for target operation, but were sold as 
> primarily an initiator adapter. How could we manage target mode 
> enablement without code mod or hard pci id partitioning ?   I know 
> individual pci unbind/bind could work, but its been frowned upon as a 
> long term option. Same thing goes for module parameters to select 
> which ports do what role.
>
> b) Assuming we have the lpfc copy in the bcmlpfc directory in the 
> staging tree: are there any issues with having a version of lpfc in 
> the main tree and another in the staging tree ?     For many reasons, 
> I'd like to keep the name lpfc on the initiator driver in the staging 
> tree. But is that possible ? I assume we would need to develop in the 
> staging tree as a new name and pci id space separate from the base 
> driver, and we can rename the staging driver to the lpfc name when it 
> merges into the main kernel and replaces the existing driver.
>
> Thoughts ? Nic ?   James ?  Martin ?
>
> -- james

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Aw: [ANNOUNCE v2]: Broadcom (Emulex) FC Target driver - efct
  2018-12-18 18:05 [ANNOUNCE v2]: Broadcom (Emulex) FC Target driver - efct James Smart
@ 2018-12-19 18:04 ` Sebastian Herbszt
  2018-12-20 11:25 ` Sebastian Herbszt
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sebastian Herbszt @ 2018-12-19 18:04 UTC (permalink / raw)
  To: target-devel

Hello James,

> I'd like to announce the availability of the Broadcom (Emulex) FC target
> driver - efct.
> 
> This is the 2nd round of announcement.   In the first round, after
> discussion with community members, it was decided that the driver would
> consist of the following:
>   - A SLI4-library that can be used by both an initiator driver and a
> target driver
>   - A FC Discovery library that could be used by both an initiator
> driver and a target driver.
>   - A SLI3-library that would be used by an initiator driver only
>   - Delivery of a target driver that would support SCSI and NVME
>   - Delivery of an initiator driver that would support SCSI and NVME 
> (NVME on SLI-4 only).
> 
> As of this announcement the repository on gitlab
> (git@gitlab.com:jsmart/efct-Emulex_FC_Target.git)
> contains:
>  - the SLI-4 library
>  - the FC Discovery library
>  - the efct target driver that supports SCSI (lio)

a lot has changed since v1:

71 files changed, 39869 insertions(+), 25695 deletions(-)

Can you maybe provide the full git history which should have tracked all
the file renaming?
Beside the split it seems there are other changes. More leftovers of the
FCoE support are gone, ddump support is no longer present and the initiator
support is not settable. Any further changes I missed?

I noticed this version does only build here on kernel 4.18. I pushed the
required changes for kernel 4.19 to my repository [1].

> Effort is underway on adding nvme target support to the efct driver, and
> after that, the initiator driver will be refactored.  The intent will be
> to move all elements into the upstream tree although it is expected the
> libraries and target components will be merged in a stage separate from
> the initiator components.

What are the plans for the "lpfc" driver? Will it use "libefc" and "libefc_sli"
or will a new (SLI4+) driver ("efci" ?) emerge?

> While those efforts are underway, we would like receive review comments
> on the code that is present. Comments can be sent to:
> ecd-efct.pdl@broadcom.com or myself
> 
> -- james

[1] https://repo.or.cz/efct-Emulex_FC_Target/sherbszt.git/shortlog/refs/heads/v2-update

Sebastian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Aw: [ANNOUNCE v2]: Broadcom (Emulex) FC Target driver - efct
  2018-12-18 18:05 [ANNOUNCE v2]: Broadcom (Emulex) FC Target driver - efct James Smart
  2018-12-19 18:04 ` Aw: " Sebastian Herbszt
@ 2018-12-20 11:25 ` Sebastian Herbszt
  2018-12-20 22:25 ` James Smart
  2018-12-22 19:38 ` Ram Kishore Vegesna
  3 siblings, 0 replies; 5+ messages in thread
From: Sebastian Herbszt @ 2018-12-20 11:25 UTC (permalink / raw)
  To: target-devel

Hello James,

> I noticed this version does only build here on kernel 4.18. I pushed the
> required changes for kernel 4.19 to my repository [1].

this patch [1] is required on 32 bit to fix

WARNING: "__udivdi3" [efct.ko] undefined!

It seems v2 contains some regressions:

My simple setup triggered this

[  167.858868] efct:efct_hw_cb_link:8556:[fc0] :Link Up, NPORT, speed is 16000
[  167.862576] efct:efct_els_req_send:96:[fc0] :send efct_send_flogi
[  167.862796] BUG: unable to handle kernel NULL pointer dereference at 0000035c
[  167.862805] *pde = 00000000 
[  167.862813] Oops: 0000 [#1] SMP PTI
[  167.862822] CPU: 1 PID: 2707 Comm: efct:0:0 Tainted: G           O      4.19.0-rc2-2.g0d9481c-default #1 openSUSE Tumbleweed (unreleased)
[  167.862829] Hardware name: FUJITSU SIEMENS ESPRIMO E           /D2164-A1, BIOS 5.00 R1.10.2164.A1               05/08/2006
[  167.862856] EIP: efct_send_flogi_p2p_acc+0x25/0x1d0 [efct]
[  167.862863] Code: 97 f8 eb da 90 3e 8d 74 26 00 55 89 e5 57 56 53 8b 42 08 89 d3 89 ce 8b 00 85 c0 74 0d f6 80 18 03 00 00 02 0f 85 2b 01 00 00 <ff> 35 5c 03 00 00 68 3c d7 97 f8 e8 cb 63 18 e0 c7 05 5c 03 00 00
[  167.862873] EAX: f2ec0000 EBX: ec3c8000 ECX: 00001802 EDX: ec3c8000
[  167.862878] ESI: 00001802 EDI: ec3c8400 EBP: eb61fd4c ESP: eb61fd40
[  167.862891] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010246
[  167.862902] CR0: 80050033 CR2: 0000035c CR3: 36700000 CR4: 000006d0
[  167.862914] Call Trace:
[  167.862947]  __efc_d_init+0x11f/0x630 [efct]
[  167.862976]  ? efc_send_ls_acc_after_attach+0x90/0x90 [efct]
[  167.863004]  efc_sm_post_event+0x11/0x30 [efct]
[  167.863033]  efc_node_post_event+0x3e/0xd0 [efct]
[  167.863062]  efc_node_recv_els_frame+0x91/0xb0 [efct]
[  167.863094]  efc_node_dispatch_frame+0x127/0x1f0 [efct]
[  167.863124]  efc_domain_dispatch_frame+0x1a1/0x2b0 [efct]
[  167.863154]  efct_unsolicited_cb+0x189/0x1a0 [efct]
[  167.863183]  ? efct_unsolicited_cb+0x189/0x1a0 [efct]
[  167.863210]  efct_hw_rqpair_process_rq+0x17b/0x2f0 [efct]
[  167.863237]  efct_hw_cq_process+0x1fd/0x310 [efct]
[  167.863263]  ? sli_eq_read+0x2e/0xd0 [efct]
[  167.863288]  ? sli_eq_read+0xab/0xd0 [efct]
[  167.863316]  efct_hw_eq_process+0x93/0x180 [efct]
[  167.863344]  efct_hw_process+0x2c/0x40 [efct]
[  167.863364]  efct_intr_thread+0xa1/0xd0 [efct]
[  167.863379]  kthread+0xf0/0x110
[  167.863398]  ? efct_teardown_msix+0x50/0x50 [efct]
[  167.863410]  ? kthread_create_worker_on_cpu+0x20/0x20
[  167.863422]  ret_from_fork+0x2e/0x40
[  167.863433] Modules linked in: nvme_fc nvme_fabrics nvmet_fc nvmet efct(O) scsi_transport_fc target_core_user uio brd target_core_pscsi target_core_file target_core_iblock target_core_mod configfs edd nfsd snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device lockd grace nfs_acl auth_rpcgss sunrpc dm_mod gpio_ich snd_hda_codec_realtek snd_hda_codec_generic iTCO_wdt iTCO_vendor_support snd_hda_intel snd_hda_codec tg3 libphy lpc_ich snd_hda_core ptp ppdev pps_core snd_hwdep hwmon snd_pcm parport_pc pcspkr floppy button snd_timer snd soundcore i2c_i801 parport sg ehci_pci i915 drm_kms_helper drm uhci_hcd ehci_hcd fb_sys_fops sysimgblt sysfillrect syscopyarea i2c_algo_bit video usbcore scsi_dh_alua scsi_dh_hp_sw scsi_dh_rdac scsi_dh_emc fan ata_generic ata_piix ahci libahci libata thermal [last unloaded: speedstep_lib]
[  167.863576] CR2: 000000000000035c
[  167.863587] ---[ end trace a869d8ef0400f630 ]---
[  167.863608] EIP: efct_send_flogi_p2p_acc+0x25/0x1d0 [efct]
[  167.863619] Code: 97 f8 eb da 90 3e 8d 74 26 00 55 89 e5 57 56 53 8b 42 08 89 d3 89 ce 8b 00 85 c0 74 0d f6 80 18 03 00 00 02 0f 85 2b 01 00 00 <ff> 35 5c 03 00 00 68 3c d7 97 f8 e8 cb 63 18 e0 c7 05 5c 03 00 00
[  167.863638] EAX: f2ec0000 EBX: ec3c8000 ECX: 00001802 EDX: ec3c8000
[  167.863648] ESI: 00001802 EDI: ec3c8400 EBP: eb61fd4c ESP: d966347c
[  167.863659] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010246
[  167.863669] CR0: 80050033 CR2: 0000035c CR3: 36700000 CR4: 000006d0

As you can see [2] "io" is NULL when it's used. This patch seems to fix it:

diff --git a/efct/efct_els.c b/efct/efct_els.c
index 524fda7..45a7198 100644
--- a/efct/efct_els.c
+++ b/efct/efct_els.c
@@ -1537,6 +1537,13 @@ efct_send_flogi_p2p_acc(struct efc_lport *efc, struct efc_node_s *node,
 
 	node_els_trace();
 
+	io = efct_els_io_alloc(node, sizeof(struct fc_plogi_payload_s),
+			       EFCT_ELS_ROLE_RESPONDER);
+
+	if (!io) {
+		efct_log_err(efct, "els IO alloc failed\n");
+		return io;
+	}
 	io->els_callback = NULL;
 	io->els_callback_arg = NULL;
 	io->display_name = "flogi_p2p_acc";


With this change I am able to use the exported volume but a read test results in

[  359.747276] WARNING: CPU: 0 PID: 3338 at /devel/efct/efct/efct_scsi.c:1341 efct_scsi_send_rd_data+0x438/0x480 [efct]
[  359.747278] Modules linked in: efct(O) nvme_fc nvme_fabrics nvmet_fc nvmet scsi_transport_fc target_core_user uio brd target_core_pscsi target_core_file target_core_iblock target_core_mod configfs nfsd lockd grace nfs_acl auth_rpcgss sunrpc edd snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device dm_mod snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel gpio_ich iTCO_wdt iTCO_vendor_support snd_hda_codec snd_hda_core tg3 snd_hwdep snd_pcm lpc_ich snd_timer snd libphy soundcore ptp i2c_i801 ppdev pps_core hwmon parport_pc ehci_pci sg parport pcspkr floppy button i915 drm_kms_helper drm fb_sys_fops sysimgblt sysfillrect syscopyarea uhci_hcd ehci_hcd usbcore i2c_algo_bit video scsi_dh_alua scsi_dh_hp_sw scsi_dh_rdac scsi_dh_emc fan ata_generic ata_piix ahci libahci libata thermal [last unloaded: efct]
[  359.747374] CPU: 0 PID: 3338 Comm: efct:0:0 Tainted: G           O      4.19.0-rc2-2.g0d9481c-default #1 openSUSE Tumbleweed (unreleased)
[  359.747376] Hardware name: FUJITSU SIEMENS ESPRIMO E           /D2164-A1, BIOS 5.00 R1.10.2164.A1               05/08/2006
[  359.747391] EIP: efct_scsi_send_rd_data+0x438/0x480 [efct]
[  359.747394] Code: b8 fc ff ff 0f 0b 8b 43 24 85 c0 0f 85 99 fc ff ff 90 0f 0b 85 f6 0f 84 8e fc ff ff 31 d2 e9 7a fc ff ff 8d b4 26 00 00 00 00 <0f> 0b e9 d3 fc ff ff 90 0f 0b e9 3d fc ff ff f6 45 ec 02 0f 85 6d
[  359.747397] EAX: 00080000 EBX: efe307b0 ECX: f50dacac EDX: 00000007
[  359.747399] ESI: f2ec8000 EDI: 00000000 EBP: eb88bda0 ESP: eb88bd74
[  359.747402] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010246
[  359.747404] CR0: 80050033 CR2: b7f26000 CR3: 3417e000 CR4: 000006d0
[  359.747407] Call Trace:
[  359.747421]  ? dma_direct_map_sg+0x55/0xa0
[  359.747424]  ? dma_direct_map_sg+0x6a/0xa0
[  359.747446]  efct_lio_queue_data_in+0x20a/0x350 [efct]
[  359.747467]  ? efct_lio_write_pending+0x280/0x280 [efct]
[  359.747472]  ? dequeue_entity+0x1ef/0xba0
[  359.747493]  efct_lio_datamove_done+0x9d/0x5b0 [efct]
[  359.747498]  ? __switch_to_asm+0x33/0x50
[  359.747501]  ? __switch_to_asm+0x27/0x50
[  359.747503]  ? __switch_to_asm+0x33/0x50
[  359.747505]  ? __switch_to_asm+0x27/0x50
[  359.747507]  ? __switch_to_asm+0x33/0x50
[  359.747510]  ? __switch_to_asm+0x27/0x50
[  359.747530]  ? efct_lio_write_pending+0x280/0x280 [efct]
[  359.747544]  efct_target_io_cb+0xc8/0x230 [efct]
[  359.747547]  ? __switch_to_asm+0x33/0x50
[  359.747549]  ? __switch_to_asm+0x27/0x50
[  359.747551]  ? __switch_to_asm+0x33/0x50
[  359.747553]  ? __switch_to_asm+0x27/0x50
[  359.747555]  ? __switch_to_asm+0x33/0x50
[  359.747569]  ? efct_scsi_check_pending+0x2b0/0x2b0 [efct]
[  359.747588]  efct_hw_wq_process_io+0x138/0x880 [efct]
[  359.747607]  ? target_wqe_timer_nop_cb+0x200/0x200 [efct]
[  359.747626]  efct_hw_wq_process+0x3b/0x130 [efct]
[  359.747645]  efct_hw_cq_process+0x1e3/0x310 [efct]
[  359.747663]  ? sli_eq_read+0x2e/0xd0 [efct]
[  359.747682]  ? sli_eq_read+0xab/0xd0 [efct]
[  359.747702]  efct_hw_eq_process+0x93/0x180 [efct]
[  359.747721]  efct_hw_process+0x2c/0x40 [efct]
[  359.747734]  efct_intr_thread+0xa1/0xd0 [efct]
[  359.747739]  kthread+0xf0/0x110
[  359.747751]  ? efct_teardown_msix+0x50/0x50 [efct]
[  359.747754]  ? kthread_create_worker_on_cpu+0x20/0x20
[  359.747757]  ret_from_fork+0x2e/0x40
[  359.747761] ---[ end trace 6a1c45757778ea22 ]---

and this is the following assertion [3]

efct_assert(io->exp_xfer_len > io->transferred, -1);

The relevant values are

xwire_len: 262144
io->exp_xfer_len: 524288
io->transferred: 524288

I was not yet able to figure out what the problem is.

[1] https://repo.or.cz/efct-Emulex_FC_Target/sherbszt.git/commitdiff/bd2b72aeb034f19be99566b3897efde4e9e24c46
[2] https://gitlab.com/jsmart/efct-Emulex_FC_Target/blob/master/efct/efct_els.c#L1512
[3] https://gitlab.com/jsmart/efct-Emulex_FC_Target/blob/master/efct/efct_scsi.c#L1341

Sebastian

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Aw: [ANNOUNCE v2]: Broadcom (Emulex) FC Target driver - efct
  2018-12-18 18:05 [ANNOUNCE v2]: Broadcom (Emulex) FC Target driver - efct James Smart
  2018-12-19 18:04 ` Aw: " Sebastian Herbszt
  2018-12-20 11:25 ` Sebastian Herbszt
@ 2018-12-20 22:25 ` James Smart
  2018-12-22 19:38 ` Ram Kishore Vegesna
  3 siblings, 0 replies; 5+ messages in thread
From: James Smart @ 2018-12-20 22:25 UTC (permalink / raw)
  To: target-devel

On 12/19/2018 10:04 AM, Sebastian Herbszt wrote:
> Hello James,
> 
>> I'd like to announce the availability of the Broadcom (Emulex) FC target
>> driver - efct.
>>
>> This is the 2nd round of announcement.   In the first round, after
>> discussion with community members, it was decided that the driver would
>> consist of the following:
>>    - A SLI4-library that can be used by both an initiator driver and a
>> target driver
>>    - A FC Discovery library that could be used by both an initiator
>> driver and a target driver.
>>    - A SLI3-library that would be used by an initiator driver only
>>    - Delivery of a target driver that would support SCSI and NVME
>>    - Delivery of an initiator driver that would support SCSI and NVME
>> (NVME on SLI-4 only).
>>
>> As of this announcement the repository on gitlab
>> (git@gitlab.com:jsmart/efct-Emulex_FC_Target.git)
>> contains:
>>   - the SLI-4 library
>>   - the FC Discovery library
>>   - the efct target driver that supports SCSI (lio)
> 
> a lot has changed since v1:
> 
> 71 files changed, 39869 insertions(+), 25695 deletions(-)
> 
> Can you maybe provide the full git history which should have tracked all
> the file renaming?

unfortunately, no. It was done using internal tools which are not git 
based. All further development will be on the gitlab git tree.

We're putting together a change log from v1 to v2 that should help in 
the things you're asking.


> Beside the split it seems there are other changes. More leftovers of the
> FCoE support are gone, ddump support is no longer present and the initiator
> support is not settable. Any further changes I missed?

Yes - it's concentrating on FC support.
ddump - it was temporary removed due to some app interfaces. I believe 
it will be added back.
Yes - initiator support was removed as there will be a separate 
initiator driver.

> 
> I noticed this version does only build here on kernel 4.18. I pushed the
> required changes for kernel 4.19 to my repository [1].

Thanks, I've asked to have our guys pull them in from your repository.

> 
>> Effort is underway on adding nvme target support to the efct driver, and
>> after that, the initiator driver will be refactored.  The intent will be
>> to move all elements into the upstream tree although it is expected the
>> libraries and target components will be merged in a stage separate from
>> the initiator components.
> 
> What are the plans for the "lpfc" driver? Will it use "libefc" and "libefc_sli"
> or will a new (SLI4+) driver ("efci" ?) emerge?

We want to finish the nvme support in efct first.  the initiator driver 
will be a large amount of work. I may start some of the initiator bring 
up in parallel, but regardless, the initiator will be a longer task.

We can choose whether to leave it the same name or give it a new one. I 
expect we'll lean to keeping the same name.

It will use the libefc_sli library for the adapter interfaces and will 
also use libefc for the discovery items. However, the behaviors between 
initiator vs target are significantly different so I don't expect libefc 
to work well in the beginning, but we'll get it to a working state as we 
go through the integration.


> 
>> While those efforts are underway, we would like receive review comments
>> on the code that is present. Comments can be sent to:
>> ecd-efct.pdl@broadcom.com or myself
>>
>> -- james
> 
> [1] https://repo.or.cz/efct-Emulex_FC_Target/sherbszt.git/shortlog/refs/heads/v2-update
> 
> Sebastian
> 

thanks Sebastian

-- james


PS: Here's a quick change list

1) Driver split,
    efct --> LIO target driver.
    libefc --> Emulex FC discovery Library.
    libfc_sli --> Emulex FC SLI Library.

2) Support for  4.18 kernel

3) Removed Wrapper functions efct_thread, efct_sem, efct_timer,
efct_malloc .. etc..

4) G7/Prism adapter support.

5) Removed FCoE support, as we support only FC.

6) Removed dma pool allocations, used dma coherent to alloc dma buffers.

7) Removed SLI queue lock wrappers, register read and wrappers..etc..

8) Fixed styling issues as per linux kernel coding style.

9) Removed ddump files. Will add the new dump functionality as a
feature in the next release.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ANNOUNCE v2]: Broadcom (Emulex) FC Target driver - efct
  2018-12-18 18:05 [ANNOUNCE v2]: Broadcom (Emulex) FC Target driver - efct James Smart
                   ` (2 preceding siblings ...)
  2018-12-20 22:25 ` James Smart
@ 2018-12-22 19:38 ` Ram Kishore Vegesna
  3 siblings, 0 replies; 5+ messages in thread
From: Ram Kishore Vegesna @ 2018-12-22 19:38 UTC (permalink / raw)
  To: target-devel

Hi Sebastian,

Thanks a lot for testing and adding 4.19 kernel support to our driver.
I pulled your changes and merged to gitlab repository.

Fixed the issues which you encountered, pushed the changes to our repository.

Thanks,
Ram
https://gitlab.com/jsmart/efct-Emulex_FC_Target


On Thu, Dec 20, 2018 at 4:55 PM Sebastian Herbszt <herbszt@gmx.net> wrote:
>
> Hello James,
>
> > I noticed this version does only build here on kernel 4.18. I pushed the
> > required changes for kernel 4.19 to my repository [1].
>
> this patch [1] is required on 32 bit to fix
>
> WARNING: "__udivdi3" [efct.ko] undefined!
>
> It seems v2 contains some regressions:
>
> My simple setup triggered this
>
> [  167.858868] efct:efct_hw_cb_link:8556:[fc0] :Link Up, NPORT, speed is 16000
> [  167.862576] efct:efct_els_req_send:96:[fc0] :send efct_send_flogi
> [  167.862796] BUG: unable to handle kernel NULL pointer dereference at 0000035c
> [  167.862805] *pde = 00000000
> [  167.862813] Oops: 0000 [#1] SMP PTI
> [  167.862822] CPU: 1 PID: 2707 Comm: efct:0:0 Tainted: G           O      4.19.0-rc2-2.g0d9481c-default #1 openSUSE Tumbleweed (unreleased)
> [  167.862829] Hardware name: FUJITSU SIEMENS ESPRIMO E           /D2164-A1, BIOS 5.00 R1.10.2164.A1               05/08/2006
> [  167.862856] EIP: efct_send_flogi_p2p_acc+0x25/0x1d0 [efct]
> [  167.862863] Code: 97 f8 eb da 90 3e 8d 74 26 00 55 89 e5 57 56 53 8b 42 08 89 d3 89 ce 8b 00 85 c0 74 0d f6 80 18 03 00 00 02 0f 85 2b 01 00 00 <ff> 35 5c 03 00 00 68 3c d7 97 f8 e8 cb 63 18 e0 c7 05 5c 03 00 00
> [  167.862873] EAX: f2ec0000 EBX: ec3c8000 ECX: 00001802 EDX: ec3c8000
> [  167.862878] ESI: 00001802 EDI: ec3c8400 EBP: eb61fd4c ESP: eb61fd40
> [  167.862891] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010246
> [  167.862902] CR0: 80050033 CR2: 0000035c CR3: 36700000 CR4: 000006d0
> [  167.862914] Call Trace:
> [  167.862947]  __efc_d_init+0x11f/0x630 [efct]
> [  167.862976]  ? efc_send_ls_acc_after_attach+0x90/0x90 [efct]
> [  167.863004]  efc_sm_post_event+0x11/0x30 [efct]
> [  167.863033]  efc_node_post_event+0x3e/0xd0 [efct]
> [  167.863062]  efc_node_recv_els_frame+0x91/0xb0 [efct]
> [  167.863094]  efc_node_dispatch_frame+0x127/0x1f0 [efct]
> [  167.863124]  efc_domain_dispatch_frame+0x1a1/0x2b0 [efct]
> [  167.863154]  efct_unsolicited_cb+0x189/0x1a0 [efct]
> [  167.863183]  ? efct_unsolicited_cb+0x189/0x1a0 [efct]
> [  167.863210]  efct_hw_rqpair_process_rq+0x17b/0x2f0 [efct]
> [  167.863237]  efct_hw_cq_process+0x1fd/0x310 [efct]
> [  167.863263]  ? sli_eq_read+0x2e/0xd0 [efct]
> [  167.863288]  ? sli_eq_read+0xab/0xd0 [efct]
> [  167.863316]  efct_hw_eq_process+0x93/0x180 [efct]
> [  167.863344]  efct_hw_process+0x2c/0x40 [efct]
> [  167.863364]  efct_intr_thread+0xa1/0xd0 [efct]
> [  167.863379]  kthread+0xf0/0x110
> [  167.863398]  ? efct_teardown_msix+0x50/0x50 [efct]
> [  167.863410]  ? kthread_create_worker_on_cpu+0x20/0x20
> [  167.863422]  ret_from_fork+0x2e/0x40
> [  167.863433] Modules linked in: nvme_fc nvme_fabrics nvmet_fc nvmet efct(O) scsi_transport_fc target_core_user uio brd target_core_pscsi target_core_file target_core_iblock target_core_mod configfs edd nfsd snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device lockd grace nfs_acl auth_rpcgss sunrpc dm_mod gpio_ich snd_hda_codec_realtek snd_hda_codec_generic iTCO_wdt iTCO_vendor_support snd_hda_intel snd_hda_codec tg3 libphy lpc_ich snd_hda_core ptp ppdev pps_core snd_hwdep hwmon snd_pcm parport_pc pcspkr floppy button snd_timer snd soundcore i2c_i801 parport sg ehci_pci i915 drm_kms_helper drm uhci_hcd ehci_hcd fb_sys_fops sysimgblt sysfillrect syscopyarea i2c_algo_bit video usbcore scsi_dh_alua scsi_dh_hp_sw scsi_dh_rdac scsi_dh_emc fan ata_generic ata_piix ahci libahci libata thermal [last unloaded: speedstep_lib]
> [  167.863576] CR2: 000000000000035c
> [  167.863587] ---[ end trace a869d8ef0400f630 ]---
> [  167.863608] EIP: efct_send_flogi_p2p_acc+0x25/0x1d0 [efct]
> [  167.863619] Code: 97 f8 eb da 90 3e 8d 74 26 00 55 89 e5 57 56 53 8b 42 08 89 d3 89 ce 8b 00 85 c0 74 0d f6 80 18 03 00 00 02 0f 85 2b 01 00 00 <ff> 35 5c 03 00 00 68 3c d7 97 f8 e8 cb 63 18 e0 c7 05 5c 03 00 00
> [  167.863638] EAX: f2ec0000 EBX: ec3c8000 ECX: 00001802 EDX: ec3c8000
> [  167.863648] ESI: 00001802 EDI: ec3c8400 EBP: eb61fd4c ESP: d966347c
> [  167.863659] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010246
> [  167.863669] CR0: 80050033 CR2: 0000035c CR3: 36700000 CR4: 000006d0
>
> As you can see [2] "io" is NULL when it's used. This patch seems to fix it:
>
> diff --git a/efct/efct_els.c b/efct/efct_els.c
> index 524fda7..45a7198 100644
> --- a/efct/efct_els.c
> +++ b/efct/efct_els.c
> @@ -1537,6 +1537,13 @@ efct_send_flogi_p2p_acc(struct efc_lport *efc, struct efc_node_s *node,
>
>         node_els_trace();
>
> +       io = efct_els_io_alloc(node, sizeof(struct fc_plogi_payload_s),
> +                              EFCT_ELS_ROLE_RESPONDER);
> +
> +       if (!io) {
> +               efct_log_err(efct, "els IO alloc failed\n");
> +               return io;
> +       }
>         io->els_callback = NULL;
>         io->els_callback_arg = NULL;
>         io->display_name = "flogi_p2p_acc";
>
>
> With this change I am able to use the exported volume but a read test results in
>
> [  359.747276] WARNING: CPU: 0 PID: 3338 at /devel/efct/efct/efct_scsi.c:1341 efct_scsi_send_rd_data+0x438/0x480 [efct]
> [  359.747278] Modules linked in: efct(O) nvme_fc nvme_fabrics nvmet_fc nvmet scsi_transport_fc target_core_user uio brd target_core_pscsi target_core_file target_core_iblock target_core_mod configfs nfsd lockd grace nfs_acl auth_rpcgss sunrpc edd snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device dm_mod snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel gpio_ich iTCO_wdt iTCO_vendor_support snd_hda_codec snd_hda_core tg3 snd_hwdep snd_pcm lpc_ich snd_timer snd libphy soundcore ptp i2c_i801 ppdev pps_core hwmon parport_pc ehci_pci sg parport pcspkr floppy button i915 drm_kms_helper drm fb_sys_fops sysimgblt sysfillrect syscopyarea uhci_hcd ehci_hcd usbcore i2c_algo_bit video scsi_dh_alua scsi_dh_hp_sw scsi_dh_rdac scsi_dh_emc fan ata_generic ata_piix ahci libahci libata thermal [last unloaded: efct]
> [  359.747374] CPU: 0 PID: 3338 Comm: efct:0:0 Tainted: G           O      4.19.0-rc2-2.g0d9481c-default #1 openSUSE Tumbleweed (unreleased)
> [  359.747376] Hardware name: FUJITSU SIEMENS ESPRIMO E           /D2164-A1, BIOS 5.00 R1.10.2164.A1               05/08/2006
> [  359.747391] EIP: efct_scsi_send_rd_data+0x438/0x480 [efct]
> [  359.747394] Code: b8 fc ff ff 0f 0b 8b 43 24 85 c0 0f 85 99 fc ff ff 90 0f 0b 85 f6 0f 84 8e fc ff ff 31 d2 e9 7a fc ff ff 8d b4 26 00 00 00 00 <0f> 0b e9 d3 fc ff ff 90 0f 0b e9 3d fc ff ff f6 45 ec 02 0f 85 6d
> [  359.747397] EAX: 00080000 EBX: efe307b0 ECX: f50dacac EDX: 00000007
> [  359.747399] ESI: f2ec8000 EDI: 00000000 EBP: eb88bda0 ESP: eb88bd74
> [  359.747402] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010246
> [  359.747404] CR0: 80050033 CR2: b7f26000 CR3: 3417e000 CR4: 000006d0
> [  359.747407] Call Trace:
> [  359.747421]  ? dma_direct_map_sg+0x55/0xa0
> [  359.747424]  ? dma_direct_map_sg+0x6a/0xa0
> [  359.747446]  efct_lio_queue_data_in+0x20a/0x350 [efct]
> [  359.747467]  ? efct_lio_write_pending+0x280/0x280 [efct]
> [  359.747472]  ? dequeue_entity+0x1ef/0xba0
> [  359.747493]  efct_lio_datamove_done+0x9d/0x5b0 [efct]
> [  359.747498]  ? __switch_to_asm+0x33/0x50
> [  359.747501]  ? __switch_to_asm+0x27/0x50
> [  359.747503]  ? __switch_to_asm+0x33/0x50
> [  359.747505]  ? __switch_to_asm+0x27/0x50
> [  359.747507]  ? __switch_to_asm+0x33/0x50
> [  359.747510]  ? __switch_to_asm+0x27/0x50
> [  359.747530]  ? efct_lio_write_pending+0x280/0x280 [efct]
> [  359.747544]  efct_target_io_cb+0xc8/0x230 [efct]
> [  359.747547]  ? __switch_to_asm+0x33/0x50
> [  359.747549]  ? __switch_to_asm+0x27/0x50
> [  359.747551]  ? __switch_to_asm+0x33/0x50
> [  359.747553]  ? __switch_to_asm+0x27/0x50
> [  359.747555]  ? __switch_to_asm+0x33/0x50
> [  359.747569]  ? efct_scsi_check_pending+0x2b0/0x2b0 [efct]
> [  359.747588]  efct_hw_wq_process_io+0x138/0x880 [efct]
> [  359.747607]  ? target_wqe_timer_nop_cb+0x200/0x200 [efct]
> [  359.747626]  efct_hw_wq_process+0x3b/0x130 [efct]
> [  359.747645]  efct_hw_cq_process+0x1e3/0x310 [efct]
> [  359.747663]  ? sli_eq_read+0x2e/0xd0 [efct]
> [  359.747682]  ? sli_eq_read+0xab/0xd0 [efct]
> [  359.747702]  efct_hw_eq_process+0x93/0x180 [efct]
> [  359.747721]  efct_hw_process+0x2c/0x40 [efct]
> [  359.747734]  efct_intr_thread+0xa1/0xd0 [efct]
> [  359.747739]  kthread+0xf0/0x110
> [  359.747751]  ? efct_teardown_msix+0x50/0x50 [efct]
> [  359.747754]  ? kthread_create_worker_on_cpu+0x20/0x20
> [  359.747757]  ret_from_fork+0x2e/0x40
> [  359.747761] ---[ end trace 6a1c45757778ea22 ]---
>
> and this is the following assertion [3]
>
> efct_assert(io->exp_xfer_len > io->transferred, -1);
>
> The relevant values are
>
> xwire_len: 262144
> io->exp_xfer_len: 524288
> io->transferred: 524288
>
> I was not yet able to figure out what the problem is.
>
> [1] https://repo.or.cz/efct-Emulex_FC_Target/sherbszt.git/commitdiff/bd2b72aeb034f19be99566b3897efde4e9e24c46
> [2] https://gitlab.com/jsmart/efct-Emulex_FC_Target/blob/master/efct/efct_els.c#L1512
> [3] https://gitlab.com/jsmart/efct-Emulex_FC_Target/blob/master/efct/efct_scsi.c#L1341
>
> Sebastian

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-12-22 19:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-18 18:05 [ANNOUNCE v2]: Broadcom (Emulex) FC Target driver - efct James Smart
2018-12-19 18:04 ` Aw: " Sebastian Herbszt
2018-12-20 11:25 ` Sebastian Herbszt
2018-12-20 22:25 ` James Smart
2018-12-22 19:38 ` Ram Kishore Vegesna

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.