diff --git a/include/osi_core.h b/include/osi_core.h index 97e13b7..95e79c2 100644 --- a/include/osi_core.h +++ b/include/osi_core.h @@ -1357,9 +1357,11 @@ struct osi_core_priv_data { nveu32_t mdc_cr; /** VLAN tag stripping enable(1) or disable(0) */ nveu32_t strip_vlan_tag; +#if !defined(L3L4_WILDCARD_FILTER) /** L3L4 filter bit bask, set index corresponding bit for * filter if filter enabled */ nveu32_t l3l4_filter_bitmask; +#endif /* !L3L4_WILDCARD_FILTER */ /** Flag which decides virtualization is enabled(1) or disabled(0) */ nveu32_t use_virtualization; /** HW supported feature list */ diff --git a/osi/core/core_common.c b/osi/core/core_common.c index 02fbfaf..d0ae02a 100644 --- a/osi/core/core_common.c +++ b/osi/core/core_common.c @@ -585,6 +585,7 @@ nve32_t hw_config_mac_pkt_filter_reg(struct osi_core_priv_data *const osi_core, return ret; } +#if !defined(L3L4_WILDCARD_FILTER) nve32_t hw_config_l3_l4_filter_enable(struct osi_core_priv_data *const osi_core, const nveu32_t filter_enb_dis) { @@ -608,6 +609,7 @@ nve32_t hw_config_l3_l4_filter_enable(struct osi_core_priv_data *const osi_core, fail: return ret; } +#endif /* !L3L4_WILDCARD_FILTER */ /** * @brief hw_est_read - indirect read the GCL to Software own list diff --git a/osi/core/core_common.h b/osi/core/core_common.h index 190d0c6..3b16e0b 100644 --- a/osi/core/core_common.h +++ b/osi/core/core_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -85,7 +85,9 @@ #define MAC_PFR_HPF OSI_BIT(10) #define MAC_PFR_VTFE OSI_BIT(16) #define MAC_PFR_IPFE OSI_BIT(20) +#if !defined(L3L4_WILDCARD_FILTER) #define MAC_PFR_IPFE_SHIFT 20U +#endif /* !L3L4_WILDCARD_FILTER */ #define MAC_PFR_DNTU OSI_BIT(21) #define MAC_PFR_RA OSI_BIT(31) @@ -154,8 +156,10 @@ nve32_t hw_ptp_tsc_capture(struct osi_core_priv_data *const osi_core, struct osi_core_ptp_tsc_data *data); nve32_t hw_config_mac_pkt_filter_reg(struct osi_core_priv_data *const osi_core, const struct osi_filter *filter); +#if !defined(L3L4_WILDCARD_FILTER) nve32_t hw_config_l3_l4_filter_enable(struct osi_core_priv_data *const osi_core, const nveu32_t filter_enb_dis); +#endif /* !L3L4_WILDCARD_FILTER */ nve32_t hw_config_est(struct osi_core_priv_data *const osi_core, struct osi_est_config *const est); nve32_t hw_config_fpe(struct osi_core_priv_data *const osi_core, diff --git a/osi/core/eqos_core.c b/osi/core/eqos_core.c index 2d987fe..d7f32f6 100644 --- a/osi/core/eqos_core.c +++ b/osi/core/eqos_core.c @@ -1241,8 +1241,7 @@ static void eqos_dma_chan_to_vmirq_map(struct osi_core_priv_data *osi_core) * - TraceID:ETHERNET_NVETHERNETRM_006 * * @param[in] osi_core: OSI core private data structure. Used params are - * - base, dcs_en, num_mtl_queues, mtl_queues, mtu, stip_vlan_tag, pause_frames, - * l3l4_filter_bitmask + * - base, dcs_en, num_mtl_queues, mtl_queues, mtu, stip_vlan_tag, pause_frames. * * @pre * - MAC should be out of reset. See osi_poll_for_mac_reset_complete() @@ -1363,8 +1362,10 @@ static nve32_t eqos_core_init(struct osi_core_priv_data *const osi_core) osi_core->hw_feature->fpe_sel); } +#if !defined(L3L4_WILDCARD_FILTER) /* initialize L3L4 Filters variable */ osi_core->l3l4_filter_bitmask = OSI_NONE; +#endif /* !L3L4_WILDCARD_FILTER */ if (osi_core->mac_ver >= OSI_EQOS_MAC_5_30) { eqos_dma_chan_to_vmirq_map(osi_core); diff --git a/osi/core/mgbe_core.c b/osi/core/mgbe_core.c index ebb0660..382ce95 100644 --- a/osi/core/mgbe_core.c +++ b/osi/core/mgbe_core.c @@ -2083,6 +2083,11 @@ static nve32_t mgbe_core_init(struct osi_core_priv_data *const osi_core) osi_core->hw_feature->fpe_sel); } +#if !defined(L3L4_WILDCARD_FILTER) + /* initialize L3L4 Filters variable */ + osi_core->l3l4_filter_bitmask = OSI_NONE; +#endif /* !L3L4_WILDCARD_FILTER */ + ret = mgbe_dma_chan_to_vmirq_map(osi_core); fail: return ret; diff --git a/osi/core/osi_hal.c b/osi/core/osi_hal.c index 4364127..84366e1 100644 --- a/osi/core/osi_hal.c +++ b/osi/core/osi_hal.c @@ -934,8 +934,10 @@ static nve32_t configure_l3l4_filter_helper(struct osi_core_priv_data *const osi OSI_CORE_INFO((osi_core->osd), (OSI_LOG_ARG_OUTOFBOUND), ("L3L4: ADD: "), (filter_no)); +#if !defined(L3L4_WILDCARD_FILTER) /* update filter mask bit */ osi_core->l3l4_filter_bitmask |= ((nveu32_t)1U << (filter_no & 0x1FU)); +#endif /* !L3L4_WILDCARD_FILTER */ } else { /* Clear the filter data. * osi_memset is an internal function and it cannot fail, hence @@ -945,10 +947,13 @@ static nve32_t configure_l3l4_filter_helper(struct osi_core_priv_data *const osi OSI_CORE_INFO((osi_core->osd), (OSI_LOG_ARG_OUTOFBOUND), ("L3L4: DELETE: "), (filter_no)); +#if !defined(L3L4_WILDCARD_FILTER) /* update filter mask bit */ osi_core->l3l4_filter_bitmask &= ~((nveu32_t)1U << (filter_no & 0x1FU)); +#endif /* !L3L4_WILDCARD_FILTER */ } +#if !defined(L3L4_WILDCARD_FILTER) if (osi_core->l3l4_filter_bitmask != 0U) { /* enable l3l4 filter */ ret = hw_config_l3_l4_filter_enable(osi_core, OSI_ENABLE); @@ -956,6 +961,7 @@ static nve32_t configure_l3l4_filter_helper(struct osi_core_priv_data *const osi /* disable l3l4 filter */ ret = hw_config_l3_l4_filter_enable(osi_core, OSI_DISABLE); } +#endif /* !L3L4_WILDCARD_FILTER */ exit_func: