1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright (c) 2017-2018 Solarflare Communications Inc.
6 * This software was jointly developed between OKTET Labs (under contract
7 * for Solarflare) and Solarflare Communications, Inc.
13 #include <rte_tailq.h>
14 #include <rte_flow_driver.h>
23 * The maximum number of fully elaborated hardware filter specifications
24 * which can be produced from a template by means of multiplication, if
25 * missing match flags are needed to be taken into account
27 #define SF_FLOW_SPEC_NB_FILTERS_MAX 8
29 #if EFSYS_OPT_RX_SCALE
30 /* RSS configuration storage */
32 unsigned int rxq_hw_index_min;
33 unsigned int rxq_hw_index_max;
34 unsigned int rss_hash_types;
35 uint8_t rss_key[EFX_RSS_KEY_SIZE];
36 unsigned int rss_tbl[EFX_RSS_TBL_SIZE];
38 #endif /* EFSYS_OPT_RX_SCALE */
40 /* Filter specification storage */
41 struct sfc_flow_spec {
42 /* partial specification from flow rule */
43 efx_filter_spec_t template;
44 /* fully elaborated hardware filters specifications */
45 efx_filter_spec_t filters[SF_FLOW_SPEC_NB_FILTERS_MAX];
46 /* number of complete specifications */
50 /* PMD-specific definition of the opaque type from rte_flow.h */
52 struct sfc_flow_spec spec; /* flow spec for hardware filter(s) */
53 #if EFSYS_OPT_RX_SCALE
54 boolean_t rss; /* RSS toggle */
55 struct sfc_flow_rss rss_conf; /* RSS configuration */
56 #endif /* EFSYS_OPT_RX_SCALE */
57 TAILQ_ENTRY(rte_flow) entries; /* flow list entries */
60 TAILQ_HEAD(sfc_flow_list, rte_flow);
62 extern const struct rte_flow_ops sfc_flow_ops;
66 void sfc_flow_init(struct sfc_adapter *sa);
67 void sfc_flow_fini(struct sfc_adapter *sa);
68 int sfc_flow_start(struct sfc_adapter *sa);
69 void sfc_flow_stop(struct sfc_adapter *sa);
74 #endif /* _SFC_FLOW_H */