]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: When we get an implicit or ack or full failure mark status
authorDonald Sharp <sharpd@nvidia.com>
Wed, 10 Nov 2021 19:12:39 +0000 (14:12 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 4 Feb 2022 20:33:58 +0000 (15:33 -0500)
When nl_batch_read_resp gets a full on failure -1 or an implicit
ack 0 from the kernel for a batch of code.  Let's immediately
mark all of those in the batch pass/fail as needed.  Instead
of having them marked else where.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/kernel_netlink.c

index d614aa26d0a8f6706d7e75d3a733ecff1df3d2af..26ceea205739e79f4545235555c0273dd743ef61 100644 (file)
@@ -1125,8 +1125,25 @@ static int nl_batch_read_resp(struct nl_batch *bth)
        while (true) {
                status = netlink_recv_msg(nl, msg, nl_batch_rx_buf,
                                          sizeof(nl_batch_rx_buf));
-               if (status == -1 || status == 0)
+               /*
+                * status == -1 is a full on failure somewhere
+                * since we don't know where the problem happened
+                * we must mark all as failed
+                *
+                * Else we mark everything as worked
+                *
+                */
+               if (status == -1 || status == 0) {
+                       while ((ctx = dplane_ctx_dequeue(&(bth->ctx_list))) !=
+                              NULL) {
+                               if (status == -1)
+                                       dplane_ctx_set_status(
+                                               ctx,
+                                               ZEBRA_DPLANE_REQUEST_FAILURE);
+                               dplane_ctx_enqueue_tail(bth->ctx_out_q, ctx);
+                       }
                        return status;
+               }
 
                h = (struct nlmsghdr *)nl_batch_rx_buf;
                ignore_msg = false;