0

TC-u32 man page states that HANDLE is:

HANDLE := { u12_hex_htid:[**u8_hex_hash:[u12_hex_nodeid]** | 0xu32_hex_value }

so the size of the bucket should range from 0x00 to 0xff as it is a u8 value.

The problem is I can't create a bucket greater than 0x1f (five bits). I got: RTNETLINK answers: Invalid argument We have an error talking to the kernel

/sbin/tc filter add dev ifb0 parent 1:0 protocol ip prio 5 u32 ht 5:2: match ip src 10.16.240.0/24 hashkey mask 0x000000ff at 12 link 100:

is OK

/sbin/tc filter add dev ifb0 parent 1:0 protocol ip prio 5 u32 ht 5:20: match ip src 10.16.240.0/24 hashkey mask 0x000000ff at 12 link 100:

yelds to error.

Environment:

iproute2 version 4.3.0-1ubuntu3.16

Ubuntu 16.04.5 LTS

Any hints?

tkx

Ethy
  • 11
  • 1
  • 1
    Hints about what? – womble Aug 02 '19 at 04:28
  • Hints on what I may be doing wrong. Why buckets greater than 1f cant be created since man page says it is possible. And examples I find on the net has bigger buckets. – Ethy Aug 02 '19 at 10:37

1 Answers1

1

To answer my own question: I had incorrectly understood that the bucket had to be greater than the number of filters I intended to hash, but no. The bucket has to be greater or equal (limited to 0xff) than the largest hash I intend to use on it.

So, since I intended to use 26 filters inside the bucket I created a "divisor 32" bucket. And since my 26 hashes to this bucket randomly ranges from 0 to 255 (last IP address octet) I got overflowed and the kernel complained about it.

I then created a bucket using "divisor 256", despite the fact I will only use 26 of these, and the error went away.

I hope this help someone in the future

Cheers

(BTW: how do I mark this "SOLVED" ??

Ethy
  • 11
  • 1