net/sfc: add pattern parsing stub to MAE backend
[dpdk.git] / drivers / net / sfc / sfc_mae.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2019-2020 Xilinx, Inc.
4  * Copyright(c) 2019 Solarflare Communications Inc.
5  *
6  * This software was jointly developed between OKTET Labs (under contract
7  * for Solarflare) and Solarflare Communications, Inc.
8  */
9
10 #ifndef _SFC_MAE_H
11 #define _SFC_MAE_H
12
13 #include <stdbool.h>
14
15 #include "efx.h"
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 /** Options for MAE support status */
22 enum sfc_mae_status {
23         SFC_MAE_STATUS_UNKNOWN = 0,
24         SFC_MAE_STATUS_UNSUPPORTED,
25         SFC_MAE_STATUS_SUPPORTED
26 };
27
28 struct sfc_mae {
29         /** NIC support for MAE status */
30         enum sfc_mae_status             status;
31         /** Priority level limit for MAE action rules */
32         unsigned int                    nb_action_rule_prios_max;
33 };
34
35 struct sfc_adapter;
36 struct sfc_flow_spec;
37
38 struct sfc_mae_parse_ctx {
39         efx_mae_match_spec_t            *match_spec_action;
40 };
41
42 int sfc_mae_attach(struct sfc_adapter *sa);
43 void sfc_mae_detach(struct sfc_adapter *sa);
44 sfc_flow_cleanup_cb_t sfc_mae_flow_cleanup;
45 int sfc_mae_rule_parse_pattern(struct sfc_adapter *sa,
46                                const struct rte_flow_item pattern[],
47                                struct sfc_flow_spec_mae *spec,
48                                struct rte_flow_error *error);
49
50 #ifdef __cplusplus
51 }
52 #endif
53 #endif /* _SFC_MAE_H */