[ovs-dev] [PATCH v3 5/6] ovn: Support OVS action 'check_pkt_larger' in OVN

Ben Pfaff blp at ovn.org
Thu Apr 18 22:01:40 UTC 2019


On Tue, Apr 16, 2019 at 01:24:07PM +0530, nusiddiq at redhat.com wrote:
> From: Numan Siddique <nusiddiq at redhat.com>
> 
> Previous commit added a new OVS action 'check_pkt_larger'. This
> patch supports that action in OVN. The syntax to use this would be
> 
> reg0[0] = check_pkt_larger(LEN)
> 
> Upcoming commit will make use of this action in ovn-northd and
> will generate an ICMPv4 packet if the packet length is greater than
> the specified length.
> 
> Signed-off-by: Numan Siddique <nusiddiq at redhat.com>
> Acked-by: Mark Michelson <mmichels at redhat.com>

In parse_check_pkt_larger(), I think it would be a good idea to
type-check the destination before parsing the rest of the syntax.  This
is because of a principle that it makes sense to report the first error
that occurs in the syntax, rather than ones that occur later.

The tests bear this out.  One test reports the problem in the
destination:

    +reg0 = check_pkt_larger(1500);
    +    Cannot use 32-bit field reg0[0..31] where 1-bit field is required.

But a later test reports an error in the argument even though the
destination is still wrong, which I personally would find a surprising
error to get in the circumstances:

    +reg0 = check_pkt_larger(foo);
    +    Syntax error at `foo' expecting `;'.

Thanks,

Ben.


More information about the dev mailing list