1e7fbdf0ba
A later patch will add support for RTE flow action PORT_ID to MAE backend. The driver has to ensure that such actions refer to RTE ethdev instances deployed on top of the same physical device. Also, the driver needs a means to find sibling RTE ethdev instances when parsing such actions. In order to solve these problems, add a switch infrastructure which allocates switch domains based on persistence of device serial number string across switch ports included in a domain. Explain mapping between RTE switch port IDs and MAE endpoints. Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@xilinx.com>
90 lines
2.2 KiB
C
90 lines
2.2 KiB
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
*
|
|
* Copyright(c) 2019-2020 Xilinx, Inc.
|
|
* Copyright(c) 2019 Solarflare Communications Inc.
|
|
*
|
|
* This software was jointly developed between OKTET Labs (under contract
|
|
* for Solarflare) and Solarflare Communications, Inc.
|
|
*/
|
|
|
|
#ifndef _SFC_MAE_H
|
|
#define _SFC_MAE_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <rte_spinlock.h>
|
|
|
|
#include "efx.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/** FW-allocatable resource context */
|
|
struct sfc_mae_fw_rsrc {
|
|
unsigned int refcnt;
|
|
RTE_STD_C11
|
|
union {
|
|
efx_mae_aset_id_t aset_id;
|
|
};
|
|
};
|
|
|
|
/** Action set registry entry */
|
|
struct sfc_mae_action_set {
|
|
TAILQ_ENTRY(sfc_mae_action_set) entries;
|
|
unsigned int refcnt;
|
|
efx_mae_actions_t *spec;
|
|
struct sfc_mae_fw_rsrc fw_rsrc;
|
|
};
|
|
|
|
TAILQ_HEAD(sfc_mae_action_sets, sfc_mae_action_set);
|
|
|
|
/** Options for MAE support status */
|
|
enum sfc_mae_status {
|
|
SFC_MAE_STATUS_UNKNOWN = 0,
|
|
SFC_MAE_STATUS_UNSUPPORTED,
|
|
SFC_MAE_STATUS_SUPPORTED
|
|
};
|
|
|
|
struct sfc_mae {
|
|
/** Assigned switch domain identifier */
|
|
uint16_t switch_domain_id;
|
|
/** Assigned switch port identifier */
|
|
uint16_t switch_port_id;
|
|
/** NIC support for MAE status */
|
|
enum sfc_mae_status status;
|
|
/** Priority level limit for MAE action rules */
|
|
unsigned int nb_action_rule_prios_max;
|
|
/** Action set registry */
|
|
struct sfc_mae_action_sets action_sets;
|
|
};
|
|
|
|
struct sfc_adapter;
|
|
struct sfc_flow_spec;
|
|
|
|
struct sfc_mae_parse_ctx {
|
|
struct sfc_adapter *sa;
|
|
efx_mae_match_spec_t *match_spec_action;
|
|
bool match_mport_set;
|
|
};
|
|
|
|
int sfc_mae_attach(struct sfc_adapter *sa);
|
|
void sfc_mae_detach(struct sfc_adapter *sa);
|
|
sfc_flow_cleanup_cb_t sfc_mae_flow_cleanup;
|
|
int sfc_mae_rule_parse_pattern(struct sfc_adapter *sa,
|
|
const struct rte_flow_item pattern[],
|
|
struct sfc_flow_spec_mae *spec,
|
|
struct rte_flow_error *error);
|
|
int sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
|
|
const struct rte_flow_action actions[],
|
|
struct sfc_mae_action_set **action_setp,
|
|
struct rte_flow_error *error);
|
|
sfc_flow_verify_cb_t sfc_mae_flow_verify;
|
|
sfc_flow_insert_cb_t sfc_mae_flow_insert;
|
|
sfc_flow_remove_cb_t sfc_mae_flow_remove;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* _SFC_MAE_H */
|