diff options
author | Jiri Pirko <jiri@mellanox.com> | 2016-09-26 10:52:30 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-28 08:48:00 (GMT) |
commit | c98501879b1b1af90c7325574f2672e9efca592c (patch) | |
tree | cc6f5e21ae1250962df15dc0e014a85975501c67 /net | |
parent | b90eb754949931b2e4481b1df9a03f84d4be66ba (diff) | |
download | linux-c98501879b1b1af90c7325574f2672e9efca592c.tar.xz |
fib: introduce FIB info offload flag helpers
These helpers are to be used in case someone offloads the FIB entry. The
result is that if the entry is offloaded to at least one device, the
offload flag is set.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/switchdev/switchdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 10b8193..abd8d2a 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c @@ -1216,7 +1216,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi, ipv4_fib.obj.orig_dev = dev; err = switchdev_port_obj_add(dev, &ipv4_fib.obj); if (!err) - fi->fib_flags |= RTNH_F_OFFLOAD; + fib_info_offload_inc(fi); return err == -EOPNOTSUPP ? 0 : err; } @@ -1260,7 +1260,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi, ipv4_fib.obj.orig_dev = dev; err = switchdev_port_obj_del(dev, &ipv4_fib.obj); if (!err) - fi->fib_flags &= ~RTNH_F_OFFLOAD; + fib_info_offload_dec(fi); return err == -EOPNOTSUPP ? 0 : err; } |