ipdk-io/networking-recipe

[ovsp4rt] PrepareVlanPushTableEntry truncates vlan_id to 8 bits

Opened this issue · 0 comments

The PrepareVlanPushTableEntry() function encodes the vlan_id parameter as as single byte in both the mod_blob_ptr match key and the vlan_id action parameter.

VLAN identifiers are bit<12>.

If this is intentional, the code should contain comments that:

  1. Acknowledge the truncation,
  2. State that it is intentional, and
  3. Explain why this is the correct thing to do.

If this is unintentional, it is a bug and should be fixed.
The unit test should also be updated.

Note

  • Address both DPDK and ES2K variants.
  • The unit tests should expect, and test with, a 12-bit input value.