]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/dcb-fix-setpfcstate
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / dcb-fix-setpfcstate
1 Subject: Fix setpfcstate
2 From: Hannes Reinecke <hare@suse.de>
3 Date: Fri Nov 7 15:36:08 2008 +0100:
4 Git: f7e09ce313fdc4f79403d43b1ac570f6807973bd
5 References: bnc#438954
6
7 Fixup setpfcstate and setnumtcs command.
8
9 Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
10 Signed-off-by: Hannes Reinecke <hare@suse.de>
11
12 diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
13 index f5e2b0b..be9dcbb 100644
14 --- a/net/dcb/dcbnl.c
15 +++ b/net/dcb/dcbnl.c
16 @@ -435,7 +435,6 @@ static int dcbnl_setnumtcs(struct net_device *netdev, struct nlattr **tb,
17 struct nlattr *data[DCB_NUMTCS_ATTR_MAX + 1];
18 int ret = -EINVAL;
19 u8 value;
20 - u8 status;
21 int i;
22
23 if (!tb[DCB_ATTR_NUMTCS] || !netdev->dcbnl_ops->setstate)
24 @@ -458,14 +457,11 @@ static int dcbnl_setnumtcs(struct net_device *netdev, struct nlattr **tb,
25 ret = netdev->dcbnl_ops->setnumtcs(netdev, i, value);
26
27 if (ret)
28 - goto err;
29 + goto operr;
30 }
31
32 - value = nla_get_u8(tb[DCB_ATTR_STATE]);
33 -
34 - status = netdev->dcbnl_ops->setnumtcs(netdev, i, value);
35 -
36 - ret = dcbnl_reply(!!status, RTM_SETDCB, DCB_CMD_SNUMTCS,
37 +operr:
38 + ret = dcbnl_reply(!!ret, RTM_SETDCB, DCB_CMD_SNUMTCS,
39 DCB_ATTR_NUMTCS, pid, seq, flags);
40
41 err:
42 @@ -496,9 +492,9 @@ static int dcbnl_setpfcstate(struct net_device *netdev, struct nlattr **tb,
43 if (!tb[DCB_ATTR_PFC_STATE] || !netdev->dcbnl_ops->setpfcstate)
44 return ret;
45
46 - value = nla_get_u8(tb[DCB_ATTR_STATE]);
47 + value = nla_get_u8(tb[DCB_ATTR_PFC_STATE]);
48
49 - netdev->dcbnl_ops->setstate(netdev, value);
50 + netdev->dcbnl_ops->setpfcstate(netdev, value);
51
52 ret = dcbnl_reply(0, RTM_SETDCB, DCB_CMD_PFC_SSTATE, DCB_ATTR_PFC_STATE,
53 pid, seq, flags);