net/mvpp2: add init and deinit to flow
Add init and deinit functionality to flow implementation. Init puts structures used by flow in a sane sate. Deinit deallocates all resources used by flow. Signed-off-by: Tomasz Duszynski <tdu@semihalf.com> Signed-off-by: Natalie Samsonov <nsamsono@marvell.com> Reviewed-by: Liron Himi <lironh@marvell.com> Reviewed-by: Shlomi Gridish <sgridish@marvell.com>
This commit is contained in:
parent
e97d88740a
commit
a1f83becf9
@ -23,6 +23,7 @@
|
||||
#include <rte_mvep_common.h>
|
||||
#include "mrvl_ethdev.h"
|
||||
#include "mrvl_qos.h"
|
||||
#include "mrvl_flow.h"
|
||||
#include "mrvl_mtr.h"
|
||||
|
||||
/* bitmask with reserved hifs */
|
||||
@ -619,6 +620,7 @@ mrvl_dev_start(struct rte_eth_dev *dev)
|
||||
goto out;
|
||||
}
|
||||
|
||||
mrvl_flow_init(dev);
|
||||
mrvl_mtr_init(dev);
|
||||
|
||||
return 0;
|
||||
@ -759,6 +761,7 @@ mrvl_dev_close(struct rte_eth_dev *dev)
|
||||
|
||||
mrvl_flush_rx_queues(dev);
|
||||
mrvl_flush_tx_shadow_queues(dev);
|
||||
mrvl_flow_deinit(dev);
|
||||
mrvl_mtr_deinit(dev);
|
||||
|
||||
for (i = 0; i < priv->ppio_params.inqs_params.num_tcs; ++i) {
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "mrvl_ethdev.h"
|
||||
#include "mrvl_flow.h"
|
||||
#include "mrvl_qos.h"
|
||||
|
||||
/** Number of rules in the classifier table. */
|
||||
@ -2790,3 +2790,34 @@ const struct rte_flow_ops mrvl_flow_ops = {
|
||||
.flush = mrvl_flow_flush,
|
||||
.isolate = mrvl_flow_isolate
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize flow resources.
|
||||
*
|
||||
* @param dev Pointer to the device.
|
||||
*/
|
||||
void
|
||||
mrvl_flow_init(struct rte_eth_dev *dev)
|
||||
{
|
||||
struct mrvl_priv *priv = dev->data->dev_private;
|
||||
|
||||
LIST_INIT(&priv->flows);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup flow resources.
|
||||
*
|
||||
* @param dev Pointer to the device.
|
||||
*/
|
||||
void
|
||||
mrvl_flow_deinit(struct rte_eth_dev *dev)
|
||||
{
|
||||
struct mrvl_priv *priv = dev->data->dev_private;
|
||||
|
||||
mrvl_flow_flush(dev, NULL);
|
||||
|
||||
if (priv->cls_tbl) {
|
||||
pp2_cls_tbl_deinit(priv->cls_tbl);
|
||||
priv->cls_tbl = NULL;
|
||||
}
|
||||
}
|
||||
|
15
drivers/net/mvpp2/mrvl_flow.h
Normal file
15
drivers/net/mvpp2/mrvl_flow.h
Normal file
@ -0,0 +1,15 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright(c) 2018 Marvell International Ltd.
|
||||
* Copyright(c) 2018 Semihalf.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _MRVL_FLOW_H_
|
||||
#define _MRVL_FLOW_H_
|
||||
|
||||
#include "mrvl_ethdev.h"
|
||||
|
||||
void mrvl_flow_init(struct rte_eth_dev *dev);
|
||||
void mrvl_flow_deinit(struct rte_eth_dev *dev);
|
||||
|
||||
#endif /* _MRVL_FLOW_H_ */
|
Loading…
Reference in New Issue
Block a user