From patchwork Tue Aug 1 16:54:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Mazarguil X-Patchwork-Id: 27358 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id CE808A317; Tue, 1 Aug 2017 18:56:34 +0200 (CEST) Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by dpdk.org (Postfix) with ESMTP id 82CB6A1EE for ; Tue, 1 Aug 2017 18:55:56 +0200 (CEST) Received: by mail-wr0-f178.google.com with SMTP id k71so9261453wrc.2 for ; Tue, 01 Aug 2017 09:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=wqbzZibHppHmKXLc/+OKl9GXc18UbITOWU5tUdLhpkc=; b=sQfs1TuNcnXNtmQATpfmOyCK2gPqNgUCfahUxd2VIRdjriwPOsQSIq02Eb8rJuGkvc RqcGD2za3ZV5xH0NuKDtEI3sCfBlbQICzqUz/SoExRRQxCXVz3MfO+8Hbtd7iB9mVQk/ lqWjnO+XP6a8yPfE5BIuiDuLS+UQvDvdb7f0j7JQxzZSuaQ5D0E724UvOv0adq5YhpE8 vWPFlgT8fu3689yz31tBy9SqqfK2PsxhLbHzknnhZWCW4Yd62SEOiUCR8zwCU7hZWFiQ rQXYQq4rmqQEhJUUflP/EVNl5oUAphU6NsszHXEL0dfyisyfskyF2+tliMIa9S14zEll 2OxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=wqbzZibHppHmKXLc/+OKl9GXc18UbITOWU5tUdLhpkc=; b=crxFUpB0uPehzuLJ71kGlTcjL826jEH7EbGkJuzrt+slh/GIgSX4qAXt+DDz+GjjFn tR/XnjSSt9TgDKOXy2vwd9q6nn9iM4FNQZ4u7DKeQdP2BszMYM7O9yWjZzpUe4Ke+1eh MXtXGgoTGcipG+GiLDWCgme6ZQP9NsegAgemoe90BQsGZO7lk+yHLCjxwYVg+lwEZvHZ SBlDlc3r+2mnXacnxjyajLA8Q4WP20SqSHeiGVTifIqNUyUweNvKpqVDCOV87Hgp1unY h3Y2k/YLBxMzchgNOuZVETOhb4jhpm+t2M8DmvuTg/m1z1y+5KzL3UHbQBCk0GNJ7Laz VD4Q== X-Gm-Message-State: AIVw1115Hcyiu3P/kRLF3/JF204dAC5aywgG4f4lvbFLdww+rC5MfsmS xMCs0ngu2f7ryUtNpzQ= X-Received: by 10.223.179.71 with SMTP id k7mr16961884wrd.232.1501606556057; Tue, 01 Aug 2017 09:55:56 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id v190sm1400987wme.2.2017.08.01.09.55.55 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 01 Aug 2017 09:55:55 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Tue, 1 Aug 2017 18:54:33 +0200 Message-Id: <6ca49556d90347dc379387546d9ba21d4a972c56.1501598384.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v1 46/48] net/mlx4: rename private functions in flow API 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" While internal static functions do not cause link time conflicts, this differentiates them from their mlx5 PMD counterparts while debugging. No impact on functionality. Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4.c | 4 ++-- drivers/net/mlx4/mlx4_flow.c | 30 +++++++++++++++--------------- drivers/net/mlx4/mlx4_flow.h | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 6424d8b..1f09b47 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -253,7 +253,7 @@ mlx4_dev_start(struct rte_eth_dev *dev) (void *)dev); goto err; } - ret = mlx4_priv_flow_start(priv); + ret = mlx4_flow_start(priv); if (ret) { ERROR("%p: flow start failed: %s", (void *)dev, strerror(ret)); @@ -284,7 +284,7 @@ mlx4_dev_stop(struct rte_eth_dev *dev) return; DEBUG("%p: detaching flows from all RX queues", (void *)dev); priv->started = 0; - mlx4_priv_flow_stop(priv); + mlx4_flow_stop(priv); mlx4_intr_uninstall(priv); mlx4_mac_addr_del(priv); } diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index 6401a83..5616b83 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -561,7 +561,7 @@ static const struct mlx4_flow_items mlx4_flow_items[] = { }; /** - * Validate a flow supported by the NIC. + * Make sure a flow rule is supported and initialize associated structure. * * @param priv * Pointer to private structure. @@ -580,12 +580,12 @@ static const struct mlx4_flow_items mlx4_flow_items[] = { * 0 on success, a negative errno value otherwise and rte_errno is set. */ static int -priv_flow_validate(struct priv *priv, - const struct rte_flow_attr *attr, - const struct rte_flow_item items[], - const struct rte_flow_action actions[], - struct rte_flow_error *error, - struct mlx4_flow *flow) +mlx4_flow_prepare(struct priv *priv, + const struct rte_flow_attr *attr, + const struct rte_flow_item items[], + const struct rte_flow_action actions[], + struct rte_flow_error *error, + struct mlx4_flow *flow) { const struct mlx4_flow_items *cur_item = mlx4_flow_items; struct mlx4_flow_action action = { @@ -725,7 +725,7 @@ mlx4_flow_validate(struct rte_eth_dev *dev, struct priv *priv = dev->data->dev_private; struct mlx4_flow flow = { .offset = sizeof(struct ibv_flow_attr) }; - return priv_flow_validate(priv, attr, items, actions, error, &flow); + return mlx4_flow_prepare(priv, attr, items, actions, error, &flow); } /** @@ -817,7 +817,7 @@ mlx4_flow_create_drop_queue(struct priv *priv) * A flow if the rule could be created. */ static struct rte_flow * -priv_flow_create_action_queue(struct priv *priv, +mlx4_flow_create_action_queue(struct priv *priv, struct ibv_flow_attr *ibv_attr, struct mlx4_flow_action *action, struct rte_flow_error *error) @@ -875,7 +875,7 @@ mlx4_flow_create(struct rte_eth_dev *dev, struct mlx4_flow flow = { .offset = sizeof(struct ibv_flow_attr), }; int err; - err = priv_flow_validate(priv, attr, items, actions, error, &flow); + err = mlx4_flow_prepare(priv, attr, items, actions, error, &flow); if (err) return NULL; flow.ibv_attr = rte_malloc(__func__, flow.offset, 0); @@ -894,8 +894,8 @@ mlx4_flow_create(struct rte_eth_dev *dev, .port = priv->port, .flags = 0, }; - claim_zero(priv_flow_validate(priv, attr, items, actions, - error, &flow)); + claim_zero(mlx4_flow_prepare(priv, attr, items, actions, + error, &flow)); action = (struct mlx4_flow_action){ .queue = 0, .drop = 0, @@ -917,7 +917,7 @@ mlx4_flow_create(struct rte_eth_dev *dev, goto exit; } } - rte_flow = priv_flow_create_action_queue(priv, flow.ibv_attr, + rte_flow = mlx4_flow_create_action_queue(priv, flow.ibv_attr, &action, error); if (rte_flow) { LIST_INSERT_HEAD(&priv->flows, rte_flow, next); @@ -1015,7 +1015,7 @@ mlx4_flow_flush(struct rte_eth_dev *dev, * Pointer to private structure. */ void -mlx4_priv_flow_stop(struct priv *priv) +mlx4_flow_stop(struct priv *priv) { struct rte_flow *flow; @@ -1039,7 +1039,7 @@ mlx4_priv_flow_stop(struct priv *priv) * 0 on success, a errno value otherwise and rte_errno is set. */ int -mlx4_priv_flow_start(struct priv *priv) +mlx4_flow_start(struct priv *priv) { int ret; struct ibv_qp *qp; diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h index 8bd659c..a24ae31 100644 --- a/drivers/net/mlx4/mlx4_flow.h +++ b/drivers/net/mlx4/mlx4_flow.h @@ -74,8 +74,8 @@ struct mlx4_flow_action { /* mlx4_flow.c */ -int mlx4_priv_flow_start(struct priv *priv); -void mlx4_priv_flow_stop(struct priv *priv); +int mlx4_flow_start(struct priv *priv); +void mlx4_flow_stop(struct priv *priv); int mlx4_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type, enum rte_filter_op filter_op,