summaryrefslogtreecommitdiffstats
path: root/extras/libmemif
AgeCommit message (Expand)AuthorFilesLines
2019-11-05libmemif: reset number of queues on disconnectJakub Grajciar1-9/+6
2019-09-09libmemif: prevent crash in case of invalid connection handleJakub Grajciar1-9/+31
2019-08-21libmemif: introduce 'memif_per_thread_' namespaceJakub Grajciar9-113/+1314
2019-07-26libmemif: fix autoconnectJakub Grajciar1-4/+4
2019-07-25libmemif: fix chained buffer flagJakub Grajciar1-0/+1
2019-07-02libmemif: version 3.0Jakub Grajciar12-339/+423
2019-07-01libmemif: icmp-responder example buffer management fixJakub Grajciar1-5/+8
2019-06-07build: add -Wall and -fno-common, fix reported issuesBenoƮt Ganne8-45/+14
2019-04-08fixing typosJim Thompson1-1/+1
2019-03-04libmemif: Connection request APIsJakub Grajciar4-84/+147
2019-01-04libmemif: fix incorrect write leading to memory corruptionKoichiro Den1-3/+3
2018-12-18Remove autotools files from extras/libmemifMauro Sardara3-117/+0
2018-12-17libmemif: fix possible segfault on memif_get_detailsKoichiro Den1-31/+28
2018-12-17Added CMake building system for libmemifmsardara12-69/+367
2018-09-27libmemif: external region bugfixJakub Grajciar2-2/+5
2018-09-07libmemif: slave connecting bugfixJakub Grajciar3-48/+70
2018-08-30libmemif: external region supportJakub Grajciar9-123/+1460
2018-07-11memif: fix max number of ringsDamjan Marion1-1/+1
2018-06-28libmemif: fixing head/tail arithmetics & queue reallocationMilan Lenco2-11/+6
2018-04-26libmemif: fix build on ununtu 18.04 (VPP-1244)Damjan Marion1-0/+1
2018-04-24libmemif: fix implicit declaration of memfd_createJakub Grajciar1-0/+1
2018-04-12libmemif: fix clang compilation errors/warningsJakub Grajciar3-16/+15
2018-03-30libmemif: zero-copy-slave mode + header spaceJakub Grajciar10-72/+1696
2018-03-28Build libmemif as part of verify jobDamjan Marion4-7/+11
2018-03-28libmemif: add private header size fieldJakub Grajciar4-2/+10
2018-03-26libmemif: version 2Jakub Grajciar16-918/+620
2018-03-13libmemif: ubuntu 18.04 build fixJakub Grajciar4-15/+23
2018-02-07libmemif: cleanup queue info while memif connectingChun Li2-1/+5
2018-01-24docs: Clean up TOCDave Wallace1-2/+8
2017-11-21libmemif: unit test update, continue configure if check module missingJakub Grajciar3-8/+10
2017-11-16libmemif: unmask head/tail pointers fix, additional ring info in memif_queue_...Jakub Grajciar3-75/+109
2017-11-08memif: do not mask head and tail pointersDamjan Marion3-59/+61
2017-11-07libmmeif: Makefile fixJakub Grajciar1-1/+1
2017-11-07libmemif: add dep to MakefileJakub Grajciar1-2/+2
2017-11-05libmemif: example app can generate ICMP, dev perf tests (using icmpr-epoll)Jakub Grajciar6-46/+774
2017-10-30libmemif: perf optimizationJakub Grajciar1-65/+34
2017-10-12libmemif: Add memif_cancel_poll_event() + bug fixing.Milan Lenco3-30/+78
2017-10-04libmemif: memif_rx_burst fixJakub Grajciar1-2/+2
2017-09-28General documentation updatesChris Luke6-31/+41
2017-09-23libmemif: Jumbo frames data/buffer length fixJakub Grajciar2-83/+195
2017-09-15libmemif: Jumbo frames supportJakub Grajciar9-103/+285
2017-09-13Shared memory packet interface (memif) libraryJakub Grajciar28-0/+11034
class="n">IGMP_DBG ("send-group-report: %U", format_vnet_sw_if_index_name, vnet_get_main (), config->sw_if_index); if (NULL == srcs) { /* * there were no sources specified, so this is a group-sepcific query. * We should respond with all our sources */ igmp_pkt_report_v3_add_group (&br, group, IGMP_MEMBERSHIP_GROUP_mode_is_include); } else { /* * the sources stored in the timer object are the combined set of sources * to be quired. We need to respond only to those queried, not our full set. */ ip46_address_t *intersect; intersect = igmp_group_new_intersect_present (group, IGMP_FILTER_MODE_INCLUDE, srcs); if (vec_len (intersect)) { igmp_pkt_report_v3_add_report (&br, group->key, intersect, IGMP_MEMBERSHIP_GROUP_mode_is_include); vec_free (intersect); } } igmp_pkt_report_v3_send (&br); igmp_timer_retire (&group->timers[IGMP_GROUP_TIMER_QUERY_REPLY]); vec_free (srcs); } static igmp_membership_group_v3_type_t igmp_filter_mode_to_report_type (igmp_filter_mode_t mode) { switch (mode) { case IGMP_FILTER_MODE_INCLUDE: return (IGMP_MEMBERSHIP_GROUP_mode_is_include); case IGMP_FILTER_MODE_EXCLUDE: return (IGMP_MEMBERSHIP_GROUP_mode_is_exclude); } return (IGMP_MEMBERSHIP_GROUP_mode_is_include); } /** * Send igmp membership general report. */ static void igmp_send_general_report_v3 (u32 obj, void *data) { igmp_pkt_build_report_t br; igmp_config_t *config; igmp_group_t *group; igmp_main_t *im; im = &igmp_main; config = pool_elt_at_index (im->configs, obj); ASSERT (config->timers[IGMP_CONFIG_TIMER_GENERAL_REPORT] != IGMP_TIMER_ID_INVALID); igmp_timer_retire (&config->timers[IGMP_CONFIG_TIMER_GENERAL_REPORT]); IGMP_DBG ("send-general-report: %U", format_vnet_sw_if_index_name, vnet_get_main (), config->sw_if_index); igmp_pkt_build_report_init (&br, config->sw_if_index); /* *INDENT-OFF* */ FOR_EACH_GROUP (group, config, ({ igmp_pkt_report_v3_add_group (&br, group, igmp_filter_mode_to_report_type(group->router_filter_mode)); })); /* *INDENT-ON* */ igmp_pkt_report_v3_send (&br); } /** * Called from the main thread on reception of a Query message */ void igmp_handle_query (const igmp_query_args_t * args) { igmp_config_t *config; config = igmp_config_lookup (args->sw_if_index); if (!config) /* * no IGMP config on the interface. quit */ return; if (IGMP_MODE_ROUTER == config->mode) { ASSERT (0); // code here for querier election */ } IGMP_DBG ("query-rx: %U", format_vnet_sw_if_index_name, vnet_get_main (), args->sw_if_index); /* Section 5.2 "When a system receives a Query, it does not respond immediately. Instead, it delays its response by a random amount of time, bounded by the Max Resp Time value derived from the Max Resp Code in the received Query message. A system may receive a variety of Queries on different interfaces and of different kinds (e.g., General Queries, Group-Specific Queries, and Group-and-Source-Specific Queries), each of which may require its own delayed response. */ if (igmp_membership_query_v3_is_geeral (args->query)) { IGMP_DBG ("...general-query-rx: %U", format_vnet_sw_if_index_name, vnet_get_main (), args->sw_if_index); /* * A general query has no info that needs saving from the response */ if (IGMP_TIMER_ID_INVALID == config->timers[IGMP_CONFIG_TIMER_GENERAL_REPORT]) { f64 delay = igmp_get_random_resp_delay (&args->query[0].header); IGMP_DBG ("...general-query-rx: %U schedule for %f", format_vnet_sw_if_index_name, vnet_get_main (), args->sw_if_index, delay); /* * no currently running timer, schedule a new one */ config->timers[IGMP_CONFIG_TIMER_GENERAL_REPORT] = igmp_timer_schedule (delay, igmp_config_index (config), igmp_send_general_report_v3, NULL); } /* * else * don't reschedule timers, we'll reply soon enough.. */ } else { /* * G or SG query. we'll need to save the sources quered */ igmp_key_t key = { .ip4 = args->query[0].group_address, }; ip46_address_t *srcs; igmp_timer_id_t tid; igmp_group_t *group; group = igmp_group_lookup (config, &key); /* * If there is no group config, no worries, we can ignore this * query. If the group state does come soon, we'll send a * state-change report at that time. */ if (!group) return; srcs = igmp_query_mk_source_list (args->query); tid = group->timers[IGMP_GROUP_TIMER_QUERY_REPLY]; IGMP_DBG ("...group-query-rx: %U for (%U, %U)", format_vnet_sw_if_index_name, vnet_get_main (), args->sw_if_index, format_igmp_src_addr_list, srcs, format_igmp_key, &key); if (IGMP_TIMER_ID_INVALID != tid) { /* * There is a timer already running, merge the sources list */ ip46_address_t *current, *s; current = igmp_timer_get_data (tid); vec_foreach (s, srcs) { if (~0 == vec_search_with_function (current, s, ip46_address_is_equal)) { vec_add1 (current, *s); } } igmp_timer_set_data (tid, current); } else { /* * schedule a new G-specific query */ f64 delay = igmp_get_random_resp_delay (&args->query[0].header); IGMP_DBG ("...group-query-rx: schedule:%f", delay); group->timers[IGMP_GROUP_TIMER_QUERY_REPLY] = igmp_timer_schedule (delay, igmp_group_index (group), igmp_send_group_report_v3, srcs); } } } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */