Closed hesingh closed 4 years ago
The current Python code does not accept a hex number for min and max with match-range-using-tcam.
One way to fix the issue is to add this function at the top of the code.
def auto_int(x): return int(x, 0)
Then changing type=int to type=auto_int where min and max are parsed.
type=int
type=auto_int
Then this use of the Python code works.
python range-to-tcam-entries.py --bit-width 16 --min 0x0800 --max 0x0806
Good suggestion. Commit with that change made here: https://github.com/jafingerhut/p4-guide/commit/001b48da13b90506c879ccc129d70ba84e7dc28f
The current Python code does not accept a hex number for min and max with match-range-using-tcam.
One way to fix the issue is to add this function at the top of the code.
Then changing
type=int
totype=auto_int
where min and max are parsed.Then this use of the Python code works.
python range-to-tcam-entries.py --bit-width 16 --min 0x0800 --max 0x0806