Skip to content

Commit c7c0bbe

Browse files
yotamgidavem330
authored andcommitted
net: ipmr: Add MFC offload indication
Allow drivers, registered to the fib notification chain indicate whether a multicast MFC route is offloaded or not, similarly to unicast routes. The indication of whether a route is offloaded is done using the mfc_flags field on an mfc_cache struct, and the information is sent to the userspace via the RTNetlink interface only. Currently, MFC routes are either offloaded or not, thus there is no need to add per-VIF offload indication. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b362053 commit c7c0bbe

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎include/linux/mroute.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ struct mr_table {
9090

9191
/* mfc_flags:
9292
* MFC_STATIC - the entry was added statically (not by a routing daemon)
93+
* MFC_OFFLOAD - the entry was offloaded to the hardware
9394
*/
9495
enum {
9596
MFC_STATIC = BIT(0),
97+
MFC_OFFLOAD = BIT(1),
9698
};
9799

98100
struct mfc_cache_cmp_arg {

‎net/ipv4/ipmr.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,6 +2268,9 @@ static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
22682268
nla_put_u32(skb, RTA_IIF, mrt->vif_table[c->mfc_parent].dev->ifindex) < 0)
22692269
return -EMSGSIZE;
22702270

2271+
if (c->mfc_flags & MFC_OFFLOAD)
2272+
rtm->rtm_flags |= RTNH_F_OFFLOAD;
2273+
22712274
if (!(mp_attr = nla_nest_start(skb, RTA_MULTIPATH)))
22722275
return -EMSGSIZE;
22732276

0 commit comments

Comments
 (0)