From: Rasesh Mody Date: Sat, 25 Apr 2020 06:13:46 +0000 (-0700) Subject: net/qede: support flow API flush X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5810e43604f046d80eb066320c755a8671829d2f;p=dpdk.git net/qede: support flow API flush This patch adds support to flush the rte flows. Signed-off-by: Rasesh Mody Signed-off-by: Igor Russkikh --- diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c index bad55740a7..86a2e0dc9a 100644 --- a/drivers/net/qede/qede_filter.c +++ b/drivers/net/qede/qede_filter.c @@ -1486,10 +1486,32 @@ qede_flow_destroy(struct rte_eth_dev *eth_dev, return rc; } +static int +qede_flow_flush(struct rte_eth_dev *eth_dev, + struct rte_flow_error *error) +{ + struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); + struct qede_arfs_entry *tmp = NULL; + int rc = 0; + + while (!SLIST_EMPTY(&qdev->arfs_info.arfs_list_head)) { + tmp = SLIST_FIRST(&qdev->arfs_info.arfs_list_head); + + rc = qede_config_arfs_filter(eth_dev, tmp, false); + if (rc < 0) + rte_flow_error_set(error, rc, + RTE_FLOW_ERROR_TYPE_HANDLE, NULL, + "Failed to flush flow filter"); + } + + return rc; +} + const struct rte_flow_ops qede_flow_ops = { .validate = qede_flow_validate, .create = qede_flow_create, .destroy = qede_flow_destroy, + .flush = qede_flow_flush, }; int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev,