[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081108005455.17939.81006.stgit@gitlost.lost>
Date: Fri, 07 Nov 2008 16:55:07 -0800
From: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
To: jeff@...zik.org, davem@...emloft.net
Cc: netdev@...r.kernel.org, Eric Multanen <eric.w.multanen@...el.com>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Subject: [NET-NEXT PATCH 7/7] DCB: Fixes for the setpfcstate and setnumtcs
command.
From: Eric Multanen <eric.w.multanen@...el.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@...el.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
---
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);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists