remarkable-linux/drivers/scsi
Robert Love 0ee31cb5df [SCSI] fcoe: Fix broken NPIV with correction to MAC validation
A previous patch attempted to validate the destination
MAC address of a FCoE frame by checking that MAC
address against the received port's MAC address. The
implementation seems fine on the surface, but any
VN_Ports added using the NPIV feature will have their
own MAC addresses and these MACs were not being checked,
which prevented any NPIV VN_Ports from receiving frames.

In other words, the following patch has broken NPIV.

519e5135e2
 [SCSI] fcoe: adds src and dest mac address
              checking for fcoe frames

Part of the offending patch is correct, but the part
that broke NPIV was attempting to satisfy FC-BB-5
section D.5, 2.1-

(discard frames that) "contain a destination MAC
address/destination N_Port_ID pair that was not
assigned by an FCF to one of the VN_Ports on the ENode"

The language does _not_ say to compare the destination
FC-MAP/destination N_Port_ID, but instead to compare
the destination MAC address/destination N_Port_ID.

>From the FC-BB-5 specification,

"A properly formed FPMA is one in which the 24 most
significant bits equal the Fabric’s FC-MAP value and
the least significant 24 bits equal the N_Port_ID
assigned to the VN_Port by the FCF."

This means that we need to compare the FC Frame's
destination FCID against the embedded FCID in the
destination MAC address. This patch checks the lower
24 bits of the destination MAC address against
destination FCID in the Fibre Channel frame.

For MAC validation the first line of defense is the
hardware MAC filtering. Each VN_Port will have a
unicast MAC addresses added to the hardware's
filtering table. The Ethernet driver should drop any
MACs not destined for a programmed MAC. This patch
adds a second line of defense that very specfically
compares an element in the FC frame against an element
in the Ethernet header, which is appropriate for the
FCoE layer.

Many alternative approaches were considered, including
a LLD callback from libfc. The second most reasonable
approach seemed to be walking the list of NPIV ports
and check each of their MAC addresses against the
destination MAC address of the received frame. The
problem with this approach was that it is likely that
performance would suffer with the more NPIV ports added
to the system since every received frame would need to
walk this list, comparing each entry's MAC.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 15:11:39 -05:00
..
aacraid Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-10-24 13:41:39 -07:00
aic7xxx [SCSI] aic7xxx: Remove OS utility wrappers 2010-07-28 09:05:27 -05:00
aic7xxx_old fix comnment/printk typos concerning "empty" 2010-07-12 18:03:50 +02:00
aic94xx drivers/scsi/aic94xx/aic94xx_init.c: correct the size argument to kmalloc 2010-08-11 08:59:00 -07:00
arcmsr [SCSI] drivers/scsi: Adjust confusing if indentation 2010-09-05 14:18:45 -03:00
arm
be2iscsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-10-22 17:34:15 -07:00
bfa [SCSI] bfa: cleanup driver 2010-09-16 22:54:24 -04:00
bnx2i Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2010-10-23 11:47:02 -07:00
cxgbi [SCSI] cxgb4i: connection and ddp setting update 2010-10-07 17:21:36 -05:00
device_handler [SCSI] scsi_dh_alua: Handle all states correctly 2010-10-07 17:22:22 -05:00
dpt
fcoe [SCSI] fcoe: Fix broken NPIV with correction to MAC validation 2010-10-25 15:11:39 -05:00
fnic [SCSI] fnic: prep for fc host dev loss tmo support 2010-10-07 17:09:33 -05:00
ibmvscsi [SCSI] ibmvfc: Handle Virtual I/O Server reboot 2010-10-07 17:17:06 -05:00
libfc [SCSI] libfc: Do not let disc work cancel itself 2010-10-25 15:11:37 -05:00
libsas Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-10-22 17:34:15 -07:00
lpfc Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-10-24 13:41:39 -07:00
megaraid Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-10-22 17:34:15 -07:00
mpt2sas Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-10-22 17:34:15 -07:00
mvsas [SCSI] Unify SAM_ and SAM_STAT_ macros 2010-07-28 09:07:49 -05:00
osd llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
pcmcia Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-10-22 17:34:15 -07:00
pm8001 [SCSI] pm8001: handle allocation failures 2010-09-09 15:31:54 -05:00
qla2xxx Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-10-22 17:34:15 -07:00
qla4xxx [SCSI] qla4xxx: Update driver version to 5.02.00-k4 2010-10-25 14:56:04 -05:00
sym53c8xx_2 [SCSI] sd, sym53c8xx: Remove warnings after vsprintf %pV introducation. 2010-09-02 17:23:20 -03:00
.gitignore
3w-9xxx.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
3w-9xxx.h
3w-sas.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
3w-sas.h
3w-xxxx.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
3w-xxxx.h
53c700.c scsi: 53c700: remove dma_is_consistent usage 2010-08-11 08:59:21 -07:00
53c700.h
53c700.scr
53c700_d.h_shipped
a100u2w.c
a100u2w.h
a2091.c m68k/scsi: a2091 - Do not use legacy Scsi_Host.base 2010-05-26 19:51:08 +02:00
a2091.h m68k/scsi: a2091 - Kill a2091_scsiregs typedef 2010-05-26 19:51:07 +02:00
a3000.c m68k/scsi: a3000 - Do not use legacy Scsi_Host.base 2010-05-26 19:51:08 +02:00
a3000.h m68k/scsi: a3000 - Kill a3000_scsiregs typedef 2010-05-26 19:51:07 +02:00
a4000t.c m68k: amiga - A4000T SCSI platform device conversion 2010-05-26 19:51:09 +02:00
advansys.c fix typos concerning "initiali[zs]e" 2010-06-16 18:05:05 +02:00
aha152x.c
aha152x.h
aha1542.c aha1532: remove ISA_DMA_THRESHOLD usage 2010-08-07 18:15:46 +02:00
aha1542.h
aha1740.c
aha1740.h
aic7xxx_old.c aic7xxx_old: removed unused 'req' variable 2010-09-16 08:27:34 +02:00
atari_NCR5380.c
atari_scsi.c
atari_scsi.h
atp870u.c
atp870u.h
BusLogic.c
BusLogic.h
bvme6000_scsi.c
ch.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
constants.c [SCSI] Fix warning: zero-length gnu_printf format string 2010-09-02 17:15:31 -03:00
dc395x.c dc395x: decrease iteration for tag_number of max_command in start_scsi() 2010-08-11 08:59:00 -07:00
dc395x.h
dmx3191d.c
dpt_i2o.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
dpti.h
dtc.c
dtc.h
eata.c
eata_generic.h
eata_pio.c
eata_pio.h
esp_scsi.c
esp_scsi.h
fd_mcs.c
fdomain.c
fdomain.h
FlashPoint.c
g_NCR5380.c g_NCR5380: fix broken MMIO compilation 2010-08-11 08:59:00 -07:00
g_NCR5380.h g_NCR5380: fix broken MMIO compilation 2010-08-11 08:59:00 -07:00
g_NCR5380_mmio.c
gdth.c [SCSI] gdth: integer overflow in ioctl 2010-10-25 15:01:14 -05:00
gdth.h
gdth_ioctl.h
gdth_proc.c
gdth_proc.h
gvp11.c m68k/scsi: gvp11 - Do not use legacy Scsi_Host.base 2010-05-26 19:51:08 +02:00
gvp11.h m68k: amiga - GVP Series II SCSI zorro_driver conversion 2010-05-26 19:51:08 +02:00
hosts.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2010-10-22 19:36:42 -07:00
hpsa.c [SCSI] hpsa: disable doorbell reset on reset_devices 2010-09-02 17:14:44 -03:00
hpsa.h [SCSI] hpsa: remove unused firm_ver member of the per-hba structure 2010-07-27 12:01:15 -05:00
hpsa_cmd.h [SCSI] hpsa: Fix hard reset code. 2010-07-27 12:02:00 -05:00
hptiop.c [SCSI] hptiop: Eliminate a NULL pointer dereference 2010-07-27 12:01:01 -05:00
hptiop.h
ibmmca.c
imm.c
imm.h
in2000.c
in2000.h
initio.c drivers/scsi: remove unnecessary NULL test 2010-08-11 08:59:00 -07:00
initio.h
ipr.c [SCSI] ipr: fix array error logging 2010-10-07 17:24:44 -05:00
ipr.h [SCSI] ipr: fix array error logging 2010-10-07 17:24:44 -05:00
ips.c
ips.h
iscsi_boot_sysfs.c [SCSI] iscsi boot: mv iscsi_boot_sysfs to drivers/scsi 2010-08-06 10:45:07 -05:00
iscsi_tcp.c [SCSI] iscsi_tcp: remove sk_sleep check 2010-05-25 10:04:10 -05:00
iscsi_tcp.h
jazz_esp.c
Kconfig Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-10-24 13:41:39 -07:00
lasi700.c
libiscsi.c [SCSI] libiscsi: regression: fix header digest errors 2010-05-02 11:16:50 -04:00
libiscsi_tcp.c
libsrp.c
mac53c94.c powerpc/macio: Fix probing of macio devices by using the right of match table 2010-06-02 17:50:38 +10:00
mac53c94.h
mac_esp.c
mac_scsi.c
mac_scsi.h
Makefile [SCSI] cxgb3i: change cxgb3i to use libcxgbi 2010-09-05 14:29:23 -03:00
megaraid.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
megaraid.h scsi: Push down BKL into ioctl functions 2010-05-17 05:27:04 +02:00
mesh.c powerpc/macio: Fix probing of macio devices by using the right of match table 2010-06-02 17:50:38 +10:00
mesh.h
mvme16x_scsi.c
mvme147.c m68k/scsi: mvme147 - Kill obsolete HOSTS_C logic 2010-05-26 19:51:07 +02:00
mvme147.h [SCSI] mvme147: Reindentation 2010-05-02 15:55:03 -04:00
ncr53c8xx.c
ncr53c8xx.h
NCR53c406a.c
NCR5380.c NCR5380: bit MR_DMA_MODE set twice in NCR5380_transfer_dma() 2010-08-11 08:59:00 -07:00
NCR5380.h
NCR_D700.c
NCR_D700.h
NCR_Q720.c
NCR_Q720.h
nsp32.c
nsp32.h
nsp32_debug.c
nsp32_io.h
osst.c scsi: autoconvert trivial BKL users to private mutex 2010-09-15 21:00:45 +02:00
osst.h
osst_detect.h
osst_options.h
pas16.c
pas16.h
pmcraid.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
pmcraid.h [SCSI] pmcraid: MSI-X support and other changes 2010-07-27 12:01:35 -05:00
ppa.c
ppa.h
ps3rom.c
qla1280.c
qla1280.h
qlogicfas.c
qlogicfas408.c
qlogicfas408.h
qlogicpti.c of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
qlogicpti.h of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
raid_class.c
script_asm.pl
scsi.c [SCSI] Fix VPD inquiry page wrapper 2010-09-16 11:48:48 -04:00
scsi.h
scsi_debug.c [SCSI] scsi_debug: Convert to use root_device_register() and root_device_unregister() 2010-09-16 22:54:08 -04:00
scsi_devinfo.c
scsi_error.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-08-14 12:34:34 -07:00
scsi_ioctl.c
scsi_lib.c [SCSI] Fix regressions in scsi_internal_device_block 2010-10-25 09:48:32 -05:00
scsi_lib_dma.c
scsi_logging.h
scsi_module.c
scsi_netlink.c
scsi_pm.c [SCSI] implement runtime Power Management 2010-07-28 09:07:50 -05:00
scsi_priv.h SCSI: remove fake "address-of" expression 2010-08-06 09:17:02 -07:00
scsi_proc.c
scsi_sas_internal.h
scsi_scan.c driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices 2010-10-22 10:16:43 -07:00
scsi_sysctl.c
scsi_sysfs.c [SCSI] Fix race when removing SCSI devices 2010-10-25 15:00:47 -05:00
scsi_tgt_if.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
scsi_tgt_lib.c [SCSI] tgt: fix warning 2010-08-11 00:55:42 -04:00
scsi_tgt_priv.h
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c [SCSI] fc class: add fc host dev loss sysfs file 2010-10-07 17:09:44 -05:00
scsi_transport_fc_internal.h
scsi_transport_iscsi.c [SCSI] iscsi transport: fix kernel-doc notation 2010-09-09 15:30:08 -05:00
scsi_transport_sas.c
scsi_transport_spi.c
scsi_transport_srp.c
scsi_transport_srp_internal.h
scsi_typedefs.h
scsi_wait_scan.c
scsicam.c
sd.c [SCSI] sd: Export effective protection mode in sysfs 2010-10-25 14:57:44 -05:00
sd.h [SCSI] sd: Fix overflow with big physical blocks 2010-10-11 17:33:20 -05:00
sd_dif.c block: Make the integrity mapped property a bio flag 2010-10-15 15:49:20 +02:00
ses.c
sg.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-10-24 13:41:39 -07:00
sgiwd93.c
sim710.c
sni_53c710.c
sr.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2010-10-22 20:30:48 -07:00
sr.h
sr_ioctl.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sr_vendor.c
st.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-10-22 17:34:15 -07:00
st.h
st_options.h
stex.c
sun3_NCR5380.c block: remove wrappers for request type/flags 2010-08-07 18:17:56 +02:00
sun3_scsi.c block: remove wrappers for request type/flags 2010-08-07 18:17:56 +02:00
sun3_scsi.h
sun3_scsi_vme.c block: remove wrappers for request type/flags 2010-08-07 18:17:56 +02:00
sun3x_esp.c
sun_esp.c of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
sym53c416.c
sym53c416.h
t128.c
t128.h
tmscsim.c
tmscsim.h
u14-34f.c
ultrastor.c
ultrastor.h
vmw_pvscsi.c
vmw_pvscsi.h
wd33c93.c [SCSI] wd33c93: Kill empty wd33c93_release() 2010-05-02 15:54:15 -04:00
wd33c93.h [SCSI] wd33c93: Kill empty wd33c93_release() 2010-05-02 15:54:15 -04:00
wd7000.c
zalon.c
zorro7xx.c m68k: amiga - Zorro bus modalias support 2010-05-17 21:37:41 +02:00