mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 05:00:23 +00:00
lib, zebra: Add ability to read kernel notice of Offload Failed
The linux kernel is getting RTM_F_OFFLOAD_FAILED for kernel routes that have failed to offload. Write the code to receive these notifications from the linux kernel and store that data for display about the routes. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
57df06840a
commit
0d32fbee6d
@ -514,6 +514,13 @@ struct zapi_route {
|
|||||||
* offload situation.
|
* offload situation.
|
||||||
*/
|
*/
|
||||||
#define ZEBRA_FLAG_OFFLOADED 0x100
|
#define ZEBRA_FLAG_OFFLOADED 0x100
|
||||||
|
/*
|
||||||
|
* This flag tells everyone that the route has
|
||||||
|
* failed offloading.
|
||||||
|
* This flag makes no sense unless you are in an asic
|
||||||
|
* offload situation.
|
||||||
|
*/
|
||||||
|
#define ZEBRA_FLAG_OFFLOAD_FAILED 0x200
|
||||||
|
|
||||||
/* The older XXX_MESSAGE flags live here */
|
/* The older XXX_MESSAGE flags live here */
|
||||||
uint32_t message;
|
uint32_t message;
|
||||||
|
@ -672,6 +672,8 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
|
|||||||
flags |= ZEBRA_FLAG_TRAPPED;
|
flags |= ZEBRA_FLAG_TRAPPED;
|
||||||
if (rtm->rtm_flags & RTM_F_OFFLOAD)
|
if (rtm->rtm_flags & RTM_F_OFFLOAD)
|
||||||
flags |= ZEBRA_FLAG_OFFLOADED;
|
flags |= ZEBRA_FLAG_OFFLOADED;
|
||||||
|
if (rtm->rtm_flags & RTM_F_OFFLOAD_FAILED)
|
||||||
|
flags |= ZEBRA_FLAG_OFFLOAD_FAILED;
|
||||||
|
|
||||||
/* Route which inserted by Zebra. */
|
/* Route which inserted by Zebra. */
|
||||||
if (selfroute) {
|
if (selfroute) {
|
||||||
|
@ -209,7 +209,7 @@ static char re_status_output_char(const struct route_entry *re,
|
|||||||
return 't';
|
return 't';
|
||||||
|
|
||||||
if (zrouter.asic_offloaded
|
if (zrouter.asic_offloaded
|
||||||
&& !CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOADED))
|
&& CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOAD_FAILED))
|
||||||
return 'o';
|
return 'o';
|
||||||
|
|
||||||
if (star_p)
|
if (star_p)
|
||||||
@ -870,6 +870,9 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
|
|||||||
if (CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOADED))
|
if (CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOADED))
|
||||||
json_object_boolean_true_add(json_route, "offloaded");
|
json_object_boolean_true_add(json_route, "offloaded");
|
||||||
|
|
||||||
|
if (CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOAD_FAILED))
|
||||||
|
json_object_boolean_false_add(json_route, "offloaded");
|
||||||
|
|
||||||
if (re->tag)
|
if (re->tag)
|
||||||
json_object_int_add(json_route, "tag", re->tag);
|
json_object_int_add(json_route, "tag", re->tag);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user