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

From: Jeff Kirsher <[email-masked]>
Date: Fri, 07 Nov 2008 16:55:07 -0800

From: Eric Multanen <[email-masked]>

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 <[email-masked]>
Signed-off-by: Jeff Kirsher <[email-masked]>
---

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

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