diff options
author | 2023-06-21 20:33:07 +0800 | |
---|---|---|
committer | 2023-06-23 10:59:17 +0200 | |
commit | 9b476494da1aad70f4f083e853eb817bcb292d08 (patch) | |
tree | b4bbe95e4256b2f4d1030749ff64751d19eaf8d6 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | Merge tag 'wireless-next-2023-06-22' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next (diff) | |
download | wireguard-linux-9b476494da1aad70f4f083e853eb817bcb292d08.tar.xz wireguard-linux-9b476494da1aad70f4f083e853eb817bcb292d08.zip |
net: hns3: refine the tcam key convert handle
The result of expression '(k ^ ~v) & k' is exactly
the same with 'k & v', so simplify it.
(k ^ ~v) & k == k & v
The truth table (in non table form):
k == 0, v == 0:
(k ^ ~v) & k == (0 ^ ~0) & 0 == (0 ^ 1) & 0 == 1 & 0 == 0
k & v == 0 & 0 == 0
k == 0, v == 1:
(k ^ ~v) & k == (0 ^ ~1) & 0 == (0 ^ 0) & 0 == 1 & 0 == 0
k & v == 0 & 1 == 0
k == 1, v == 0:
(k ^ ~v) & k == (1 ^ ~0) & 1 == (1 ^ 1) & 1 == 0 & 1 == 0
k & v == 1 & 0 == 0
k == 1, v == 1:
(k ^ ~v) & k == (1 ^ ~1) & 1 == (1 ^ 0) & 1 == 1 & 1 == 1
k & v == 1 & 1 == 1
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Hao Lan <lanhao@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions