[ovs-dev] [PATCH] ofp-parse: Support "igmp" keyword in flows.
Ilya Maximets
i.maximets at ovn.org
Tue Nov 3 02:53:51 UTC 2020
On 11/3/20 12:28 AM, Ben Pfaff wrote:
> match_format() prints out "igmp" for IGMP flows, but
> ofp_parse_protocol() didn't accept it, which meant that OVS would print
> out a flow that it wouldn't re-parse. This fixes the problem and adds
> a test.
I'm a bit confused. IIUC, matching on igmp is not supported by any
OF version or by any extensions, i.e. we could match by 'ip,nw_proto=2',
but there is no special OF header for "igmp" or "igmp_type" or "igmp_code".
While it seems easy to add parsing of "igmp" itself, its fields ("igmp_type"
and "igmp_code") could appear in the output too and parsing of these fields
will, I guess, require a new OF extension. Is it correct? If so, maybe
it's better to remove "igmp*" printing code from the match_format() instead?
Best regards, Ilya Maximets.
>
> Signed-off-by: Ben Pfaff <blp at ovn.org>
> ---
> lib/ofp-parse.c | 1 +
> tests/ovs-ofctl.at | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
> index a90b926efb54..395a519f555f 100644
> --- a/lib/ofp-parse.c
> +++ b/lib/ofp-parse.c
> @@ -184,6 +184,7 @@ ofp_parse_protocol(const char *name, const struct ofp_protocol **p_out)
> { "ip4", ETH_TYPE_IP, 0 },
> { "arp", ETH_TYPE_ARP, 0 },
> { "icmp", ETH_TYPE_IP, IPPROTO_ICMP },
> + { "igmp", ETH_TYPE_IP, IPPROTO_IGMP },
> { "tcp", ETH_TYPE_IP, IPPROTO_TCP },
> { "udp", ETH_TYPE_IP, IPPROTO_UDP },
> { "sctp", ETH_TYPE_IP, IPPROTO_SCTP },
> diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at
> index b6951f404c45..05ba943d84d6 100644
> --- a/tests/ovs-ofctl.at
> +++ b/tests/ovs-ofctl.at
> @@ -191,6 +191,7 @@ actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
> ip,actions=set_field:10.4.3.77->ip_src,mod_nw_ecn:2
> sctp actions=drop
> sctp actions=drop
> +igmp actions=drop
> in_port=0 actions=resubmit:0
> actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
> actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,ingress)
> @@ -225,6 +226,7 @@ OFPT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.0
> OFPT_FLOW_MOD: ADD ip actions=mod_nw_src:10.4.3.77,load:0x2->NXM_NX_IP_ECN[]
> OFPT_FLOW_MOD: ADD sctp actions=drop
> OFPT_FLOW_MOD: ADD sctp actions=drop
> +OFPT_FLOW_MOD: ADD igmp actions=drop
> OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0
> OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
> OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,ingress)
>
More information about the dev
mailing list