X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fsfc%2Fbase%2Fefx.h;h=07cd0bb398ba1a7674739493b9c435f7070007c7;hb=6cf2f95d4dfbae8c8b4ea31ec899e750dcbc62bb;hp=492c8c6bf4b71ea3f873eeda5d377262329e30d8;hpb=d1708933bb48a3d86be336d6c9603300131ff70f;p=dpdk.git diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h index 492c8c6bf4..07cd0bb398 100644 --- a/drivers/net/sfc/base/efx.h +++ b/drivers/net/sfc/base/efx.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * - * Copyright (c) 2006-2018 Solarflare Communications Inc. - * All rights reserved. + * Copyright(c) 2019-2020 Xilinx, Inc. + * Copyright(c) 2006-2019 Solarflare Communications Inc. */ #ifndef _SYS_EFX_H @@ -29,6 +29,18 @@ extern "C" { /* The macro expands divider twice */ #define EFX_DIV_ROUND_UP(_n, _d) (((_n) + (_d) - 1) / (_d)) +/* Round value up to the nearest power of two. */ +#define EFX_P2ROUNDUP(_type, _value, _align) \ + (-(-(_type)(_value) & -(_type)(_align))) + +/* Align value down to the nearest power of two. */ +#define EFX_P2ALIGN(_type, _value, _align) \ + ((_type)(_value) & -(_type)(_align)) + +/* Test if value is power of 2 aligned. */ +#define EFX_IS_P2ALIGNED(_type, _value, _align) \ + ((((_type)(_value)) & ((_type)(_align) - 1)) == 0) + /* Return codes */ typedef __success(return == 0) int efx_rc_t; @@ -243,6 +255,9 @@ typedef struct efx_mcdi_transport_s { #if EFSYS_OPT_MCDI_PROXY_AUTH void (*emt_ev_proxy_response)(void *, uint32_t, efx_rc_t); #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ +#if EFSYS_OPT_MCDI_PROXY_AUTH_SERVER + void (*emt_ev_proxy_request)(void *, uint32_t); +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH_SERVER */ } efx_mcdi_transport_t; extern __checkReturn efx_rc_t @@ -495,10 +510,10 @@ typedef enum efx_link_mode_e { + /* bug16011 */ 16) \ #define EFX_MAC_PDU(_sdu) \ - P2ROUNDUP((_sdu) + EFX_MAC_PDU_ADJUSTMENT, 8) + EFX_P2ROUNDUP(size_t, (_sdu) + EFX_MAC_PDU_ADJUSTMENT, 8) /* - * Due to the P2ROUNDUP in EFX_MAC_PDU(), EFX_MAC_SDU_FROM_PDU() may give + * Due to the EFX_P2ROUNDUP in EFX_MAC_PDU(), EFX_MAC_SDU_FROM_PDU() may give * the SDU rounded up slightly. */ #define EFX_MAC_SDU_FROM_PDU(_pdu) ((_pdu) - EFX_MAC_PDU_ADJUSTMENT) @@ -529,6 +544,12 @@ efx_mac_filter_set( __in boolean_t all_mulcst, __in boolean_t brdcst); +extern void +efx_mac_filter_get_all_ucast_mcast( + __in efx_nic_t *enp, + __out boolean_t *all_unicst, + __out boolean_t *all_mulcst); + extern __checkReturn efx_rc_t efx_mac_multicast_list_set( __in efx_nic_t *enp, @@ -584,8 +605,9 @@ efx_mac_stat_name( #define EFX_MAC_STATS_MASK_BITS_PER_PAGE (8 * sizeof (uint32_t)) -#define EFX_MAC_STATS_MASK_NPAGES \ - (P2ROUNDUP(EFX_MAC_NSTATS, EFX_MAC_STATS_MASK_BITS_PER_PAGE) / \ +#define EFX_MAC_STATS_MASK_NPAGES \ + (EFX_P2ROUNDUP(uint32_t, EFX_MAC_NSTATS, \ + EFX_MAC_STATS_MASK_BITS_PER_PAGE) / \ EFX_MAC_STATS_MASK_BITS_PER_PAGE) /* @@ -1367,6 +1389,8 @@ typedef struct efx_nic_cfg_s { uint32_t enc_hw_pf_count; /* Datapath firmware vadapter/vport/vswitch support */ boolean_t enc_datapath_cap_evb; + /* Datapath firmware vport reconfigure support */ + boolean_t enc_vport_reconfigure_supported; boolean_t enc_rx_disable_scatter_supported; boolean_t enc_allow_set_mac_with_installed_filters; boolean_t enc_enhanced_set_mac_supported; @@ -2931,17 +2955,15 @@ typedef uint8_t efx_filter_flags_t; typedef uint32_t efx_filter_match_flags_t; +/* Filter priority from lowest to highest */ typedef enum efx_filter_priority_s { - EFX_FILTER_PRI_HINT = 0, /* Performance hint */ - EFX_FILTER_PRI_AUTO, /* Automatic filter based on device + EFX_FILTER_PRI_AUTO = 0, /* Automatic filter based on device * address list or hardware * requirements. This may only be used * by the filter implementation for * each NIC type. */ EFX_FILTER_PRI_MANUAL, /* Manually configured filter */ - EFX_FILTER_PRI_REQUIRED, /* Required for correct behaviour of the - * client (e.g. SR-IOV, HyperV VMQ etc.) - */ + EFX_FILTER_NPRI, } efx_filter_priority_t; /* @@ -2956,6 +2978,11 @@ typedef struct efx_filter_spec_s { uint16_t efs_dmaq_id; uint32_t efs_rss_context; uint32_t efs_mark; + /* + * Saved lower-priority filter. If it is set, it is restored on + * filter delete operation. + */ + struct efx_filter_spec_s *efs_overridden_spec; /* Fields below here are hashed for software filter lookup */ uint16_t efs_outer_vid; uint16_t efs_inner_vid; @@ -3417,8 +3444,114 @@ efx_evb_vswitch_destroy( __in efx_nic_t *enp, __in efx_vswitch_t *evp); +extern __checkReturn efx_rc_t +efx_evb_vport_mac_set( + __in efx_nic_t *enp, + __in efx_vswitch_t *evp, + __in efx_vport_id_t vport_id, + __in_bcount(EFX_MAC_ADDR_LEN) uint8_t *addrp); + +extern __checkReturn efx_rc_t +efx_evb_vport_vlan_set( + __in efx_nic_t *enp, + __in efx_vswitch_t *evp, + __in efx_vport_id_t vport_id, + __in uint16_t vid); + +extern __checkReturn efx_rc_t +efx_evb_vport_reset( + __in efx_nic_t *enp, + __in efx_vswitch_t *evp, + __in efx_vport_id_t vport_id, + __in_bcount(EFX_MAC_ADDR_LEN) uint8_t *addrp, + __in uint16_t vid, + __out boolean_t *is_fn_resetp); + +extern __checkReturn efx_rc_t +efx_evb_vport_stats( + __in efx_nic_t *enp, + __in efx_vswitch_t *evp, + __in efx_vport_id_t vport_id, + __out efsys_mem_t *stats_bufferp); + #endif /* EFSYS_OPT_EVB */ +#if EFSYS_OPT_MCDI_PROXY_AUTH_SERVER + +typedef struct efx_proxy_auth_config_s { + efsys_mem_t *request_bufferp; + efsys_mem_t *response_bufferp; + efsys_mem_t *status_bufferp; + uint32_t block_cnt; + uint32_t *op_listp; + size_t op_count; + uint32_t handled_privileges; +} efx_proxy_auth_config_t; + +typedef struct efx_proxy_cmd_params_s { + uint32_t pf_index; + uint32_t vf_index; + uint8_t *request_bufferp; + size_t request_size; + uint8_t *response_bufferp; + size_t response_size; + size_t *response_size_actualp; +} efx_proxy_cmd_params_t; + +extern __checkReturn efx_rc_t +efx_proxy_auth_init( + __in efx_nic_t *enp); + +extern void +efx_proxy_auth_fini( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +efx_proxy_auth_configure( + __in efx_nic_t *enp, + __in efx_proxy_auth_config_t *configp); + + __checkReturn efx_rc_t +efx_proxy_auth_destroy( + __in efx_nic_t *enp, + __in uint32_t handled_privileges); + + __checkReturn efx_rc_t +efx_proxy_auth_complete_request( + __in efx_nic_t *enp, + __in uint32_t fn_index, + __in uint32_t proxy_result, + __in uint32_t handle); + + __checkReturn efx_rc_t +efx_proxy_auth_exec_cmd( + __in efx_nic_t *enp, + __inout efx_proxy_cmd_params_t *paramsp); + + __checkReturn efx_rc_t +efx_proxy_auth_set_privilege_mask( + __in efx_nic_t *enp, + __in uint32_t vf_index, + __in uint32_t mask, + __in uint32_t value); + + __checkReturn efx_rc_t +efx_proxy_auth_privilege_mask_get( + __in efx_nic_t *enp, + __in uint32_t pf_index, + __in uint32_t vf_index, + __out uint32_t *maskp); + + __checkReturn efx_rc_t +efx_proxy_auth_privilege_modify( + __in efx_nic_t *enp, + __in uint32_t pf_index, + __in uint32_t vf_index, + __in uint32_t add_privileges_mask, + __in uint32_t remove_privileges_mask); + +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH_SERVER */ + #ifdef __cplusplus } #endif