From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by dpdk.org (Postfix) with ESMTP id 34667A0B6 for ; Wed, 2 Aug 2017 16:11:05 +0200 (CEST) Received: by mail-wr0-f179.google.com with SMTP id 33so19235712wrz.4 for ; Wed, 02 Aug 2017 07:11:05 -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=5IkdPh/XDHbtTjXCMFKXWBO8FjuSJRUTmOpwZGr3s6A=; b=Td+he6ktgxqDyR+/QH9x/Znud2poWddnvJvNeqR+Eg3WqNYKm31auiI7J2isMJyYm+ QDYvcELfoLc8T6dr0ob+V0vH4n2ZNv1FpgdGKpsca1PNHb9hx5D+H+kwMxyL6wPePC/B 7uzu1UnfhfyoF90k40hJNGBzQlSje2YMRIBuyM5f9sHxN8NW4UBBz2BNiduOG+oIi12c GvkGrjZQfZqZaOOxlaTQn+llo840izv1sIQ5mbbQvw4udZ72DN3sW9bPNV16qWK2m+TX XzKirVG+y0d+04T2DMF1i0mBcn5hz4RzZ5xJUVpGT+SlxrNiApS+kWsrxYRbWnSc3PVZ +lMw== 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=5IkdPh/XDHbtTjXCMFKXWBO8FjuSJRUTmOpwZGr3s6A=; b=QWMKu/MROOw+lp8syyKCpJCdYekXrIs9W5N7j1WU9AxukCm+cr2t0EJr6GrxX6ovmz k5ar2QdAoXgbiJumL2UJNDWgIxEvJoJP8IHCzHd+A/un8VwwfoXCmE3ggr5f12bdR2/D lxnDwe0H8H1NO94VyynPizcT7VLN4zwZOnX8hAvVq8wgo0czTLiufo4FSPSu2mq+mZni OLcBx6v9glQKAwy/70eJlE0Z1wqQKYRm5Hlf/fZP2VRQ/kYaEuCeFQaDy3ApR0OPRA4i T6jizWL4/f7s7k9OJ0uNTy0TDCEMYljluRqPkkYQBAW8lz7y6Zxm+dMfh2gER4WYJeDq VQZA== X-Gm-Message-State: AIVw113NhRGnLCvR8kfXE/kSS0oafdob6NeIxjKDO6QjJ3MSe9262j9R IiY/xSZwgGZHrSmpm6pYCw== X-Received: by 10.223.139.219 with SMTP id w27mr17013903wra.146.1501683064710; Wed, 02 Aug 2017 07:11:04 -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 d53sm39449552wrd.81.2017.08.02.07.11.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 07:11:04 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: adrien.mazarguil@6wind.com Date: Wed, 2 Aug 2017 16:10:22 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v1 06/21] 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: Wed, 02 Aug 2017 14:11:05 -0000 Debug tools to verify all flows are be un-register from the NIC. Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5.c | 3 +++ drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow.c | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index c7bc65f..0d8ca52 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -200,6 +200,9 @@ mlx5_dev_close(struct rte_eth_dev *dev) } if (priv->reta_idx != NULL) rte_free(priv->reta_idx); + i = priv_flow_verify(priv); + if (i) + 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 40c3475..a5e9aa1 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -287,5 +287,6 @@ 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 *); #endif /* RTE_PMD_MLX5_H_ */ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 996fe31..bcbb984 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1639,3 +1639,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 object 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