diff options
author | Vasu Dev <vasu.dev@intel.com> | 2009-08-14 08:41:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-14 19:12:06 -0400 |
commit | b85daa5324a3c9e560a4351c17d18f49c647eb5c (patch) | |
tree | 0616b7adcb0b785560b4826a211517aeb84f03d3 /net | |
parent | cf9911166113e471e1796eaf273982d8e43b138d (diff) |
vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field
Adds fcoe offload related net_device_ops functions vlan_dev_fcoe_ddp_setup
and vlan_dev_fcoe_ddp_done, their implementation simply calls real eth device
net_device_ops for FCoE DDP setup and done operations.
Updates VLAN netdev field value for fcoe_ddp_xid from real eth device netdev.
Above changes are required for fcoe DDP offload working on a VLAN interface.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/8021q/vlan.c | 3 | ||||
-rw-r--r-- | net/8021q/vlan_dev.c | 39 |
2 files changed, 42 insertions, 0 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index a1f16303703a..e814794b0a1a 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -391,6 +391,9 @@ static void vlan_transfer_features(struct net_device *dev, | |||
391 | vlandev->features &= ~dev->vlan_features; | 391 | vlandev->features &= ~dev->vlan_features; |
392 | vlandev->features |= dev->features & dev->vlan_features; | 392 | vlandev->features |= dev->features & dev->vlan_features; |
393 | vlandev->gso_max_size = dev->gso_max_size; | 393 | vlandev->gso_max_size = dev->gso_max_size; |
394 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | ||
395 | vlandev->fcoe_ddp_xid = dev->fcoe_ddp_xid; | ||
396 | #endif | ||
394 | 397 | ||
395 | if (old_features != vlandev->features) | 398 | if (old_features != vlandev->features) |
396 | netdev_features_change(vlandev); | 399 | netdev_features_change(vlandev); |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 96bad8f233e2..6e695acd1ae0 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -561,6 +561,33 @@ static int vlan_dev_neigh_setup(struct net_device *dev, struct neigh_parms *pa) | |||
561 | return err; | 561 | return err; |
562 | } | 562 | } |
563 | 563 | ||
564 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | ||
565 | static int vlan_dev_fcoe_ddp_setup(struct net_device *dev, u16 xid, | ||
566 | struct scatterlist *sgl, unsigned int sgc) | ||
567 | { | ||
568 | struct net_device *real_dev = vlan_dev_info(dev)->real_dev; | ||
569 | const struct net_device_ops *ops = real_dev->netdev_ops; | ||
570 | int rc = 0; | ||
571 | |||
572 | if (ops->ndo_fcoe_ddp_setup) | ||
573 | rc = ops->ndo_fcoe_ddp_setup(real_dev, xid, sgl, sgc); | ||
574 | |||
575 | return rc; | ||
576 | } | ||
577 | |||
578 | static int vlan_dev_fcoe_ddp_done(struct net_device *dev, u16 xid) | ||
579 | { | ||
580 | struct net_device *real_dev = vlan_dev_info(dev)->real_dev; | ||
581 | const struct net_device_ops *ops = real_dev->netdev_ops; | ||
582 | int len = 0; | ||
583 | |||
584 | if (ops->ndo_fcoe_ddp_done) | ||
585 | len = ops->ndo_fcoe_ddp_done(real_dev, xid); | ||
586 | |||
587 | return len; | ||
588 | } | ||
589 | #endif | ||
590 | |||
564 | static void vlan_dev_change_rx_flags(struct net_device *dev, int change) | 591 | static void vlan_dev_change_rx_flags(struct net_device *dev, int change) |
565 | { | 592 | { |
566 | struct net_device *real_dev = vlan_dev_info(dev)->real_dev; | 593 | struct net_device *real_dev = vlan_dev_info(dev)->real_dev; |
@@ -635,6 +662,10 @@ static int vlan_dev_init(struct net_device *dev) | |||
635 | if (is_zero_ether_addr(dev->broadcast)) | 662 | if (is_zero_ether_addr(dev->broadcast)) |
636 | memcpy(dev->broadcast, real_dev->broadcast, dev->addr_len); | 663 | memcpy(dev->broadcast, real_dev->broadcast, dev->addr_len); |
637 | 664 | ||
665 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | ||
666 | dev->fcoe_ddp_xid = real_dev->fcoe_ddp_xid; | ||
667 | #endif | ||
668 | |||
638 | if (real_dev->features & NETIF_F_HW_VLAN_TX) { | 669 | if (real_dev->features & NETIF_F_HW_VLAN_TX) { |
639 | dev->header_ops = real_dev->header_ops; | 670 | dev->header_ops = real_dev->header_ops; |
640 | dev->hard_header_len = real_dev->hard_header_len; | 671 | dev->hard_header_len = real_dev->hard_header_len; |
@@ -715,6 +746,10 @@ static const struct net_device_ops vlan_netdev_ops = { | |||
715 | .ndo_change_rx_flags = vlan_dev_change_rx_flags, | 746 | .ndo_change_rx_flags = vlan_dev_change_rx_flags, |
716 | .ndo_do_ioctl = vlan_dev_ioctl, | 747 | .ndo_do_ioctl = vlan_dev_ioctl, |
717 | .ndo_neigh_setup = vlan_dev_neigh_setup, | 748 | .ndo_neigh_setup = vlan_dev_neigh_setup, |
749 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | ||
750 | .ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup, | ||
751 | .ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done, | ||
752 | #endif | ||
718 | }; | 753 | }; |
719 | 754 | ||
720 | static const struct net_device_ops vlan_netdev_accel_ops = { | 755 | static const struct net_device_ops vlan_netdev_accel_ops = { |
@@ -731,6 +766,10 @@ static const struct net_device_ops vlan_netdev_accel_ops = { | |||
731 | .ndo_change_rx_flags = vlan_dev_change_rx_flags, | 766 | .ndo_change_rx_flags = vlan_dev_change_rx_flags, |
732 | .ndo_do_ioctl = vlan_dev_ioctl, | 767 | .ndo_do_ioctl = vlan_dev_ioctl, |
733 | .ndo_neigh_setup = vlan_dev_neigh_setup, | 768 | .ndo_neigh_setup = vlan_dev_neigh_setup, |
769 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | ||
770 | .ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup, | ||
771 | .ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done, | ||
772 | #endif | ||
734 | }; | 773 | }; |
735 | 774 | ||
736 | void vlan_setup(struct net_device *dev) | 775 | void vlan_setup(struct net_device *dev) |