1
2
3
4 #ifndef _IONIC_RX_FILTER_H_
5 #define _IONIC_RX_FILTER_H_
6
7 #define IONIC_RXQ_INDEX_ANY (0xFFFF)
8 struct ionic_rx_filter {
9 u32 flow_id;
10 u32 filter_id;
11 u16 rxq_index;
12 struct ionic_rx_filter_add_cmd cmd;
13 struct hlist_node by_hash;
14 struct hlist_node by_id;
15 };
16
17 #define IONIC_RX_FILTER_HASH_BITS 10
18 #define IONIC_RX_FILTER_HLISTS BIT(IONIC_RX_FILTER_HASH_BITS)
19 #define IONIC_RX_FILTER_HLISTS_MASK (IONIC_RX_FILTER_HLISTS - 1)
20 struct ionic_rx_filters {
21 spinlock_t lock;
22 struct hlist_head by_hash[IONIC_RX_FILTER_HLISTS];
23 struct hlist_head by_id[IONIC_RX_FILTER_HLISTS];
24 };
25
26 void ionic_rx_filter_free(struct ionic_lif *lif, struct ionic_rx_filter *f);
27 int ionic_rx_filter_del(struct ionic_lif *lif, struct ionic_rx_filter *f);
28 int ionic_rx_filters_init(struct ionic_lif *lif);
29 void ionic_rx_filters_deinit(struct ionic_lif *lif);
30 int ionic_rx_filter_save(struct ionic_lif *lif, u32 flow_id, u16 rxq_index,
31 u32 hash, struct ionic_admin_ctx *ctx);
32 struct ionic_rx_filter *ionic_rx_filter_by_vlan(struct ionic_lif *lif, u16 vid);
33 struct ionic_rx_filter *ionic_rx_filter_by_addr(struct ionic_lif *lif, const u8 *addr);
34
35 #endif