Skip to content
Permalink
Browse files
nexthop: Add netlink defines and enumerators for resilient NH groups
RTM_NEWNEXTHOP et.al. that handle resilient groups will have a new nested
attribute, NHA_RES_GROUP, whose elements are attributes NHA_RES_GROUP_*.

RTM_NEWNEXTHOPBUCKET et.al. is a suite of new messages that will currently
serve only for dumping of individual buckets of resilient next hop groups.
For nexthop group buckets, these messages will carry a nested attribute
NHA_RES_BUCKET, whose elements are attributes NHA_RES_BUCKET_*.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
  • Loading branch information
pmachata committed Jan 15, 2021
1 parent 8214b7c commit ea7a8e9972e4be1cd719b732566d98dd88d959d1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
@@ -22,6 +22,7 @@ struct nexthop_grp {

enum {
NEXTHOP_GRP_TYPE_MPATH, /* default type if not specified */
NEXTHOP_GRP_TYPE_RES, /* resilient nexthop group */
__NEXTHOP_GRP_TYPE_MAX,
};

@@ -52,8 +53,50 @@ enum {
NHA_FDB, /* flag; nexthop belongs to a bridge fdb */
/* if NHA_FDB is added, OIF, BLACKHOLE, ENCAP cannot be set */

/* nested; resilient nexthop group attributes */
NHA_RES_GROUP,
/* nested; nexthop bucket attributes */
NHA_RES_BUCKET,

__NHA_MAX,
};

#define NHA_MAX (__NHA_MAX - 1)

enum {
NHA_RES_GROUP_UNSPEC,
/* Pad attribute for 64-bit alignment. */
NHA_RES_GROUP_PAD = NHA_RES_GROUP_UNSPEC,

/* u32; number of nexthop buckets in a resilient nexthop group */
NHA_RES_GROUP_BUCKETS,
/* clock_t as u32; nexthop bucket idle timer (per-group) */
NHA_RES_GROUP_IDLE_TIMER,
/* clock_t as u32; nexthop unbalanced timer */
NHA_RES_GROUP_UNBALANCED_TIMER,
/* clock_t as u64; nexthop unbalanced time */
NHA_RES_GROUP_UNBALANCED_TIME,

__NHA_RES_GROUP_MAX,
};

#define NHA_RES_GROUP_MAX (__NHA_RES_GROUP_MAX - 1)

enum {
NHA_RES_BUCKET_UNSPEC,
/* Pad attribute for 64-bit alignment. */
NHA_RES_BUCKET_PAD = NHA_RES_BUCKET_UNSPEC,

/* u32; nexthop bucket index */
NHA_RES_BUCKET_INDEX,
/* clock_t as u64; nexthop bucket idle time */
NHA_RES_BUCKET_IDLE_TIME,
/* u32; nexthop id assigned to the nexthop bucket */
NHA_RES_BUCKET_NH_ID,

__NHA_RES_BUCKET_MAX,
};

#define NHA_RES_BUCKET_MAX (__NHA_RES_BUCKET_MAX - 1)

#endif
@@ -178,6 +178,13 @@ enum {
RTM_GETVLAN,
#define RTM_GETVLAN RTM_GETVLAN

RTM_NEWNEXTHOPBUCKET = 116,
#define RTM_NEWNEXTHOPBUCKET RTM_NEWNEXTHOPBUCKET
RTM_DELNEXTHOPBUCKET,
#define RTM_DELNEXTHOPBUCKET RTM_DELNEXTHOPBUCKET
RTM_GETNEXTHOPBUCKET,
#define RTM_GETNEXTHOPBUCKET RTM_GETNEXTHOPBUCKET

__RTM_MAX,
#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
};

0 comments on commit ea7a8e9

Please sign in to comment.