Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

p4c-of: Handling overlapping matches for a single field #73

@blp

Description

@blp

p4c-of does not properly handle it if an OF_SeqMatch has multiple matches on the same bits within a field. ofvisitors.cpp has the following explanatory comment:

               /* Masks from different matches overlap.  There are three cases:
                 *
                 *     1. The values are constants and bits in corresponding
                 *        positions are the same. Then the overlap makes no
                 *        difference.  We could handle this here by tracking
                 *        constant bits that overlap and verifying that they
                 *        are the same.
                 *
                 *     2. The values are constants and there is at least one
                 *        difference in the values for corresponding
                 *        positions. Then the overlap means that the flow
                 *        cannot possibly match.  By the time we arrive here to
                 *        print the match, it is too late to handle this
                 *        correctly.
                 *
                 *     3. At least one value is expanded from a variable. The
                 *        value bits might match or might not.  We would have
                 *        to do a dynamic comparison in DDlog code; again, it
                 *        is too late by the time we arrive here to print the
                 *        match.
                 *
                 * The code already here handles case #1 correctly, but not
                 * case #2 or #3, and can't yet distinguish.
                 */

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions