diff options
author | Bhanu Prakash Gollapudi <bprakash@broadcom.com> | 2011-08-04 20:38:51 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-08-27 10:35:49 -0400 |
commit | 861efc547ce517e3d75a507ebc2268e6a0dfa767 (patch) | |
tree | a196faabc2738d6d655d0d751d1a9c005d9a3e5d /drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |
parent | 5243960777a8d5f0dfabd0e67035d13ac6eaf304 (diff) |
[SCSI] bnx2fc: Prevent creating of NPIV port with duplicate WWN
This patch adds a validation step before allowing creation of a new NPIV port.
It checks whether the WWPN passed for the new NPIV port to be created is unique
for the given physical port.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_fcoe.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 25d3bcd179b1..351ca4cb403f 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -1020,6 +1020,17 @@ static int bnx2fc_vport_create(struct fc_vport *vport, bool disabled) | |||
1020 | struct bnx2fc_interface *interface = port->priv; | 1020 | struct bnx2fc_interface *interface = port->priv; |
1021 | struct net_device *netdev = interface->netdev; | 1021 | struct net_device *netdev = interface->netdev; |
1022 | struct fc_lport *vn_port; | 1022 | struct fc_lport *vn_port; |
1023 | int rc; | ||
1024 | char buf[32]; | ||
1025 | |||
1026 | rc = fcoe_validate_vport_create(vport); | ||
1027 | if (rc) { | ||
1028 | fcoe_wwn_to_str(vport->port_name, buf, sizeof(buf)); | ||
1029 | printk(KERN_ERR PFX "Failed to create vport, " | ||
1030 | "WWPN (0x%s) already exists\n", | ||
1031 | buf); | ||
1032 | return rc; | ||
1033 | } | ||
1023 | 1034 | ||
1024 | if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { | 1035 | if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) { |
1025 | printk(KERN_ERR PFX "vn ports cannot be created on" | 1036 | printk(KERN_ERR PFX "vn ports cannot be created on" |