linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hiral Patel <hiralpat@cisco.com>
To: linux-scsi@vger.kernel.org
Cc: JBottomley@parallels.com, Hiral Patel <hiralpat@cisco.com>
Subject: [PATCH 09/10] fnic: Kernel panic due to FIP mode misconfiguration
Date: Mon, 10 Dec 2012 01:21:38 -0800	[thread overview]
Message-ID: <1355131299-3313-10-git-send-email-hiralpat@cisco.com> (raw)
In-Reply-To: <1355131299-3313-1-git-send-email-hiralpat@cisco.com>

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>
---
 drivers/scsi/fnic/fnic_fcs.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
index 3810c0b..d1cc7a4 100644
--- a/drivers/scsi/fnic/fnic_fcs.c
+++ b/drivers/scsi/fnic/fnic_fcs.c
@@ -602,6 +602,12 @@ static inline int fnic_import_rq_eth_pkt(struct fnic *fnic, struct sk_buff *skb)
 		skb_reset_mac_header(skb);
 	}
 	if (eh->h_proto == htons(ETH_P_FIP)) {
+		if (!(fnic->config.flags & VFCF_FIP_CAPABLE)) {
+			printk(KERN_ERR "Dropped FIP frame, as firmware "
+					"uses non-FIP mode, Enable FIP "
+					"using UCSM\n");
+			goto drop;
+		}
 		skb_queue_tail(&fnic->fip_frame_queue, skb);
 		queue_work(fnic_fip_queue, &fnic->fip_frame_work);
 		return 1;		/* let caller know packet was used */
-- 
1.7.9.5


  parent reply	other threads:[~2012-12-10  9:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-10  9:21 [PATCH 01/10] fnic: updated MAINTAINERS list Hiral Patel
2012-12-10  9:21 ` [PATCH 02/10] fnic: fix for trusted cos Hiral Patel
2012-12-10  9:21 ` [PATCH 03/10] fnic:fixing issues in device and firmware reset code Hiral Patel
2012-12-10  9:21 ` [PATCH 04/10] fnic: Fix SGEs limit Hiral Patel
2012-12-10  9:21 ` [PATCH 05/10] fnic: fnic driver may hit BUG_ON on device reset Hiral Patel
2012-12-17 11:24   ` James Bottomley
2012-12-17 23:36     ` Hiral Patel (hiralpat)
2012-12-10  9:21 ` [PATCH 06/10] fnic: New debug flags and debug log messages Hiral Patel
2012-12-10  9:21 ` [PATCH 07/10] fnic: Fnic Trace Utility Hiral Patel
2012-12-10  9:21 ` [PATCH 08/10] fnic: FIP VLAN Discovery Feature Support Hiral Patel
2012-12-10  9:21 ` [PATCH 9/9] fnic: FIP configuration mismatch between switch and adapter crashes driver Hiral Patel
2012-12-10  9:38   ` James Bottomley
2012-12-10  9:45     ` Hiral Patel (hiralpat)
2012-12-10  9:21 ` Hiral Patel [this message]
2012-12-10  9:21 ` [PATCH 10/10] fnic: Incremented driver version Hiral Patel
  -- strict thread matches above, loose matches on Subject: below --
2013-01-30  0:05 [PATCH 03/10] fnic:fixing issues in device and firmware reset code Hiral Patel
2013-01-30  0:05 ` [PATCH 09/10] fnic: Kernel panic due to FIP mode misconfiguration Hiral Patel
2013-02-13  1:00 [PATCH 03/10] fnic:fixing issues in device and firmware reset code Hiral Patel
2013-02-13  1:01 ` [PATCH 09/10] fnic: Kernel panic due to FIP mode misconfiguration Hiral Patel

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=1355131299-3313-10-git-send-email-hiralpat@cisco.com \
    --to=hiralpat@cisco.com \
    --cc=JBottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    /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).