/* SPDX-License-Identifier: BSD-3-Clause
*
- * Copyright(c) 2019-2020 Xilinx, Inc.
+ * Copyright(c) 2019-2021 Xilinx, Inc.
* Copyright(c) 2006-2019 Solarflare Communications Inc.
*/
uint32_t enc_assigned_port;
} efx_nic_cfg_t;
+#define EFX_PCI_VF_INVALID 0xffff
+
#define EFX_VPORT_PCI_FUNCTION_IS_PF(configp) \
- ((configp)->evc_function == 0xffff)
+ ((configp)->evc_function == EFX_PCI_VF_INVALID)
-#define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff)
-#define EFX_PCI_FUNCTION_IS_VF(_encp) ((_encp)->enc_vf != 0xffff)
+#define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == EFX_PCI_VF_INVALID)
+#define EFX_PCI_FUNCTION_IS_VF(_encp) ((_encp)->enc_vf != EFX_PCI_VF_INVALID)
#define EFX_PCI_FUNCTION(_encp) \
(EFX_PCI_FUNCTION_IS_PF(_encp) ? (_encp)->enc_pf : (_encp)->enc_vf)
__in efx_nic_t *enp,
__out efx_nic_fw_info_t *enfip);
+#define EFX_NIC_BOARD_INFO_SERIAL_LEN (64)
+#define EFX_NIC_BOARD_INFO_NAME_LEN (16)
+
+typedef struct efx_nic_board_info_s {
+ /* The following two fields are NUL-terminated ASCII strings. */
+ char enbi_serial[EFX_NIC_BOARD_INFO_SERIAL_LEN];
+ char enbi_name[EFX_NIC_BOARD_INFO_NAME_LEN];
+ uint32_t enbi_revision;
+} efx_nic_board_info_t;
+
+LIBEFX_API
+extern __checkReturn efx_rc_t
+efx_nic_get_board_info(
+ __in efx_nic_t *enp,
+ __out efx_nic_board_info_t *board_infop);
+
/* Driver resource limits (minimum required/maximum usable). */
typedef struct efx_drv_limits_s {
uint32_t edl_min_evq_count;
#define EFX_VPORT_ID_INVALID 0
typedef struct efx_vport_config_s {
- /* Either VF index or 0xffff for PF */
+ /* Either VF index or EFX_PCI_VF_INVALID for PF */
uint16_t evc_function;
/* VLAN ID of the associated function */
uint16_t evc_vid;
typedef struct efx_mae_limits_s {
uint32_t eml_max_n_action_prios;
+ uint32_t eml_max_n_outer_prios;
+ uint32_t eml_encap_types_supported;
} efx_mae_limits_t;
LIBEFX_API
typedef enum efx_mae_rule_type_e {
EFX_MAE_RULE_ACTION = 0,
+ EFX_MAE_RULE_OUTER,
EFX_MAE_RULE_NTYPES
} efx_mae_rule_type_t;
EFX_MAE_FIELD_ETHER_TYPE_BE,
EFX_MAE_FIELD_ETH_SADDR_BE,
EFX_MAE_FIELD_ETH_DADDR_BE,
+ EFX_MAE_FIELD_VLAN0_TCI_BE,
+ EFX_MAE_FIELD_VLAN0_PROTO_BE,
+ EFX_MAE_FIELD_VLAN1_TCI_BE,
+ EFX_MAE_FIELD_VLAN1_PROTO_BE,
+ EFX_MAE_FIELD_SRC_IP4_BE,
+ EFX_MAE_FIELD_DST_IP4_BE,
+ EFX_MAE_FIELD_IP_PROTO,
+ EFX_MAE_FIELD_IP_TOS,
+ EFX_MAE_FIELD_IP_TTL,
+ EFX_MAE_FIELD_SRC_IP6_BE,
+ EFX_MAE_FIELD_DST_IP6_BE,
+ EFX_MAE_FIELD_L4_SPORT_BE,
+ EFX_MAE_FIELD_L4_DPORT_BE,
+ EFX_MAE_FIELD_TCP_FLAGS_BE,
+ EFX_MAE_FIELD_ENC_ETHER_TYPE_BE,
+ EFX_MAE_FIELD_ENC_ETH_SADDR_BE,
+ EFX_MAE_FIELD_ENC_ETH_DADDR_BE,
+ EFX_MAE_FIELD_ENC_VLAN0_TCI_BE,
+ EFX_MAE_FIELD_ENC_VLAN0_PROTO_BE,
+ EFX_MAE_FIELD_ENC_VLAN1_TCI_BE,
+ EFX_MAE_FIELD_ENC_VLAN1_PROTO_BE,
+ EFX_MAE_FIELD_ENC_SRC_IP4_BE,
+ EFX_MAE_FIELD_ENC_DST_IP4_BE,
+ EFX_MAE_FIELD_ENC_IP_PROTO,
+ EFX_MAE_FIELD_ENC_IP_TOS,
+ EFX_MAE_FIELD_ENC_IP_TTL,
+ EFX_MAE_FIELD_ENC_SRC_IP6_BE,
+ EFX_MAE_FIELD_ENC_DST_IP6_BE,
+ EFX_MAE_FIELD_ENC_L4_SPORT_BE,
+ EFX_MAE_FIELD_ENC_L4_DPORT_BE,
+ EFX_MAE_FIELD_ENC_VNET_ID_BE,
+ EFX_MAE_FIELD_OUTER_RULE_ID,
EFX_MAE_FIELD_NIDS
} efx_mae_field_id_t;
__in uint32_t phy_port,
__out efx_mport_sel_t *mportp);
+/*
+ * Get MPORT selector of a PCIe function.
+ *
+ * The resulting MPORT selector is opaque to the caller and can be
+ * passed as an argument to efx_mae_match_spec_mport_set()
+ * and efx_mae_action_set_populate_deliver().
+ */
+LIBEFX_API
+extern __checkReturn efx_rc_t
+efx_mae_mport_by_pcie_function(
+ __in uint32_t pf,
+ __in uint32_t vf,
+ __out efx_mport_sel_t *mportp);
+
/*
* Fields which have BE postfix in their named constants are expected
* to be passed by callers in big-endian byte order. They will appear
__in const efx_mport_sel_t *valuep,
__in_opt const efx_mport_sel_t *maskp);
+LIBEFX_API
+extern __checkReturn boolean_t
+efx_mae_match_specs_equal(
+ __in const efx_mae_match_spec_t *left,
+ __in const efx_mae_match_spec_t *right);
+
/*
* Make sure that match fields known by EFX have proper masks set
* in the match specification as per requirements of SF-122526-TC.
efx_mae_action_set_populate_flag(
__in efx_mae_actions_t *spec);
+LIBEFX_API
+extern __checkReturn efx_rc_t
+efx_mae_action_set_populate_mark(
+ __in efx_mae_actions_t *spec,
+ __in uint32_t mark_value);
+
LIBEFX_API
extern __checkReturn efx_rc_t
efx_mae_action_set_populate_deliver(
__in efx_mae_actions_t *spec,
__in const efx_mport_sel_t *mportp);
+LIBEFX_API
+extern __checkReturn efx_rc_t
+efx_mae_action_set_populate_drop(
+ __in efx_mae_actions_t *spec);
+
LIBEFX_API
extern __checkReturn boolean_t
efx_mae_action_set_specs_equal(
* Conduct a comparison to check whether two match specifications
* of equal rule type (action / outer) and priority would map to
* the very same rule class from the firmware's standpoint.
+ *
+ * For match specification fields that are not supported by firmware,
+ * the rule class only matches if the mask/value pairs for that field
+ * are equal. Clients should use efx_mae_match_spec_is_valid() before
+ * calling this API to detect usage of unsupported fields.
*/
LIBEFX_API
extern __checkReturn efx_rc_t
uint32_t id;
} efx_mae_rule_id_t;
+LIBEFX_API
+extern __checkReturn efx_rc_t
+efx_mae_outer_rule_insert(
+ __in efx_nic_t *enp,
+ __in const efx_mae_match_spec_t *spec,
+ __in efx_tunnel_protocol_t encap_type,
+ __out efx_mae_rule_id_t *or_idp);
+
+LIBEFX_API
+extern __checkReturn efx_rc_t
+efx_mae_outer_rule_remove(
+ __in efx_nic_t *enp,
+ __in const efx_mae_rule_id_t *or_idp);
+
+LIBEFX_API
+extern __checkReturn efx_rc_t
+efx_mae_match_spec_outer_rule_id_set(
+ __in efx_mae_match_spec_t *spec,
+ __in const efx_mae_rule_id_t *or_idp);
+
/* Action set ID */
typedef struct efx_mae_aset_id_s {
uint32_t id;