/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
- * Copyright 2017 Mellanox Technologies, Ltd.
+ * Copyright 2017 Mellanox Technologies, Ltd
*/
#include <stdint.h>
((b) & 0xff))
/*
- * The queue number is offset by 1, to distinguish packets that have
- * gone through this rule (skb->cb[1] != 0) from others.
+ * The queue number is offset by a unique QUEUE_OFFSET, to distinguish
+ * packets that have gone through this rule (skb->cb[1] != 0) from others.
*/
-#define QUEUE_OFFSET 1
+#define QUEUE_OFFSET 0x7cafe800
#define PIN_GLOBAL_NS 2
#define KEY_IDX 0
if (queue != match_queue)
return TC_ACT_OK;
+
+ /* queue match */
+ skb->cb[1] = 0;
return TC_ACT_UNSPEC;
}
__u32 dst_addr;
__u16 dport;
__u16 sport;
-} __attribute__((packed));
+} __rte_packed;
struct ipv6_l3_l4_tuple {
__u8 src_addr[16];
__u8 dst_addr[16];
__u16 dport;
__u16 sport;
-} __attribute__((packed));
+} __rte_packed;
-static const __u8 def_rss_key[] = {
+static const __u8 def_rss_key[TAP_RSS_HASH_KEY_SIZE] = {
0xd1, 0x81, 0xc6, 0x2c,
0xf7, 0xf4, 0xdb, 0x5b,
0x19, 0x83, 0xa2, 0xfc,
for (j = 0; j < input_len; j++) {
#pragma unroll
for (i = 0; i < 32; i++) {
- if (input_tuple[j] & (1 << (31 - i))) {
+ if (input_tuple[j] & (1U << (31 - i))) {
hash ^= ((const __u32 *)def_rss_key)[j] << i |
(__u32)((uint64_t)
(((const __u32 *)def_rss_key)[j + 1])