/* 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.
*/
#include "efx.h"
#include "efx_impl.h"
-#if EFX_OPTS_EF10()
+#if EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10()
#if EFSYS_OPT_FILTER
efx_rc_t rc;
ef10_filter_table_t *eftp;
- EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
+ EFSYS_ASSERT(EFX_FAMILY_IS_EF100(enp) || EFX_FAMILY_IS_EF10(enp));
#define MATCH_MASK(match) (EFX_MASK32(match) << EFX_LOW_BIT(match))
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_HOST ==
ef10_filter_fini(
__in efx_nic_t *enp)
{
- EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
+ EFSYS_ASSERT(EFX_FAMILY_IS_EF100(enp) || EFX_FAMILY_IS_EF10(enp));
if (enp->en_filter.ef_ef10_filter_table != NULL) {
EFSYS_KMEM_FREE(enp->en_esip, sizeof (ef10_filter_table_t),
efsys_lock_state_t state;
efx_rc_t rc;
- EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
+ EFSYS_ASSERT(EFX_FAMILY_IS_EF100(enp) || EFX_FAMILY_IS_EF10(enp));
for (tbl_id = 0; tbl_id < EFX_EF10_FILTER_TBL_ROWS; tbl_id++) {
efsys_lock_state_t state;
boolean_t locked = B_FALSE;
- EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
+ EFSYS_ASSERT(EFX_FAMILY_IS_EF100(enp) || EFX_FAMILY_IS_EF10(enp));
EFSYS_ASSERT(spec->efs_overridden_spec == NULL);
efsys_lock_state_t state;
boolean_t locked = B_FALSE;
- EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
+ EFSYS_ASSERT(EFX_FAMILY_IS_EF100(enp) || EFX_FAMILY_IS_EF10(enp));
hash = ef10_filter_hash(spec);
goto fail1;
}
+ if (req.emr_out_length_used < MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMIN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
matches_count = MCDI_OUT_DWORD(req,
GET_PARSER_DISP_INFO_OUT_NUM_SUPPORTED_MATCHES);
if (req.emr_out_length_used <
MC_CMD_GET_PARSER_DISP_INFO_OUT_LEN(matches_count)) {
rc = EMSGSIZE;
- goto fail2;
+ goto fail3;
}
*list_lengthp = matches_count;
if (buffer_length < matches_count) {
rc = ENOSPC;
- goto fail3;
+ goto fail4;
}
/*
return (0);
+fail4:
+ EFSYS_PROBE(fail4);
fail3:
EFSYS_PROBE(fail3);
fail2:
rc = efx_mcdi_get_parser_disp_info(enp, &buffer[next_buf_idx],
next_buf_length, B_TRUE, &mcdi_encap_list_length);
if (rc != 0) {
- if (rc == ENOSPC)
+ if (rc == ENOSPC) {
no_space = B_TRUE;
- else
+ } else if (rc == EINVAL) {
+ /*
+ * Do not fail if the MCDI do not recognize the
+ * query for encapsulated packet filters.
+ */
+ mcdi_encap_list_length = 0;
+ } else
goto fail2;
} else {
for (i = next_buf_idx;
#endif /* EFSYS_OPT_FILTER */
-#endif /* EFX_OPTS_EF10() */
+#endif /* EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10() */