+/*
+ * The maximum number of fully elaborated hardware filter specifications
+ * which can be produced from a template by means of multiplication, if
+ * missing match flags are needed to be taken into account
+ */
+#define SF_FLOW_SPEC_NB_FILTERS_MAX 8
+
+/* Used to guard action masks */
+#define SFC_BUILD_SET_OVERFLOW(_action, _set) \
+ RTE_BUILD_BUG_ON((_action) >= sizeof(_set) * CHAR_BIT)
+
+/* RSS configuration storage */
+struct sfc_flow_rss {
+ unsigned int rxq_hw_index_min;
+ unsigned int rxq_hw_index_max;
+ unsigned int rss_hash_types;
+ uint8_t rss_key[EFX_RSS_KEY_SIZE];
+ unsigned int rss_tbl[EFX_RSS_TBL_SIZE];
+};
+
+/* Flow engines supported by the implementation */
+enum sfc_flow_spec_type {
+ SFC_FLOW_SPEC_FILTER = 0,
+ SFC_FLOW_SPEC_MAE,
+
+ SFC_FLOW_SPEC_NTYPES
+};
+
+/* VNIC-specific flow specification */
+struct sfc_flow_spec_filter {
+ /* partial specification from flow rule */
+ efx_filter_spec_t template;
+ /* fully elaborated hardware filters specifications */
+ efx_filter_spec_t filters[SF_FLOW_SPEC_NB_FILTERS_MAX];
+ /* number of complete specifications */
+ unsigned int count;
+ /* RSS toggle */
+ boolean_t rss;
+ /* RSS hash toggle */
+ boolean_t rss_hash_required;
+ /* RSS configuration */
+ struct sfc_flow_rss rss_conf;
+};
+
+/* MAE-specific flow specification */
+struct sfc_flow_spec_mae {
+ /* Desired priority level */
+ unsigned int priority;
+ /* Outer rule registry entry */
+ struct sfc_mae_outer_rule *outer_rule;
+ /* EFX match specification */
+ efx_mae_match_spec_t *match_spec;
+ /* Action set registry entry */
+ struct sfc_mae_action_set *action_set;
+ /* Firmware-allocated rule ID */
+ efx_mae_rule_id_t rule_id;
+};
+
+/* Flow specification */
+struct sfc_flow_spec {
+ /* Flow specification type (engine-based) */
+ enum sfc_flow_spec_type type;
+
+ RTE_STD_C11
+ union {
+ /* Filter-based (VNIC level flows) specification */
+ struct sfc_flow_spec_filter filter;
+ /* MAE-based (lower-level HW switch flows) specification */
+ struct sfc_flow_spec_mae mae;
+ };
+};
+