From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id B8C854C8B for ; Tue, 25 Sep 2018 09:05:17 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id r83-v6so2612099ljr.7 for ; Tue, 25 Sep 2018 00:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CRmTCTrBXAHmzxMItLh+3rqWKqIL4Z1s0w9BGRIIQbY=; b=xfLmdy41jjWz6irfms/lTm8wZTmjZkxkDPyN+uKG9xKOLm68pzoeI/rlTh1koG+lDa 4a2PMG7h6MW2KPGY6VqxJsCIEw9F/tWPCKRggy4sOwNP+Z8sIHeWLQYupW5jY4OaB6BU 3VTq9Ip3YSnfDMkUSXJFJouKHlYQK2lHMMEJdeX2y92fmZNwa1ldbtg9x8HmGU5cfPze 0fr5CLlWQ+K4IZUDwAQKd62lB1AEzNhB3ElK/sqLDJFuorlmHnhjSziM+Xft1JIPClbB VjM9qQEnu5KpJ40FDaqNyg4DRC8pDWdYw5qI/+6z0+wW3Fi8xIT8lL6GZi5GHqqKl7na 9f9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CRmTCTrBXAHmzxMItLh+3rqWKqIL4Z1s0w9BGRIIQbY=; b=Q/wnXRQEdISgegOdKn7SjdToIvSSQ+Vg+fwymhFZ2l02X1vi+x9lpKQDBGv7SK+V9N 0Sih3wDjyJfkdDy+3iy0tEMfCj1D6Uxowfs4W3ddg2dvvU7+Yqf2euWn1JrTDNCMu+ws zNlFzT1e9dPobo3nV1sjYOnkvjbzreCT+jxqcf2Gwed7rkRdbttfCujY/cDTmDXkAoXy BhN2LxZ0W7UjtZxExjZCGRboqyBildDrr59/IpsDqXelYQatl9zgfeKhdSD4rTv+5oX2 8SV3V/AZYI6EgYZ0RnAPliwvwMmzaZnvvb1g/rcSMcSb4x2GovgLzbG7Un3d9jpYETkz sPWA== X-Gm-Message-State: ABuFfojlU3n/BcTKfpbcB5nQlFJaUfsIE4gB/W8jU+RlJNKH4N8VOSrf E4vurKPRsHqgCIJG7fiwvaeeBbEWmpClfQ== X-Google-Smtp-Source: ACcGV62dQADydwEn99JrntjqOEII2WBnGJh5Lb8esfJC7lK2wv6FBYlyWK/4Z3DTfOfbm7DW6k0ACg== X-Received: by 2002:a2e:c49:: with SMTP id o9-v6mr1521405ljd.16.1537859117123; Tue, 25 Sep 2018 00:05:17 -0700 (PDT) Received: from amok.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id 24-v6sm238306ljb.76.2018.09.25.00.05.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Sep 2018 00:05:16 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: mw@semihalf.com, nadavh@marvell.com, Tomasz Duszynski , Natalie Samsonov Date: Tue, 25 Sep 2018 09:05:01 +0200 Message-Id: <1537859109-25659-6-git-send-email-amo@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537859109-25659-1-git-send-email-amo@semihalf.com> References: <1536068953-9352-1-git-send-email-tdu@semihalf.com> <1537859109-25659-1-git-send-email-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v3 05/13] net/mvpp2: add init and deinit to flow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2018 07:05:17 -0000 From: Tomasz Duszynski 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 Signed-off-by: Natalie Samsonov Reviewed-by: Liron Himi Reviewed-by: Shlomi Gridish --- drivers/net/mvpp2/mrvl_ethdev.c | 3 +++ drivers/net/mvpp2/mrvl_flow.c | 33 ++++++++++++++++++++++++++++++++- drivers/net/mvpp2/mrvl_flow.h | 15 +++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 drivers/net/mvpp2/mrvl_flow.h diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 0571635..461f297 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -23,6 +23,7 @@ #include #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) { diff --git a/drivers/net/mvpp2/mrvl_flow.c b/drivers/net/mvpp2/mrvl_flow.c index e6953e4..065b1aa 100644 --- a/drivers/net/mvpp2/mrvl_flow.c +++ b/drivers/net/mvpp2/mrvl_flow.c @@ -11,7 +11,7 @@ #include -#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; + } +} diff --git a/drivers/net/mvpp2/mrvl_flow.h b/drivers/net/mvpp2/mrvl_flow.h new file mode 100644 index 0000000..f63747c --- /dev/null +++ b/drivers/net/mvpp2/mrvl_flow.h @@ -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_ */ -- 2.7.4