From: Robert Love <robert.w.love@intel.com>
To: James.Bottomley@suse.de, linux-scsi@vger.kernel.org
Cc: Yi Zou <yi.zou@intel.com>, Robert Love <robert.w.love@intel.com>
Subject: [PATCH 4/9] libfcoe: add checking disable flag in FIP_FKA_ADV
Date: Fri, 20 Nov 2009 14:54:57 -0800 [thread overview]
Message-ID: <20091120225457.495.93487.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091120225436.495.88600.stgit@localhost.localdomain>
From: Yi Zou <yi.zou@intel.com>
When the D bit is set if the FKA_ADV_Period of the FIP Discovery
Advertisement, the ENode should not transmit period ENode FIP Keep Alive and
VN_Port FIP Keep Alive (FC-BB-5 Rev2, 7.8.3.13).
Note that fcf->flags is taken directly from the fip_header, I am claiming one
bit for the purpose of the FIP_FKA_Period D bit as FIP_FL_FK_ADV_B, and use
FIP_HEADER_FLAGS as bitmask for bits used in fip_header.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/fcoe/libfcoe.c | 4 +++-
include/scsi/fc/fc_fip.h | 12 +++++++++++-
include/scsi/libfcoe.h | 1 +
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 3c501d4..9961fd7 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -665,6 +665,8 @@ static int fcoe_ctlr_parse_adv(struct fcoe_ctlr *fip,
if (dlen != sizeof(struct fip_fka_desc))
goto len_err;
fka = (struct fip_fka_desc *)desc;
+ if (fka->fd_flags & FIP_FKA_ADV_D)
+ fcf->fd_flags = 1;
t = ntohl(fka->fd_fka_period);
if (t >= FCOE_CTLR_MIN_FKA)
fcf->fka_period = msecs_to_jiffies(t);
@@ -1160,7 +1162,7 @@ static void fcoe_ctlr_timeout(unsigned long arg)
}
}
- if (sel) {
+ if (sel && !sel->fd_flags) {
if (time_after_eq(jiffies, fip->ctlr_ka_time)) {
fip->ctlr_ka_time = jiffies + sel->fka_period;
fip->send_ctlr_ka = 1;
diff --git a/include/scsi/fc/fc_fip.h b/include/scsi/fc/fc_fip.h
index 3d138c1..17baa19 100644
--- a/include/scsi/fc/fc_fip.h
+++ b/include/scsi/fc/fc_fip.h
@@ -214,11 +214,21 @@ struct fip_vn_desc {
*/
struct fip_fka_desc {
struct fip_desc fd_desc;
- __u8 fd_resvd[2];
+ __u8 fd_resvd;
+ __u8 fd_flags; /* bit0 is fka disable flag */
__be32 fd_fka_period; /* adv./keep-alive period in mS */
} __attribute__((packed));
/*
+ * flags for fip_fka_desc.fd_flags
+ */
+enum fip_fka_flags {
+ FIP_FKA_ADV_D = 0x01, /* no need for FKA from ENode */
+};
+
+/* FIP_DT_FKA flags */
+
+/*
* FIP_DT_VENDOR descriptor.
*/
struct fip_vendor_desc {
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 3837872..c603f4a 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -155,6 +155,7 @@ struct fcoe_fcf {
u8 pri;
u16 flags;
u32 fka_period;
+ u8 fd_flags:1;
};
/* FIP API functions */
next prev parent reply other threads:[~2009-11-20 22:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-20 22:54 [PATCH 0/9] libfc, libfcoe and fcoe updates for scsi-misc.git (2.6.33) Robert Love
2009-11-20 22:54 ` [PATCH 1/9] libfc: fix payload size passed to fc_frame_alloc() in fc_lport_els_request Robert Love
2009-11-20 22:54 ` [PATCH 2/9] fcoe: allow SCSI-FCP to be processed directly in softirq context Robert Love
2009-11-20 22:54 ` [PATCH 3/9] libfc: add FC-BB-5 LESB counters to fcoe_dev_stats Robert Love
2009-11-20 22:54 ` Robert Love [this message]
2009-11-20 22:55 ` [PATCH 5/9] libfcoe: add tracking FIP Virtual Link Failure count Robert Love
2009-11-20 22:55 ` [PATCH 6/9] libfcoe: add tracking FIP Missing Discovery Advertisement count Robert Love
2009-11-20 22:55 ` [PATCH 7/9] libfc: add fcoe_fc_els_lesb to fc_fcoe.h for FC-BB-5 LESB definitions Robert Love
2009-11-20 22:55 ` [PATCH 8/9] fcoe, libfc: add get_lesb() to allow LLD to fill the link error status block (LESB) Robert Love
2009-11-20 22:55 ` [PATCH 9/9] libfc: add support of receiving ELS_RLS Robert Love
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091120225457.495.93487.stgit@localhost.localdomain \
--to=robert.w.love@intel.com \
--cc=James.Bottomley@suse.de \
--cc=linux-scsi@vger.kernel.org \
--cc=yi.zou@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox