Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300525
b: refs/heads/master
c: 08f10af
h: refs/heads/master
i:
  300523: c1a56f0
v: v3
  • Loading branch information
Amir Vadai authored and David S. Miller committed Apr 5, 2012
1 parent fab7296 commit 0b4b0e8
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 366cddb4028858079a9a8145bd713c13a9edb3dc
refs/heads/master: 08f10affe45051e18e0d8291c0a53aecef1b8a14
12 changes: 12 additions & 0 deletions trunk/include/linux/dcbnl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ struct ieee_ets {
__u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
};

/* This structure contains rate limit extension to the IEEE 802.1Qaz ETS
* managed object.
* Values are 64 bits long and specified in Kbps to enable usage over both
* slow and very fast networks.
*
* @tc_maxrate: maximal tc tx bandwidth indexed by traffic class
*/
struct ieee_maxrate {
__u64 tc_maxrate[IEEE_8021QAZ_MAX_TCS];
};

/* This structure contains the IEEE 802.1Qaz PFC managed object
*
* @pfc_cap: Indicates the number of traffic classes on the local device
Expand Down Expand Up @@ -321,6 +332,7 @@ enum ieee_attrs {
DCB_ATTR_IEEE_PEER_ETS,
DCB_ATTR_IEEE_PEER_PFC,
DCB_ATTR_IEEE_PEER_APP,
DCB_ATTR_IEEE_MAXRATE,
__DCB_ATTR_IEEE_MAX
};
#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/net/dcbnl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ struct dcbnl_rtnl_ops {
/* IEEE 802.1Qaz std */
int (*ieee_getets) (struct net_device *, struct ieee_ets *);
int (*ieee_setets) (struct net_device *, struct ieee_ets *);
int (*ieee_getmaxrate) (struct net_device *, struct ieee_maxrate *);
int (*ieee_setmaxrate) (struct net_device *, struct ieee_maxrate *);
int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *);
int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *);
int (*ieee_getapp) (struct net_device *, struct dcb_app *);
Expand Down
20 changes: 20 additions & 0 deletions trunk/net/dcb/dcbnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ static const struct nla_policy dcbnl_ieee_policy[DCB_ATTR_IEEE_MAX + 1] = {
[DCB_ATTR_IEEE_ETS] = {.len = sizeof(struct ieee_ets)},
[DCB_ATTR_IEEE_PFC] = {.len = sizeof(struct ieee_pfc)},
[DCB_ATTR_IEEE_APP_TABLE] = {.type = NLA_NESTED},
[DCB_ATTR_IEEE_MAXRATE] = {.len = sizeof(struct ieee_maxrate)},
};

static const struct nla_policy dcbnl_ieee_app[DCB_ATTR_IEEE_APP_MAX + 1] = {
Expand Down Expand Up @@ -1246,6 +1247,17 @@ static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev)
goto nla_put_failure;
}

if (ops->ieee_getmaxrate) {
struct ieee_maxrate maxrate;
err = ops->ieee_getmaxrate(netdev, &maxrate);
if (!err) {
err = nla_put(skb, DCB_ATTR_IEEE_MAXRATE,
sizeof(maxrate), &maxrate);
if (err)
goto nla_put_failure;
}
}

if (ops->ieee_getpfc) {
struct ieee_pfc pfc;
err = ops->ieee_getpfc(netdev, &pfc);
Expand Down Expand Up @@ -1601,6 +1613,14 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlattr **tb,
goto err;
}

if (ieee[DCB_ATTR_IEEE_MAXRATE] && ops->ieee_setmaxrate) {
struct ieee_maxrate *maxrate =
nla_data(ieee[DCB_ATTR_IEEE_MAXRATE]);
err = ops->ieee_setmaxrate(netdev, maxrate);
if (err)
goto err;
}

if (ieee[DCB_ATTR_IEEE_PFC] && ops->ieee_setpfc) {
struct ieee_pfc *pfc = nla_data(ieee[DCB_ATTR_IEEE_PFC]);
err = ops->ieee_setpfc(netdev, pfc);
Expand Down

0 comments on commit 0b4b0e8

Please sign in to comment.