1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright(c) 2022 Xilinx, Inc.
6 #ifndef _SFC_FLOW_RSS_H
7 #define _SFC_FLOW_RSS_H
13 #include <rte_tailq.h>
21 struct sfc_flow_rss_conf {
22 uint8_t key[EFX_RSS_KEY_SIZE];
23 efx_rx_hash_type_t efx_hash_types;
24 unsigned int nb_qid_offsets;
25 unsigned int qid_span;
28 struct sfc_flow_rss_ctx {
29 TAILQ_ENTRY(sfc_flow_rss_ctx) entries;
34 unsigned int nic_handle_refcnt;
37 struct sfc_flow_rss_conf conf;
39 uint16_t *qid_offsets;
42 TAILQ_HEAD(sfc_flow_rss_ctx_list, sfc_flow_rss_ctx);
45 unsigned int qid_span_max;
47 unsigned int bounce_tbl[EFX_RSS_TBL_SIZE];
49 struct sfc_flow_rss_ctx_list ctx_list;
54 int sfc_flow_rss_attach(struct sfc_adapter *sa);
56 void sfc_flow_rss_detach(struct sfc_adapter *sa);
58 int sfc_flow_rss_parse_conf(struct sfc_adapter *sa,
59 const struct rte_flow_action_rss *in,
60 struct sfc_flow_rss_conf *out,
61 uint16_t *sw_qid_minp);
63 struct sfc_flow_rss_ctx *sfc_flow_rss_ctx_reuse(struct sfc_adapter *sa,
64 const struct sfc_flow_rss_conf *conf,
65 uint16_t sw_qid_min, const uint16_t *sw_qids);
67 int sfc_flow_rss_ctx_add(struct sfc_adapter *sa,
68 const struct sfc_flow_rss_conf *conf,
69 uint16_t sw_qid_min, const uint16_t *sw_qids,
70 struct sfc_flow_rss_ctx **ctxp);
72 void sfc_flow_rss_ctx_del(struct sfc_adapter *sa, struct sfc_flow_rss_ctx *ctx);
74 int sfc_flow_rss_ctx_program(struct sfc_adapter *sa,
75 struct sfc_flow_rss_ctx *ctx);
77 void sfc_flow_rss_ctx_terminate(struct sfc_adapter *sa,
78 struct sfc_flow_rss_ctx *ctx);
83 #endif /* _SFC_FLOW_RSS_H */