Skip to content

Commit c49cd38

Browse files
aditya-mehakarealmusil
authored andcommitted
utilities: Add command to print pipeline oftable starts.
Add "ovn-debug lflow-pipeline-oftable-start-list" to print the starting OpenFlow table numbers of the ingress and egress logical pipelines. This lets external consumers that read OpenFlow table statistics safely compute the actual OpenFlow table of a logical flow (pipeline base + logical flow table number) during upgrades, avoiding reliance on lflow-stage-to-ltable, which can be inaccurate when ovn-controller and ovn-northd run different versions. Assisted-by: Cursor, with model: claude-4.8-opus-high Signed-off-by: Aditya Mehakare <aditya.mehakare@nutanix.com> Acked-by: Naveen Yerramneni <naveen.yerramneni@nutanix.com> Signed-off-by: Ales Musil <amusil@redhat.com>
1 parent bae8a67 commit c49cd38

4 files changed

Lines changed: 27 additions & 0 deletions

File tree

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ Post v26.03.0
9595
original destination. This enables passive monitoring use cases where
9696
network functions can observe traffic without being inline in
9797
the data path.
98+
- Added a new "ovn-debug lflow-pipeline-oftable-start-list" command that
99+
prints the starting OpenFlow table number of the logical ingress and
100+
egress pipelines.
98101

99102
OVN v26.03.0 - xxx xx xxxx
100103
--------------------------

tests/ovn-util.at

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,10 @@ cookie=$egress, priority=0,metadata=0x1 actions=resubmit(,??)
106106
OVN_CLEANUP([hv1])
107107

108108
AT_CLEANUP
109+
110+
AT_SETUP([ovn-debug - lflow-pipeline-oftable-start-list])
111+
AT_CHECK([ovn-debug lflow-pipeline-oftable-start-list], [0], [dnl
112+
ingress OFTABLE_LOG_INGRESS_PIPELINE
113+
egress OFTABLE_LOG_EGRESS_PIPELINE
114+
])
115+
AT_CLEANUP

utilities/ovn-debug.8.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@
2424
Convert the logical flow stage name e.g. <code>ls_in_lb</code> into
2525
the OpenFlow table number e.g. <code>21</code>.
2626
</dd>
27+
<dt><code>lflow-pipeline-oftable-start-list</code></dt>
28+
<dd>
29+
Print the starting OpenFlow table number of the
30+
<code>ingress</code> and <code>egress</code> pipelines.
31+
</dd>
2732
</dl>
2833
</manpage>

utilities/ovn-debug.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ lflow_stage_to_table(struct ovs_cmdl_context *ctx)
7676
exit(EXIT_SUCCESS);
7777
}
7878

79+
static void
80+
lflow_pipeline_oftable_start_list(struct ovs_cmdl_context *ctx OVS_UNUSED)
81+
{
82+
printf("ingress %"PRIu8"\n", (uint8_t) OFTABLE_LOG_INGRESS_PIPELINE);
83+
printf("egress %"PRIu8"\n", (uint8_t) OFTABLE_LOG_EGRESS_PIPELINE);
84+
exit(EXIT_SUCCESS);
85+
}
86+
7987
static void
8088
uuid_to_cookie_str(struct ovs_cmdl_context *ctx)
8189
{
@@ -102,6 +110,8 @@ lflow-stage-to-ltable STAGE_NAME\n\
102110
Converts STAGE_NAME into logical flow table number.\n\
103111
lflow-stage-to-oftable STAGE_NAME\n\
104112
Converts STAGE_NAME into OpenFlow table number.\n\
113+
lflow-pipeline-oftable-start-list\n\
114+
Prints the starting OpenFlow table number of the logical pipelines.\n\
105115
uuid-to-cookie UUID\n\
106116
Converts UUID into cookie format.\n\
107117
\n\
@@ -161,6 +171,8 @@ main(int argc, char *argv[])
161171
OVS_RO},
162172
{"lflow-stage-to-ltable", NULL, 1, 1, lflow_stage_to_table,
163173
OVS_RO},
174+
{"lflow-pipeline-oftable-start-list", NULL, 0, 0,
175+
lflow_pipeline_oftable_start_list, OVS_RO},
164176
{"uuid-to-cookie", NULL, 1, 1, uuid_to_cookie_str,
165177
OVS_RO},
166178
{ "help", NULL, 0, INT_MAX, help, OVS_RO },

0 commit comments

Comments
 (0)