-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offload/Trap #7155
Offload/Trap #7155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution to FRR!
Click for style suggestions
To apply these suggestions:
curl -s https://gist.githubusercontent.com/polychaeta/a0a723d4ba5663ceb51555c669461450/raw/1e541bff93f412547af62ae7b585a759082d3bdb/cr_7155_1600784124.diff | git apply
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 9b814c92d..ce898a55d 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -21,164 +21,163 @@
/* Types of messages */
-enum {
- RTM_BASE = 16,
+enum { RTM_BASE = 16,
#define RTM_BASE RTM_BASE
- RTM_NEWLINK = 16,
+ RTM_NEWLINK = 16,
#define RTM_NEWLINK RTM_NEWLINK
- RTM_DELLINK,
+ RTM_DELLINK,
#define RTM_DELLINK RTM_DELLINK
- RTM_GETLINK,
+ RTM_GETLINK,
#define RTM_GETLINK RTM_GETLINK
- RTM_SETLINK,
+ RTM_SETLINK,
#define RTM_SETLINK RTM_SETLINK
- RTM_NEWADDR = 20,
+ RTM_NEWADDR = 20,
#define RTM_NEWADDR RTM_NEWADDR
- RTM_DELADDR,
+ RTM_DELADDR,
#define RTM_DELADDR RTM_DELADDR
- RTM_GETADDR,
+ RTM_GETADDR,
#define RTM_GETADDR RTM_GETADDR
- RTM_NEWROUTE = 24,
+ RTM_NEWROUTE = 24,
#define RTM_NEWROUTE RTM_NEWROUTE
- RTM_DELROUTE,
+ RTM_DELROUTE,
#define RTM_DELROUTE RTM_DELROUTE
- RTM_GETROUTE,
+ RTM_GETROUTE,
#define RTM_GETROUTE RTM_GETROUTE
- RTM_NEWNEIGH = 28,
+ RTM_NEWNEIGH = 28,
#define RTM_NEWNEIGH RTM_NEWNEIGH
- RTM_DELNEIGH,
+ RTM_DELNEIGH,
#define RTM_DELNEIGH RTM_DELNEIGH
- RTM_GETNEIGH,
+ RTM_GETNEIGH,
#define RTM_GETNEIGH RTM_GETNEIGH
- RTM_NEWRULE = 32,
+ RTM_NEWRULE = 32,
#define RTM_NEWRULE RTM_NEWRULE
- RTM_DELRULE,
+ RTM_DELRULE,
#define RTM_DELRULE RTM_DELRULE
- RTM_GETRULE,
+ RTM_GETRULE,
#define RTM_GETRULE RTM_GETRULE
- RTM_NEWQDISC = 36,
+ RTM_NEWQDISC = 36,
#define RTM_NEWQDISC RTM_NEWQDISC
- RTM_DELQDISC,
+ RTM_DELQDISC,
#define RTM_DELQDISC RTM_DELQDISC
- RTM_GETQDISC,
+ RTM_GETQDISC,
#define RTM_GETQDISC RTM_GETQDISC
- RTM_NEWTCLASS = 40,
+ RTM_NEWTCLASS = 40,
#define RTM_NEWTCLASS RTM_NEWTCLASS
- RTM_DELTCLASS,
+ RTM_DELTCLASS,
#define RTM_DELTCLASS RTM_DELTCLASS
- RTM_GETTCLASS,
+ RTM_GETTCLASS,
#define RTM_GETTCLASS RTM_GETTCLASS
- RTM_NEWTFILTER = 44,
+ RTM_NEWTFILTER = 44,
#define RTM_NEWTFILTER RTM_NEWTFILTER
- RTM_DELTFILTER,
+ RTM_DELTFILTER,
#define RTM_DELTFILTER RTM_DELTFILTER
- RTM_GETTFILTER,
+ RTM_GETTFILTER,
#define RTM_GETTFILTER RTM_GETTFILTER
- RTM_NEWACTION = 48,
+ RTM_NEWACTION = 48,
#define RTM_NEWACTION RTM_NEWACTION
- RTM_DELACTION,
+ RTM_DELACTION,
#define RTM_DELACTION RTM_DELACTION
- RTM_GETACTION,
+ RTM_GETACTION,
#define RTM_GETACTION RTM_GETACTION
- RTM_NEWPREFIX = 52,
+ RTM_NEWPREFIX = 52,
#define RTM_NEWPREFIX RTM_NEWPREFIX
- RTM_GETMULTICAST = 58,
+ RTM_GETMULTICAST = 58,
#define RTM_GETMULTICAST RTM_GETMULTICAST
- RTM_GETANYCAST = 62,
+ RTM_GETANYCAST = 62,
#define RTM_GETANYCAST RTM_GETANYCAST
- RTM_NEWNEIGHTBL = 64,
+ RTM_NEWNEIGHTBL = 64,
#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
- RTM_GETNEIGHTBL = 66,
+ RTM_GETNEIGHTBL = 66,
#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
- RTM_SETNEIGHTBL,
+ RTM_SETNEIGHTBL,
#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
- RTM_NEWNDUSEROPT = 68,
+ RTM_NEWNDUSEROPT = 68,
#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
- RTM_NEWADDRLABEL = 72,
+ RTM_NEWADDRLABEL = 72,
#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
- RTM_DELADDRLABEL,
+ RTM_DELADDRLABEL,
#define RTM_DELADDRLABEL RTM_DELADDRLABEL
- RTM_GETADDRLABEL,
+ RTM_GETADDRLABEL,
#define RTM_GETADDRLABEL RTM_GETADDRLABEL
- RTM_GETDCB = 78,
+ RTM_GETDCB = 78,
#define RTM_GETDCB RTM_GETDCB
- RTM_SETDCB,
+ RTM_SETDCB,
#define RTM_SETDCB RTM_SETDCB
- RTM_NEWNETCONF = 80,
+ RTM_NEWNETCONF = 80,
#define RTM_NEWNETCONF RTM_NEWNETCONF
- RTM_DELNETCONF,
+ RTM_DELNETCONF,
#define RTM_DELNETCONF RTM_DELNETCONF
- RTM_GETNETCONF = 82,
+ RTM_GETNETCONF = 82,
#define RTM_GETNETCONF RTM_GETNETCONF
- RTM_NEWMDB = 84,
+ RTM_NEWMDB = 84,
#define RTM_NEWMDB RTM_NEWMDB
- RTM_DELMDB = 85,
+ RTM_DELMDB = 85,
#define RTM_DELMDB RTM_DELMDB
- RTM_GETMDB = 86,
+ RTM_GETMDB = 86,
#define RTM_GETMDB RTM_GETMDB
- RTM_NEWNSID = 88,
+ RTM_NEWNSID = 88,
#define RTM_NEWNSID RTM_NEWNSID
- RTM_DELNSID = 89,
+ RTM_DELNSID = 89,
#define RTM_DELNSID RTM_DELNSID
- RTM_GETNSID = 90,
+ RTM_GETNSID = 90,
#define RTM_GETNSID RTM_GETNSID
- RTM_NEWSTATS = 92,
+ RTM_NEWSTATS = 92,
#define RTM_NEWSTATS RTM_NEWSTATS
- RTM_GETSTATS = 94,
+ RTM_GETSTATS = 94,
#define RTM_GETSTATS RTM_GETSTATS
- RTM_NEWCACHEREPORT = 96,
+ RTM_NEWCACHEREPORT = 96,
#define RTM_NEWCACHEREPORT RTM_NEWCACHEREPORT
- RTM_NEWCHAIN = 100,
+ RTM_NEWCHAIN = 100,
#define RTM_NEWCHAIN RTM_NEWCHAIN
- RTM_DELCHAIN,
+ RTM_DELCHAIN,
#define RTM_DELCHAIN RTM_DELCHAIN
- RTM_GETCHAIN,
+ RTM_GETCHAIN,
#define RTM_GETCHAIN RTM_GETCHAIN
- RTM_NEWNEXTHOP = 104,
+ RTM_NEWNEXTHOP = 104,
#define RTM_NEWNEXTHOP RTM_NEWNEXTHOP
- RTM_DELNEXTHOP,
+ RTM_DELNEXTHOP,
#define RTM_DELNEXTHOP RTM_DELNEXTHOP
- RTM_GETNEXTHOP,
+ RTM_GETNEXTHOP,
#define RTM_GETNEXTHOP RTM_GETNEXTHOP
- RTM_NEWLINKPROP = 108,
-#define RTM_NEWLINKPROP RTM_NEWLINKPROP
- RTM_DELLINKPROP,
-#define RTM_DELLINKPROP RTM_DELLINKPROP
- RTM_GETLINKPROP,
-#define RTM_GETLINKPROP RTM_GETLINKPROP
-
- RTM_NEWVLAN = 112,
-#define RTM_NEWNVLAN RTM_NEWVLAN
- RTM_DELVLAN,
-#define RTM_DELVLAN RTM_DELVLAN
- RTM_GETVLAN,
-#define RTM_GETVLAN RTM_GETVLAN
-
- __RTM_MAX,
+ RTM_NEWLINKPROP = 108,
+#define RTM_NEWLINKPROP RTM_NEWLINKPROP
+ RTM_DELLINKPROP,
+#define RTM_DELLINKPROP RTM_DELLINKPROP
+ RTM_GETLINKPROP,
+#define RTM_GETLINKPROP RTM_GETLINKPROP
+
+ RTM_NEWVLAN = 112,
+#define RTM_NEWNVLAN RTM_NEWVLAN
+ RTM_DELVLAN,
+#define RTM_DELVLAN RTM_DELVLAN
+ RTM_GETVLAN,
+#define RTM_GETVLAN RTM_GETVLAN
+
+ __RTM_MAX,
#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
};
@@ -186,7 +185,7 @@ enum {
#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
-/*
+/*
Generic structure for encapsulation of optional route information.
It is reminiscent of sockaddr, but with sa_family replaced
with attribute type.
@@ -226,7 +225,7 @@ struct rtmsg {
unsigned char rtm_table; /* Routing table id */
unsigned char rtm_protocol; /* Routing protocol; see below */
- unsigned char rtm_scope; /* See below */
+ unsigned char rtm_scope; /* See below */
unsigned char rtm_type; /* See below */
unsigned rtm_flags;
@@ -257,12 +256,13 @@ enum {
/* rtm_protocol */
-#define RTPROT_UNSPEC 0
-#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects;
- not used by current IPv4 */
-#define RTPROT_KERNEL 2 /* Route installed by kernel */
-#define RTPROT_BOOT 3 /* Route installed during boot */
-#define RTPROT_STATIC 4 /* Route installed by administrator */
+#define RTPROT_UNSPEC 0
+#define RTPROT_REDIRECT \
+ 1 /* Route installed by ICMP redirects; \
+ not used by current IPv4 */
+#define RTPROT_KERNEL 2 /* Route installed by kernel */
+#define RTPROT_BOOT 3 /* Route installed during boot */
+#define RTPROT_STATIC 4 /* Route installed by administrator */
/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
they are just passed from user and back as is.
@@ -271,23 +271,23 @@ enum {
avoid conflicts.
*/
-#define RTPROT_GATED 8 /* Apparently, GateD */
-#define RTPROT_RA 9 /* RDISC/ND router advertisements */
-#define RTPROT_MRT 10 /* Merit MRT */
-#define RTPROT_ZEBRA 11 /* Zebra */
-#define RTPROT_BIRD 12 /* BIRD */
-#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
-#define RTPROT_XORP 14 /* XORP */
-#define RTPROT_NTK 15 /* Netsukuku */
-#define RTPROT_DHCP 16 /* DHCP client */
-#define RTPROT_MROUTED 17 /* Multicast daemon */
-#define RTPROT_KEEPALIVED 18 /* Keepalived daemon */
-#define RTPROT_BABEL 42 /* Babel daemon */
-#define RTPROT_BGP 186 /* BGP Routes */
-#define RTPROT_ISIS 187 /* ISIS Routes */
-#define RTPROT_OSPF 188 /* OSPF Routes */
-#define RTPROT_RIP 189 /* RIP Routes */
-#define RTPROT_EIGRP 192 /* EIGRP Routes */
+#define RTPROT_GATED 8 /* Apparently, GateD */
+#define RTPROT_RA 9 /* RDISC/ND router advertisements */
+#define RTPROT_MRT 10 /* Merit MRT */
+#define RTPROT_ZEBRA 11 /* Zebra */
+#define RTPROT_BIRD 12 /* BIRD */
+#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
+#define RTPROT_XORP 14 /* XORP */
+#define RTPROT_NTK 15 /* Netsukuku */
+#define RTPROT_DHCP 16 /* DHCP client */
+#define RTPROT_MROUTED 17 /* Multicast daemon */
+#define RTPROT_KEEPALIVED 18 /* Keepalived daemon */
+#define RTPROT_BABEL 42 /* Babel daemon */
+#define RTPROT_BGP 186 /* BGP Routes */
+#define RTPROT_ISIS 187 /* ISIS Routes */
+#define RTPROT_OSPF 188 /* OSPF Routes */
+#define RTPROT_RIP 189 /* RIP Routes */
+#define RTPROT_EIGRP 192 /* EIGRP Routes */
/* rtm_scope
@@ -317,8 +317,8 @@ enum rt_scope_t {
#define RTM_F_PREFIX 0x800 /* Prefix addresses */
#define RTM_F_LOOKUP_TABLE 0x1000 /* set rtm_table to FIB lookup result */
#define RTM_F_FIB_MATCH 0x2000 /* return full fib lookup match */
-#define RTM_F_OFFLOAD 0x4000 /* route is offloaded */
-#define RTM_F_TRAP 0x8000 /* route is trapping packets */
+#define RTM_F_OFFLOAD 0x4000 /* route is offloaded */
+#define RTM_F_TRAP 0x8000 /* route is trapping packets */
/* Reserved table identifiers */
@@ -540,7 +540,7 @@ struct ifinfomsg {
};
/********************************************************************
- * prefix information
+ * prefix information
****/
struct prefixmsg {
@@ -554,13 +554,7 @@ struct prefixmsg {
unsigned char prefix_pad3;
};
-enum
-{
- PREFIX_UNSPEC,
- PREFIX_ADDRESS,
- PREFIX_CACHEINFO,
- __PREFIX_MAX
-};
+enum { PREFIX_UNSPEC, PREFIX_ADDRESS, PREFIX_CACHEINFO, __PREFIX_MAX };
#define PREFIX_MAX (__PREFIX_MAX - 1)
@@ -594,32 +588,31 @@ struct tcmsg {
*/
#define TCM_IFINDEX_MAGIC_BLOCK (0xFFFFFFFFU)
-enum {
- TCA_UNSPEC,
- TCA_KIND,
- TCA_OPTIONS,
- TCA_STATS,
- TCA_XSTATS,
- TCA_RATE,
- TCA_FCNT,
- TCA_STATS2,
- TCA_STAB,
- TCA_PAD,
- TCA_DUMP_INVISIBLE,
- TCA_CHAIN,
- TCA_HW_OFFLOAD,
- TCA_INGRESS_BLOCK,
- TCA_EGRESS_BLOCK,
- TCA_DUMP_FLAGS,
- __TCA_MAX
-};
+enum { TCA_UNSPEC,
+ TCA_KIND,
+ TCA_OPTIONS,
+ TCA_STATS,
+ TCA_XSTATS,
+ TCA_RATE,
+ TCA_FCNT,
+ TCA_STATS2,
+ TCA_STAB,
+ TCA_PAD,
+ TCA_DUMP_INVISIBLE,
+ TCA_CHAIN,
+ TCA_HW_OFFLOAD,
+ TCA_INGRESS_BLOCK,
+ TCA_EGRESS_BLOCK,
+ TCA_DUMP_FLAGS,
+ __TCA_MAX };
#define TCA_MAX (__TCA_MAX - 1)
-#define TCA_DUMP_FLAGS_TERSE (1 << 0) /* Means that in dump user gets only basic
- * data necessary to identify the objects
- * (handle, cookie, etc.) and stats.
- */
+#define TCA_DUMP_FLAGS_TERSE \
+ (1 << 0) /* Means that in dump user gets only basic \
+ * data necessary to identify the objects \
+ * (handle, cookie, etc.) and stats. \
+ */
#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
@@ -738,7 +731,7 @@ enum rtnetlink_groups {
RTNLGRP_NEXTHOP,
#define RTNLGRP_NEXTHOP RTNLGRP_NEXTHOP
RTNLGRP_BRVLAN,
-#define RTNLGRP_BRVLAN RTNLGRP_BRVLAN
+#define RTNLGRP_BRVLAN RTNLGRP_BRVLAN
__RTNLGRP_MAX
};
#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
@@ -778,7 +771,7 @@ enum {
#define RTEXT_FILTER_BRVLAN (1 << 1)
#define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2)
#define RTEXT_FILTER_SKIP_STATS (1 << 3)
-#define RTEXT_FILTER_MRP (1 << 4)
+#define RTEXT_FILTER_MRP (1 << 4)
/* End of information exported to user level */
diff --git a/lib/zclient.h b/lib/zclient.h
index 050877f27..0f33f32cb 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -486,14 +486,14 @@ struct zapi_route {
* forwarding. This flag makes no sense unless you are in
* an asic offload situation
*/
-#define ZEBRA_FLAG_TRAPPED 0x80
+#define ZEBRA_FLAG_TRAPPED 0x80
/*
* This flag tells everyone that the route has been
* successfully offloaded to an asic for forwarding.
* This flag makes no sense unless you are in an asic
* offload situation.
*/
-#define ZEBRA_FLAG_OFFLOADED 0x100
+#define ZEBRA_FLAG_OFFLOADED 0x100
/* The older XXX_MESSAGE flags live here */
uint32_t message;
If you are a new contributor to FRR, please see our contributing guidelines.
After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
For details, please contact louberger |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopo tests part 1 on Ubuntu 18.04 amd64: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP1U1804AMD64-14308/test Topology Tests failed for Topo tests part 1 on Ubuntu 18.04 amd64:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-14308/artifact/TP1U1804AMD64/ErrorLog/log_topotests.txt Topo tests part 1 on Ubuntu 16.04 amd64: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP1U1604AMD64-14308/test Topology Tests failed for Topo tests part 1 on Ubuntu 16.04 amd64:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-14308/artifact/TP1U1604AMD64/ErrorLog/log_topotests.txt Topo tests part 1 on Ubuntu 18.04 arm8: Failed (click for details)Topo tests part 1 on Ubuntu 18.04 arm8: No useful log foundTopo tests part 1 on Ubuntu 16.04 i386: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP1U1604I386-14308/test Topology Tests failed for Topo tests part 1 on Ubuntu 16.04 i386:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-14308/artifact/TP1U1604I386/ErrorLog/log_topotests.txt Successful on other platforms/tests
Warnings Generated during build:Checkout code: Successful with additional warningsTopo tests part 1 on Ubuntu 18.04 amd64: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP1U1804AMD64-14308/test Topology Tests failed for Topo tests part 1 on Ubuntu 18.04 amd64:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-14308/artifact/TP1U1804AMD64/ErrorLog/log_topotests.txt Topo tests part 1 on Ubuntu 16.04 amd64: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP1U1604AMD64-14308/test Topology Tests failed for Topo tests part 1 on Ubuntu 16.04 amd64:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-14308/artifact/TP1U1604AMD64/ErrorLog/log_topotests.txt Topo tests part 1 on Ubuntu 18.04 arm8: Failed (click for details)Topo tests part 1 on Ubuntu 18.04 arm8: No useful log foundTopo tests part 1 on Ubuntu 16.04 i386: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP1U1604I386-14308/test Topology Tests failed for Topo tests part 1 on Ubuntu 16.04 i386:
see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-14308/artifact/TP1U1604I386/ErrorLog/log_topotests.txt
Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
The rtnetlink.h header has changed in the kernel. Let's pull it in we need this for OFFLOAD and TRAP Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Some linux kernels are starting to support the idea of knowledge about the underlying asic. Add a boolean that we can set/unset to track whether or not we think the router has this functionality available. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
The linux kernel is getting RTM_F_TRAP and RTM_F_OFFLOAD for kernel routes that have an underlying asic offload. Write the code to receive these notifications from the linux kernel and to store that data for display about the routes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution to FRR!
Click for style suggestions
To apply these suggestions:
curl -s https://gist.githubusercontent.com/polychaeta/fed6a9534bb5df7f10bd31ddcd1adaff/raw/1e541bff93f412547af62ae7b585a759082d3bdb/cr_7155_1600804676.diff | git apply
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 9b814c92d..ce898a55d 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -21,164 +21,163 @@
/* Types of messages */
-enum {
- RTM_BASE = 16,
+enum { RTM_BASE = 16,
#define RTM_BASE RTM_BASE
- RTM_NEWLINK = 16,
+ RTM_NEWLINK = 16,
#define RTM_NEWLINK RTM_NEWLINK
- RTM_DELLINK,
+ RTM_DELLINK,
#define RTM_DELLINK RTM_DELLINK
- RTM_GETLINK,
+ RTM_GETLINK,
#define RTM_GETLINK RTM_GETLINK
- RTM_SETLINK,
+ RTM_SETLINK,
#define RTM_SETLINK RTM_SETLINK
- RTM_NEWADDR = 20,
+ RTM_NEWADDR = 20,
#define RTM_NEWADDR RTM_NEWADDR
- RTM_DELADDR,
+ RTM_DELADDR,
#define RTM_DELADDR RTM_DELADDR
- RTM_GETADDR,
+ RTM_GETADDR,
#define RTM_GETADDR RTM_GETADDR
- RTM_NEWROUTE = 24,
+ RTM_NEWROUTE = 24,
#define RTM_NEWROUTE RTM_NEWROUTE
- RTM_DELROUTE,
+ RTM_DELROUTE,
#define RTM_DELROUTE RTM_DELROUTE
- RTM_GETROUTE,
+ RTM_GETROUTE,
#define RTM_GETROUTE RTM_GETROUTE
- RTM_NEWNEIGH = 28,
+ RTM_NEWNEIGH = 28,
#define RTM_NEWNEIGH RTM_NEWNEIGH
- RTM_DELNEIGH,
+ RTM_DELNEIGH,
#define RTM_DELNEIGH RTM_DELNEIGH
- RTM_GETNEIGH,
+ RTM_GETNEIGH,
#define RTM_GETNEIGH RTM_GETNEIGH
- RTM_NEWRULE = 32,
+ RTM_NEWRULE = 32,
#define RTM_NEWRULE RTM_NEWRULE
- RTM_DELRULE,
+ RTM_DELRULE,
#define RTM_DELRULE RTM_DELRULE
- RTM_GETRULE,
+ RTM_GETRULE,
#define RTM_GETRULE RTM_GETRULE
- RTM_NEWQDISC = 36,
+ RTM_NEWQDISC = 36,
#define RTM_NEWQDISC RTM_NEWQDISC
- RTM_DELQDISC,
+ RTM_DELQDISC,
#define RTM_DELQDISC RTM_DELQDISC
- RTM_GETQDISC,
+ RTM_GETQDISC,
#define RTM_GETQDISC RTM_GETQDISC
- RTM_NEWTCLASS = 40,
+ RTM_NEWTCLASS = 40,
#define RTM_NEWTCLASS RTM_NEWTCLASS
- RTM_DELTCLASS,
+ RTM_DELTCLASS,
#define RTM_DELTCLASS RTM_DELTCLASS
- RTM_GETTCLASS,
+ RTM_GETTCLASS,
#define RTM_GETTCLASS RTM_GETTCLASS
- RTM_NEWTFILTER = 44,
+ RTM_NEWTFILTER = 44,
#define RTM_NEWTFILTER RTM_NEWTFILTER
- RTM_DELTFILTER,
+ RTM_DELTFILTER,
#define RTM_DELTFILTER RTM_DELTFILTER
- RTM_GETTFILTER,
+ RTM_GETTFILTER,
#define RTM_GETTFILTER RTM_GETTFILTER
- RTM_NEWACTION = 48,
+ RTM_NEWACTION = 48,
#define RTM_NEWACTION RTM_NEWACTION
- RTM_DELACTION,
+ RTM_DELACTION,
#define RTM_DELACTION RTM_DELACTION
- RTM_GETACTION,
+ RTM_GETACTION,
#define RTM_GETACTION RTM_GETACTION
- RTM_NEWPREFIX = 52,
+ RTM_NEWPREFIX = 52,
#define RTM_NEWPREFIX RTM_NEWPREFIX
- RTM_GETMULTICAST = 58,
+ RTM_GETMULTICAST = 58,
#define RTM_GETMULTICAST RTM_GETMULTICAST
- RTM_GETANYCAST = 62,
+ RTM_GETANYCAST = 62,
#define RTM_GETANYCAST RTM_GETANYCAST
- RTM_NEWNEIGHTBL = 64,
+ RTM_NEWNEIGHTBL = 64,
#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
- RTM_GETNEIGHTBL = 66,
+ RTM_GETNEIGHTBL = 66,
#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
- RTM_SETNEIGHTBL,
+ RTM_SETNEIGHTBL,
#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
- RTM_NEWNDUSEROPT = 68,
+ RTM_NEWNDUSEROPT = 68,
#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
- RTM_NEWADDRLABEL = 72,
+ RTM_NEWADDRLABEL = 72,
#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
- RTM_DELADDRLABEL,
+ RTM_DELADDRLABEL,
#define RTM_DELADDRLABEL RTM_DELADDRLABEL
- RTM_GETADDRLABEL,
+ RTM_GETADDRLABEL,
#define RTM_GETADDRLABEL RTM_GETADDRLABEL
- RTM_GETDCB = 78,
+ RTM_GETDCB = 78,
#define RTM_GETDCB RTM_GETDCB
- RTM_SETDCB,
+ RTM_SETDCB,
#define RTM_SETDCB RTM_SETDCB
- RTM_NEWNETCONF = 80,
+ RTM_NEWNETCONF = 80,
#define RTM_NEWNETCONF RTM_NEWNETCONF
- RTM_DELNETCONF,
+ RTM_DELNETCONF,
#define RTM_DELNETCONF RTM_DELNETCONF
- RTM_GETNETCONF = 82,
+ RTM_GETNETCONF = 82,
#define RTM_GETNETCONF RTM_GETNETCONF
- RTM_NEWMDB = 84,
+ RTM_NEWMDB = 84,
#define RTM_NEWMDB RTM_NEWMDB
- RTM_DELMDB = 85,
+ RTM_DELMDB = 85,
#define RTM_DELMDB RTM_DELMDB
- RTM_GETMDB = 86,
+ RTM_GETMDB = 86,
#define RTM_GETMDB RTM_GETMDB
- RTM_NEWNSID = 88,
+ RTM_NEWNSID = 88,
#define RTM_NEWNSID RTM_NEWNSID
- RTM_DELNSID = 89,
+ RTM_DELNSID = 89,
#define RTM_DELNSID RTM_DELNSID
- RTM_GETNSID = 90,
+ RTM_GETNSID = 90,
#define RTM_GETNSID RTM_GETNSID
- RTM_NEWSTATS = 92,
+ RTM_NEWSTATS = 92,
#define RTM_NEWSTATS RTM_NEWSTATS
- RTM_GETSTATS = 94,
+ RTM_GETSTATS = 94,
#define RTM_GETSTATS RTM_GETSTATS
- RTM_NEWCACHEREPORT = 96,
+ RTM_NEWCACHEREPORT = 96,
#define RTM_NEWCACHEREPORT RTM_NEWCACHEREPORT
- RTM_NEWCHAIN = 100,
+ RTM_NEWCHAIN = 100,
#define RTM_NEWCHAIN RTM_NEWCHAIN
- RTM_DELCHAIN,
+ RTM_DELCHAIN,
#define RTM_DELCHAIN RTM_DELCHAIN
- RTM_GETCHAIN,
+ RTM_GETCHAIN,
#define RTM_GETCHAIN RTM_GETCHAIN
- RTM_NEWNEXTHOP = 104,
+ RTM_NEWNEXTHOP = 104,
#define RTM_NEWNEXTHOP RTM_NEWNEXTHOP
- RTM_DELNEXTHOP,
+ RTM_DELNEXTHOP,
#define RTM_DELNEXTHOP RTM_DELNEXTHOP
- RTM_GETNEXTHOP,
+ RTM_GETNEXTHOP,
#define RTM_GETNEXTHOP RTM_GETNEXTHOP
- RTM_NEWLINKPROP = 108,
-#define RTM_NEWLINKPROP RTM_NEWLINKPROP
- RTM_DELLINKPROP,
-#define RTM_DELLINKPROP RTM_DELLINKPROP
- RTM_GETLINKPROP,
-#define RTM_GETLINKPROP RTM_GETLINKPROP
-
- RTM_NEWVLAN = 112,
-#define RTM_NEWNVLAN RTM_NEWVLAN
- RTM_DELVLAN,
-#define RTM_DELVLAN RTM_DELVLAN
- RTM_GETVLAN,
-#define RTM_GETVLAN RTM_GETVLAN
-
- __RTM_MAX,
+ RTM_NEWLINKPROP = 108,
+#define RTM_NEWLINKPROP RTM_NEWLINKPROP
+ RTM_DELLINKPROP,
+#define RTM_DELLINKPROP RTM_DELLINKPROP
+ RTM_GETLINKPROP,
+#define RTM_GETLINKPROP RTM_GETLINKPROP
+
+ RTM_NEWVLAN = 112,
+#define RTM_NEWNVLAN RTM_NEWVLAN
+ RTM_DELVLAN,
+#define RTM_DELVLAN RTM_DELVLAN
+ RTM_GETVLAN,
+#define RTM_GETVLAN RTM_GETVLAN
+
+ __RTM_MAX,
#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
};
@@ -186,7 +185,7 @@ enum {
#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
-/*
+/*
Generic structure for encapsulation of optional route information.
It is reminiscent of sockaddr, but with sa_family replaced
with attribute type.
@@ -226,7 +225,7 @@ struct rtmsg {
unsigned char rtm_table; /* Routing table id */
unsigned char rtm_protocol; /* Routing protocol; see below */
- unsigned char rtm_scope; /* See below */
+ unsigned char rtm_scope; /* See below */
unsigned char rtm_type; /* See below */
unsigned rtm_flags;
@@ -257,12 +256,13 @@ enum {
/* rtm_protocol */
-#define RTPROT_UNSPEC 0
-#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects;
- not used by current IPv4 */
-#define RTPROT_KERNEL 2 /* Route installed by kernel */
-#define RTPROT_BOOT 3 /* Route installed during boot */
-#define RTPROT_STATIC 4 /* Route installed by administrator */
+#define RTPROT_UNSPEC 0
+#define RTPROT_REDIRECT \
+ 1 /* Route installed by ICMP redirects; \
+ not used by current IPv4 */
+#define RTPROT_KERNEL 2 /* Route installed by kernel */
+#define RTPROT_BOOT 3 /* Route installed during boot */
+#define RTPROT_STATIC 4 /* Route installed by administrator */
/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
they are just passed from user and back as is.
@@ -271,23 +271,23 @@ enum {
avoid conflicts.
*/
-#define RTPROT_GATED 8 /* Apparently, GateD */
-#define RTPROT_RA 9 /* RDISC/ND router advertisements */
-#define RTPROT_MRT 10 /* Merit MRT */
-#define RTPROT_ZEBRA 11 /* Zebra */
-#define RTPROT_BIRD 12 /* BIRD */
-#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
-#define RTPROT_XORP 14 /* XORP */
-#define RTPROT_NTK 15 /* Netsukuku */
-#define RTPROT_DHCP 16 /* DHCP client */
-#define RTPROT_MROUTED 17 /* Multicast daemon */
-#define RTPROT_KEEPALIVED 18 /* Keepalived daemon */
-#define RTPROT_BABEL 42 /* Babel daemon */
-#define RTPROT_BGP 186 /* BGP Routes */
-#define RTPROT_ISIS 187 /* ISIS Routes */
-#define RTPROT_OSPF 188 /* OSPF Routes */
-#define RTPROT_RIP 189 /* RIP Routes */
-#define RTPROT_EIGRP 192 /* EIGRP Routes */
+#define RTPROT_GATED 8 /* Apparently, GateD */
+#define RTPROT_RA 9 /* RDISC/ND router advertisements */
+#define RTPROT_MRT 10 /* Merit MRT */
+#define RTPROT_ZEBRA 11 /* Zebra */
+#define RTPROT_BIRD 12 /* BIRD */
+#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
+#define RTPROT_XORP 14 /* XORP */
+#define RTPROT_NTK 15 /* Netsukuku */
+#define RTPROT_DHCP 16 /* DHCP client */
+#define RTPROT_MROUTED 17 /* Multicast daemon */
+#define RTPROT_KEEPALIVED 18 /* Keepalived daemon */
+#define RTPROT_BABEL 42 /* Babel daemon */
+#define RTPROT_BGP 186 /* BGP Routes */
+#define RTPROT_ISIS 187 /* ISIS Routes */
+#define RTPROT_OSPF 188 /* OSPF Routes */
+#define RTPROT_RIP 189 /* RIP Routes */
+#define RTPROT_EIGRP 192 /* EIGRP Routes */
/* rtm_scope
@@ -317,8 +317,8 @@ enum rt_scope_t {
#define RTM_F_PREFIX 0x800 /* Prefix addresses */
#define RTM_F_LOOKUP_TABLE 0x1000 /* set rtm_table to FIB lookup result */
#define RTM_F_FIB_MATCH 0x2000 /* return full fib lookup match */
-#define RTM_F_OFFLOAD 0x4000 /* route is offloaded */
-#define RTM_F_TRAP 0x8000 /* route is trapping packets */
+#define RTM_F_OFFLOAD 0x4000 /* route is offloaded */
+#define RTM_F_TRAP 0x8000 /* route is trapping packets */
/* Reserved table identifiers */
@@ -540,7 +540,7 @@ struct ifinfomsg {
};
/********************************************************************
- * prefix information
+ * prefix information
****/
struct prefixmsg {
@@ -554,13 +554,7 @@ struct prefixmsg {
unsigned char prefix_pad3;
};
-enum
-{
- PREFIX_UNSPEC,
- PREFIX_ADDRESS,
- PREFIX_CACHEINFO,
- __PREFIX_MAX
-};
+enum { PREFIX_UNSPEC, PREFIX_ADDRESS, PREFIX_CACHEINFO, __PREFIX_MAX };
#define PREFIX_MAX (__PREFIX_MAX - 1)
@@ -594,32 +588,31 @@ struct tcmsg {
*/
#define TCM_IFINDEX_MAGIC_BLOCK (0xFFFFFFFFU)
-enum {
- TCA_UNSPEC,
- TCA_KIND,
- TCA_OPTIONS,
- TCA_STATS,
- TCA_XSTATS,
- TCA_RATE,
- TCA_FCNT,
- TCA_STATS2,
- TCA_STAB,
- TCA_PAD,
- TCA_DUMP_INVISIBLE,
- TCA_CHAIN,
- TCA_HW_OFFLOAD,
- TCA_INGRESS_BLOCK,
- TCA_EGRESS_BLOCK,
- TCA_DUMP_FLAGS,
- __TCA_MAX
-};
+enum { TCA_UNSPEC,
+ TCA_KIND,
+ TCA_OPTIONS,
+ TCA_STATS,
+ TCA_XSTATS,
+ TCA_RATE,
+ TCA_FCNT,
+ TCA_STATS2,
+ TCA_STAB,
+ TCA_PAD,
+ TCA_DUMP_INVISIBLE,
+ TCA_CHAIN,
+ TCA_HW_OFFLOAD,
+ TCA_INGRESS_BLOCK,
+ TCA_EGRESS_BLOCK,
+ TCA_DUMP_FLAGS,
+ __TCA_MAX };
#define TCA_MAX (__TCA_MAX - 1)
-#define TCA_DUMP_FLAGS_TERSE (1 << 0) /* Means that in dump user gets only basic
- * data necessary to identify the objects
- * (handle, cookie, etc.) and stats.
- */
+#define TCA_DUMP_FLAGS_TERSE \
+ (1 << 0) /* Means that in dump user gets only basic \
+ * data necessary to identify the objects \
+ * (handle, cookie, etc.) and stats. \
+ */
#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
@@ -738,7 +731,7 @@ enum rtnetlink_groups {
RTNLGRP_NEXTHOP,
#define RTNLGRP_NEXTHOP RTNLGRP_NEXTHOP
RTNLGRP_BRVLAN,
-#define RTNLGRP_BRVLAN RTNLGRP_BRVLAN
+#define RTNLGRP_BRVLAN RTNLGRP_BRVLAN
__RTNLGRP_MAX
};
#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
@@ -778,7 +771,7 @@ enum {
#define RTEXT_FILTER_BRVLAN (1 << 1)
#define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2)
#define RTEXT_FILTER_SKIP_STATS (1 << 3)
-#define RTEXT_FILTER_MRP (1 << 4)
+#define RTEXT_FILTER_MRP (1 << 4)
/* End of information exported to user level */
diff --git a/lib/zclient.h b/lib/zclient.h
index 050877f27..0f33f32cb 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -486,14 +486,14 @@ struct zapi_route {
* forwarding. This flag makes no sense unless you are in
* an asic offload situation
*/
-#define ZEBRA_FLAG_TRAPPED 0x80
+#define ZEBRA_FLAG_TRAPPED 0x80
/*
* This flag tells everyone that the route has been
* successfully offloaded to an asic for forwarding.
* This flag makes no sense unless you are in an asic
* offload situation.
*/
-#define ZEBRA_FLAG_OFFLOADED 0x100
+#define ZEBRA_FLAG_OFFLOADED 0x100
/* The older XXX_MESSAGE flags live here */
uint32_t message;
If you are a new contributor to FRR, please see our contributing guidelines.
After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-14317/ This is a comment from an automated CI system. Warnings Generated during build:Checkout code: Successful with additional warnings
Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a few questions
The linux kernel has the ability to notice if a route has been offloaded to an asic for forwarding or if the route has been setup to trap to the kernel. Write the code to notice that this is happening. At this time we do not really do anything with this data other than to keep track of it. Future commits will take advantage of this.
At this point in time I have not written any topotests for this because the kernel is so new that will support this that it really is not in any distribution. I will be writing these tests once we get features that start to take advantage of this knowledge