Skip to content

Commit

Permalink
ovn-northd.c: Remove the use of the REGBIT_SKIP_LOOKUP_NEIGHBOR bit.
Browse files Browse the repository at this point in the history
In LR ingress stage LOOKUP_NEIGHBOR and LEARN_NEIGHBOR, the flag
REGBIT_SKIP_LOOKUP_NEIGHBOR was used to indicate if mac-binding
lookup can be skipped. This patch avoid using the bit by combining
it with the REGBIT_LOOKUP_NEIGHBOR_RESULT bit, and assigning 1
to REGBIT_LOOKUP_NEIGHBOR_RESULT serves same purpose of skipping
the lookup. There will be a new bit needed in a future patch, and
this change can avoid using too many bits unnecessarily.

Acked-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Han Zhou <hzhou@ovn.org>
  • Loading branch information
hzhou8 committed Jul 30, 2020
1 parent 10d384b commit acd3842
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 4 additions & 7 deletions northd/ovn-northd.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ next;

<li>
A priority-0 fallback flow that matches all packets and applies
the action <code>reg9[3] = 1; next;</code>
the action <code>reg9[2] = 1; next;</code>
advancing the packet to the next table.
</li>
</ul>
Expand All @@ -1610,17 +1610,14 @@ next;

<p>
reg9[2] will be <code>1</code> if the <code>lookup_arp/lookup_nd</code>
in the previous table was successful.
</p>

<p>
reg9[3] will be <code>1</code> if there was no need to do the lookup.
in the previous table was successful, or if there was no need to do the
lookup.
</p>

<ul>
<li>
A priority-100 flow with the match
<code>reg9[2] == 1 || reg9[3] == 1</code> and advances the packet
<code>reg9[2] == 1</code> and advances the packet
to the next table as there is no need to learn the neighbor.
</li>

Expand Down
6 changes: 2 additions & 4 deletions northd/ovn-northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ enum ovn_stage {
/* Register to store the result of check_pkt_larger action. */
#define REGBIT_PKT_LARGER "reg9[1]"
#define REGBIT_LOOKUP_NEIGHBOR_RESULT "reg9[2]"
#define REGBIT_SKIP_LOOKUP_NEIGHBOR "reg9[3]"

/* Register to store the eth address associated to a router port for packets
* received in S_ROUTER_IN_ADMISSION.
Expand Down Expand Up @@ -8475,14 +8474,13 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
"lookup_nd(inport, ip6.src, nd.sll); next;");

/* For other packet types, we can skip neighbor learning.
* So set REGBIT_SKIP_LOOKUP_NEIGHBOR to 1. */
* So set REGBIT_LOOKUP_NEIGHBOR_RESULT to 1. */
ovn_lflow_add(lflows, od, S_ROUTER_IN_LOOKUP_NEIGHBOR, 0, "1",
REGBIT_SKIP_LOOKUP_NEIGHBOR" = 1; next;");
REGBIT_LOOKUP_NEIGHBOR_RESULT" = 1; next;");

/* Flows for LEARN_NEIGHBOR. */
/* Skip Neighbor learning if not required. */
ovn_lflow_add(lflows, od, S_ROUTER_IN_LEARN_NEIGHBOR, 100,
REGBIT_SKIP_LOOKUP_NEIGHBOR" == 1 || "
REGBIT_LOOKUP_NEIGHBOR_RESULT" == 1", "next;");

ovn_lflow_add(lflows, od, S_ROUTER_IN_LEARN_NEIGHBOR, 90,
Expand Down

0 comments on commit acd3842

Please sign in to comment.