* [net-next PATCH 00/12] ixgbe/vlan/DCB patch set
@ 2009-08-14 22:40 Jeff Kirsher
2009-08-14 22:41 ` [net-next PATCH 01/12] vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field Jeff Kirsher
` (11 more replies)
0 siblings, 12 replies; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:40 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-scsi, gospo
Please merge net-2.6 then apply this set...
---
Vasu Dev (2):
ixgbe: updates vlan feature flags to enable FCoE offloads on vlan interface
vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field
Yi Zou (10):
ixgbe: Add support for dcbnl_rtnl_ops.setapp/getapp
dcbnl: Add implementations of dcbnl setapp/getapp commands
dcbnl: Add netlink attributes for setapp/getapp to dcbnl
dcbnl: Add support for setapp/getapp to netdev dcbnl_rtnl_ops
dcbnl: Add support for setapp/getapp commands to dcbnl
ixgbe: Add support for the net_device_ops.ndo_fcoe_control to 82599
vlan: Add support for net_devices_ops.ndo_fcoe_control to VLAN
net: Add ndo_fcoe_control to net_device_ops
ixgbe: Add support for NETIF_F_FCOE_MTU to 82599 devices
net: Add NETIF_F_FCOE_MTU to indicate support for a different MTU for FCoE
drivers/net/ixgbe/ixgbe.h | 5 +
drivers/net/ixgbe/ixgbe_dcb_nl.c | 83 ++++++++++++-----
drivers/net/ixgbe/ixgbe_fcoe.c | 184 ++++++++++++++++++++++++++++++++++++++
drivers/net/ixgbe/ixgbe_fcoe.h | 4 +
drivers/net/ixgbe/ixgbe_main.c | 9 +-
include/linux/dcbnl.h | 18 ++++
include/linux/netdevice.h | 5 +
include/net/dcbnl.h | 2
net/8021q/vlan.c | 3 +
net/8021q/vlan_dev.c | 52 +++++++++++
net/dcb/dcbnl.c | 130 +++++++++++++++++++++++++++
11 files changed, 469 insertions(+), 26 deletions(-)
--
Cheers,
Jeff
^ permalink raw reply [flat|nested] 19+ messages in thread
* [net-next PATCH 01/12] vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
@ 2009-08-14 22:41 ` Jeff Kirsher
2009-08-14 23:12 ` 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
` (10 subsequent siblings)
11 siblings, 1 reply; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:41 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-scsi, gospo, Vasu Dev, Jeff Kirsher
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)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 02/12] ixgbe: updates vlan feature flags to enable FCoE offloads on vlan interface
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
2009-08-14 22:41 ` [net-next PATCH 01/12] vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field Jeff Kirsher
@ 2009-08-14 22:41 ` 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
` (9 subsequent siblings)
11 siblings, 1 reply; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:41 UTC (permalink / raw)
To: davem
Cc: netdev, linux-scsi, gospo, Vasu Dev, Yi Zou,
Peter P Waskiewicz Jr, Jeff Kirsher
From: Vasu Dev <vasu.dev@intel.com>
Updates netdev->vlan_features for NETIF_F_FCOE_CRC and NETIF_F_FSO, so that
FCoE CRC and GSO offloads will get used for FCoE over ixgbe based vlan
interface.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_dcb_nl.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 1c72657..116f12c 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -148,7 +148,10 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
IXGBE_FCRETA_SIZE;
netdev->features |= NETIF_F_FCOE_CRC;
netdev->features |= NETIF_F_FSO;
+ netdev->vlan_features |= NETIF_F_FCOE_CRC;
+ netdev->vlan_features |= NETIF_F_FSO;
netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
+ netdev_features_change(netdev);
}
#endif /* IXGBE_FCOE */
ixgbe_init_interrupt_scheme(adapter);
@@ -177,7 +180,10 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
adapter->ring_feature[RING_F_FCOE].indices = 0;
netdev->features &= ~NETIF_F_FCOE_CRC;
netdev->features &= ~NETIF_F_FSO;
+ netdev->vlan_features &= ~NETIF_F_FCOE_CRC;
+ netdev->vlan_features &= ~NETIF_F_FSO;
netdev->fcoe_ddp_xid = 0;
+ netdev_features_change(netdev);
}
#endif /* IXGBE_FCOE */
ixgbe_init_interrupt_scheme(adapter);
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 03/12] net: Add NETIF_F_FCOE_MTU to indicate support for a different MTU for FCoE
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
2009-08-14 22:41 ` [net-next PATCH 01/12] vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field Jeff Kirsher
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 22:41 ` 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
` (8 subsequent siblings)
11 siblings, 1 reply; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:41 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-scsi, gospo, Yi Zou, Jeff Kirsher
From: Yi Zou <yi.zou@intel.com>
Add NETIF_F_FCOE_MTU to indicate that the NIC can support a secondary MTU for
converged traffic of LAN and Fiber Channel over Ethernet (FCoE). The MTU for
FCoE is 2158 = 14 (FCoE header) + 24 (FC header) + 2112 (FC max payload) +
4 (FC CRC) + 4 (FCoE trailer).
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
include/linux/netdevice.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9f25ab2..9192cdf 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -701,6 +701,7 @@ struct net_device
/* the GSO_MASK reserves bits 16 through 23 */
#define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */
#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */
+#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
/* Segmentation offload features */
#define NETIF_F_GSO_SHIFT 16
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 04/12] ixgbe: Add support for NETIF_F_FCOE_MTU to 82599 devices
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
` (2 preceding siblings ...)
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 22:42 ` 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
` (7 subsequent siblings)
11 siblings, 1 reply; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:42 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-scsi, gospo, Yi Zou, Jeff Kirsher
From: Yi Zou <yi.zou@intel.com>
Enable netdev feature flag bit NETIF_F_FCOE_MTU for 82599 devices and enable
jumbo frame correspondingly when NETIF_F_FCOE_MTU is set.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_dcb_nl.c | 4 ++++
drivers/net/ixgbe/ixgbe_main.c | 6 +++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 116f12c..34bca45 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -148,8 +148,10 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
IXGBE_FCRETA_SIZE;
netdev->features |= NETIF_F_FCOE_CRC;
netdev->features |= NETIF_F_FSO;
+ netdev->features |= NETIF_F_FCOE_MTU;
netdev->vlan_features |= NETIF_F_FCOE_CRC;
netdev->vlan_features |= NETIF_F_FSO;
+ netdev->vlan_features |= NETIF_F_FCOE_MTU;
netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
netdev_features_change(netdev);
}
@@ -180,8 +182,10 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
adapter->ring_feature[RING_F_FCOE].indices = 0;
netdev->features &= ~NETIF_F_FCOE_CRC;
netdev->features &= ~NETIF_F_FSO;
+ netdev->features &= ~NETIF_F_FCOE_MTU;
netdev->vlan_features &= ~NETIF_F_FCOE_CRC;
netdev->vlan_features &= ~NETIF_F_FSO;
+ netdev->vlan_features &= ~NETIF_F_FCOE_MTU;
netdev->fcoe_ddp_xid = 0;
netdev_features_change(netdev);
}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 8a8518d..d69d277 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2026,7 +2026,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
else
hlreg0 |= IXGBE_HLREG0_JUMBOEN;
#ifdef IXGBE_FCOE
- if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
+ if (netdev->features & NETIF_F_FCOE_MTU)
hlreg0 |= IXGBE_HLREG0_JUMBOEN;
#endif
IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
@@ -2057,7 +2057,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
rx_ring->flags |= IXGBE_RING_RX_PS_ENABLED;
#ifdef IXGBE_FCOE
- if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) {
+ if (netdev->features & NETIF_F_FCOE_MTU) {
struct ixgbe_ring_feature *f;
f = &adapter->ring_feature[RING_F_FCOE];
if ((i >= f->mask) && (i < f->mask + f->indices)) {
@@ -2609,7 +2609,7 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)
#ifdef IXGBE_FCOE
/* adjust max frame to be able to do baby jumbo for FCoE */
- if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) &&
+ if ((netdev->features & NETIF_F_FCOE_MTU) &&
(max_frame < IXGBE_FCOE_JUMBO_FRAME_SIZE))
max_frame = IXGBE_FCOE_JUMBO_FRAME_SIZE;
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 05/12] net: Add ndo_fcoe_control to net_device_ops
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
` (3 preceding siblings ...)
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 22:42 ` Jeff Kirsher
2009-08-14 23:14 ` David Miller
2009-08-14 22:43 ` [net-next PATCH 06/12] vlan: Add support for net_devices_ops.ndo_fcoe_control to VLAN Jeff Kirsher
` (6 subsequent siblings)
11 siblings, 1 reply; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:42 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-scsi, gospo, Yi Zou, Jeff Kirsher
From: Yi Zou <yi.zou@intel.com>
Add ndo_fcoe_control to net_device_ops so the corresponding HW can initialize
itself for FCoE traffic or clean up after FCoE traffic is done. This is
expected to be called by the kernel FCoE stack upon receiving a request for
creating an FCoE instance on the corresponding netdev interface. When
implemented by the actual HW, the HW driver check the op code to perform
corresponding initialization or clean up for FCoE. The initialization normally
includes allocating extra queues for FCoE, setting corresponding HW registers
for FCoE, indicating FCoE offload features via netdev, etc. The clean-up would
include releasing the resources allocated for FCoE.
Currently, there are two defined op codes as NETDEV_FCOE_DISABLE and _ENABLE,
for initialization and cleanup accordingly.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
include/linux/netdevice.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9192cdf..84c110b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -623,6 +623,10 @@ struct net_device_ops {
void (*ndo_poll_controller)(struct net_device *dev);
#endif
#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+#define NETDEV_FCOE_DISABLE 0x0
+#define NETDEV_FCOE_ENABLE 0x1
+ int (*ndo_fcoe_control)(struct net_device *dev,
+ u32 op);
int (*ndo_fcoe_ddp_setup)(struct net_device *dev,
u16 xid,
struct scatterlist *sgl,
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 06/12] vlan: Add support for net_devices_ops.ndo_fcoe_control to VLAN
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
` (4 preceding siblings ...)
2009-08-14 22:42 ` [net-next PATCH 05/12] net: Add ndo_fcoe_control to net_device_ops Jeff Kirsher
@ 2009-08-14 22:43 ` 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
` (5 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-scsi, gospo, Yi Zou, Jeff Kirsher
From: Yi Zou <yi.zou@intel.com>
This adds implementation of the net_devices_ops.ndo_fcoe_control to the VLAN
driver. It checks if the real_dev has support for ndo_fcoe_control and pass on
to call the associated real_dev->netdevice_ops->ndo_fcoe_control.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
net/8021q/vlan_dev.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 6e695ac..9a4ddf5 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -586,6 +586,17 @@ static int vlan_dev_fcoe_ddp_done(struct net_device *dev, u16 xid)
return len;
}
+
+static int vlan_dev_fcoe_control(struct net_device *dev, u32 op)
+{
+ struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
+ const struct net_device_ops *ops = real_dev->netdev_ops;
+ int rc = -EINVAL;
+
+ if (ops->ndo_fcoe_control)
+ rc = ops->ndo_fcoe_control(real_dev, op);
+ return rc;
+}
#endif
static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
@@ -749,6 +760,7 @@ static const struct net_device_ops vlan_netdev_ops = {
#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,
+ .ndo_fcoe_control = vlan_dev_fcoe_control,
#endif
};
@@ -769,6 +781,7 @@ static const struct net_device_ops vlan_netdev_accel_ops = {
#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,
+ .ndo_fcoe_control = vlan_dev_fcoe_control,
#endif
};
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 07/12] ixgbe: Add support for the net_device_ops.ndo_fcoe_control to 82599
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
` (5 preceding siblings ...)
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 ` Jeff Kirsher
2009-08-14 22:43 ` [net-next PATCH 08/12] dcbnl: Add support for setapp/getapp commands to dcbnl Jeff Kirsher
` (4 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:43 UTC (permalink / raw)
To: davem
Cc: netdev, linux-scsi, gospo, Yi Zou, Peter P Waskiewicz Jr,
Jeff Kirsher
From: Yi Zou <yi.zou@intel.com>
This adds support to the net_device_ops.ndo_fcoe_control for 82599. This
consequently allows us to dynamically turn FCoE offload feature on or off
upon incoming calls to ndo_fcoe_control. When this happens, FCoE offload
features are enabled/disabled accordingly, and this is regardless of whether
DCB being turned on or not.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe.h | 1
drivers/net/ixgbe/ixgbe_dcb_nl.c | 33 ----------
drivers/net/ixgbe/ixgbe_fcoe.c | 120 ++++++++++++++++++++++++++++++++++++++
drivers/net/ixgbe/ixgbe_main.c | 1
4 files changed, 122 insertions(+), 33 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 8f1f8ba..3c25524 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -485,6 +485,7 @@ extern int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter,
extern int ixgbe_fcoe_ddp_get(struct net_device *netdev, u16 xid,
struct scatterlist *sgl, unsigned int sgc);
extern int ixgbe_fcoe_ddp_put(struct net_device *netdev, u16 xid);
+extern int ixgbe_fcoe_control(struct net_device *netdev, u32 op);
#endif /* IXGBE_FCOE */
#endif /* _IXGBE_H_ */
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 34bca45..e05c62a 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -139,23 +139,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
}
adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
-#ifdef IXGBE_FCOE
- /* Turn on FCoE offload */
- if ((adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) &&
- (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))) {
- adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
- adapter->ring_feature[RING_F_FCOE].indices =
- IXGBE_FCRETA_SIZE;
- netdev->features |= NETIF_F_FCOE_CRC;
- netdev->features |= NETIF_F_FSO;
- netdev->features |= NETIF_F_FCOE_MTU;
- netdev->vlan_features |= NETIF_F_FCOE_CRC;
- netdev->vlan_features |= NETIF_F_FSO;
- netdev->vlan_features |= NETIF_F_FCOE_MTU;
- netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
- netdev_features_change(netdev);
- }
-#endif /* IXGBE_FCOE */
ixgbe_init_interrupt_scheme(adapter);
if (netif_running(netdev))
netdev->netdev_ops->ndo_open(netdev);
@@ -174,22 +157,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
if (adapter->hw.mac.type == ixgbe_mac_82599EB)
adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
-#ifdef IXGBE_FCOE
- /* Turn off FCoE offload */
- if (adapter->flags & (IXGBE_FLAG_FCOE_CAPABLE |
- IXGBE_FLAG_FCOE_ENABLED)) {
- adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
- adapter->ring_feature[RING_F_FCOE].indices = 0;
- netdev->features &= ~NETIF_F_FCOE_CRC;
- netdev->features &= ~NETIF_F_FSO;
- netdev->features &= ~NETIF_F_FCOE_MTU;
- netdev->vlan_features &= ~NETIF_F_FCOE_CRC;
- netdev->vlan_features &= ~NETIF_F_FSO;
- netdev->vlan_features &= ~NETIF_F_FCOE_MTU;
- netdev->fcoe_ddp_xid = 0;
- netdev_features_change(netdev);
- }
-#endif /* IXGBE_FCOE */
ixgbe_init_interrupt_scheme(adapter);
if (netif_running(netdev))
netdev->netdev_ops->ndo_open(netdev);
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c
index 28cf104..b67ed27 100644
--- a/drivers/net/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ixgbe/ixgbe_fcoe.c
@@ -554,3 +554,123 @@ void ixgbe_cleanup_fcoe(struct ixgbe_adapter *adapter)
fcoe->pool = NULL;
}
}
+
+/**
+ * ixgbe_enable_fcoe - turn on FCoE offload feature
+ * @netdev: the corresponding netdev
+ *
+ * Turns on FCoE offload feature in 82599.
+ *
+ * Returns : 0 indicates success or -EINVAL on failure
+ */
+static int ixgbe_enable_fcoe(struct net_device *netdev)
+{
+ int rc = -EINVAL;
+ struct ixgbe_adapter *adapter = netdev_priv(netdev);
+
+ if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
+ goto out_enable;
+
+ DPRINTK(DRV, INFO, "Enabling FCoE offload features.\n");
+ if (netif_running(netdev))
+ netdev->netdev_ops->ndo_stop(netdev);
+
+ ixgbe_clear_interrupt_scheme(adapter);
+
+ adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
+ adapter->ring_feature[RING_F_FCOE].indices = IXGBE_FCRETA_SIZE;
+ netdev->features |= NETIF_F_FCOE_CRC;
+ netdev->features |= NETIF_F_FSO;
+ netdev->features |= NETIF_F_FCOE_MTU;
+ netdev->vlan_features |= NETIF_F_FCOE_CRC;
+ netdev->vlan_features |= NETIF_F_FSO;
+ netdev->vlan_features |= NETIF_F_FCOE_MTU;
+ netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
+ netdev_features_change(netdev);
+
+ ixgbe_init_interrupt_scheme(adapter);
+
+ if (netif_running(netdev))
+ netdev->netdev_ops->ndo_open(netdev);
+ rc = 0;
+
+out_enable:
+ return rc;
+}
+
+/**
+ * ixgbe_disable_fcoe - turn off FCoE offload feature
+ * @netdev: the corresponding netdev
+ *
+ * Turns off FCoE offload feature in 82599.
+ *
+ * Returns : 0 indicates success or -EINVAL on failure
+ */
+static int ixgbe_disable_fcoe(struct net_device *netdev)
+{
+ int rc = -EINVAL;
+ struct ixgbe_adapter *adapter = netdev_priv(netdev);
+
+ if (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))
+ goto out_disable;
+
+ DPRINTK(DRV, INFO, "Disabling FCoE offload features.\n");
+ if (netif_running(netdev))
+ netdev->netdev_ops->ndo_stop(netdev);
+
+ ixgbe_clear_interrupt_scheme(adapter);
+
+ adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
+ adapter->ring_feature[RING_F_FCOE].indices = 0;
+ netdev->features &= ~NETIF_F_FCOE_CRC;
+ netdev->features &= ~NETIF_F_FSO;
+ netdev->features &= ~NETIF_F_FCOE_MTU;
+ netdev->vlan_features &= ~NETIF_F_FCOE_CRC;
+ netdev->vlan_features &= ~NETIF_F_FSO;
+ netdev->vlan_features &= ~NETIF_F_FCOE_MTU;
+ netdev->fcoe_ddp_xid = 0;
+ netdev_features_change(netdev);
+
+ ixgbe_cleanup_fcoe(adapter);
+
+ ixgbe_init_interrupt_scheme(adapter);
+ if (netif_running(netdev))
+ netdev->netdev_ops->ndo_open(netdev);
+ rc = 0;
+
+out_disable:
+ return rc;
+}
+
+/**
+ * ixgbe_fcoe_control - turn on or off FCoE offload feature
+ * @adapter : ixgbe adapter
+ * @ops : FCoE related command codes
+ *
+ * Supports op code NETDEV_FCOE_ENABLE to turn on FCoE offload
+ * features and op code NETDEV_FCOE_DISABLE to turn off FCoE
+ * offload features in 82599.
+ *
+ * Returns : 0 indicates success or -EINVAL on failure
+ */
+int ixgbe_fcoe_control(struct net_device *netdev, u32 op)
+{
+ int rc = -EINVAL;
+ struct ixgbe_adapter *adapter = netdev_priv(netdev);
+
+ if (!(adapter->flags & IXGBE_FLAG_FCOE_CAPABLE))
+ goto out;
+
+ switch (op) {
+ case NETDEV_FCOE_ENABLE:
+ rc = ixgbe_enable_fcoe(netdev);
+ break;
+ case NETDEV_FCOE_DISABLE:
+ rc = ixgbe_disable_fcoe(netdev);
+ break;
+ default:
+ break;
+ }
+out:
+ return rc;
+}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index d69d277..9738317 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -5376,6 +5376,7 @@ static const struct net_device_ops ixgbe_netdev_ops = {
#ifdef IXGBE_FCOE
.ndo_fcoe_ddp_setup = ixgbe_fcoe_ddp_get,
.ndo_fcoe_ddp_done = ixgbe_fcoe_ddp_put,
+ .ndo_fcoe_control = ixgbe_fcoe_control,
#endif /* IXGBE_FCOE */
};
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 08/12] dcbnl: Add support for setapp/getapp commands to dcbnl
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
` (6 preceding siblings ...)
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 ` 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
` (3 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:43 UTC (permalink / raw)
To: davem
Cc: netdev, linux-scsi, gospo, Yi Zou, Peter P Waskiewicz Jr,
Jeff Kirsher
From: Yi Zou <yi.zou@intel.com>
This patch adds dcbnl command definitions to support setapp/getapp
functionality from the IEEE 802.1Qaz Data Center Bridging Capability
Exchange protocol (DCBX) specification. Section 3.3 defines the
application protocol and its 802.1p user priority in DCBX, which is
implemented here as a pair of setapp/getapp commands in the kernel
dcbnl for setting and retrieving the user priority for an given
application protocol. The protocol is identified by the combination of
an id and an idtype. Currently, when idtype is 0, the corresponding
id gives the ether type of this protocol, e.g., for FCoE, it will be
0x8906; when idtype is 1, then the corresponding id gives the TCP or
UDP port number.
For more information regarding DCBX spec., please refer to the following:
http://www.ieee802.org/1/files/public/docs2008/
az-wadekar-dcbx-capability-exchange-discovery-protocol-1108-v1.01.pdf
Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
include/linux/dcbnl.h | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 7d2e100..b7cdbb4 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -50,6 +50,8 @@ struct dcbmsg {
* @DCB_CMD_SNUMTCS: set the number of traffic classes
* @DCB_CMD_GBCN: set backward congestion notification configuration
* @DCB_CMD_SBCN: get backward congestion notification configration.
+ * @DCB_CMD_GAPP: get application protocol configuration
+ * @DCB_CMD_SAPP: set application protocol configuration
*/
enum dcbnl_commands {
DCB_CMD_UNDEFINED,
@@ -80,6 +82,9 @@ enum dcbnl_commands {
DCB_CMD_BCN_GCFG,
DCB_CMD_BCN_SCFG,
+ DCB_CMD_GAPP,
+ DCB_CMD_SAPP,
+
__DCB_CMD_ENUM_MAX,
DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
};
@@ -114,6 +119,7 @@ enum dcbnl_attrs {
DCB_ATTR_CAP,
DCB_ATTR_NUMTCS,
DCB_ATTR_BCN,
+ DCB_ATTR_APP,
__DCB_ATTR_ENUM_MAX,
DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
@@ -338,5 +344,17 @@ enum dcb_general_attr_values {
DCB_ATTR_VALUE_UNDEFINED = 0xff
};
+#define DCB_APP_IDTYPE_ETHTYPE 0x00
+#define DCB_APP_IDTYPE_PORTNUM 0x01
+enum dcbnl_app_attrs {
+ DCB_APP_ATTR_UNDEFINED,
+
+ DCB_APP_ATTR_IDTYPE,
+ DCB_APP_ATTR_ID,
+ DCB_APP_ATTR_PRIORITY,
+
+ __DCB_APP_ATTR_ENUM_MAX,
+ DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
+};
#endif /* __LINUX_DCBNL_H__ */
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 09/12] dcbnl: Add support for setapp/getapp to netdev dcbnl_rtnl_ops
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
` (7 preceding siblings ...)
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 ` Jeff Kirsher
2009-08-14 22:44 ` [net-next PATCH 10/12] dcbnl: Add netlink attributes for setapp/getapp to dcbnl Jeff Kirsher
` (2 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:44 UTC (permalink / raw)
To: davem
Cc: netdev, linux-scsi, gospo, Yi Zou, Peter P Waskiewicz Jr,
Jeff Kirsher
From: Yi Zou <yi.zou@intel.com>
Adds support of dcbnl setapp/getapp to dcbnl_rtnl_ops in netdev to allow
LLDs to implement their corresponding dcbnl setapp/getapp ops to support
the IEEE 802.1Q DCBX setapp/getapp commands.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
include/net/dcbnl.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index 775cfc8..b36ac7e 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -48,6 +48,8 @@ struct dcbnl_rtnl_ops {
void (*setbcncfg)(struct net_device *, int, u32);
void (*getbcnrp)(struct net_device *, int, u8 *);
void (*setbcnrp)(struct net_device *, int, u8);
+ u8 (*setapp)(struct net_device *, u8, u16, u8);
+ u8 (*getapp)(struct net_device *, u8, u16);
};
#endif /* __NET_DCBNL_H__ */
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 10/12] dcbnl: Add netlink attributes for setapp/getapp to dcbnl
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
` (8 preceding siblings ...)
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 ` 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
11 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:44 UTC (permalink / raw)
To: davem
Cc: netdev, linux-scsi, gospo, Yi Zou, Peter P Waskiewicz Jr,
Jeff Kirsher
From: Yi Zou <yi.zou@intel.com>
Add defines for dcbnl netlink attributes to support netlink message passing of
setapp/getapp in dcbnl.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
net/dcb/dcbnl.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 8379496..4046468 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -64,6 +64,7 @@ static struct nla_policy dcbnl_rtnl_policy[DCB_ATTR_MAX + 1] = {
[DCB_ATTR_CAP] = {.type = NLA_NESTED},
[DCB_ATTR_PFC_STATE] = {.type = NLA_U8},
[DCB_ATTR_BCN] = {.type = NLA_NESTED},
+ [DCB_ATTR_APP] = {.type = NLA_NESTED},
};
/* DCB priority flow control to User Priority nested attributes */
@@ -158,6 +159,13 @@ static struct nla_policy dcbnl_bcn_nest[DCB_BCN_ATTR_MAX + 1] = {
[DCB_BCN_ATTR_ALL] = {.type = NLA_FLAG},
};
+/* DCB APP nested attributes. */
+static struct nla_policy dcbnl_app_nest[DCB_APP_ATTR_MAX + 1] = {
+ [DCB_APP_ATTR_IDTYPE] = {.type = NLA_U8},
+ [DCB_APP_ATTR_ID] = {.type = NLA_U16},
+ [DCB_APP_ATTR_PRIORITY] = {.type = NLA_U8},
+};
+
/* standard netlink reply call */
static int dcbnl_reply(u8 value, u8 event, u8 cmd, u8 attr, u32 pid,
u32 seq, u16 flags)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 11/12] dcbnl: Add implementations of dcbnl setapp/getapp commands
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
` (9 preceding siblings ...)
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 ` Jeff Kirsher
2009-08-14 22:45 ` [net-next PATCH 12/12] ixgbe: Add support for dcbnl_rtnl_ops.setapp/getapp Jeff Kirsher
11 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:44 UTC (permalink / raw)
To: davem
Cc: netdev, linux-scsi, gospo, Yi Zou, Peter P Waskiewicz Jr,
Jeff Kirsher
From: Yi Zou <yi.zou@intel.com>
Implements the dcbnl netlink setapp/getapp pair. When a setapp/getapp
is received, dcbnl would just pass on to dcbnl_rtnl_op.setapp/getapp
that are supposed to be implemented by the low level drivers.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
net/dcb/dcbnl.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 122 insertions(+), 0 deletions(-)
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 4046468..e0879bf 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -544,6 +544,120 @@ static int dcbnl_setpfcstate(struct net_device *netdev, struct nlattr **tb,
return ret;
}
+static int dcbnl_getapp(struct net_device *netdev, struct nlattr **tb,
+ u32 pid, u32 seq, u16 flags)
+{
+ struct sk_buff *dcbnl_skb;
+ struct nlmsghdr *nlh;
+ struct dcbmsg *dcb;
+ struct nlattr *app_nest;
+ struct nlattr *app_tb[DCB_APP_ATTR_MAX + 1];
+ u16 id;
+ u8 up, idtype;
+ int ret = -EINVAL;
+
+ if (!tb[DCB_ATTR_APP] || !netdev->dcbnl_ops->getapp)
+ goto out;
+
+ ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP],
+ dcbnl_app_nest);
+ if (ret)
+ goto out;
+
+ ret = -EINVAL;
+ /* all must be non-null */
+ if ((!app_tb[DCB_APP_ATTR_IDTYPE]) ||
+ (!app_tb[DCB_APP_ATTR_ID]))
+ goto out;
+
+ /* either by eth type or by socket number */
+ idtype = nla_get_u8(app_tb[DCB_APP_ATTR_IDTYPE]);
+ if ((idtype != DCB_APP_IDTYPE_ETHTYPE) &&
+ (idtype != DCB_APP_IDTYPE_PORTNUM))
+ goto out;
+
+ id = nla_get_u16(app_tb[DCB_APP_ATTR_ID]);
+ up = netdev->dcbnl_ops->getapp(netdev, idtype, id);
+
+ /* send this back */
+ dcbnl_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (!dcbnl_skb)
+ goto out;
+
+ nlh = NLMSG_NEW(dcbnl_skb, pid, seq, RTM_GETDCB, sizeof(*dcb), flags);
+ dcb = NLMSG_DATA(nlh);
+ dcb->dcb_family = AF_UNSPEC;
+ dcb->cmd = DCB_CMD_GAPP;
+
+ app_nest = nla_nest_start(dcbnl_skb, DCB_ATTR_APP);
+ ret = nla_put_u8(dcbnl_skb, DCB_APP_ATTR_IDTYPE, idtype);
+ if (ret)
+ goto out_cancel;
+
+ ret = nla_put_u16(dcbnl_skb, DCB_APP_ATTR_ID, id);
+ if (ret)
+ goto out_cancel;
+
+ ret = nla_put_u8(dcbnl_skb, DCB_APP_ATTR_PRIORITY, up);
+ if (ret)
+ goto out_cancel;
+
+ nla_nest_end(dcbnl_skb, app_nest);
+ nlmsg_end(dcbnl_skb, nlh);
+
+ ret = rtnl_unicast(dcbnl_skb, &init_net, pid);
+ if (ret)
+ goto nlmsg_failure;
+
+ goto out;
+
+out_cancel:
+ nla_nest_cancel(dcbnl_skb, app_nest);
+nlmsg_failure:
+ kfree_skb(dcbnl_skb);
+out:
+ return ret;
+}
+
+static int dcbnl_setapp(struct net_device *netdev, struct nlattr **tb,
+ u32 pid, u32 seq, u16 flags)
+{
+ int ret = -EINVAL;
+ u16 id;
+ u8 up, idtype;
+ struct nlattr *app_tb[DCB_APP_ATTR_MAX + 1];
+
+ if (!tb[DCB_ATTR_APP] || !netdev->dcbnl_ops->setapp)
+ goto out;
+
+ ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP],
+ dcbnl_app_nest);
+ if (ret)
+ goto out;
+
+ ret = -EINVAL;
+ /* all must be non-null */
+ if ((!app_tb[DCB_APP_ATTR_IDTYPE]) ||
+ (!app_tb[DCB_APP_ATTR_ID]) ||
+ (!app_tb[DCB_APP_ATTR_PRIORITY]))
+ goto out;
+
+ /* either by eth type or by socket number */
+ idtype = nla_get_u8(app_tb[DCB_APP_ATTR_IDTYPE]);
+ if ((idtype != DCB_APP_IDTYPE_ETHTYPE) &&
+ (idtype != DCB_APP_IDTYPE_PORTNUM))
+ goto out;
+
+ id = nla_get_u16(app_tb[DCB_APP_ATTR_ID]);
+ up = nla_get_u8(app_tb[DCB_APP_ATTR_PRIORITY]);
+
+ ret = dcbnl_reply(netdev->dcbnl_ops->setapp(netdev, idtype, id, up),
+ RTM_SETDCB, DCB_CMD_SAPP, DCB_ATTR_APP,
+ pid, seq, flags);
+out:
+ return ret;
+}
+
static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlattr **tb,
u32 pid, u32 seq, u16 flags, int dir)
{
@@ -1101,6 +1215,14 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
ret = dcbnl_bcn_setcfg(netdev, tb, pid, nlh->nlmsg_seq,
nlh->nlmsg_flags);
goto out;
+ case DCB_CMD_GAPP:
+ ret = dcbnl_getapp(netdev, tb, pid, nlh->nlmsg_seq,
+ nlh->nlmsg_flags);
+ goto out;
+ case DCB_CMD_SAPP:
+ ret = dcbnl_setapp(netdev, tb, pid, nlh->nlmsg_seq,
+ nlh->nlmsg_flags);
+ goto out;
default:
goto errout;
}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [net-next PATCH 12/12] ixgbe: Add support for dcbnl_rtnl_ops.setapp/getapp
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
` (10 preceding siblings ...)
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 ` Jeff Kirsher
11 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2009-08-14 22:45 UTC (permalink / raw)
To: davem
Cc: netdev, linux-scsi, gospo, Yi Zou, Peter P Waskiewicz Jr,
Jeff Kirsher
From: Yi Zou <yi.zou@intel.com>
Add support for dcbnl_rtnl_ops.setapp/getapp to set or get the current user
priority bitmap for the given application protocol. Currently, 82599 only
supports setapp/getapp for Fiber Channel over Ethernet (FCoE) protocol.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe.h | 4 ++
drivers/net/ixgbe/ixgbe_dcb_nl.c | 60 ++++++++++++++++++++++++++++++++++++
drivers/net/ixgbe/ixgbe_fcoe.c | 64 ++++++++++++++++++++++++++++++++++++++
drivers/net/ixgbe/ixgbe_fcoe.h | 4 ++
drivers/net/ixgbe/ixgbe_main.c | 2 +
5 files changed, 134 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 3c25524..cc324f3 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -486,6 +486,10 @@ extern int ixgbe_fcoe_ddp_get(struct net_device *netdev, u16 xid,
struct scatterlist *sgl, unsigned int sgc);
extern int ixgbe_fcoe_ddp_put(struct net_device *netdev, u16 xid);
extern int ixgbe_fcoe_control(struct net_device *netdev, u32 op);
+#ifdef CONFIG_IXGBE_DCB
+extern u8 ixgbe_fcoe_getapp(struct ixgbe_adapter *adapter);
+extern u8 ixgbe_fcoe_setapp(struct ixgbe_adapter *adapter, u8 up);
+#endif /* CONFIG_IXGBE_DCB */
#endif /* IXGBE_FCOE */
#endif /* _IXGBE_H_ */
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index e05c62a..47d9dde 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -480,6 +480,64 @@ static void ixgbe_dcbnl_setpfcstate(struct net_device *netdev, u8 state)
return;
}
+/**
+ * ixgbe_dcbnl_getapp - retrieve the DCBX application user priority
+ * @netdev : the corresponding netdev
+ * @idtype : identifies the id as ether type or TCP/UDP port number
+ * @id: id is either ether type or TCP/UDP port number
+ *
+ * Returns : on success, returns a non-zero 802.1p user priority bitmap
+ * otherwise returns 0 as the invalid user priority bitmap to indicate an
+ * error.
+ */
+static u8 ixgbe_dcbnl_getapp(struct net_device *netdev, u8 idtype, u16 id)
+{
+ u8 rval = 0;
+
+ switch (idtype) {
+ case DCB_APP_IDTYPE_ETHTYPE:
+#ifdef IXGBE_FCOE
+ if (id == ETH_P_FCOE)
+ rval = ixgbe_fcoe_getapp(netdev_priv(netdev));
+#endif
+ break;
+ case DCB_APP_IDTYPE_PORTNUM:
+ break;
+ default:
+ break;
+ }
+ return rval;
+}
+
+/**
+ * ixgbe_dcbnl_setapp - set the DCBX application user priority
+ * @netdev : the corresponding netdev
+ * @idtype : identifies the id as ether type or TCP/UDP port number
+ * @id: id is either ether type or TCP/UDP port number
+ * @up: the 802.1p user priority bitmap
+ *
+ * Returns : 0 on success or 1 on error
+ */
+static u8 ixgbe_dcbnl_setapp(struct net_device *netdev,
+ u8 idtype, u16 id, u8 up)
+{
+ u8 rval = 1;
+
+ switch (idtype) {
+ case DCB_APP_IDTYPE_ETHTYPE:
+#ifdef IXGBE_FCOE
+ if (id == ETH_P_FCOE)
+ rval = ixgbe_fcoe_setapp(netdev_priv(netdev), up);
+#endif
+ break;
+ case DCB_APP_IDTYPE_PORTNUM:
+ break;
+ default:
+ break;
+ }
+ return rval;
+}
+
struct dcbnl_rtnl_ops dcbnl_ops = {
.getstate = ixgbe_dcbnl_get_state,
.setstate = ixgbe_dcbnl_set_state,
@@ -500,5 +558,7 @@ struct dcbnl_rtnl_ops dcbnl_ops = {
.setnumtcs = ixgbe_dcbnl_setnumtcs,
.getpfcstate = ixgbe_dcbnl_getpfcstate,
.setpfcstate = ixgbe_dcbnl_setpfcstate,
+ .getapp = ixgbe_dcbnl_getapp,
+ .setapp = ixgbe_dcbnl_setapp,
};
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c
index b67ed27..39336f0 100644
--- a/drivers/net/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ixgbe/ixgbe_fcoe.c
@@ -27,6 +27,9 @@
#include "ixgbe.h"
+#ifdef CONFIG_IXGBE_DCB
+#include "ixgbe_dcb_82599.h"
+#endif /* CONFIG_IXGBE_DCB */
#include <linux/if_ether.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
@@ -674,3 +677,64 @@ int ixgbe_fcoe_control(struct net_device *netdev, u32 op)
out:
return rc;
}
+
+#ifdef CONFIG_IXGBE_DCB
+/**
+ * ixgbe_fcoe_getapp - retrieves current user priority bitmap for FCoE
+ * @adapter : ixgbe adapter
+ *
+ * Finds out the corresponding user priority bitmap from the current
+ * traffic class that FCoE belongs to. Returns 0 as the invalid user
+ * priority bitmap to indicate an error.
+ *
+ * Returns : 802.1p user priority bitmap for FCoE
+ */
+u8 ixgbe_fcoe_getapp(struct ixgbe_adapter *adapter)
+{
+ int i;
+ u8 tc;
+ u32 up2tc;
+
+ up2tc = IXGBE_READ_REG(&adapter->hw, IXGBE_RTTUP2TC);
+ for (i = 0; i < MAX_USER_PRIORITY; i++) {
+ tc = (u8)(up2tc >> (i * IXGBE_RTTUP2TC_UP_SHIFT));
+ tc &= (MAX_TRAFFIC_CLASS - 1);
+ if (adapter->fcoe.tc == tc)
+ return 1 << i;
+ }
+
+ return 0;
+}
+
+/**
+ * ixgbe_fcoe_setapp - sets the user priority bitmap for FCoE
+ * @adapter : ixgbe adapter
+ * @up : 802.1p user priority bitmap
+ *
+ * Finds out the traffic class from the input user priority
+ * bitmap for FCoE.
+ *
+ * Returns : 0 on success otherwise returns 1 on error
+ */
+u8 ixgbe_fcoe_setapp(struct ixgbe_adapter *adapter, u8 up)
+{
+ int i;
+ u32 up2tc;
+
+ /* valid user priority bitmap must not be 0 */
+ if (up) {
+ /* from user priority to the corresponding traffic class */
+ up2tc = IXGBE_READ_REG(&adapter->hw, IXGBE_RTTUP2TC);
+ for (i = 0; i < MAX_USER_PRIORITY; i++) {
+ if (up & (1 << i)) {
+ up2tc >>= (i * IXGBE_RTTUP2TC_UP_SHIFT);
+ up2tc &= (MAX_TRAFFIC_CLASS - 1);
+ adapter->fcoe.tc = (u8)up2tc;
+ return 0;
+ }
+ }
+ }
+
+ return 1;
+}
+#endif /* CONFIG_IXGBE_DCB */
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.h b/drivers/net/ixgbe/ixgbe_fcoe.h
index c5b5002..b5dee7b 100644
--- a/drivers/net/ixgbe/ixgbe_fcoe.h
+++ b/drivers/net/ixgbe/ixgbe_fcoe.h
@@ -46,6 +46,9 @@
#define IXGBE_FCBUFF_MIN 4096 /* 4KB min */
#define IXGBE_FCOE_DDP_MAX 512 /* 9 bits xid */
+/* Default traffic class to use for FCoE */
+#define IXGBE_FCOE_DEFTC 3
+
/* fcerr */
#define IXGBE_FCERR_BADCRC 0x00100000
@@ -59,6 +62,7 @@ struct ixgbe_fcoe_ddp {
};
struct ixgbe_fcoe {
+ u8 tc;
spinlock_t lock;
struct pci_pool *pool;
struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX];
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 9738317..f4fc4ae 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3801,6 +3801,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE;
adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
adapter->ring_feature[RING_F_FCOE].indices = 0;
+ /* Default traffic class to use for FCoE */
+ adapter->fcoe.tc = IXGBE_FCOE_DEFTC;
#endif /* IXGBE_FCOE */
}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [net-next PATCH 01/12] vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field
2009-08-14 22:41 ` [net-next PATCH 01/12] vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field Jeff Kirsher
@ 2009-08-14 23:12 ` David Miller
0 siblings, 0 replies; 19+ messages in thread
From: David Miller @ 2009-08-14 23:12 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, linux-scsi, gospo, vasu.dev
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 14 Aug 2009 15:41:07 -0700
> 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>
Applied.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [net-next PATCH 02/12] ixgbe: updates vlan feature flags to enable FCoE offloads on vlan interface
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
0 siblings, 0 replies; 19+ messages in thread
From: David Miller @ 2009-08-14 23:12 UTC (permalink / raw)
To: jeffrey.t.kirsher
Cc: netdev, linux-scsi, gospo, vasu.dev, yi.zou,
peter.p.waskiewicz.jr
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 14 Aug 2009 15:41:28 -0700
> From: Vasu Dev <vasu.dev@intel.com>
>
> Updates netdev->vlan_features for NETIF_F_FCOE_CRC and NETIF_F_FSO, so that
> FCoE CRC and GSO offloads will get used for FCoE over ixgbe based vlan
> interface.
>
> Signed-off-by: Vasu Dev <vasu.dev@intel.com>
> Signed-off-by: Yi Zou <yi.zou@intel.com>
> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [net-next PATCH 03/12] net: Add NETIF_F_FCOE_MTU to indicate support for a different MTU for FCoE
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
0 siblings, 0 replies; 19+ messages in thread
From: David Miller @ 2009-08-14 23:12 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, linux-scsi, gospo, yi.zou
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 14 Aug 2009 15:41:57 -0700
> From: Yi Zou <yi.zou@intel.com>
>
> Add NETIF_F_FCOE_MTU to indicate that the NIC can support a secondary MTU for
> converged traffic of LAN and Fiber Channel over Ethernet (FCoE). The MTU for
> FCoE is 2158 = 14 (FCoE header) + 24 (FC header) + 2112 (FC max payload) +
> 4 (FC CRC) + 4 (FCoE trailer).
>
> Signed-off-by: Yi Zou <yi.zou@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [net-next PATCH 04/12] ixgbe: Add support for NETIF_F_FCOE_MTU to 82599 devices
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
0 siblings, 0 replies; 19+ messages in thread
From: David Miller @ 2009-08-14 23:12 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, linux-scsi, gospo, yi.zou
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 14 Aug 2009 15:42:17 -0700
> From: Yi Zou <yi.zou@intel.com>
>
> Enable netdev feature flag bit NETIF_F_FCOE_MTU for 82599 devices and enable
> jumbo frame correspondingly when NETIF_F_FCOE_MTU is set.
>
> Signed-off-by: Yi Zou <yi.zou@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [net-next PATCH 05/12] net: Add ndo_fcoe_control to net_device_ops
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
0 siblings, 1 reply; 19+ messages in thread
From: David Miller @ 2009-08-14 23:14 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, linux-scsi, gospo, yi.zou
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 14 Aug 2009 15:42:39 -0700
> From: Yi Zou <yi.zou@intel.com>
>
> Add ndo_fcoe_control to net_device_ops so the corresponding HW can initialize
> itself for FCoE traffic or clean up after FCoE traffic is done. This is
> expected to be called by the kernel FCoE stack upon receiving a request for
> creating an FCoE instance on the corresponding netdev interface. When
> implemented by the actual HW, the HW driver check the op code to perform
> corresponding initialization or clean up for FCoE. The initialization normally
> includes allocating extra queues for FCoE, setting corresponding HW registers
> for FCoE, indicating FCoE offload features via netdev, etc. The clean-up would
> include releasing the resources allocated for FCoE.
>
> Currently, there are two defined op codes as NETDEV_FCOE_DISABLE and _ENABLE,
> for initialization and cleanup accordingly.
>
> Signed-off-by: Yi Zou <yi.zou@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
And here is where I stop applying patches. This is not the way
to do this.
Having a vague "_control" operation with command codes is almost
as bad as ioctl().
Instead, add explicit ->ndo_fcoe_enable() and ndo_fcoe_disable()
operations.
Any other "control" commands you would add would probably need
parameters, and then this method would be a tangled web of
misc parameter slots and an even more tangled web of semantics.
Please resubmit the rest of this series once this issue is corrected.
Thanks.
^ permalink raw reply [flat|nested] 19+ messages in thread
* RE: [net-next PATCH 05/12] net: Add ndo_fcoe_control to net_device_ops
2009-08-14 23:14 ` David Miller
@ 2009-08-14 23:29 ` Zou, Yi
0 siblings, 0 replies; 19+ messages in thread
From: Zou, Yi @ 2009-08-14 23:29 UTC (permalink / raw)
To: David Miller, Kirsher, Jeffrey T
Cc: netdev@vger.kernel.org, linux-scsi@vger.kernel.org,
gospo@redhat.com
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Friday, August 14, 2009 4:15 PM
>To: Kirsher, Jeffrey T
>Cc: netdev@vger.kernel.org; linux-scsi@vger.kernel.org; gospo@redhat.com; Zou,
>Yi
>Subject: Re: [net-next PATCH 05/12] net: Add ndo_fcoe_control to
>net_device_ops
>
>From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>Date: Fri, 14 Aug 2009 15:42:39 -0700
>
>> From: Yi Zou <yi.zou@intel.com>
>>
>> Add ndo_fcoe_control to net_device_ops so the corresponding HW can
>initialize
>> itself for FCoE traffic or clean up after FCoE traffic is done. This is
>> expected to be called by the kernel FCoE stack upon receiving a request for
>> creating an FCoE instance on the corresponding netdev interface. When
>> implemented by the actual HW, the HW driver check the op code to perform
>> corresponding initialization or clean up for FCoE. The initialization
>normally
>> includes allocating extra queues for FCoE, setting corresponding HW
>registers
>> for FCoE, indicating FCoE offload features via netdev, etc. The clean-up
>would
>> include releasing the resources allocated for FCoE.
>>
>> Currently, there are two defined op codes as NETDEV_FCOE_DISABLE and
>_ENABLE,
>> for initialization and cleanup accordingly.
>>
>> Signed-off-by: Yi Zou <yi.zou@intel.com>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
>And here is where I stop applying patches. This is not the way
>to do this.
>
>Having a vague "_control" operation with command codes is almost
>as bad as ioctl().
>
>Instead, add explicit ->ndo_fcoe_enable() and ndo_fcoe_disable()
>operations.
>
>Any other "control" commands you would add would probably need
>parameters, and then this method would be a tangled web of
>misc parameter slots and an even more tangled web of semantics.
>
>Please resubmit the rest of this series once this issue is corrected.
>
>Thanks.
Thanks, I was kind of worried about the growing of fcoe related function
pointers there. I am thinking that if it may be better to move into a
fcoe_ops structure. If so, I will rework these patch and move them into
the fcoe_ops sturct in the updated set of patches. This will also make sense
as I am currently trying to add support for querying the nic for the Fiber
Channel WWN for the FCoE kernel stack (based on the SAN MAC address plus 2
more bytes as the IEEE extended address format) from the from the same ops
struct.
Thanks,
yi
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2009-08-14 23:29 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-14 22:40 [net-next PATCH 00/12] ixgbe/vlan/DCB patch set Jeff Kirsher
2009-08-14 22:41 ` [net-next PATCH 01/12] vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field Jeff Kirsher
2009-08-14 23:12 ` 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
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).