net: bridge: Add port attribute IFLA_BRPORT_MRP_RING_OPEN
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Sun, 26 Apr 2020 13:22:01 +0000 (15:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Apr 2020 18:40:25 +0000 (11:40 -0700)
This patch adds a new port attribute, IFLA_BRPORT_MRP_RING_OPEN, which allows
to notify the userspace when the port lost the continuite of MRP frames.

This attribute is set by kernel whenever the SW or HW detects that the ring is
being open or closed.

Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/if_link.h
net/bridge/br_netlink.c
tools/include/uapi/linux/if_link.h

index 127c704eeba950c1c6646911b5018aafe51da2ee..a009365ad67b5a5589f9ce61d0b1f36a4f055d57 100644 (file)
@@ -343,6 +343,7 @@ enum {
        IFLA_BRPORT_NEIGH_SUPPRESS,
        IFLA_BRPORT_ISOLATED,
        IFLA_BRPORT_BACKUP_PORT,
+       IFLA_BRPORT_MRP_RING_OPEN,
        __IFLA_BRPORT_MAX
 };
 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
index 43dab4066f915bddcdcdc3dafc0d07fa7d50e01f..4084f1ef8641b379aab8331d21bdb0381578d70a 100644 (file)
@@ -151,6 +151,7 @@ static inline size_t br_port_info_size(void)
                + nla_total_size(sizeof(u8))    /* IFLA_BRPORT_MULTICAST_ROUTER */
 #endif
                + nla_total_size(sizeof(u16))   /* IFLA_BRPORT_GROUP_FWD_MASK */
+               + nla_total_size(sizeof(u8))    /* IFLA_BRPORT_MRP_RING_OPEN */
                + 0;
 }
 
@@ -213,6 +214,8 @@ static int br_port_fill_attrs(struct sk_buff *skb,
            nla_put_u16(skb, IFLA_BRPORT_GROUP_FWD_MASK, p->group_fwd_mask) ||
            nla_put_u8(skb, IFLA_BRPORT_NEIGH_SUPPRESS,
                       !!(p->flags & BR_NEIGH_SUPPRESS)) ||
+           nla_put_u8(skb, IFLA_BRPORT_MRP_RING_OPEN, !!(p->flags &
+                                                         BR_MRP_LOST_CONT)) ||
            nla_put_u8(skb, IFLA_BRPORT_ISOLATED, !!(p->flags & BR_ISOLATED)))
                return -EMSGSIZE;
 
index ca6665ea758a5be138aab892a5d4f5850cca8236..cafedbbfefbe9821491564e7759455776f0199a3 100644 (file)
@@ -343,6 +343,7 @@ enum {
        IFLA_BRPORT_NEIGH_SUPPRESS,
        IFLA_BRPORT_ISOLATED,
        IFLA_BRPORT_BACKUP_PORT,
+       IFLA_BRPORT_MRP_RING_OPEN,
        __IFLA_BRPORT_MAX
 };
 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)