From 914710d79e18319e3e72ac2ac5f5c6c15c82dc42 Mon Sep 17 00:00:00 2001 From: Abhishek N R Date: Mon, 11 Jul 2022 01:33:07 -0700 Subject: [PATCH 1/4] pim6d: Completing "ipv6 mld query-max-response-time" command. Signed-off-by: Abhishek N R --- pimd/pim6_mld.c | 11 ++++++++--- pimd/pim_nb_config.c | 23 ++++++++++++----------- pimd/pim_vty.c | 7 +++++++ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/pimd/pim6_mld.c b/pimd/pim6_mld.c index badc25b473..2bffede800 100644 --- a/pimd/pim6_mld.c +++ b/pimd/pim6_mld.c @@ -2091,11 +2091,10 @@ static void gm_start(struct interface *ifp) else gm_ifp->cur_version = GM_MLDV2; - /* hardcoded for dev without CLI */ - gm_ifp->cur_qrv = 2; + gm_ifp->cur_qrv = pim_ifp->gm_default_robustness_variable; gm_ifp->cur_query_intv = pim_ifp->gm_default_query_interval * 1000; gm_ifp->cur_query_intv_trig = gm_ifp->cur_query_intv; - gm_ifp->cur_max_resp = 250; + gm_ifp->cur_max_resp = pim_ifp->gm_query_max_response_time_dsec * 100; gm_ifp->cfg_timing_fuzz.tv_sec = 0; gm_ifp->cfg_timing_fuzz.tv_usec = 10 * 1000; @@ -2272,6 +2271,12 @@ void gm_ifp_update(struct interface *ifp) changed = true; } + unsigned int cfg_max_response = + pim_ifp->gm_query_max_response_time_dsec * 100; + + if (gm_ifp->cur_max_resp != cfg_max_response) + gm_ifp->cur_max_resp = cfg_max_response; + enum gm_version cfg_version; if (pim_ifp->mld_version == 1) diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index 72b16a5f49..87c8659fc5 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -454,14 +454,17 @@ static void change_query_interval(struct pim_interface *pim_ifp, } #endif -#if PIM_IPV == 4 -static void change_query_max_response_time(struct pim_interface *pim_ifp, - int query_max_response_time_dsec) +static void change_query_max_response_time(struct interface *ifp, + int query_max_response_time_dsec) { +#if PIM_IPV == 4 struct listnode *sock_node; struct gm_sock *igmp; struct listnode *grp_node; struct gm_group *grp; +#endif + + struct pim_interface *pim_ifp = ifp->info; if (pim_ifp->gm_query_max_response_time_dsec == query_max_response_time_dsec) @@ -469,6 +472,9 @@ static void change_query_max_response_time(struct pim_interface *pim_ifp, pim_ifp->gm_query_max_response_time_dsec = query_max_response_time_dsec; +#if PIM_IPV == 6 + gm_ifp_update(ifp); +#else /* * Below we modify socket/group/source timers in order to quickly * reflect the change. Otherwise, those timers would args->eventually @@ -501,8 +507,8 @@ static void change_query_max_response_time(struct pim_interface *pim_ifp, igmp_source_reset_gmi(grp, src); } } +#endif /* PIM_IPV == 4 */ } -#endif int routing_control_plane_protocols_name_validate( struct nb_cb_create_args *args) @@ -2797,7 +2803,6 @@ int lib_interface_gmp_address_family_query_interval_modify( int lib_interface_gmp_address_family_query_max_response_time_modify( struct nb_cb_modify_args *args) { -#if PIM_IPV == 4 struct interface *ifp; int query_max_response_time_dsec; @@ -2810,13 +2815,9 @@ int lib_interface_gmp_address_family_query_max_response_time_modify( ifp = nb_running_get_entry(args->dnode, NULL, true); query_max_response_time_dsec = yang_dnode_get_uint16(args->dnode, NULL); - change_query_max_response_time(ifp->info, - query_max_response_time_dsec); + change_query_max_response_time(ifp, + query_max_response_time_dsec); } -#else - /* TBD Depends on MLD data structure changes */ -#endif - return NB_OK; } diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index cfbd436981..80faa503f3 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -378,6 +378,13 @@ static int gm_config_write(struct vty *vty, int writes, if (pim_ifp->mld_version != MLD_DEFAULT_VERSION) vty_out(vty, " ipv6 mld version %d\n", pim_ifp->mld_version); + + /* IF ipv6 mld query-max-response-time */ + if (pim_ifp->gm_query_max_response_time_dsec != + IGMP_QUERY_MAX_RESPONSE_TIME_DSEC) + vty_out(vty, " ipv6 mld query-max-response-time %d\n", + pim_ifp->gm_query_max_response_time_dsec); + if (pim_ifp->gm_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL) vty_out(vty, " ipv6 mld query-interval %d\n", pim_ifp->gm_default_query_interval); From 51b4991feb398dd557c15af5264623214e2b5835 Mon Sep 17 00:00:00 2001 From: Abhishek N R Date: Mon, 11 Jul 2022 08:51:52 -0700 Subject: [PATCH 2/4] pim6d: Completing "ipv6 mld last-member-query-count" command. Signed-off-by: Abhishek N R --- pimd/pim6_mld.c | 6 +++++- pimd/pim6_mld.h | 1 + pimd/pim_nb_config.c | 4 ---- pimd/pim_vty.c | 7 +++++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pimd/pim6_mld.c b/pimd/pim6_mld.c index 2bffede800..2ffdefc2fe 100644 --- a/pimd/pim6_mld.c +++ b/pimd/pim6_mld.c @@ -418,7 +418,7 @@ static void gm_sg_update(struct gm_sg *sg, bool has_expired) gm_sg_timer_start(gm_ifp, sg, timers.expire_wait); THREAD_OFF(sg->t_sg_query); - sg->n_query = gm_ifp->cur_qrv; + sg->n_query = gm_ifp->cur_lmqc; sg->query_sbit = false; gm_trigger_specific(sg); } @@ -2095,6 +2095,7 @@ static void gm_start(struct interface *ifp) gm_ifp->cur_query_intv = pim_ifp->gm_default_query_interval * 1000; gm_ifp->cur_query_intv_trig = gm_ifp->cur_query_intv; gm_ifp->cur_max_resp = pim_ifp->gm_query_max_response_time_dsec * 100; + gm_ifp->cur_lmqc = pim_ifp->gm_last_member_query_count; gm_ifp->cfg_timing_fuzz.tv_sec = 0; gm_ifp->cfg_timing_fuzz.tv_usec = 10 * 1000; @@ -2277,6 +2278,9 @@ void gm_ifp_update(struct interface *ifp) if (gm_ifp->cur_max_resp != cfg_max_response) gm_ifp->cur_max_resp = cfg_max_response; + if (gm_ifp->cur_lmqc != pim_ifp->gm_last_member_query_count) + gm_ifp->cur_lmqc = pim_ifp->gm_last_member_query_count; + enum gm_version cfg_version; if (pim_ifp->mld_version == 1) diff --git a/pimd/pim6_mld.h b/pimd/pim6_mld.h index 95523c2922..540d2e1899 100644 --- a/pimd/pim6_mld.h +++ b/pimd/pim6_mld.h @@ -324,6 +324,7 @@ struct gm_if { unsigned int cur_query_intv_trig; /* ms */ unsigned int cur_max_resp; /* ms */ enum gm_version cur_version; + int cur_lmqc; /* last member query count in ds */ /* this value (positive, default 10ms) defines our "timing tolerance": * - added to deadlines for expiring joins diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index 87c8659fc5..582878e09e 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -2861,7 +2861,6 @@ int lib_interface_gmp_address_family_last_member_query_interval_modify( int lib_interface_gmp_address_family_robustness_variable_modify( struct nb_cb_modify_args *args) { -#if PIM_IPV == 4 struct interface *ifp; struct pim_interface *pim_ifp; int last_member_query_count; @@ -2880,9 +2879,6 @@ int lib_interface_gmp_address_family_robustness_variable_modify( break; } -#else - /* TBD Depends on MLD data structure changes */ -#endif return NB_OK; } diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 80faa503f3..a67ede9b49 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -388,6 +388,13 @@ static int gm_config_write(struct vty *vty, int writes, if (pim_ifp->gm_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL) vty_out(vty, " ipv6 mld query-interval %d\n", pim_ifp->gm_default_query_interval); + + /* IF ipv6 mld last-member_query-count */ + if (pim_ifp->gm_last_member_query_count != + IGMP_DEFAULT_ROBUSTNESS_VARIABLE) + vty_out(vty, " ipv6 mld last-member-query-count %d\n", + pim_ifp->gm_last_member_query_count); + return 0; } #endif From 707a9e9a905ed6ddc1697f79c77225c21bbcd0ac Mon Sep 17 00:00:00 2001 From: Abhishek N R Date: Mon, 11 Jul 2022 10:09:39 -0700 Subject: [PATCH 3/4] pim6d: Completing "ipv6 mld last-member-query-interval" command Signed-off-by: Abhishek N R --- pimd/pim6_mld.c | 12 ++++++++++-- pimd/pim_nb_config.c | 4 ---- pimd/pim_vty.c | 6 ++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pimd/pim6_mld.c b/pimd/pim6_mld.c index 2ffdefc2fe..4b10c4c9c1 100644 --- a/pimd/pim6_mld.c +++ b/pimd/pim6_mld.c @@ -2093,7 +2093,8 @@ static void gm_start(struct interface *ifp) gm_ifp->cur_qrv = pim_ifp->gm_default_robustness_variable; gm_ifp->cur_query_intv = pim_ifp->gm_default_query_interval * 1000; - gm_ifp->cur_query_intv_trig = gm_ifp->cur_query_intv; + gm_ifp->cur_query_intv_trig = + pim_ifp->gm_specific_query_max_response_time_dsec * 100; gm_ifp->cur_max_resp = pim_ifp->gm_query_max_response_time_dsec * 100; gm_ifp->cur_lmqc = pim_ifp->gm_last_member_query_count; @@ -2268,7 +2269,14 @@ void gm_ifp_update(struct interface *ifp) if (gm_ifp->cur_query_intv != cfg_query_intv) { gm_ifp->cur_query_intv = cfg_query_intv; - gm_ifp->cur_query_intv_trig = cfg_query_intv; + changed = true; + } + + unsigned int cfg_query_intv_trig = + pim_ifp->gm_specific_query_max_response_time_dsec * 100; + + if (gm_ifp->cur_query_intv_trig != cfg_query_intv_trig) { + gm_ifp->cur_query_intv_trig = cfg_query_intv_trig; changed = true; } diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index 582878e09e..aaad56e543 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -2828,7 +2828,6 @@ int lib_interface_gmp_address_family_query_max_response_time_modify( int lib_interface_gmp_address_family_last_member_query_interval_modify( struct nb_cb_modify_args *args) { -#if PIM_IPV == 4 struct interface *ifp; struct pim_interface *pim_ifp; int last_member_query_interval; @@ -2848,9 +2847,6 @@ int lib_interface_gmp_address_family_last_member_query_interval_modify( break; } -#else - /* TBD Depends on MLD data structure changes */ -#endif return NB_OK; } diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index a67ede9b49..c18652f72e 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -395,6 +395,12 @@ static int gm_config_write(struct vty *vty, int writes, vty_out(vty, " ipv6 mld last-member-query-count %d\n", pim_ifp->gm_last_member_query_count); + /* IF ipv6 mld last-member_query-interval */ + if (pim_ifp->gm_specific_query_max_response_time_dsec != + IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC) + vty_out(vty, " ipv6 mld last-member-query-interval %d\n", + pim_ifp->gm_specific_query_max_response_time_dsec); + return 0; } #endif From 588e1188f6e96807171819221fe91a2fe2a3fd5c Mon Sep 17 00:00:00 2001 From: Abhishek N R Date: Sun, 28 Aug 2022 23:35:03 -0700 Subject: [PATCH 4/4] doc: Changed uppercase MLD to lowercase in ipv6 MLD last-member-query-interval (1-65535) Signed-off-by: Abhishek N R --- doc/user/pimv6.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/pimv6.rst b/doc/user/pimv6.rst index 74891c88b9..843734e217 100644 --- a/doc/user/pimv6.rst +++ b/doc/user/pimv6.rst @@ -195,7 +195,7 @@ is in a vrf, enter the interface command with the vrf keyword at the end. Set the MLD last member query count. The default value is 2. 'no' form of this command is used to configure back to the default value. -.. clicmd:: ipv6 MLD last-member-query-interval (1-65535) +.. clicmd:: ipv6 mld last-member-query-interval (1-65535) Set the MLD last member query interval in deciseconds. The default value is 10 deciseconds. 'no' form of this command is used to to configure back to the