netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-scsi@vger.kernel.org,
	gospo@redhat.com, Vasu Dev <vasu.dev@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next PATCH 01/12] vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field
Date: Fri, 14 Aug 2009 15:41:07 -0700	[thread overview]
Message-ID: <20090814224106.1640.6910.stgit@localhost.localdomain> (raw)
In-Reply-To: <20090814223857.1640.26881.stgit@localhost.localdomain>

From: Vasu Dev <vasu.dev@intel.com>

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>
---

 net/8021q/vlan.c     |    3 +++
 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 a1f1630..e814794 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -391,6 +391,9 @@ static void vlan_transfer_features(struct net_device *dev,
 	vlandev->features &= ~dev->vlan_features;
 	vlandev->features |= dev->features & dev->vlan_features;
 	vlandev->gso_max_size = dev->gso_max_size;
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+	vlandev->fcoe_ddp_xid = dev->fcoe_ddp_xid;
+#endif
 
 	if (old_features != vlandev->features)
 		netdev_features_change(vlandev);
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 96bad8f..6e695ac 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)
 	return err;
 }
 
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+static int vlan_dev_fcoe_ddp_setup(struct net_device *dev, u16 xid,
+				   struct scatterlist *sgl, unsigned int sgc)
+{
+	struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
+	const struct net_device_ops *ops = real_dev->netdev_ops;
+	int rc = 0;
+
+	if (ops->ndo_fcoe_ddp_setup)
+		rc = ops->ndo_fcoe_ddp_setup(real_dev, xid, sgl, sgc);
+
+	return rc;
+}
+
+static int vlan_dev_fcoe_ddp_done(struct net_device *dev, u16 xid)
+{
+	struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
+	const struct net_device_ops *ops = real_dev->netdev_ops;
+	int len = 0;
+
+	if (ops->ndo_fcoe_ddp_done)
+		len = ops->ndo_fcoe_ddp_done(real_dev, xid);
+
+	return len;
+}
+#endif
+
 static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
 {
 	struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
@@ -635,6 +662,10 @@ static int vlan_dev_init(struct net_device *dev)
 	if (is_zero_ether_addr(dev->broadcast))
 		memcpy(dev->broadcast, real_dev->broadcast, dev->addr_len);
 
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+	dev->fcoe_ddp_xid = real_dev->fcoe_ddp_xid;
+#endif
+
 	if (real_dev->features & NETIF_F_HW_VLAN_TX) {
 		dev->header_ops      = real_dev->header_ops;
 		dev->hard_header_len = real_dev->hard_header_len;
@@ -715,6 +746,10 @@ static const struct net_device_ops vlan_netdev_ops = {
 	.ndo_change_rx_flags	= vlan_dev_change_rx_flags,
 	.ndo_do_ioctl		= vlan_dev_ioctl,
 	.ndo_neigh_setup	= vlan_dev_neigh_setup,
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+	.ndo_fcoe_ddp_setup	= vlan_dev_fcoe_ddp_setup,
+	.ndo_fcoe_ddp_done	= vlan_dev_fcoe_ddp_done,
+#endif
 };
 
 static const struct net_device_ops vlan_netdev_accel_ops = {
@@ -731,6 +766,10 @@ static const struct net_device_ops vlan_netdev_accel_ops = {
 	.ndo_change_rx_flags	= vlan_dev_change_rx_flags,
 	.ndo_do_ioctl		= vlan_dev_ioctl,
 	.ndo_neigh_setup	= vlan_dev_neigh_setup,
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+	.ndo_fcoe_ddp_setup	= vlan_dev_fcoe_ddp_setup,
+	.ndo_fcoe_ddp_done	= vlan_dev_fcoe_ddp_done,
+#endif
 };
 
 void vlan_setup(struct net_device *dev)


  reply	other threads:[~2009-08-14 22:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
2009-08-14 22:41 ` Jeff Kirsher [this message]
2009-08-14 23:12   ` [net-next PATCH 01/12] vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field David Miller
2009-08-14 22:41 ` [net-next PATCH 02/12] ixgbe: updates vlan feature flags to enable FCoE offloads on vlan interface Jeff Kirsher
2009-08-14 23:12   ` David Miller
2009-08-14 22:41 ` [net-next PATCH 03/12] net: Add NETIF_F_FCOE_MTU to indicate support for a different MTU for FCoE Jeff Kirsher
2009-08-14 23:12   ` David Miller
2009-08-14 22:42 ` [net-next PATCH 04/12] ixgbe: Add support for NETIF_F_FCOE_MTU to 82599 devices Jeff Kirsher
2009-08-14 23:12   ` David Miller
2009-08-14 22:42 ` [net-next PATCH 05/12] net: Add ndo_fcoe_control to net_device_ops Jeff Kirsher
2009-08-14 23:14   ` David Miller
2009-08-14 23:29     ` Zou, Yi
2009-08-14 22:43 ` [net-next PATCH 06/12] vlan: Add support for net_devices_ops.ndo_fcoe_control to VLAN Jeff Kirsher
2009-08-14 22:43 ` [net-next PATCH 07/12] ixgbe: Add support for the net_device_ops.ndo_fcoe_control to 82599 Jeff Kirsher
2009-08-14 22:43 ` [net-next PATCH 08/12] dcbnl: Add support for setapp/getapp commands to dcbnl Jeff Kirsher
2009-08-14 22:44 ` [net-next PATCH 09/12] dcbnl: Add support for setapp/getapp to netdev dcbnl_rtnl_ops Jeff Kirsher
2009-08-14 22:44 ` [net-next PATCH 10/12] dcbnl: Add netlink attributes for setapp/getapp to dcbnl Jeff Kirsher
2009-08-14 22:44 ` [net-next PATCH 11/12] dcbnl: Add implementations of dcbnl setapp/getapp commands Jeff Kirsher
2009-08-14 22:45 ` [net-next PATCH 12/12] ixgbe: Add support for dcbnl_rtnl_ops.setapp/getapp Jeff Kirsher

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=20090814224106.1640.6910.stgit@localhost.localdomain \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vasu.dev@intel.com \
    /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).