On 7/3/20 7:55 AM, Han Zhou wrote:
> 
> 
> On Thu, Jul 2, 2020 at 7:53 AM Dumitru Ceara <[email protected]
> <mailto:[email protected]>> wrote:
>>
>> This helps simplifying logical flows that need to use the port's
>> configured ETH address:
>> - ARP responders for owned IPs
>> - NS responders for owned IPs
>>
>> Signed-off-by: Dumitru Ceara <[email protected]
> <mailto:[email protected]>>
>> ---
>>  northd/ovn-northd.8.xml |   22 ++++---
>>  northd/ovn-northd.c     |  148
> ++++++++++++++++++++++++++---------------------
>>  tests/ovn-northd.at <http://ovn-northd.at>     |  140
> ++++++++++++++++++++++++++++++++++++++++++++
>>  3 files changed, 233 insertions(+), 77 deletions(-)
>>
>> diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml
>> index a7639f3..78e2a71 100644
>> --- a/northd/ovn-northd.8.xml
>> +++ b/northd/ovn-northd.8.xml
>> @@ -1487,7 +1487,9 @@ output;
>>            For each enabled router port <var>P</var> with Ethernet address
>>            <var>E</var>, a priority-50 flow that matches <code>inport ==
>>            <var>P</var> &amp;&amp; (eth.mcast || eth.dst ==
>> -          <var>E</var></code>), with action <code>next;</code>.
>> +          <var>E</var></code>), stores the router port ethernet address
>> +          and advances to next table, with action
>> +          <code>xreg0[0..47]=E; next;</code>.
>>          </p>
>>
>>          <p>
>> @@ -1507,7 +1509,7 @@ output;
>>            a priority-50 flow that matches <code>inport == <var>GW</var>
>>            &amp;&amp; eth.dst == <var>E</var></code>, where <var>GW</var>
>>            is the logical router gateway port, with action
>> -          <code>next;</code>.
>> +          <code>xreg0[0..47]=E; next;</code>.
>>          </p>
>>
>>          <p>
>> @@ -1770,10 +1772,10 @@ next;
>>
>>          <pre>
>>  eth.dst = eth.src;
>> -eth.src = <var>E</var>;
>> +eth.src = xreg0[0..47];
>>  arp.op = 2; /* ARP reply. */
>>  arp.tha = arp.sha;
>> -arp.sha = <var>E</var>;
>> +arp.sha = xreg0[0..47];
>>  arp.tpa = arp.spa;
>>  arp.spa = <var>A</var>;
>>  outport = <var>P</var>;
>> @@ -1822,10 +1824,10 @@ output;
>>
>>          <pre>
>>  nd_na_router {
>> -    eth.src = <var>E</var>;
>> +    eth.src = xreg0[0..47];
>>      ip6.src = <var>A</var>;
>>      nd.target = <var>A</var>;
>> -    nd.tll = <var>E</var>;
>> +    nd.tll = xreg0[0..47];
>>      outport = inport;
>>      flags.loopback = 1;
>>      output;
>> @@ -1862,10 +1864,10 @@ nd_na_router {
>>
>>          <pre>
>>  eth.dst = eth.src;
>> -eth.src = <var>E</var>;
>> +eth.src = xreg0[0..47];
>>  arp.op = 2; /* ARP reply. */
>>  arp.tha = arp.sha;
>> -arp.sha = <var>E</var>;
>> +arp.sha = xreg0[0..47];
>>  arp.tpa = arp.spa;
>>  arp.spa = <var>A</var>;
>>  outport = <var>P</var>;
>> @@ -1894,8 +1896,8 @@ output;
>>          <pre>
>>  eth.dst = eth.src;
>>  nd_na {
>> -    eth.src = <var>E</var>;
>> -    nd.tll = <var>E</var>;
>> +    eth.src = xreg0[0..47];
>> +    nd.tll = xreg0[0..47];
>>      ip6.src = <var>A</var>;
>>      nd.target = <var>A</var>;
>>      outport = <var>P</var>;
>> diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
>> index 85d73ff..7c92436 100644
>> --- a/northd/ovn-northd.c
>> +++ b/northd/ovn-northd.c
>> @@ -223,6 +223,11 @@ enum ovn_stage {
>>  #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.
>> + */
>> +#define REG_INPORT_ETH_ADDR "xreg0[0..47]"
>> +
>>  /* Register for ECMP bucket selection. */
>>  #define REG_ECMP_GROUP_ID       "reg8[0..15]"
>>  #define REG_ECMP_MEMBER_ID      "reg8[16..31]"
>> @@ -246,33 +251,40 @@ enum ovn_stage {
>>   * +---------+-------------------------------------+
>>   *
>>   * Logical Router pipeline:
>> - * +-----+--------------------------+---+-------------+
>> - * | R0  | REGBIT_ND_RA_OPTS_RESULT |   |             |
>> - * |     |    IPv4-NEXT-HOP         | X |             |
>> - * +-----+--------------------------+ X |             |
>> - * | R1  | IPv4-SRC-IP for ARP-REQ  | R |    IPv6     |
>> - * +-----+--------------------------+ E |  NEXT-HOP   |
>> - * | R2  |        UNUSED            | G |             |
>> - * +-----+--------------------------+ 0 |             |
>> - * | R3  |        UNUSED            |   |             |
>> - * +-----+--------------------------+---+-------------+
>> - * | R4  |        UNUSED            |   |             |
>> - * +-----+--------------------------+ X |             |
>> - * | R5  |        UNUSED            | X | IPv6-SRC-IP |
>> - * +-----+--------------------------+ R |   for NS    |
>> - * | R6  |        UNUSED            | E |             |
>> - * +-----+--------------------------+ G |             |
>> - * | R7  |        UNUSED            | 1 |             |
>> - * +-----+--------------------------+---+-------------+
>> - * | R8  |     ECMP_GROUP_ID        |
>> - * |     |     ECMP_MEMBER_ID       |
>> - * +-----+--------------------------+
>> - * |     | REGBIT_{                 |
>> - * |     |   EGRESS_LOOPBACK/       |
>> - * | R9  |   PKT_LARGER/            |
>> - * |     |   LOOKUP_NEIGHBOR_RESULT/|
>> - * |     |   SKIP_LOOKUP_NEIGHBOR}  |
>> - * +-----+--------------------------+
>> + *
> +-----+--------------------------+---+-----------------+---+-------------+
>> + * | R0  | REGBIT_ND_RA_OPTS_RESULT | X |                 |   |      
>       |
>> + * |     |    IPv4-NEXT-HOP         | R |                 |   |      
>       |
>> + * +-----+--------------------------+ E | INPORT_ETH_ADDR | X |      
>       |
>> + * | R1  | IPv4-SRC-IP for ARP-REQ  | G |   (< IP_INPUT)  | X |  
>  IPv6     |
>> + * |     |                          | 0 |                 | R |
>  NEXT-HOP   |
>> + * +-----+--------------------------+---+-----------------+ E |(>=
> IP_INPUT)|
> 
> It is a good idea to mention the stage "< IP_INPUT" or ">= IP_INPUT".
> However, sInce R0 and R1 are overlapping with xreg0 and xxreg0, it might
> be better to mention the stage of R0 and R1 usage as well.
> Otherwise:
> 
> Acked-by: Han Zhou <[email protected] <mailto:[email protected]>>
> 

Thanks Han, I'll mention the stage for R0 and R1 but I guess that should
go in patch 1 of the series.

Regards,
Dumitru

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to