Skip to content

Commit 1d460b9

Browse files
roopa-prabhudavem330
authored andcommitted
rocker: remove swdev mode
Remove use of 'swdev' mode in rocker. rocker dev offloads can use the BRIDGE_FLAGS_SELF to indicate offload to hardware. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fc0bdbb commit 1d460b9

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

drivers/net/ethernet/rocker/rocker.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3717,27 +3717,11 @@ static int rocker_port_bridge_setlink(struct net_device *dev,
37173717
{
37183718
struct rocker_port *rocker_port = netdev_priv(dev);
37193719
struct nlattr *protinfo;
3720-
struct nlattr *afspec;
37213720
struct nlattr *attr;
3722-
u16 mode;
37233721
int err;
37243722

37253723
protinfo = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg),
37263724
IFLA_PROTINFO);
3727-
afspec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);
3728-
3729-
if (afspec) {
3730-
attr = nla_find_nested(afspec, IFLA_BRIDGE_MODE);
3731-
if (attr) {
3732-
if (nla_len(attr) < sizeof(mode))
3733-
return -EINVAL;
3734-
3735-
mode = nla_get_u16(attr);
3736-
if (mode != BRIDGE_MODE_SWDEV)
3737-
return -EINVAL;
3738-
}
3739-
}
3740-
37413725
if (protinfo) {
37423726
attr = nla_find_nested(protinfo, IFLA_BRPORT_LEARNING);
37433727
if (attr) {
@@ -3772,7 +3756,7 @@ static int rocker_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
37723756
u32 filter_mask)
37733757
{
37743758
struct rocker_port *rocker_port = netdev_priv(dev);
3775-
u16 mode = BRIDGE_MODE_SWDEV;
3759+
u16 mode = BRIDGE_MODE_UNDEF;
37763760
u32 mask = BR_LEARNING | BR_LEARNING_SYNC;
37773761

37783762
return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode,

net/core/rtnetlink.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2751,11 +2751,17 @@ int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
27512751
if (!br_afspec)
27522752
goto nla_put_failure;
27532753

2754-
if (nla_put_u16(skb, IFLA_BRIDGE_FLAGS, BRIDGE_FLAGS_SELF) ||
2755-
nla_put_u16(skb, IFLA_BRIDGE_MODE, mode)) {
2754+
if (nla_put_u16(skb, IFLA_BRIDGE_FLAGS, BRIDGE_FLAGS_SELF)) {
27562755
nla_nest_cancel(skb, br_afspec);
27572756
goto nla_put_failure;
27582757
}
2758+
2759+
if (mode != BRIDGE_MODE_UNDEF) {
2760+
if (nla_put_u16(skb, IFLA_BRIDGE_MODE, mode)) {
2761+
nla_nest_cancel(skb, br_afspec);
2762+
goto nla_put_failure;
2763+
}
2764+
}
27592765
nla_nest_end(skb, br_afspec);
27602766

27612767
protinfo = nla_nest_start(skb, IFLA_PROTINFO | NLA_F_NESTED);

0 commit comments

Comments
 (0)