X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fsfc_efx%2Fbase%2Fefx_impl.h;h=992edbabe37ddad3a621d5a02862321ca4ce5fc4;hb=c4f4a0e60dcb2a3877a4a751d7641fa1d9c46c29;hp=44e6467bc04c50b39906ffa8453af216c91dda68;hpb=799889bada11fbaefc8e372d315ec0e2dc370750;p=dpdk.git diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h index 44e6467bc0..992edbabe3 100644 --- a/drivers/common/sfc_efx/base/efx_impl.h +++ b/drivers/common/sfc_efx/base/efx_impl.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * - * Copyright(c) 2019-2020 Xilinx, Inc. + * Copyright(c) 2019-2021 Xilinx, Inc. * Copyright(c) 2007-2019 Solarflare Communications Inc. */ @@ -65,6 +65,7 @@ extern "C" { #define EFX_MOD_TUNNEL 0x00004000 #define EFX_MOD_EVB 0x00008000 #define EFX_MOD_PROXY 0x00010000 +#define EFX_MOD_VIRTIO 0x00020000 #define EFX_RESET_PHY 0x00000001 #define EFX_RESET_RXQ_ERR 0x00000002 @@ -86,7 +87,8 @@ typedef struct efx_ev_ops_s { void (*eevo_fini)(efx_nic_t *); efx_rc_t (*eevo_qcreate)(efx_nic_t *, unsigned int, efsys_mem_t *, size_t, uint32_t, - uint32_t, uint32_t, efx_evq_t *); + uint32_t, uint32_t, uint32_t, + efx_evq_t *); void (*eevo_qdestroy)(efx_evq_t *); efx_rc_t (*eevo_qprime)(efx_evq_t *, unsigned int); void (*eevo_qpost)(efx_evq_t *, uint16_t); @@ -308,6 +310,22 @@ typedef struct efx_tunnel_ops_s { } efx_tunnel_ops_t; #endif /* EFSYS_OPT_TUNNEL */ +#if EFSYS_OPT_VIRTIO +typedef struct efx_virtio_ops_s { + efx_rc_t (*evo_virtio_qstart)(efx_virtio_vq_t *, + efx_virtio_vq_cfg_t *, + efx_virtio_vq_dyncfg_t *); + efx_rc_t (*evo_virtio_qstop)(efx_virtio_vq_t *, + efx_virtio_vq_dyncfg_t *); + efx_rc_t (*evo_get_doorbell_offset)(efx_virtio_vq_t *, + uint32_t *); + efx_rc_t (*evo_get_features)(efx_nic_t *, + efx_virtio_device_type_t, uint64_t *); + efx_rc_t (*evo_verify_features)(efx_nic_t *, + efx_virtio_device_type_t, uint64_t); +} efx_virtio_ops_t; +#endif /* EFSYS_OPT_VIRTIO */ + typedef struct efx_port_s { efx_mac_type_t ep_mac_type; uint32_t ep_phy_type; @@ -798,6 +816,12 @@ typedef struct efx_mae_s { /** Action rule match field capabilities. */ efx_mae_field_cap_t *em_action_rule_field_caps; size_t em_action_rule_field_caps_size; + uint32_t em_max_n_outer_prios; + uint32_t em_encap_types_supported; + /** Outer rule match field capabilities. */ + efx_mae_field_cap_t *em_outer_rule_field_caps; + size_t em_outer_rule_field_caps_size; + uint32_t em_max_ncounters; } efx_mae_t; #endif /* EFSYS_OPT_MAE */ @@ -853,6 +877,9 @@ struct efx_nic_s { #if EFSYS_OPT_VPD const efx_vpd_ops_t *en_evpdop; #endif /* EFSYS_OPT_VPD */ +#if EFSYS_OPT_VIRTIO + const efx_virtio_ops_t *en_evop; +#endif /* EFSYS_OPT_VPD */ #if EFSYS_OPT_RX_SCALE efx_rx_hash_support_t en_hash_support; efx_rx_scale_context_type_t en_rss_context_type; @@ -1510,6 +1537,7 @@ efx_mcdi_init_evq( __in efsys_mem_t *esmp, __in size_t nevs, __in uint32_t irq, + __in uint32_t target_evq, __in uint32_t us, __in uint32_t flags, __in boolean_t low_latency); @@ -1695,15 +1723,95 @@ struct efx_mae_match_spec_s { efx_mae_rule_type_t emms_type; uint32_t emms_prio; union emms_mask_value_pairs { - uint8_t action[MAE_FIELD_MASK_VALUE_PAIRS_LEN]; + uint8_t action[ + MAE_FIELD_MASK_VALUE_PAIRS_V2_LEN]; + uint8_t outer[MAE_ENC_FIELD_PAIRS_LEN]; } emms_mask_value_pairs; }; +typedef enum efx_mae_action_e { + /* These actions are strictly ordered. */ + EFX_MAE_ACTION_DECAP, + EFX_MAE_ACTION_VLAN_POP, + EFX_MAE_ACTION_VLAN_PUSH, + EFX_MAE_ACTION_COUNT, + EFX_MAE_ACTION_ENCAP, + + /* + * These actions are not strictly ordered and can + * be passed by a client in any order (before DELIVER). + * However, these enumerants must be kept compactly + * in the end of the enumeration (before DELIVER). + */ + EFX_MAE_ACTION_FLAG, + EFX_MAE_ACTION_MARK, + + /* DELIVER is always the last action. */ + EFX_MAE_ACTION_DELIVER, + + EFX_MAE_NACTIONS +} efx_mae_action_t; + +/* MAE VLAN_POP action can handle 1 or 2 tags. */ +#define EFX_MAE_VLAN_POP_MAX_NTAGS (2) + +/* MAE VLAN_PUSH action can handle 1 or 2 tags. */ +#define EFX_MAE_VLAN_PUSH_MAX_NTAGS (2) + +typedef struct efx_mae_action_vlan_push_s { + uint16_t emavp_tpid_be; + uint16_t emavp_tci_be; +} efx_mae_action_vlan_push_t; + +typedef struct efx_mae_actions_rsrc_s { + efx_mae_eh_id_t emar_eh_id; + efx_counter_t emar_counter_id; +} efx_mae_actions_rsrc_t; + struct efx_mae_actions_s { + /* Bitmap of actions in spec, indexed by action type */ + uint32_t ema_actions; + + unsigned int ema_n_vlan_tags_to_pop; + unsigned int ema_n_vlan_tags_to_push; + efx_mae_action_vlan_push_t ema_vlan_push_descs[ + EFX_MAE_VLAN_PUSH_MAX_NTAGS]; + unsigned int ema_n_count_actions; + uint32_t ema_mark_value; + efx_mport_sel_t ema_deliver_mport; + + /* + * Always keep this at the end of the struct since + * efx_mae_action_set_specs_equal() relies on that + * to make sure that resource IDs are not compared. + */ + efx_mae_actions_rsrc_t ema_rsrc; }; #endif /* EFSYS_OPT_MAE */ +#if EFSYS_OPT_VIRTIO + +#define EFX_VQ_MAGIC 0x026011950 + +typedef enum efx_virtio_vq_state_e { + EFX_VIRTIO_VQ_STATE_UNKNOWN = 0, + EFX_VIRTIO_VQ_STATE_INITIALIZED, + EFX_VIRTIO_VQ_STATE_STARTED, + EFX_VIRTIO_VQ_NSTATES +} efx_virtio_vq_state_t; + +struct efx_virtio_vq_s { + uint32_t evv_magic; + efx_nic_t *evv_enp; + efx_virtio_vq_state_t evv_state; + uint32_t evv_vi_index; + efx_virtio_vq_type_t evv_type; + uint16_t evv_target_vf; +}; + +#endif /* EFSYS_OPT_VIRTIO */ + #ifdef __cplusplus } #endif