linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Love <robert.w.love@intel.com>
To: linux-scsi@vger.kernel.org
Cc: Yi Zou <yi.zou@intel.com>
Subject: [PATCH 5/6] libfcoe: fix VN2VN N_Port_ID Beacon source MAC
Date: Fri, 20 Apr 2012 12:16:49 -0700	[thread overview]
Message-ID: <20120420191649.4634.26012.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20120420191620.4634.94869.stgit@localhost6.localdomain6>

From: Yi Zou <yi.zou@intel.com>

FC-BB-6 v1.04 7.9.8.14 N_Port_ID Beacon:

"A N_Port_ID Beacon is multicast and uses the VN_Port MAC address as source
address."

Currently, libfcoe is using ENode MAC, this seems ok and functionality wise
not a problem in my back to back testing setup, however, just fix this to
make libfcoe VN2VN support more spec compliant.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
 drivers/scsi/fcoe/fcoe_ctlr.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 249a106..5a4c725 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -1883,7 +1883,13 @@ static void fcoe_ctlr_vn_send(struct fcoe_ctlr *fip,
 	frame = (struct fip_frame *)skb->data;
 	memset(frame, 0, len);
 	memcpy(frame->eth.h_dest, dest, ETH_ALEN);
-	memcpy(frame->eth.h_source, fip->ctl_src_addr, ETH_ALEN);
+
+	if (sub == FIP_SC_VN_BEACON) {
+		hton24(frame->eth.h_source, FIP_VN_FC_MAP);
+		hton24(frame->eth.h_source + 3, fip->port_id);
+	} else {
+		memcpy(frame->eth.h_source, fip->ctl_src_addr, ETH_ALEN);
+	}
 	frame->eth.h_proto = htons(ETH_P_FIP);
 
 	frame->fip.fip_ver = FIP_VER_ENCAPS(FIP_VER);


  parent reply	other threads:[~2012-04-20 19:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 19:16 [PATCH 0/6] libfc, libfcoe and fcoe patches for scsi-misc Robert Love
2012-04-20 19:16 ` [PATCH 1/6] fcoe: remove lport from net device before doing per cpu rx thread cleanup Robert Love
2012-04-20 19:16 ` [PATCH 2/6] libfc: flush lport worker after its disabled Robert Love
2012-04-20 19:16 ` [PATCH 3/6] libfc: defer releasing master lport until complete fcoe interface cleanuped up Robert Love
2012-04-20 19:16 ` [PATCH 4/6] fcoe: Don't hold rtnl_mutex in fcoe_update_src_mac Robert Love
2012-05-10  7:53   ` James Bottomley
2012-04-20 19:16 ` Robert Love [this message]
2012-04-20 19:16 ` [PATCH 6/6] fcoe: remove a stray unlock 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=20120420191649.4634.26012.stgit@localhost6.localdomain6 \
    --to=robert.w.love@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).