diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-11-02 23:56:40 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-11-02 23:56:40 -0400 |
commit | 31cbecb4ab538f433145bc5a46f3bea9b9627031 (patch) | |
tree | d6206d42dea7298f7ef05fd1f7bf474245f0d43a /net/dcb | |
parent | 2b72c9ccd22c4a3299e5a358dcd639fb253730f4 (diff) | |
parent | 278c023a99b0d6b471d0f4a79835c703482e29ac (diff) |
Merge branch 'osd-devel' into nfs-for-next
Diffstat (limited to 'net/dcb')
-rw-r--r-- | net/dcb/dcbnl.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 3cb56af4e13c..9bfbc1d1b50c 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c | |||
@@ -1255,7 +1255,7 @@ static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev) | |||
1255 | 1255 | ||
1256 | spin_lock(&dcb_lock); | 1256 | spin_lock(&dcb_lock); |
1257 | list_for_each_entry(itr, &dcb_app_list, list) { | 1257 | list_for_each_entry(itr, &dcb_app_list, list) { |
1258 | if (strncmp(itr->name, netdev->name, IFNAMSIZ) == 0) { | 1258 | if (itr->ifindex == netdev->ifindex) { |
1259 | err = nla_put(skb, DCB_ATTR_IEEE_APP, sizeof(itr->app), | 1259 | err = nla_put(skb, DCB_ATTR_IEEE_APP, sizeof(itr->app), |
1260 | &itr->app); | 1260 | &itr->app); |
1261 | if (err) { | 1261 | if (err) { |
@@ -1412,7 +1412,7 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev) | |||
1412 | goto dcb_unlock; | 1412 | goto dcb_unlock; |
1413 | 1413 | ||
1414 | list_for_each_entry(itr, &dcb_app_list, list) { | 1414 | list_for_each_entry(itr, &dcb_app_list, list) { |
1415 | if (strncmp(itr->name, netdev->name, IFNAMSIZ) == 0) { | 1415 | if (itr->ifindex == netdev->ifindex) { |
1416 | struct nlattr *app_nest = nla_nest_start(skb, | 1416 | struct nlattr *app_nest = nla_nest_start(skb, |
1417 | DCB_ATTR_APP); | 1417 | DCB_ATTR_APP); |
1418 | if (!app_nest) | 1418 | if (!app_nest) |
@@ -2050,7 +2050,7 @@ u8 dcb_getapp(struct net_device *dev, struct dcb_app *app) | |||
2050 | list_for_each_entry(itr, &dcb_app_list, list) { | 2050 | list_for_each_entry(itr, &dcb_app_list, list) { |
2051 | if (itr->app.selector == app->selector && | 2051 | if (itr->app.selector == app->selector && |
2052 | itr->app.protocol == app->protocol && | 2052 | itr->app.protocol == app->protocol && |
2053 | (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) { | 2053 | itr->ifindex == dev->ifindex) { |
2054 | prio = itr->app.priority; | 2054 | prio = itr->app.priority; |
2055 | break; | 2055 | break; |
2056 | } | 2056 | } |
@@ -2073,15 +2073,17 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new) | |||
2073 | struct dcb_app_type *itr; | 2073 | struct dcb_app_type *itr; |
2074 | struct dcb_app_type event; | 2074 | struct dcb_app_type event; |
2075 | 2075 | ||
2076 | memcpy(&event.name, dev->name, sizeof(event.name)); | 2076 | event.ifindex = dev->ifindex; |
2077 | memcpy(&event.app, new, sizeof(event.app)); | 2077 | memcpy(&event.app, new, sizeof(event.app)); |
2078 | if (dev->dcbnl_ops->getdcbx) | ||
2079 | event.dcbx = dev->dcbnl_ops->getdcbx(dev); | ||
2078 | 2080 | ||
2079 | spin_lock(&dcb_lock); | 2081 | spin_lock(&dcb_lock); |
2080 | /* Search for existing match and replace */ | 2082 | /* Search for existing match and replace */ |
2081 | list_for_each_entry(itr, &dcb_app_list, list) { | 2083 | list_for_each_entry(itr, &dcb_app_list, list) { |
2082 | if (itr->app.selector == new->selector && | 2084 | if (itr->app.selector == new->selector && |
2083 | itr->app.protocol == new->protocol && | 2085 | itr->app.protocol == new->protocol && |
2084 | (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) { | 2086 | itr->ifindex == dev->ifindex) { |
2085 | if (new->priority) | 2087 | if (new->priority) |
2086 | itr->app.priority = new->priority; | 2088 | itr->app.priority = new->priority; |
2087 | else { | 2089 | else { |
@@ -2101,7 +2103,7 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new) | |||
2101 | } | 2103 | } |
2102 | 2104 | ||
2103 | memcpy(&entry->app, new, sizeof(*new)); | 2105 | memcpy(&entry->app, new, sizeof(*new)); |
2104 | strncpy(entry->name, dev->name, IFNAMSIZ); | 2106 | entry->ifindex = dev->ifindex; |
2105 | list_add(&entry->list, &dcb_app_list); | 2107 | list_add(&entry->list, &dcb_app_list); |
2106 | } | 2108 | } |
2107 | out: | 2109 | out: |
@@ -2127,7 +2129,7 @@ u8 dcb_ieee_getapp_mask(struct net_device *dev, struct dcb_app *app) | |||
2127 | list_for_each_entry(itr, &dcb_app_list, list) { | 2129 | list_for_each_entry(itr, &dcb_app_list, list) { |
2128 | if (itr->app.selector == app->selector && | 2130 | if (itr->app.selector == app->selector && |
2129 | itr->app.protocol == app->protocol && | 2131 | itr->app.protocol == app->protocol && |
2130 | (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) { | 2132 | itr->ifindex == dev->ifindex) { |
2131 | prio |= 1 << itr->app.priority; | 2133 | prio |= 1 << itr->app.priority; |
2132 | } | 2134 | } |
2133 | } | 2135 | } |
@@ -2150,8 +2152,10 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new) | |||
2150 | struct dcb_app_type event; | 2152 | struct dcb_app_type event; |
2151 | int err = 0; | 2153 | int err = 0; |
2152 | 2154 | ||
2153 | memcpy(&event.name, dev->name, sizeof(event.name)); | 2155 | event.ifindex = dev->ifindex; |
2154 | memcpy(&event.app, new, sizeof(event.app)); | 2156 | memcpy(&event.app, new, sizeof(event.app)); |
2157 | if (dev->dcbnl_ops->getdcbx) | ||
2158 | event.dcbx = dev->dcbnl_ops->getdcbx(dev); | ||
2155 | 2159 | ||
2156 | spin_lock(&dcb_lock); | 2160 | spin_lock(&dcb_lock); |
2157 | /* Search for existing match and abort if found */ | 2161 | /* Search for existing match and abort if found */ |
@@ -2159,7 +2163,7 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new) | |||
2159 | if (itr->app.selector == new->selector && | 2163 | if (itr->app.selector == new->selector && |
2160 | itr->app.protocol == new->protocol && | 2164 | itr->app.protocol == new->protocol && |
2161 | itr->app.priority == new->priority && | 2165 | itr->app.priority == new->priority && |
2162 | (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) { | 2166 | itr->ifindex == dev->ifindex) { |
2163 | err = -EEXIST; | 2167 | err = -EEXIST; |
2164 | goto out; | 2168 | goto out; |
2165 | } | 2169 | } |
@@ -2173,7 +2177,7 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new) | |||
2173 | } | 2177 | } |
2174 | 2178 | ||
2175 | memcpy(&entry->app, new, sizeof(*new)); | 2179 | memcpy(&entry->app, new, sizeof(*new)); |
2176 | strncpy(entry->name, dev->name, IFNAMSIZ); | 2180 | entry->ifindex = dev->ifindex; |
2177 | list_add(&entry->list, &dcb_app_list); | 2181 | list_add(&entry->list, &dcb_app_list); |
2178 | out: | 2182 | out: |
2179 | spin_unlock(&dcb_lock); | 2183 | spin_unlock(&dcb_lock); |
@@ -2194,8 +2198,10 @@ int dcb_ieee_delapp(struct net_device *dev, struct dcb_app *del) | |||
2194 | struct dcb_app_type event; | 2198 | struct dcb_app_type event; |
2195 | int err = -ENOENT; | 2199 | int err = -ENOENT; |
2196 | 2200 | ||
2197 | memcpy(&event.name, dev->name, sizeof(event.name)); | 2201 | event.ifindex = dev->ifindex; |
2198 | memcpy(&event.app, del, sizeof(event.app)); | 2202 | memcpy(&event.app, del, sizeof(event.app)); |
2203 | if (dev->dcbnl_ops->getdcbx) | ||
2204 | event.dcbx = dev->dcbnl_ops->getdcbx(dev); | ||
2199 | 2205 | ||
2200 | spin_lock(&dcb_lock); | 2206 | spin_lock(&dcb_lock); |
2201 | /* Search for existing match and remove it. */ | 2207 | /* Search for existing match and remove it. */ |
@@ -2203,7 +2209,7 @@ int dcb_ieee_delapp(struct net_device *dev, struct dcb_app *del) | |||
2203 | if (itr->app.selector == del->selector && | 2209 | if (itr->app.selector == del->selector && |
2204 | itr->app.protocol == del->protocol && | 2210 | itr->app.protocol == del->protocol && |
2205 | itr->app.priority == del->priority && | 2211 | itr->app.priority == del->priority && |
2206 | (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) { | 2212 | itr->ifindex == dev->ifindex) { |
2207 | list_del(&itr->list); | 2213 | list_del(&itr->list); |
2208 | kfree(itr); | 2214 | kfree(itr); |
2209 | err = 0; | 2215 | err = 0; |