/* SPDX-License-Identifier: BSD-3-Clause
*
- * Copyright(c) 2019-2020 Xilinx, Inc.
+ * Copyright(c) 2019-2021 Xilinx, Inc.
* Copyright(c) 2019 Solarflare Communications Inc.
*
* This software was jointly developed between OKTET Labs (under contract
RTE_STD_C11
union {
efx_mae_aset_id_t aset_id;
+ efx_mae_rule_id_t rule_id;
+ efx_mae_eh_id_t eh_id;
};
};
+/** Outer rule registry entry */
+struct sfc_mae_outer_rule {
+ TAILQ_ENTRY(sfc_mae_outer_rule) entries;
+ unsigned int refcnt;
+ efx_mae_match_spec_t *match_spec;
+ efx_tunnel_protocol_t encap_type;
+ struct sfc_mae_fw_rsrc fw_rsrc;
+};
+
+TAILQ_HEAD(sfc_mae_outer_rules, sfc_mae_outer_rule);
+
+/** Encap. header registry entry */
+struct sfc_mae_encap_header {
+ TAILQ_ENTRY(sfc_mae_encap_header) entries;
+ unsigned int refcnt;
+ uint8_t *buf;
+ size_t size;
+ efx_tunnel_protocol_t type;
+ struct sfc_mae_fw_rsrc fw_rsrc;
+};
+
+TAILQ_HEAD(sfc_mae_encap_headers, sfc_mae_encap_header);
+
/** 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_encap_header *encap_header;
struct sfc_mae_fw_rsrc fw_rsrc;
};
SFC_MAE_STATUS_SUPPORTED
};
+/*
+ * Encap. header bounce buffer. It is used to store header data
+ * when parsing the header definition in the action VXLAN_ENCAP.
+ */
+struct sfc_mae_bounce_eh {
+ uint8_t *buf;
+ size_t buf_size;
+ size_t size;
+ efx_tunnel_protocol_t type;
+};
+
struct sfc_mae {
/** Assigned switch domain identifier */
uint16_t switch_domain_id;
uint16_t switch_port_id;
/** NIC support for MAE status */
enum sfc_mae_status status;
+ /** Priority level limit for MAE outer rules */
+ unsigned int nb_outer_rule_prios_max;
/** Priority level limit for MAE action rules */
unsigned int nb_action_rule_prios_max;
+ /** Encapsulation support status */
+ uint32_t encap_types_supported;
+ /** Outer rule registry */
+ struct sfc_mae_outer_rules outer_rules;
+ /** Encap. header registry */
+ struct sfc_mae_encap_headers encap_headers;
/** Action set registry */
struct sfc_mae_action_sets action_sets;
+ /** Encap. header bounce buffer */
+ struct sfc_mae_bounce_eh bounce_eh;
};
struct sfc_adapter;
*
* - If a L3 item is followed by an item TCP, the former has
* its "proto" set to either 0x06/0xff or 0x00/0x00.
+ *
+ * - If a L3 item is followed by an item UDP, the former has
+ * its "proto" set to either 0x11/0xff or 0x00/0x00.
*/
uint8_t l3_next_proto_value;
uint8_t l3_next_proto_mask;
* L4 requirement for L3 item's "proto".
* This contains one of:
* - 0x06/0xff: TCP
+ * - 0x11/0xff: UDP
* - 0x00/0x00: no L4 item
*/
uint8_t l3_next_proto_restriction_value;
struct sfc_mae_parse_ctx {
struct sfc_adapter *sa;
efx_mae_match_spec_t *match_spec_action;
+ efx_mae_match_spec_t *match_spec_outer;
+ /*
+ * This points to either of the above two specifications depending
+ * on which part of the pattern is being parsed (outer / inner).
+ */
+ efx_mae_match_spec_t *match_spec;
+ /*
+ * This points to either "field_ids_remap_to_encap"
+ * or "field_ids_no_remap" (see sfc_mae.c) depending on
+ * which part of the pattern is being parsed.
+ */
+ const efx_mae_field_id_t *field_ids_remap;
+ /* These two fields correspond to the tunnel-specific default mask. */
+ size_t tunnel_def_mask_size;
+ const void *tunnel_def_mask;
bool match_mport_set;
struct sfc_mae_pattern_data pattern_data;
+ efx_tunnel_protocol_t encap_type;
+ unsigned int priority;
};
int sfc_mae_attach(struct sfc_adapter *sa);
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 sfc_flow_spec_mae *spec_mae,
struct rte_flow_error *error);
sfc_flow_verify_cb_t sfc_mae_flow_verify;
sfc_flow_insert_cb_t sfc_mae_flow_insert;