Sivaram Kannan wrote:
> Hi all,
>
> I have created a patch for Open-Fcoe-Target which could compile against the
> latest kernel test
branch(linux-2.6.29-rc8). The same patch will also compile against the latest
stable version 2.6.28. I exposed the
target and when I triggered the initiator, I could see sequence of SCSI packets
at the wireshark. I did not understand
the messages completely, I am decoding it. One problem that I noticed during
the testing is with the initiator. For
initiator I compiled the latest 2.6.29-rc8 in Fedora 10, and when I give the
command "echo "ethX" >
/sys/module/fcoe/parameters/create", I am getting a kernel opps. There is no
trouble at the target end, wireshark was
still printing SCSI packets. Would attaching the wireshark trace from target
end would be helpful to identify what is
the problem?
I see a problem, too. Maybe its the same one, or maybe another one.
With no LUNs exported from the target, the latest initiator (fcoe-features.git
as of 3/17/09
just after the FIP patches were integrated) I get this crash:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000088
IP: [<ffffffffa003b733>] fc_fcp_resp+0xe7/0x1fc [libfc]
PGD 7bc33067 PUD 7bc64067 PMD 0
Oops: 0000 [#1] SMP
last sysfs file: /sys/class/fc_remote_ports/rport-6:0-0/roles
CPU 0
Modules linked in: fcoe libfcoe libfc ata_generic ata_piix e1000
Pid: 4213, comm: fcoethread/0 Tainted: G W 2.6.29-rc7-feat2 #1
PowerEdge SC1425
RIP: 0010:[<ffffffffa003b733>] [<ffffffffa003b733>] fc_fcp_resp+0xe7/0x1fc
[libfc]
RSP: 0018:ffff88007249dd80 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88007dd7c060 RCX: 0000000000000060
RDX: 0000000000000002 RSI: ffff880075c5d316 RDI: ffff88007242b748
RBP: ffff88007249ddc0 R08: 000000000000006c R09: 0000000000000060
R10: 0000000000000000 R11: 0000000000000046 R12: ffff880075c5d2fe
R13: ffff88007dd7c002 R14: 0000000000000084 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffffffff808b2080(0000) knlGS:0000000000000000
CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 0000000000000088 CR3: 000000007d1c7000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process fcoethread/0 (pid: 4213, threadinfo ffff88007249c000, task
ffff8800724ea0c0)
Stack:
ffff88007dd7c070 ffff88007dc1ce00 ffff88007dc1ce00 ffff88007dd7c060
ffff88007dc1ce00 ffff88007dd7c070 ffff88007dd802c8 ffffffffa003b848
ffff88007249ddf0 ffffffffa003b8d6 0000000000980000 ffff88007dd801b8
Call Trace:
[<ffffffffa003b848>] ? fc_tm_done+0x0/0xc6 [libfc]
[<ffffffffa003b8d6>] fc_tm_done+0x8e/0xc6 [libfc]
[<ffffffffa00344f7>] fc_exch_recv+0x89a/0xdcf [libfc]
[<ffffffffa004ea92>] fcoe_percpu_receive_thread+0x382/0x3a0 [fcoe]
[<ffffffffa004e710>] ? fcoe_percpu_receive_thread+0x0/0x3a0 [fcoe]
[<ffffffff8024b7ef>] kthread+0x49/0x76
[<ffffffff8020c63a>] child_rip+0xa/0x20
[<ffffffff8020c03c>] ? restore_args+0x0/0x30
[<ffffffff8024b7a6>] ? kthread+0x0/0x76
[<ffffffff8020c630>] ? child_rip+0x0/0x20
Code: 01 00 00 e8 c0 14 1f e0 e9 24 01 00 00 f6 c2 02 74 24 8b 40 04 41 b9 60
00 00 00 0f c8 83 f8 60 44 0f 46 c8 48 8b
43 40 44 89 c9 <48> 8b b8 88 00 00 00 f3 a4 eb 03 45 31 c9 f6 c2 0c 74 49 31 c0
RIP [<ffffffffa003b733>] fc_fcp_resp+0xe7/0x1fc [libfc]
RSP <ffff88007249dd80>
CR2: 0000000000000088
---[ end trace 0be88afb67690d86 ]---
Kernel panic - not syncing: Fatal exception in interrupt
The fsp has a NULL cmd pointer in fc_fcp_resp() in this code:
if (flags & FCP_SNS_LEN_VAL) {
snsl = ntohl(rp_ex->fr_sns_len);
if (snsl > SCSI_SENSE_BUFFERSIZE)
snsl = SCSI_SENSE_BUFFERSIZE;
==> blew up here since fsp->cmd is NULL.
memcpy(fsp->cmd->sense_buffer,
(char *)fc_rp_info + respl, snsl);
}
For those that like assembly:
1ae3: 0f c8 bswap %eax
1ae5: 83 f8 60 cmp $0x60,%eax
1ae8: 44 0f 46 c8 cmovbe %eax,%r9d
1aec: 48 8b 43 40 mov 0x40(%rbx),%rax
1af0: 44 89 c9 mov %r9d,%ecx
----- blew up here fetching pointer to memcpy destination.
1af3: 48 8b b8 88 00 00 00 mov 0x88(%rax),%rdi
1afa: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi)
The trace shows a check condition response to a Test Unit Ready.
I haven't looked further. I don't know why fsp->cmd is NULL.
Joe
> I have tested the patch with the scripts/checkpatch.pl, it gave one error
> saying "ERROR: Missing Signed-off-by: line(s)" .
>
> Thanks,
> Siva
>
> =================
>
> fcoe/fcoe_dev.c | 4 ++--
> fcoe/fcoe_if.c | 2 +-
> fcoe/fcoeinit.c | 4 ++--
> include/sa_hash.h | 1 +
> openfctgt/openfc_scst.c | 6 +++---
> 5 files changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/fcoe/fcoe_dev.c b/fcoe/fcoe_dev.c
> index 8f2dad1..5ba163f 100644
> --- a/fcoe/fcoe_dev.c
> +++ b/fcoe/fcoe_dev.c
> @@ -284,14 +284,14 @@ int fcoe_xmit(struct fcdev *fc_dev, struct fc_frame *fp)
> u_long off = sg->offset;
> u_long len = sg->length;
>
> - skb_fill_page_desc(skb, indx, sg->page, off, len);
> + skb_fill_page_desc(skb, indx, sg->page_link, off, len);
> skb->len += len;
> skb->data_len += len;
> while (len > 0) {
> u_long clen;
>
> clen = min(len, PAGE_SIZE - (off & ~PAGE_MASK));
> - data = kmap_atomic(sg->page + (off >> PAGE_SHIFT),
> + data = kmap_atomic(sg->page_link + (off >> PAGE_SHIFT),
> KM_SKB_DATA_SOFTIRQ);
> crc = crc32_sb8_64_bit(crc, data + (off & ~PAGE_MASK),
> clen);
> diff --git a/fcoe/fcoe_if.c b/fcoe/fcoe_if.c
> index 8cf6c34..d87ede1 100644
> --- a/fcoe/fcoe_if.c
> +++ b/fcoe/fcoe_if.c
> @@ -194,7 +194,7 @@ int fcoe_create_interface(struct fcoe_info *fci, void
> *ptr)
> /*
> * get the pointer the real eth device
> */
> - fc->real_dev = (void *)dev_get_by_name(cfg->local_ifname);
> + fc->real_dev = (void *)dev_get_by_name(&init_net, cfg->local_ifname);
> if (fc->real_dev == NULL) {
> SA_LOG("could not get network device for %s",
> cfg->local_ifname);
> diff --git a/fcoe/fcoeinit.c b/fcoe/fcoeinit.c
> index 182a9b1..77f16f6 100644
> --- a/fcoe/fcoeinit.c
> +++ b/fcoe/fcoeinit.c
> @@ -287,7 +287,7 @@ static int __init fcoeinit(void)
> rc = -ENODEV;
> goto out_chrdev;
> }
> - class_device_create(fci->fcoe_class, NULL,
> + device_create(fci->fcoe_class, NULL,
> MKDEV(fci->fcoe_major, 0), NULL, FCOE_CTL_DEV_NAME);
>
> /*
> @@ -362,7 +362,7 @@ static void __exit fcoe_exit(void)
> #ifdef CONFIG_HOTPLUG_CPU
> unregister_cpu_notifier(&fcoe_cpu_notifier);
> #endif /* CONFIG_HOTPLUG_CPU */
> - class_device_destroy(fci->fcoe_class, MKDEV(fci->fcoe_major, 0));
> + device_destroy(fci->fcoe_class, MKDEV(fci->fcoe_major, 0));
> class_destroy(fci->fcoe_class);
> fcoe_unreg_char_dev();
> fcoe_dev_cleanup();
> diff --git a/include/sa_hash.h b/include/sa_hash.h
> index d4ee6be..cd64fa4 100644
> --- a/include/sa_hash.h
> +++ b/include/sa_hash.h
> @@ -21,6 +21,7 @@
> #define _LIBSA_HASH_H_
>
> #include <linux/list.h>
> +#include <linux/rculist.h>
>
> /*
> * Hash table facility.
> diff --git a/openfctgt/openfc_scst.c b/openfctgt/openfc_scst.c
> index d245ae9..b89537a 100644
> --- a/openfctgt/openfc_scst.c
> +++ b/openfctgt/openfc_scst.c
> @@ -171,7 +171,7 @@ openfc_scsi_send_data(struct fc_scsi_pkt *fsp, struct
> fc_seq *sp,
> if (using_sg) {
> ASSERT(fp->fr_sg_len < FC_FRAME_SG_LEN);
> fsg = &fp->fr_sg[fp->fr_sg_len++];
> - fsg->page = sg->page;
> + fsg->page_link = sg->page_link;
> fsg->offset = sg->offset + offset;
> fsg->length = sg_bytes;
> fp->fr_len += sg_bytes;
> @@ -185,7 +185,7 @@ openfc_scsi_send_data(struct fc_scsi_pkt *fsp, struct
> fc_seq *sp,
> */
> sg_bytes = min(sg_bytes, (size_t) (PAGE_SIZE -
> (off & ~PAGE_MASK)));
> - page_addr = kmap_atomic(sg->page +
> + page_addr = kmap_atomic(sg->page_link +
> (off >> PAGE_SHIFT), KM_SOFTIRQ0);
> __memcpy(data, (char *) page_addr +
> (off & ~PAGE_MASK), sg_bytes);
> @@ -247,7 +247,7 @@ int openfct_cp_to_user(struct fc_scsi_pkt *fsp, uint
> offset, void *buf, int len)
> off = offset + sg->offset;
> sg_bytes = min(sg_bytes,
> (u_int32_t) (PAGE_SIZE - (off & ~PAGE_MASK)));
> - page_addr = kmap_atomic(sg->page + (off >> PAGE_SHIFT),
> + page_addr = kmap_atomic(sg->page_link + (off >> PAGE_SHIFT),
> KM_SOFTIRQ0);
> if (!page_addr) {
> return -1;
>
>
>
>
> _______________________________________________
> devel mailing list
> [email protected]
> http://www.open-fcoe.org/mailman/listinfo/devel
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel