Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

northd: Fix issues for Forwarding_Group #250

Closed
wants to merge 1 commit into from

Conversation

ZhangQiang3
Copy link

The use of variables from the outer loop in the inner loop causes the outer loop to terminate prematurely.
eg. LVS are three fwgs, fwg1(p1,p2,p3,p4),fwg2(p11,p22),fwg3(p31,p32),only fwg1 in logical_flows

@numansiddique
Copy link
Collaborator

Thanks for the patch. I'll take a look.

@numansiddique
Copy link
Collaborator

@ZhangQiang3 Can you please provide your Signed-off-by tag ?

You just need to update the commit message with the below line and update this PR

Signed-off-by: Author Name <author.name@email.address...>

Please see https://docs.ovn.org/en/latest/internals/contributing/submitting-patches.html

Thanks

The use of variables from the outer loop in the inner
loop causes the outer loop to terminate prematurely.
eg. LVS are three fwgs, fwg1(p1,p2,p3,p4),fwg2(p11,p22),
fwg3(p31,p32),only fwg1 in logical_flows.

Signed-off-by: zhangqiang45 <zhangqiang45@lenovo.com>
numansiddique pushed a commit that referenced this pull request Jul 22, 2024
The use of variables from the outer loop in the inner
loop causes the outer loop to terminate prematurely.
eg. LVS are three fwgs, fwg1(p1,p2,p3,p4),fwg2(p11,p22),
fwg3(p31,p32),only fwg1 in logical_flows.

Submitted-at: #250
Signed-off-by: zhangqiang45 <zhangqiang45@lenovo.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
@numansiddique
Copy link
Collaborator

numansiddique commented Jul 22, 2024

Thank you for the PR. I manually pushed this PR. I added your name to the AUTHORS list and applied with the below changes :


diff --git a/northd/northd.c b/northd/northd.c
index be1a1e288b..fe7753f824 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -7922,7 +7922,7 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct lflow_table *lflows,
     struct ds actions = DS_EMPTY_INITIALIZER;
     struct ds group_ports = DS_EMPTY_INITIALIZER;
 
-    for (int i = 0; i < od->nbs->n_forwarding_groups; ++i) {
+    for (size_t i = 0; i < od->nbs->n_forwarding_groups; ++i) {
         const struct nbrec_forwarding_group *fwd_group = NULL;
         fwd_group = od->nbs->forwarding_groups[i];
         if (!fwd_group->n_child_port) {
@@ -7964,7 +7964,7 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct lflow_table *lflows,
         ds_put_cstr(&group_ports, "childports=");
         for (size_t j = 0; j < (fwd_group->n_child_port - 1); ++j) {
             ds_put_format(&group_ports, "\"%s\",",
-                         fwd_group->child_port[j]);
+                          fwd_group->child_port[j]);
         }
         ds_put_format(&group_ports, "\"%s\"",
                       fwd_group->child_port[fwd_group->n_child_port - 1]);


numansiddique pushed a commit to numansiddique/ovn that referenced this pull request Jul 22, 2024
The use of variables from the outer loop in the inner
loop causes the outer loop to terminate prematurely.
eg. LVS are three fwgs, fwg1(p1,p2,p3,p4),fwg2(p11,p22),
fwg3(p31,p32),only fwg1 in logical_flows.

Submitted-at: ovn-org#250
Signed-off-by: zhangqiang45 <zhangqiang45@lenovo.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
(cherry picked from commit b64c564)
numansiddique pushed a commit to numansiddique/ovn that referenced this pull request Jul 22, 2024
The use of variables from the outer loop in the inner
loop causes the outer loop to terminate prematurely.
eg. LVS are three fwgs, fwg1(p1,p2,p3,p4),fwg2(p11,p22),
fwg3(p31,p32),only fwg1 in logical_flows.

Submitted-at: ovn-org#250
Signed-off-by: zhangqiang45 <zhangqiang45@lenovo.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
(cherry picked from commit b64c564)
numansiddique pushed a commit to numansiddique/ovn that referenced this pull request Jul 22, 2024
The use of variables from the outer loop in the inner
loop causes the outer loop to terminate prematurely.
eg. LVS are three fwgs, fwg1(p1,p2,p3,p4),fwg2(p11,p22),
fwg3(p31,p32),only fwg1 in logical_flows.

Submitted-at: ovn-org#250
Signed-off-by: zhangqiang45 <zhangqiang45@lenovo.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
(cherry picked from commit b64c564)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants