rxclass: fix a bug in rmgr when searching for empty slot

When reverse searching the list in rmgr for a free location the last
slot (first slot searched) in the list needs special care as it might
not span the full word length. This is done by building a bit-mask
covering the not-active parts of the last word and using that to judge
if there is a free location in the last word or not. Once that is known
searching in the last slot, or to skip it, can be done by the same
algorithm as for the other slots in the list.

There is a bug in creating the bit-mask for the non-active parts of the
last slot where the 0-indexed nature of bit addressing is not taken into
account when shifting. This leads to a one-off bug, fix it.

Fixes: 8d63f72ccdcb ("Add RX packet classification interface")
Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Cc: Alexander Duyck <alexanderduyck@meta.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
1 file changed