diff mbox

[NET-NEXT,7/7] DCB: Fixes for the setpfcstate and setnumtcs command.

Message ID 20081108005455.17939.81006.stgit@gitlost.lost
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Kirsher, Jeffrey T Nov. 8, 2008, 12:55 a.m. UTC
From: Eric Multanen <eric.w.multanen@intel.com>

Removes invalid extra call to the setnumtcs operation.
Fix dcbnl_setpfcstate by referencing the PFC state attribute and calling the setpfcstate operation.

Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 net/dcb/dcbnl.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index a8e0c79..b2bda3f 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -467,7 +467,6 @@  static int dcbnl_setnumtcs(struct net_device *netdev, struct nlattr **tb,
 	struct nlattr *data[DCB_NUMTCS_ATTR_MAX + 1];
 	int ret = -EINVAL;
 	u8 value;
-	u8 status;
 	int i;
 
 	if (!tb[DCB_ATTR_NUMTCS] || !netdev->dcbnl_ops->setstate)
@@ -490,14 +489,11 @@  static int dcbnl_setnumtcs(struct net_device *netdev, struct nlattr **tb,
 		ret = netdev->dcbnl_ops->setnumtcs(netdev, i, value);
 
 		if (ret)
-			goto err;
+			goto operr;
 	}
 
-	value = nla_get_u8(tb[DCB_ATTR_STATE]);
-
-	status = netdev->dcbnl_ops->setnumtcs(netdev, i, value);
-
-	ret = dcbnl_reply(!!status, RTM_SETDCB, DCB_CMD_SNUMTCS,
+operr:
+	ret = dcbnl_reply(!!ret, RTM_SETDCB, DCB_CMD_SNUMTCS,
 	                  DCB_ATTR_NUMTCS, pid, seq, flags);
 
 err:
@@ -528,9 +524,9 @@  static int dcbnl_setpfcstate(struct net_device *netdev, struct nlattr **tb,
 	if (!tb[DCB_ATTR_PFC_STATE] || !netdev->dcbnl_ops->setpfcstate)
 		return ret;
 
-	value = nla_get_u8(tb[DCB_ATTR_STATE]);
+	value = nla_get_u8(tb[DCB_ATTR_PFC_STATE]);
 
-	netdev->dcbnl_ops->setstate(netdev, value);
+	netdev->dcbnl_ops->setpfcstate(netdev, value);
 
 	ret = dcbnl_reply(0, RTM_SETDCB, DCB_CMD_PFC_SSTATE, DCB_ATTR_PFC_STATE,
 	                  pid, seq, flags);