Hi Lorenzo,

i have applied and tested this change and i can confirm that it fixes the
issue.
if you please can rebase on top of the main.


Acked-by: Mohammad Heib <[email protected]>

On Thu, Oct 19, 2023 at 7:47 PM Lorenzo Bianconi <
[email protected]> wrote:

> Avoid recirculating IGMP/MLD packets more than one time from stage
> ls_out_pre_lb in the egress pipeline to ovn table 37 in order to avoid
> packet looping for ovn-ic deployment.
>
> Signed-off-by: Lorenzo Bianconi <[email protected]>
> ---
>  controller/pinctrl.c         |  2 ++
>  include/ovn/logical-fields.h |  3 +++
>  lib/logical-fields.c         |  4 ++++
>  northd/northd.c              | 11 +++++++----
>  4 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 3c1cecfde..d4ae7de46 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -650,6 +650,8 @@ pinctrl_forward_pkt(struct rconn *swconn, int64_t
> dp_key,
>      put_load(dp_key, MFF_LOG_DATAPATH, 0, 64, &ofpacts);
>      put_load(in_port_key, MFF_LOG_INPORT, 0, 32, &ofpacts);
>      put_load(out_port_key, MFF_LOG_OUTPORT, 0, 32, &ofpacts);
> +    /* Avoid re-injecting packet already consumed. */
> +    put_load(1, MFF_LOG_FLAGS, MLF_IGMP_IGMP_SPOOF_INJECT_BIT, 1,
> &ofpacts);
>
>      struct ofpact_resubmit *resubmit = ofpact_put_RESUBMIT(&ofpacts);
>      resubmit->in_port = OFPP_CONTROLLER;
> diff --git a/include/ovn/logical-fields.h b/include/ovn/logical-fields.h
> index a7b64ef67..0652af380 100644
> --- a/include/ovn/logical-fields.h
> +++ b/include/ovn/logical-fields.h
> @@ -77,6 +77,7 @@ enum mff_log_flags_bits {
>      MLF_CHECK_PORT_SEC_BIT = 12,
>      MLF_LOOKUP_COMMIT_ECMP_NH_BIT = 13,
>      MLF_USE_LB_AFF_SESSION_BIT = 14,
> +    MLF_IGMP_IGMP_SPOOF_INJECT_BIT = 15,
>  };
>
>  /* MFF_LOG_FLAGS_REG flag assignments */
> @@ -124,6 +125,8 @@ enum mff_log_flags {
>      MLF_LOOKUP_COMMIT_ECMP_NH = (1 << MLF_LOOKUP_COMMIT_ECMP_NH_BIT),
>
>      MLF_USE_LB_AFF_SESSION = (1 << MLF_USE_LB_AFF_SESSION_BIT),
> +
> +    MLF_IGMP_IGMP_SPOOF = (1 << MLF_IGMP_IGMP_SPOOF_INJECT_BIT),
>  };
>
>  /* OVN logical fields
> diff --git a/lib/logical-fields.c b/lib/logical-fields.c
> index fd509d9ee..3d8d5f950 100644
> --- a/lib/logical-fields.c
> +++ b/lib/logical-fields.c
> @@ -129,6 +129,10 @@ ovn_init_symtab(struct shash *symtab)
>               MLF_USE_SNAT_ZONE);
>      expr_symtab_add_subfield(symtab, "flags.use_snat_zone", NULL,
>                               flags_str);
> +    snprintf(flags_str, sizeof flags_str, "flags[%d]",
> +             MLF_IGMP_IGMP_SPOOF_INJECT_BIT);
> +    expr_symtab_add_subfield(symtab, "flags.igmp_loopback", NULL,
> +                             flags_str);
>
>      /* Connection tracking state. */
>      expr_symtab_add_field_scoped(symtab, "ct_mark", MFF_CT_MARK, NULL,
> false,
> diff --git a/northd/northd.c b/northd/northd.c
> index 916068d44..557fcca72 100644
> --- a/northd/northd.c
> +++ b/northd/northd.c
> @@ -7323,7 +7323,8 @@ build_interconn_mcast_snoop_flows(struct
> ovn_datapath *od,
>              continue;
>          }
>          /* Punt IGMP traffic to controller. */
> -        char *match = xasprintf("inport == %s && igmp", op->json_key);
> +        char *match = xasprintf("inport == %s && igmp && "
> +                                "flags.igmp_loopback == 0", op->json_key);
>          ovn_lflow_metered(lflows, od, S_SWITCH_OUT_PRE_LB, 120, match,
>                            "clone { igmp; }; next;",
>                            copp_meter_get(COPP_IGMP, od->nbs->copp,
> @@ -7331,7 +7332,8 @@ build_interconn_mcast_snoop_flows(struct
> ovn_datapath *od,
>          free(match);
>
>          /* Punt MLD traffic to controller. */
> -        match = xasprintf("inport == %s && (mldv1 || mldv2)",
> op->json_key);
> +        match = xasprintf("inport == %s && (mldv1 || mldv2) && "
> +                          "flags.igmp_loopback == 0", op->json_key);
>          ovn_lflow_metered(lflows, od, S_SWITCH_OUT_PRE_LB, 120, match,
>                            "clone { igmp; }; next;",
>                            copp_meter_get(COPP_IGMP, od->nbs->copp,
> @@ -10317,13 +10319,14 @@ build_lswitch_destination_lookup_bmcast(struct
> ovn_datapath *od,
>          ds_put_cstr(actions, "igmp;");
>          /* Punt IGMP traffic to controller. */
>          ovn_lflow_metered(lflows, od, S_SWITCH_IN_L2_LKUP, 100,
> -                          "igmp", ds_cstr(actions),
> +                          "flags.igmp_loopback == 0 && igmp",
> ds_cstr(actions),
>                            copp_meter_get(COPP_IGMP, od->nbs->copp,
>                                           meter_groups));
>
>          /* Punt MLD traffic to controller. */
>          ovn_lflow_metered(lflows, od, S_SWITCH_IN_L2_LKUP, 100,
> -                          "mldv1 || mldv2", ds_cstr(actions),
> +                          "flags.igmp_loopback == 0 && (mldv1 || mldv2)",
> +                          ds_cstr(actions),
>                            copp_meter_get(COPP_IGMP, od->nbs->copp,
>                                           meter_groups));
>
> --
> 2.41.0
>
> _______________________________________________
> dev mailing list
> [email protected]
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to