summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_packet.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 02:24:42 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 02:24:42 +0200
commitd06ccd4768673332ee0c48b7d1fded57e6d41cd5 (patch)
treee5f43dc278c3108fd5f7f71bca72a2882d8412c4 /ospfd/ospf_packet.c
parentAdd a null check to ensure that another thread (diff)
downloadfrr-d06ccd4768673332ee0c48b7d1fded57e6d41cd5.tar.xz
frr-d06ccd4768673332ee0c48b7d1fded57e6d41cd5.zip
Ensuring that all interfaces are served in a round robin fashion during
write. Signed-off-by: Ayan Banerjee <ayan@cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_packet.c')
-rw-r--r--ospfd/ospf_packet.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 4b4a61a6e..c0c092437 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -760,6 +760,11 @@ ospf_write (struct thread *thread)
sockopt_iphdrincl_swab_htosys (&iph);
ret = sendmsg (ospf->fd, &msg, flags);
sockopt_iphdrincl_swab_systoh (&iph);
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug ("ospf_write to %s, "
+ "id %d, off %d, len %d, interface %s, mtu %u:",
+ inet_ntoa (iph.ip_dst), iph.ip_id, iph.ip_off, iph.ip_len,
+ oi->ifp->name, oi->ifp->mtu);
if (ret < 0)
zlog_warn ("*** sendmsg in ospf_write failed to %s, "
@@ -789,10 +794,16 @@ ospf_write (struct thread *thread)
/* Now delete packet from queue. */
ospf_packet_delete (oi);
+ /* Move this interface to the tail of write_q to
+ serve everyone in a round robin fashion */
+ list_delete_node (ospf->oi_write_q, node);
if (ospf_fifo_head (oi->obuf) == NULL)
{
oi->on_write_q = 0;
- list_delete_node (ospf->oi_write_q, node);
+ }
+ else
+ {
+ listnode_add (ospf->oi_write_q, oi);
}
/* If packets still remain in queue, call write thread. */
@@ -3326,7 +3337,7 @@ ospf_make_ls_upd (struct ospf_interface *oi, struct list *update, struct stream
u_int16_t ls_age;
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("ospf_make_ls_upd: List Iteration");
+ zlog_debug ("ospf_make_ls_upd: List Iteration %d", count);
lsa = listgetdata (node);
@@ -3732,7 +3743,8 @@ ospf_ls_upd_queue_send (struct ospf_interface *oi, struct list *update,
u_int16_t length = OSPF_HEADER_SIZE;
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("listcount = %d, dst %s", listcount (update), inet_ntoa(addr));
+ zlog_debug ("listcount = %d, [%s]dst %s", listcount (update), IF_NAME(oi),
+ inet_ntoa(addr));
op = ospf_ls_upd_packet_new (update, oi);