On 2/10/26 10:23 AM, Ales Musil wrote:
> Add helpers for parsing masked MAC in format of MAC/MAC and
> MAC/prefix. In additions to utils that convert MAC into prefix
> len and in reverse, creating MAC mask from prefix len. This
> will be used for the extended port_security parsing.
>
> Acked-by: Dumitru Ceara <[email protected]>
> Acked-by: Lorenzo Bianconi <[email protected]>
> Signed-off-by: Ales Musil <[email protected]>
> ---
> v4: Rebase on top of latest main.
> v5: Rebase on top of latest main.
> Add Dumitru's ack.
> Add Lorenzo's ack.
> v6: Rebase on top of latest main.
> v7: Rebase on top of latest main.
> ---
Hi Ales,
[...]
> diff --git a/tests/test-ovn.c b/tests/test-ovn.c
> index e88d3d45e..f35bd980c 100644
> --- a/tests/test-ovn.c
> +++ b/tests/test-ovn.c
> @@ -1474,6 +1474,22 @@ test_parse_actions(struct ovs_cmdl_context *ctx
> OVS_UNUSED)
> flow_collector_ids_destroy(&collector_ids);
> exit(ok ? EXIT_SUCCESS : EXIT_FAILURE);
> }
> +
> +static void
> +test_parse_eth_addr(struct ovs_cmdl_context *ctx)
> +{
> + unsigned int plen;
> + struct eth_addr mac;
> +
> + if (!eth_addr_parse_masked(ctx->argv[1], &mac, &plen)) {
> + ovs_assert(eth_addr_equals(mac, eth_addr_zero));
> + exit(EXIT_FAILURE);
> + }
> +
> + printf(ETH_ADDR_FMT "/" ETH_ADDR_FMT " " ETH_ADDR_FMT "/%u\n",
> + ETH_ADDR_ARGS(mac), ETH_ADDR_ARGS(eth_addr_create_mask(plen)),
> + ETH_ADDR_ARGS(mac), plen);
> +}
>
> static unsigned int
> parse_relops(const char *s)
> @@ -1560,6 +1576,9 @@ exhaustive N\n\
> parse-actions\n\
> Parses OVN actions from stdin and prints the equivalent OpenFlow actions\n\
> on stdout.\n\
> +parse-eth-addr\n\
> + Parses masked MAC address from stdin and prints the equivalent MAC/plen \n\
Nit: trailing space.
> + and MAC/mask to stdout\n\
> ",
With that addressed my ack stands. It can be fixed up when merging the
series, no need for a v8 just for this.
Regards,
Dumitru
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev