From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 4F3C52BF7 for ; Tue, 4 Sep 2018 09:10:43 +0200 (CEST) Received: by mail-pf1-f193.google.com with SMTP id p12-v6so1235557pfh.2 for ; Tue, 04 Sep 2018 00:10:43 -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=j8KUDWso1N84oCd1YwrgDHqam7TiIe6PQ4Sy/GDxrtc=; b=PUXtUIHLTqDODfAfKmqtiiQiHHcWNh9zJbFSeHbFx+CK52aWsoSrgCSIngS3TcDRxN OSvvF99mN19wy3Jjk7dOeyl4B0nJRoFbJzuQaVV7N44Tfi2h7IHMQSYgNIW4YLvZvjsX FkOp/AGm5R+M6/eYnyfEdQyTMGuhyvGjriIwVbAmX/H3jojLYLPeM2TQVNLsaha6IeRG eLBGR2yk8fWwyNq1bnN6dm4sMtqMuuGjnWlyqHpI9nk68QkII+6ZwWJiTU5E04Jo50zz Erk+Z2XR8f6Q1OkDN8gLYS6797/GZLDXy4keXZbiTFoc2limDFPJowW4r/BuK4ICJP7q qiZA== 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=j8KUDWso1N84oCd1YwrgDHqam7TiIe6PQ4Sy/GDxrtc=; b=t68DULBsX4YXHg/JLuEuLsLmZXAPihvKncEYvNTgbGb6wNFN1tkyxFAur5W617A7gT iHZZEWYo04kqkZhu9U4iLgUOfV+HNsQYLYdHtSu5K2gBpeSuz+/J83lVy4l/OK/ReSdj Yrvh/ge9anOQFJsm6G5A6XkTGnthqV/Z8B7IS3e069UCmtLsQJAcFY79pALP8BgbjAK7 z8+sA/UvIa4dfDOI4HsfxonLcyubOekNzO0AUhNifMYvMTH80wDU2jTxt7xSURxfsl77 mfd6gjOQJLaOx2VcQvk5MQR1qUaf/RVZtIafKgOrSUhM1a3og7qeHYIliRvy+4JmemoT 1ymw== X-Gm-Message-State: APzg51BAQ6SztOUl6atz6e8oPTU24I2dw4bp6/911KL0zD8W9sH77oIS 1oXNeHeJJmZW36rvPuy164+AAd0/Sg+PBA== X-Google-Smtp-Source: ANB0VdZPYtzzYy5eCPbqrh9Dvf3MeNcyFk/vOKaDAqtcDv6tGtuq+0LeEVuzZihXzsA+KgHLe0Tm7Q== X-Received: by 2002:a63:e001:: with SMTP id e1-v6mr3917251pgh.380.1536045042480; Tue, 04 Sep 2018 00:10:42 -0700 (PDT) Received: from sh.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id l79-v6sm31229451pfb.111.2018.09.04.00.10.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 00:10:41 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com, Tomasz Duszynski Date: Tue, 4 Sep 2018 09:10:13 +0200 Message-Id: <1536045016-32008-6-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536045016-32008-1-git-send-email-tdu@semihalf.com> References: <1536045016-32008-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH 5/8] 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, 04 Sep 2018 07:10:44 -0000 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 1464385..5e3a106 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 */ @@ -628,6 +629,7 @@ mrvl_dev_start(struct rte_eth_dev *dev) goto out; } + mrvl_flow_init(dev); mrvl_mtr_init(dev); return 0; @@ -768,6 +770,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