Skip to content

Commit 0a89eb9

Browse files
cleechdavem330
authored andcommitted
vlan: conditional inclusion of FCoE hooks to match netdevice.h and bnx2x
Way back in 3c9c36b the ndo_fcoe_get_wwn pointer was switched from depending on CONFIG_FCOE to CONFIG_LIBFCOE in order to allow building FCoE support into the bnx2x driver and used by bnx2fc without including the generic software fcoe module. But, FCoE is generally used over an 802.1q VLAN, and the implementation of ndo_fcoe_get_wwn in the 8021q module was not similarly changed. The result is that if CONFIG_FCOE is disabled, then bnz2fc cannot make a call to ndo_fcoe_get_wwn through the 8021q interface to the underlying bnx2x interface. The bnx2fc driver then falls back to a potentially different mapping of Ethernet MAC to Fibre Channel WWN, creating an incompatibility with the fabric and target configurations when compared to the WWNs used by pre-boot firmware and differently-configured kernels. So make the conditional inclusion of FCoE code in 8021q match the conditional inclusion in netdevice.h Signed-off-by: Chris Leech <cleech@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5ba5780 commit 0a89eb9

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

net/8021q/vlan_dev.c

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -443,27 +443,29 @@ static int vlan_dev_fcoe_disable(struct net_device *dev)
443443
return rc;
444444
}
445445

446-
static int vlan_dev_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)
446+
static int vlan_dev_fcoe_ddp_target(struct net_device *dev, u16 xid,
447+
struct scatterlist *sgl, unsigned int sgc)
447448
{
448449
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
449450
const struct net_device_ops *ops = real_dev->netdev_ops;
450-
int rc = -EINVAL;
451+
int rc = 0;
452+
453+
if (ops->ndo_fcoe_ddp_target)
454+
rc = ops->ndo_fcoe_ddp_target(real_dev, xid, sgl, sgc);
451455

452-
if (ops->ndo_fcoe_get_wwn)
453-
rc = ops->ndo_fcoe_get_wwn(real_dev, wwn, type);
454456
return rc;
455457
}
458+
#endif
456459

457-
static int vlan_dev_fcoe_ddp_target(struct net_device *dev, u16 xid,
458-
struct scatterlist *sgl, unsigned int sgc)
460+
#ifdef NETDEV_FCOE_WWNN
461+
static int vlan_dev_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)
459462
{
460463
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
461464
const struct net_device_ops *ops = real_dev->netdev_ops;
462-
int rc = 0;
463-
464-
if (ops->ndo_fcoe_ddp_target)
465-
rc = ops->ndo_fcoe_ddp_target(real_dev, xid, sgl, sgc);
465+
int rc = -EINVAL;
466466

467+
if (ops->ndo_fcoe_get_wwn)
468+
rc = ops->ndo_fcoe_get_wwn(real_dev, wwn, type);
467469
return rc;
468470
}
469471
#endif
@@ -794,9 +796,11 @@ static const struct net_device_ops vlan_netdev_ops = {
794796
.ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done,
795797
.ndo_fcoe_enable = vlan_dev_fcoe_enable,
796798
.ndo_fcoe_disable = vlan_dev_fcoe_disable,
797-
.ndo_fcoe_get_wwn = vlan_dev_fcoe_get_wwn,
798799
.ndo_fcoe_ddp_target = vlan_dev_fcoe_ddp_target,
799800
#endif
801+
#ifdef NETDEV_FCOE_WWNN
802+
.ndo_fcoe_get_wwn = vlan_dev_fcoe_get_wwn,
803+
#endif
800804
#ifdef CONFIG_NET_POLL_CONTROLLER
801805
.ndo_poll_controller = vlan_dev_poll_controller,
802806
.ndo_netpoll_setup = vlan_dev_netpoll_setup,

0 commit comments

Comments
 (0)