From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 728A31B1C1 for ; Mon, 9 Oct 2017 16:45:31 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id t69so23225740wmt.2 for ; Mon, 09 Oct 2017 07:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=7b19Oi2z6fc6n9vD1+kAZZiEAkcgXl28j4IKj1vSG50=; b=pb1FLo9F/hzcVkpn9o9QpkF8qkAC2vkVd2UILtSP6SlxXfUVxUqDYXCF5bzVuXAXst x6P16PtARGJztOTYYgLmKPqZ9lSK+a9l76kgLfyp+96iM+RjtGb2GsqvTcZADpvFK+NT AWuwdehLuEYwQUmXu5an0kuXpyfRYopcyrPaHk1P1bxawAQTuZTsqN3X8lY3X+VB17Jf P+dHycfJ2+WBxhrIeYPBNISs3Zt+OC4p6GXLOLqy73ao+ORhpYvJLj2TpY/p+PcwEDT9 JLNbLckxnkH0+MI8BtUBqd5OWH9tOsZu8rqnKo/Uh5rT/nK8wlo7cAWGjb3XcTf200fi Px2A== 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:in-reply-to:references; bh=7b19Oi2z6fc6n9vD1+kAZZiEAkcgXl28j4IKj1vSG50=; b=LblYDFRdOL/l+0gZp19rFDjQc9ySsbf1Wk8O/7lgumqmNzE/hoQ5FCs0F4uJOxA0oA FH4HASehknI9xZbYUXNQi4B6hw48LOMjde0mgwVVy/0s05aKfHmLBhe63kwQdDUi6BD7 rDCwrZGHTm3I7AhAvt8PxJLH0zlNhGdZl63fkbGaB29ZYx2c89ma8o8qN6ML4yrRXuzR b08PwRTFSzY3zd8tz1wz+7RrBhTY+oCONDEoOvTOCkNrTf48vKJfpAN30qmVq1OSWxnN Y8PakADhigQo3103TrB5oBCILO2E2mZ+uu/kqNLG7QL7HX5yFYywQV+CnvCemosTNQd7 HUYA== X-Gm-Message-State: AMCzsaXdXf8KSfayRiRhu+hm4lb+XtUNNsfPDQfDqzkdckvWX92gYN2G GOXhALxGjA5uJfRt33TSig4u1cT3Tg== X-Google-Smtp-Source: AOwi7QCYwupXYtqDlcFz5KPbkGGs3m+Laco6rHZgQgEMiHD3FYHLFcH5AO86r4IKVdmXjrdrc81NvQ== X-Received: by 10.223.170.197 with SMTP id i5mr97048wrc.118.1507560331014; Mon, 09 Oct 2017 07:45:31 -0700 (PDT) Received: from ping.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id x15sm6791495wma.32.2017.10.09.07.45.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 07:45:30 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: adrien.mazarguil@6wind.com, yskoh@mellanox.com, ferruh.yigit@intel.com Date: Mon, 9 Oct 2017 16:44:42 +0200 Message-Id: <682dd6ac7477933eddde9e84811c01743bd8e04a.1507560012.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 06/30] net/mlx5: verify all flows are been removed on close 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: Mon, 09 Oct 2017 14:45:31 -0000 Debug tools to verify all flows are be un-register from the NIC. Signed-off-by: Nelio Laranjeiro Acked-by: Yongseok Koh --- drivers/net/mlx5/mlx5.c | 4 ++++ drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow.c | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 7aea5a4..1397016 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -190,6 +190,7 @@ mlx5_dev_close(struct rte_eth_dev *dev) { struct priv *priv = mlx5_get_priv(dev); unsigned int i; + int ret; priv_lock(priv); DEBUG("%p: closing device \"%s\"", @@ -252,6 +253,9 @@ mlx5_dev_close(struct rte_eth_dev *dev) if (priv->reta_idx != NULL) rte_free(priv->reta_idx); priv_socket_uninit(priv); + ret = priv_flow_verify(priv); + if (ret) + WARN("%p: some flows still remain", (void *)priv); priv_unlock(priv); memset(priv, 0, sizeof(*priv)); } diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 3c58f7a..c6563bd 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -290,6 +290,7 @@ int mlx5_flow_isolate(struct rte_eth_dev *, int, struct rte_flow_error *); int priv_flow_start(struct priv *); void priv_flow_stop(struct priv *); int priv_flow_rxq_in_use(struct priv *, struct mlx5_rxq_data *); +int priv_flow_verify(struct priv *); /* mlx5_socket.c */ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 3504c43..193a90b 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1630,3 +1630,25 @@ mlx5_flow_isolate(struct rte_eth_dev *dev, priv_unlock(priv); return 0; } + +/** + * Verify the flow list is empty + * + * @param priv + * Pointer to private structure. + * + * @return the number of flows not released. + */ +int +priv_flow_verify(struct priv *priv) +{ + struct rte_flow *flow; + int ret = 0; + + TAILQ_FOREACH(flow, &priv->flows, next) { + DEBUG("%p: flow %p still referenced", (void *)priv, + (void *)flow); + ++ret; + } + return ret; +} -- 2.1.4