[v1,02/31] net/ntnic: add flow filter deinitialization API
Checks
Context |
Check |
Description |
ci/Intel-compilation |
warning
|
apply issues
|
Commit Message
From: Oleksandr Kolomeiets <okl-plv@napatech.com>
Add high-level interfaces for the deinitialization of the flow filter.
Signed-off-by: Oleksandr Kolomeiets <okl-plv@napatech.com>
---
drivers/net/ntnic/adapter/nt4ga_adapter.c | 17 +++++++++++++++++
drivers/net/ntnic/ntnic_mod_reg.h | 1 +
2 files changed, 18 insertions(+)
@@ -217,12 +217,29 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)
static int nt4ga_adapter_deinit(struct adapter_info_s *p_adapter_info)
{
+ const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+
+ if (flow_filter_ops == NULL)
+ NT_LOG(ERR, NTNIC, "%s: flow_filter module uninitialized\n", __func__);
+
fpga_info_t *fpga_info = &p_adapter_info->fpga_info;
int i;
int res = -1;
stop_monitor_tasks(-1);
+ /* Nt4ga Deinit Filter */
+ nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter;
+
+ if (flow_filter_ops != NULL) {
+ res = flow_filter_ops->flow_filter_done(p_filter->mp_flow_device);
+
+ if (res != 0) {
+ NT_LOG(ERR, NTNIC, "Cannot deinitialize filter\n");
+ return res;
+ }
+ }
+
nthw_fpga_shutdown(&p_adapter_info->fpga_info);
/* Rac rab reset flip flop */
@@ -121,6 +121,7 @@ void rst9563_ops_init(void);
struct flow_filter_ops {
int (*flow_filter_init)(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device,
int adapter_no);
+ int (*flow_filter_done)(struct flow_nic_dev *dev);
};
const struct flow_filter_ops *get_flow_filter_ops(void);