netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [NET-NEXT PATCH 1/3] net: fix DCB setstate to return success/failure
@ 2008-12-20  0:14 Jeff Kirsher
  2008-12-20  0:15 ` [NET-NEXT PATCH 2/3] net: add DCNA attribute to the BCN interface for DCB Jeff Kirsher
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jeff Kirsher @ 2008-12-20  0:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, jeff, Don Skidmore, Eric W Multanen, Jeff Kirsher

From: Don Skidmore <donald.c.skidmore@intel.com>

Data Center Bridging (DCB) had no way to know if setstate had failed in the
driver.  This patch enables dcb netlink code to handle the status for the DCB
setstate interface.  Likewise it allows the driver to return a failed status
if MSI-X isn't enabled.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe_dcb_nl.c |   52 +++++++++++++++++++++-----------------
 include/net/dcbnl.h              |    2 +
 net/dcb/dcbnl.c                  |    5 +---
 3 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 615c280..7d158a5 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -124,39 +124,45 @@ static u16 ixgbe_dcb_select_queue(struct net_device *dev, struct sk_buff *skb)
 	return 0;
 }
 
-static void ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
+static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
 {
+	u8 err = 0;
 	struct ixgbe_adapter *adapter = netdev_priv(netdev);
 
 	DPRINTK(DRV, INFO, "Set DCB Admin Mode.\n");
 
 	if (state > 0) {
 		/* Turn on DCB */
-		if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
-			return;
-		} else {
-			if (netif_running(netdev))
-				netdev->stop(netdev);
-			ixgbe_reset_interrupt_capability(adapter);
-			ixgbe_napi_del_all(adapter);
-			kfree(adapter->tx_ring);
-			kfree(adapter->rx_ring);
-			adapter->tx_ring = NULL;
-			adapter->rx_ring = NULL;
-			netdev->select_queue = &ixgbe_dcb_select_queue;
+		if (adapter->flags & IXGBE_FLAG_DCB_ENABLED)
+			goto out;
 
-			adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED;
-			adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
-			ixgbe_init_interrupt_scheme(adapter);
-			ixgbe_napi_add_all(adapter);
-			if (netif_running(netdev))
-				netdev->open(netdev);
+		if (!(adapter->flags & IXGBE_FLAG_MSIX_ENABLED)) {
+			DPRINTK(DRV, ERR, "Enable failed, needs MSI-X\n");
+			err = 1;
+			goto out;
 		}
+
+		if (netif_running(netdev))
+			netdev->netdev_ops->ndo_stop(netdev);
+		ixgbe_reset_interrupt_capability(adapter);
+		ixgbe_napi_del_all(adapter);
+		kfree(adapter->tx_ring);
+		kfree(adapter->rx_ring);
+		adapter->tx_ring = NULL;
+		adapter->rx_ring = NULL;
+		netdev->select_queue = &ixgbe_dcb_select_queue;
+
+		adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED;
+		adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
+		ixgbe_init_interrupt_scheme(adapter);
+		ixgbe_napi_add_all(adapter);
+		if (netif_running(netdev))
+			netdev->netdev_ops->ndo_open(netdev);
 	} else {
 		/* Turn off DCB */
 		if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
 			if (netif_running(netdev))
-				netdev->stop(netdev);
+				netdev->netdev_ops->ndo_stop(netdev);
 			ixgbe_reset_interrupt_capability(adapter);
 			ixgbe_napi_del_all(adapter);
 			kfree(adapter->tx_ring);
@@ -170,11 +176,11 @@ static void ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
 			ixgbe_init_interrupt_scheme(adapter);
 			ixgbe_napi_add_all(adapter);
 			if (netif_running(netdev))
-				netdev->open(netdev);
-		} else {
-			return;
+				netdev->netdev_ops->ndo_open(netdev);
 		}
 	}
+out:
+	return err;
 }
 
 static void ixgbe_dcbnl_get_perm_hw_addr(struct net_device *netdev,
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index 91e0a3d..775cfc8 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -26,7 +26,7 @@
  */
 struct dcbnl_rtnl_ops {
 	u8   (*getstate)(struct net_device *);
-	void (*setstate)(struct net_device *, u8);
+	u8   (*setstate)(struct net_device *, u8);
 	void (*getpermhwaddr)(struct net_device *, u8 *);
 	void (*setpgtccfgtx)(struct net_device *, int, u8, u8, u8, u8);
 	void (*setpgbwgcfgtx)(struct net_device *, int, u8);
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index a125406..fc88fc4 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -714,9 +714,8 @@ static int dcbnl_setstate(struct net_device *netdev, struct nlattr **tb,
 
 	value = nla_get_u8(tb[DCB_ATTR_STATE]);
 
-	netdev->dcbnl_ops->setstate(netdev, value);
-
-	ret = dcbnl_reply(0, RTM_SETDCB, DCB_CMD_SSTATE, DCB_ATTR_STATE,
+	ret = dcbnl_reply(netdev->dcbnl_ops->setstate(netdev, value),
+	                  RTM_SETDCB, DCB_CMD_SSTATE, DCB_ATTR_STATE,
 	                  pid, seq, flags);
 
 	return ret;


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [NET-NEXT PATCH 2/3] net: add DCNA attribute to the BCN interface for DCB
  2008-12-20  0:14 [NET-NEXT PATCH 1/3] net: fix DCB setstate to return success/failure Jeff Kirsher
@ 2008-12-20  0:15 ` Jeff Kirsher
  2008-12-22  4:10   ` David Miller
  2008-12-20  0:15 ` [NET-NEXT PATCH 3/3] ixgbe: fix the display of DCB control stats in ethtool Jeff Kirsher
  2008-12-22  4:10 ` [NET-NEXT PATCH 1/3] net: fix DCB setstate to return success/failure David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2008-12-20  0:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, jeff, Don Skidmore, Eric W Multanen, Jeff Kirsher

From: Don Skidmore <donald.c.skidmore@intel.com>

Adds the Backward Congestion Notification Address (BCNA) attribute to the
Backward Congestion Notification (BCN) interface for Data Center Bridging
(DCB), which was missing.  Receive the BCNA attribute in the ixgbe driver.
The BCNA attribute is for a switch to inform the endstation about the physical
port identification in order to support BCN on aggregated links.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe_dcb_nl.c |   20 ++++++++++++++++++++
 include/linux/dcbnl.h            |    2 ++
 net/dcb/dcbnl.c                  |    6 ++++--
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 7d158a5..8ac639d 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -93,6 +93,8 @@ int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg,
 		dst_dcb_cfg->bcn.rp_admin_mode[i - DCB_BCN_ATTR_RP_0] =
 			src_dcb_cfg->bcn.rp_admin_mode[i - DCB_BCN_ATTR_RP_0];
 	}
+	dst_dcb_cfg->bcn.bcna_option[0] = src_dcb_cfg->bcn.bcna_option[0];
+	dst_dcb_cfg->bcn.bcna_option[1] = src_dcb_cfg->bcn.bcna_option[1];
 	dst_dcb_cfg->bcn.rp_alpha = src_dcb_cfg->bcn.rp_alpha;
 	dst_dcb_cfg->bcn.rp_beta = src_dcb_cfg->bcn.rp_beta;
 	dst_dcb_cfg->bcn.rp_gd = src_dcb_cfg->bcn.rp_gd;
@@ -457,6 +459,12 @@ static void ixgbe_dcbnl_getbcncfg(struct net_device *netdev, int enum_index,
 	struct ixgbe_adapter *adapter = netdev_priv(netdev);
 
 	switch (enum_index) {
+	case DCB_BCN_ATTR_BCNA_0:
+		*setting = adapter->dcb_cfg.bcn.bcna_option[0];
+		break;
+	case DCB_BCN_ATTR_BCNA_1:
+		*setting = adapter->dcb_cfg.bcn.bcna_option[1];
+		break;
 	case DCB_BCN_ATTR_ALPHA:
 		*setting = adapter->dcb_cfg.bcn.rp_alpha;
 		break;
@@ -516,6 +524,18 @@ static void ixgbe_dcbnl_setbcncfg(struct net_device *netdev, int enum_index,
 	struct ixgbe_adapter *adapter = netdev_priv(netdev);
 
 	switch (enum_index) {
+	case DCB_BCN_ATTR_BCNA_0:
+		adapter->temp_dcb_cfg.bcn.bcna_option[0] = setting;
+		if (adapter->temp_dcb_cfg.bcn.bcna_option[0] !=
+			adapter->dcb_cfg.bcn.bcna_option[0])
+			adapter->dcb_set_bitmap |= BIT_BCN;
+		break;
+	case DCB_BCN_ATTR_BCNA_1:
+		adapter->temp_dcb_cfg.bcn.bcna_option[1] = setting;
+		if (adapter->temp_dcb_cfg.bcn.bcna_option[1] !=
+			adapter->dcb_cfg.bcn.bcna_option[1])
+			adapter->dcb_set_bitmap |= BIT_BCN;
+		break;
 	case DCB_BCN_ATTR_ALPHA:
 		adapter->temp_dcb_cfg.bcn.rp_alpha = setting;
 		if (adapter->temp_dcb_cfg.bcn.rp_alpha !=
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index e73a614..b0ef274 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -305,6 +305,8 @@ enum dcbnl_bcn_attrs{
 	DCB_BCN_ATTR_RP_7,
 	DCB_BCN_ATTR_RP_ALL,
 
+	DCB_BCN_ATTR_BCNA_0,
+	DCB_BCN_ATTR_BCNA_1,
 	DCB_BCN_ATTR_ALPHA,
 	DCB_BCN_ATTR_BETA,
 	DCB_BCN_ATTR_GD,
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index fc88fc4..5dbfe5f 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -140,6 +140,8 @@ static struct nla_policy dcbnl_bcn_nest[DCB_BCN_ATTR_MAX + 1] = {
 	[DCB_BCN_ATTR_RP_6]         = {.type = NLA_U8},
 	[DCB_BCN_ATTR_RP_7]         = {.type = NLA_U8},
 	[DCB_BCN_ATTR_RP_ALL]       = {.type = NLA_FLAG},
+	[DCB_BCN_ATTR_BCNA_0]       = {.type = NLA_U32},
+	[DCB_BCN_ATTR_BCNA_1]       = {.type = NLA_U32},
 	[DCB_BCN_ATTR_ALPHA]        = {.type = NLA_U32},
 	[DCB_BCN_ATTR_BETA]         = {.type = NLA_U32},
 	[DCB_BCN_ATTR_GD]           = {.type = NLA_U32},
@@ -922,7 +924,7 @@ static int dcbnl_bcn_getcfg(struct net_device *netdev, struct nlattr **tb,
 			goto err_bcn;
 	}
 
-	for (i = DCB_BCN_ATTR_ALPHA; i <= DCB_BCN_ATTR_RI; i++) {
+	for (i = DCB_BCN_ATTR_BCNA_0; i <= DCB_BCN_ATTR_RI; i++) {
 		if (!getall && !bcn_tb[i])
 			continue;
 
@@ -980,7 +982,7 @@ static int dcbnl_bcn_setcfg(struct net_device *netdev, struct nlattr **tb,
 			data[i]->nla_type - DCB_BCN_ATTR_RP_0, value_byte);
 	}
 
-	for (i = DCB_BCN_ATTR_ALPHA; i <= DCB_BCN_ATTR_RI; i++) {
+	for (i = DCB_BCN_ATTR_BCNA_0; i <= DCB_BCN_ATTR_RI; i++) {
 		if (data[i] == NULL)
 			continue;
 		value_int = nla_get_u32(data[i]);


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [NET-NEXT PATCH 3/3] ixgbe: fix the display of DCB control stats in ethtool
  2008-12-20  0:14 [NET-NEXT PATCH 1/3] net: fix DCB setstate to return success/failure Jeff Kirsher
  2008-12-20  0:15 ` [NET-NEXT PATCH 2/3] net: add DCNA attribute to the BCN interface for DCB Jeff Kirsher
@ 2008-12-20  0:15 ` Jeff Kirsher
  2008-12-22  4:11   ` David Miller
  2008-12-22  4:10 ` [NET-NEXT PATCH 1/3] net: fix DCB setstate to return success/failure David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2008-12-20  0:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, jeff, Don Skidmore, Eric W Multanen, Jeff Kirsher

From: Don Skidmore <donald.c.skidmore@intel.com>

Priority flow contol statistics for Data Center Bridging (DCB) weren't
included in ethtool.  This patch adds them.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe_ethtool.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index ad9759d..849c1fe 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -881,8 +881,15 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset,
 		if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
 			for (i = 0; i < MAX_TX_PACKET_BUFFERS; i++) {
 				sprintf(p, "tx_pb_%u_pxon", i);
+				p += ETH_GSTRING_LEN;
+				sprintf(p, "tx_pb_%u_pxoff", i);
+				p += ETH_GSTRING_LEN;
 			}
 			for (i = 0; i < MAX_RX_PACKET_BUFFERS; i++) {
+				sprintf(p, "rx_pb_%u_pxon", i);
+				p += ETH_GSTRING_LEN;
+				sprintf(p, "rx_pb_%u_pxoff", i);
+				p += ETH_GSTRING_LEN;
 			}
 		}
 		/* BUG_ON(p - data != IXGBE_STATS_LEN * ETH_GSTRING_LEN); */


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [NET-NEXT PATCH 1/3] net: fix DCB setstate to return success/failure
  2008-12-20  0:14 [NET-NEXT PATCH 1/3] net: fix DCB setstate to return success/failure Jeff Kirsher
  2008-12-20  0:15 ` [NET-NEXT PATCH 2/3] net: add DCNA attribute to the BCN interface for DCB Jeff Kirsher
  2008-12-20  0:15 ` [NET-NEXT PATCH 3/3] ixgbe: fix the display of DCB control stats in ethtool Jeff Kirsher
@ 2008-12-22  4:10 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2008-12-22  4:10 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, jeff, donald.c.skidmore, eric.w.multanen

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 19 Dec 2008 16:14:38 -0800

> Data Center Bridging (DCB) had no way to know if setstate had failed in the
> driver.  This patch enables dcb netlink code to handle the status for the DCB
> setstate interface.  Likewise it allows the driver to return a failed status
> if MSI-X isn't enabled.
> 
> Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
> Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [NET-NEXT PATCH 2/3] net: add DCNA attribute to the BCN interface for DCB
  2008-12-20  0:15 ` [NET-NEXT PATCH 2/3] net: add DCNA attribute to the BCN interface for DCB Jeff Kirsher
@ 2008-12-22  4:10   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2008-12-22  4:10 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, jeff, donald.c.skidmore, eric.w.multanen

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 19 Dec 2008 16:15:00 -0800

> Adds the Backward Congestion Notification Address (BCNA) attribute to the
> Backward Congestion Notification (BCN) interface for Data Center Bridging
> (DCB), which was missing.  Receive the BCNA attribute in the ixgbe driver.
> The BCNA attribute is for a switch to inform the endstation about the physical
> port identification in order to support BCN on aggregated links.
> 
> Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
> Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [NET-NEXT PATCH 3/3] ixgbe: fix the display of DCB control stats in ethtool
  2008-12-20  0:15 ` [NET-NEXT PATCH 3/3] ixgbe: fix the display of DCB control stats in ethtool Jeff Kirsher
@ 2008-12-22  4:11   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2008-12-22  4:11 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, jeff, donald.c.skidmore, eric.w.multanen

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 19 Dec 2008 16:15:20 -0800

> Priority flow contol statistics for Data Center Bridging (DCB) weren't
> included in ethtool.  This patch adds them.
> 
> Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
> Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Also applied, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-22  4:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-20  0:14 [NET-NEXT PATCH 1/3] net: fix DCB setstate to return success/failure Jeff Kirsher
2008-12-20  0:15 ` [NET-NEXT PATCH 2/3] net: add DCNA attribute to the BCN interface for DCB Jeff Kirsher
2008-12-22  4:10   ` David Miller
2008-12-20  0:15 ` [NET-NEXT PATCH 3/3] ixgbe: fix the display of DCB control stats in ethtool Jeff Kirsher
2008-12-22  4:11   ` David Miller
2008-12-22  4:10 ` [NET-NEXT PATCH 1/3] net: fix DCB setstate to return success/failure David Miller

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