From: Mark Stapp Date: Wed, 26 Sep 2018 13:34:43 +0000 (-0400) Subject: zebra: rebase dataplane, align with master X-Git-Tag: frr-7.1-dev~233^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8b962e77595b499be610aee5f8ce6132f062affd;p=matthieu%2Ffrr.git zebra: rebase dataplane, align with master Rebase and pick up dataplane changes on master, including renamed structs and enums. Signed-off-by: Mark Stapp --- diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 0a58c2e262..0772c59b92 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -934,7 +934,7 @@ int netlink_parse_info(int (*filter)(struct nlmsghdr *, ns_id_t, int), * * filter -> The filter to read final results from kernel * nlmsghdr -> The data to send to the kernel - * zns_info -> The netlink socket information + * dp_info -> The dataplane and netlink socket information * startup -> Are we reading in under startup conditions * This is passed through eventually to filter. */ @@ -990,7 +990,6 @@ int netlink_talk_info(int (*filter)(struct nlmsghdr *, ns_id_t, int startup), return -1; } - /* * Get reply from netlink socket. * The reply should either be an acknowlegement or an error. @@ -1001,7 +1000,6 @@ int netlink_talk_info(int (*filter)(struct nlmsghdr *, ns_id_t, int startup), /* * Synchronous version of netlink_talk_info. Converts args to suit the * common version, which is suitable for both sync and async use. - * */ int netlink_talk(int (*filter)(struct nlmsghdr *, ns_id_t, int startup), struct nlmsghdr *n, struct nlsock *nl, struct zebra_ns *zns, diff --git a/zebra/kernel_netlink.h b/zebra/kernel_netlink.h index f3de011b66..9918729eb6 100644 --- a/zebra/kernel_netlink.h +++ b/zebra/kernel_netlink.h @@ -53,7 +53,7 @@ extern void netlink_read_init(const char *fname); #endif /* HANDLE_NETLINK_FUZZING */ extern int netlink_parse_info(int (*filter)(struct nlmsghdr *, ns_id_t, int), const struct nlsock *nl, - const struct zebra_dplane_info *zns, + const struct zebra_dplane_info *dp_info, int count, int startup); extern int netlink_talk_filter(struct nlmsghdr *h, ns_id_t ns, int startup); extern int netlink_talk(int (*filter)(struct nlmsghdr *, ns_id_t, int startup), @@ -62,8 +62,7 @@ extern int netlink_talk(int (*filter)(struct nlmsghdr *, ns_id_t, int startup), /* Version with 'info' struct only */ int netlink_talk_info(int (*filter)(struct nlmsghdr *, ns_id_t, int startup), struct nlmsghdr *n, - const struct zebra_dplane_info *dp_info, - int startup); + const struct zebra_dplane_info *dp_info, int startup); extern int netlink_request(struct nlsock *nl, struct nlmsghdr *n); diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 9d75ae940a..0581edfd6d 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -70,8 +70,8 @@ struct zebra_dplane_ctx { enum zebra_dplane_result zd_status; /* TODO -- internal/sub-operation status? */ - enum zebra_dplane_status zd_remote_status; - enum zebra_dplane_status zd_kernel_status; + enum zebra_dplane_result zd_remote_status; + enum zebra_dplane_result zd_kernel_status; /* Dest and (optional) source prefixes */ struct prefix zd_dest; diff --git a/zebra/zebra_ns.h b/zebra/zebra_ns.h index 037c7322b7..ed70a34c0b 100644 --- a/zebra/zebra_ns.h +++ b/zebra/zebra_ns.h @@ -87,40 +87,6 @@ struct zebra_ns { struct ns *ns; }; -/* Key netlink info from zebra ns, passed from the zebra main context - * to the dataplane/kernel context (which might be in a different pthread). - */ -struct zebra_ns_info { - ns_id_t ns_id; - -#if defined(HAVE_NETLINK) - struct nlsock nls; - uint32_t nl_cmd_pid; - bool is_cmd; -#endif -}; - -/* Utility to fill in zns info from main zns struct */ -static inline void zebra_ns_info_from_ns(struct zebra_ns_info *zns_info, - const struct zebra_ns *zns, - bool is_cmd) -{ - zns_info->ns_id = zns->ns_id; - -#if defined(HAVE_NETLINK) - /* Need to know whether we're using the 'command' netlink socket, - * and need to know its port-id to handle some test/filtering - * cases. - */ - zns_info->is_cmd = is_cmd; - zns_info->nl_cmd_pid = zns->netlink_cmd.snl.nl_pid; - if (is_cmd) - zns_info->nls = zns->netlink_cmd; - else - zns_info->nls = zns->netlink; -#endif /* NETLINK */ -} - struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id); int zebra_ns_init(void); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 0d1a149694..becdfaada7 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2191,8 +2191,8 @@ static wq_item_status meta_queue_process(struct work_queue *dummy, void *data) queue_len = dplane_get_in_queue_len(); if (queue_len > queue_limit) { if (IS_ZEBRA_DEBUG_RIB_DETAILED) - zlog_debug("meta_queue_process: dplane queue len %u, " - "limit %u, retrying", queue_len, queue_limit); + zlog_debug("rib queue: dplane queue len %u, limit %u, retrying", + queue_len, queue_limit); /* Ensure that the meta-queue is actually enqueued */ if (work_queue_empty(zebrad.ribq))