From 48f8c3d212644a33dd0abaaa1a0c71d4decaafdf Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Mon, 24 Jun 2019 17:01:54 +0200 Subject: Add support for igmp and multicast Multicast can be enabled through configuration or through command line - Through configuration Add multicast=mcast_address (e.g. multicast=01:00:5e:01:02:03) in the port section - Through command line run enable multicast port_id mcast_address (e.g. enable multicast 1 01:00:5e:01:02:03) IGMP join message is sent unsollicited through command line: join igmp core_id task_id ip (e.g. join igmp 1 0 224.1.1.3) To enable swap answering IGMP Query (w/ IGMP Join) - Through configuration Add igmp ipv4=ip_address within the core/task section - Through command line join igmp core_id task_id ip (e.g. join igmp 1 0 224.1.1.3) (this will 1st initiate an unsollicated join, then answer any subsequent query) UDP/TCP packets received on a multicast address (224.0.0.0 => 239.255.255.255) are discarded To stop sending responses to IGMP query: leave igmp core_id task_id Change-Id: I3808ccabf3b38b5a1e10e1b044db63aa05bcd7b5 Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/prox_port_cfg.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'VNFs/DPPD-PROX/prox_port_cfg.c') diff --git a/VNFs/DPPD-PROX/prox_port_cfg.c b/VNFs/DPPD-PROX/prox_port_cfg.c index c335ee10..ac0ba0f3 100644 --- a/VNFs/DPPD-PROX/prox_port_cfg.c +++ b/VNFs/DPPD-PROX/prox_port_cfg.c @@ -41,6 +41,7 @@ #include "prox_cksum.h" #include "stats_irq.h" #include "prox_compat.h" +#include "rte_ethdev.h" struct prox_port_cfg prox_port_cfg[PROX_MAX_PORTS]; rte_atomic32_t lsc; @@ -518,7 +519,7 @@ static void init_port(struct prox_port_cfg *port_cfg) #if RTE_VERSION >= RTE_VERSION_NUM(2,0,0,0) port_cfg->port_conf.rx_adv_conf.rss_conf.rss_hf &= port_cfg->dev_info.flow_type_rss_offloads; #endif - plog_info("\t\t Enabling RSS rss_hf = 0x%lx (requested 0x%llx)\n", port_cfg->port_conf.rx_adv_conf.rss_conf.rss_hf, ETH_RSS_IP|ETH_RSS_UDP); + plog_info("\t\t Enabling RSS rss_hf = 0x%lx (requested 0x%llx, supported 0x%lx)\n", port_cfg->port_conf.rx_adv_conf.rss_conf.rss_hf, ETH_RSS_IP|ETH_RSS_UDP, port_cfg->dev_info.flow_type_rss_offloads); // rxmode such as hw src strip #if RTE_VERSION >= RTE_VERSION_NUM(18,8,0,1) @@ -689,6 +690,18 @@ static void init_port(struct prox_port_cfg *port_cfg) } } } + if (port_cfg->nb_mc_addr) { + rte_eth_allmulticast_enable(port_id); + if ((ret = rte_eth_dev_set_mc_addr_list(port_id, port_cfg->mc_addr, port_cfg->nb_mc_addr)) != 0) { + plog_err("\t\trte_eth_dev_set_mc_addr_list returns %d on port %u\n", ret, port_id); + port_cfg->nb_mc_addr = 0; + rte_eth_allmulticast_disable(port_id); + plog_info("\t\tport %u NOT in multicast mode as failed to add mcast address\n", port_id); + } else { + plog_info("\t\trte_eth_dev_set_mc_addr_list(%d addr) on port %u\n", port_cfg->nb_mc_addr, port_id); + plog_info("\t\tport %u in multicast mode\n", port_id); + } + } } void init_port_all(void) -- cgit 1.2.3-korg