From patchwork Wed Oct 24 12:36:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahaf Shuler X-Patchwork-Id: 47321 X-Patchwork-Delegate: shahafs@mellanox.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5169F1B1FF; Wed, 24 Oct 2018 14:38:51 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id EAA431B1FD for ; Wed, 24 Oct 2018 14:38:49 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shahafs@mellanox.com) with ESMTPS (AES256-SHA encrypted); 24 Oct 2018 14:43:54 +0200 Received: from unicorn01.mtl.labs.mlnx. (unicorn01.mtl.labs.mlnx [10.7.12.62]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w9OCaLct001458; Wed, 24 Oct 2018 15:38:46 +0300 From: Shahaf Shuler To: shahafs@mellanox.com Cc: dev@dpdk.org, yskoh@mellanox.com Date: Wed, 24 Oct 2018 15:36:13 +0300 Message-Id: <808a0ac238cd8a9924e7cc881a18f42c421197ee.1540384475.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: Subject: [dpdk-dev] [PATCH 1/3] net/mlx5: rename static functions 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" From: Yongseok Koh In mlx5_flow*.c, static functions have names starting from 'flow_' while shared ones start from "mlx5_flow_'. Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow.c | 62 +++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 6219c9d68a..68eb7da3f6 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -505,7 +505,7 @@ mlx5_flow_hashfields_adjust(struct mlx5_flow *dev_flow, * Rx queue to update. */ static void -mlx5_flow_rxq_tunnel_ptype_update(struct mlx5_rxq_ctrl *rxq_ctrl) +flow_rxq_tunnel_ptype_update(struct mlx5_rxq_ctrl *rxq_ctrl) { unsigned int i; uint32_t tunnel_ptype = 0; @@ -533,7 +533,7 @@ mlx5_flow_rxq_tunnel_ptype_update(struct mlx5_rxq_ctrl *rxq_ctrl) * Pointer to flow structure. */ static void -mlx5_flow_rxq_flags_set(struct rte_eth_dev *dev, struct rte_flow *flow) +flow_rxq_flags_set(struct rte_eth_dev *dev, struct rte_flow *flow) { struct priv *priv = dev->data->dev_private; const int mark = !!(flow->actions & @@ -562,7 +562,7 @@ mlx5_flow_rxq_flags_set(struct rte_eth_dev *dev, struct rte_flow *flow) break; } } - mlx5_flow_rxq_tunnel_ptype_update(rxq_ctrl); + flow_rxq_tunnel_ptype_update(rxq_ctrl); } } } @@ -577,7 +577,7 @@ mlx5_flow_rxq_flags_set(struct rte_eth_dev *dev, struct rte_flow *flow) * Pointer to the flow. */ static void -mlx5_flow_rxq_flags_trim(struct rte_eth_dev *dev, struct rte_flow *flow) +flow_rxq_flags_trim(struct rte_eth_dev *dev, struct rte_flow *flow) { struct priv *priv = dev->data->dev_private; const int mark = !!(flow->actions & @@ -607,7 +607,7 @@ mlx5_flow_rxq_flags_trim(struct rte_eth_dev *dev, struct rte_flow *flow) break; } } - mlx5_flow_rxq_tunnel_ptype_update(rxq_ctrl); + flow_rxq_tunnel_ptype_update(rxq_ctrl); } } } @@ -619,7 +619,7 @@ mlx5_flow_rxq_flags_trim(struct rte_eth_dev *dev, struct rte_flow *flow) * Pointer to Ethernet device. */ static void -mlx5_flow_rxq_flags_clear(struct rte_eth_dev *dev) +flow_rxq_flags_clear(struct rte_eth_dev *dev) { struct priv *priv = dev->data->dev_private; unsigned int i; @@ -1914,7 +1914,7 @@ mlx5_flow_validate(struct rte_eth_dev *dev, * Pointer to the RSS action if exist, else return NULL. */ static const struct rte_flow_action_rss* -mlx5_flow_get_rss_action(const struct rte_flow_action actions[]) +flow_get_rss_action(const struct rte_flow_action actions[]) { for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) { switch (actions->type) { @@ -1929,7 +1929,7 @@ mlx5_flow_get_rss_action(const struct rte_flow_action actions[]) } static unsigned int -mlx5_find_graph_root(const struct rte_flow_item pattern[], uint32_t rss_level) +find_graph_root(const struct rte_flow_item pattern[], uint32_t rss_level) { const struct rte_flow_item *item; unsigned int has_vlan = 0; @@ -1967,12 +1967,11 @@ mlx5_find_graph_root(const struct rte_flow_item pattern[], uint32_t rss_level) * A flow on success, NULL otherwise and rte_errno is set. */ static struct rte_flow * -mlx5_flow_list_create(struct rte_eth_dev *dev, - struct mlx5_flows *list, - const struct rte_flow_attr *attr, - const struct rte_flow_item items[], - const struct rte_flow_action actions[], - struct rte_flow_error *error) +flow_list_create(struct rte_eth_dev *dev, struct mlx5_flows *list, + const struct rte_flow_attr *attr, + const struct rte_flow_item items[], + const struct rte_flow_action actions[], + struct rte_flow_error *error) { struct rte_flow *flow = NULL; struct mlx5_flow *dev_flow; @@ -1992,7 +1991,7 @@ mlx5_flow_list_create(struct rte_eth_dev *dev, if (ret < 0) return NULL; flow_size = sizeof(struct rte_flow); - rss = mlx5_flow_get_rss_action(actions); + rss = flow_get_rss_action(actions); if (rss) flow_size += RTE_ALIGN_CEIL(rss->queue_num * sizeof(uint16_t), sizeof(void *)); @@ -2007,7 +2006,7 @@ mlx5_flow_list_create(struct rte_eth_dev *dev, if (rss && rss->types) { unsigned int graph_root; - graph_root = mlx5_find_graph_root(items, rss->level); + graph_root = find_graph_root(items, rss->level); ret = rte_flow_expand_rss(buf, sizeof(expand_buffer.buffer), items, rss->types, mlx5_support_expansion, @@ -2038,7 +2037,7 @@ mlx5_flow_list_create(struct rte_eth_dev *dev, goto error; } TAILQ_INSERT_TAIL(list, flow, next); - mlx5_flow_rxq_flags_set(dev, flow); + flow_rxq_flags_set(dev, flow); return flow; error: ret = rte_errno; /* Save rte_errno before cleanup. */ @@ -2062,9 +2061,9 @@ mlx5_flow_create(struct rte_eth_dev *dev, const struct rte_flow_action actions[], struct rte_flow_error *error) { - return mlx5_flow_list_create - (dev, &((struct priv *)dev->data->dev_private)->flows, - attr, items, actions, error); + return flow_list_create(dev, + &((struct priv *)dev->data->dev_private)->flows, + attr, items, actions, error); } /** @@ -2078,8 +2077,8 @@ mlx5_flow_create(struct rte_eth_dev *dev, * Flow to destroy. */ static void -mlx5_flow_list_destroy(struct rte_eth_dev *dev, struct mlx5_flows *list, - struct rte_flow *flow) +flow_list_destroy(struct rte_eth_dev *dev, struct mlx5_flows *list, + struct rte_flow *flow) { flow_drv_destroy(dev, flow); TAILQ_REMOVE(list, flow, next); @@ -2088,7 +2087,7 @@ mlx5_flow_list_destroy(struct rte_eth_dev *dev, struct mlx5_flows *list, * already clean. */ if (dev->data->dev_started) - mlx5_flow_rxq_flags_trim(dev, flow); + flow_rxq_flags_trim(dev, flow); rte_free(flow); } @@ -2107,7 +2106,7 @@ mlx5_flow_list_flush(struct rte_eth_dev *dev, struct mlx5_flows *list) struct rte_flow *flow; flow = TAILQ_FIRST(list); - mlx5_flow_list_destroy(dev, list, flow); + flow_list_destroy(dev, list, flow); } } @@ -2126,7 +2125,7 @@ mlx5_flow_stop(struct rte_eth_dev *dev, struct mlx5_flows *list) TAILQ_FOREACH_REVERSE(flow, list, mlx5_flows, next) flow_drv_remove(dev, flow); - mlx5_flow_rxq_flags_clear(dev); + flow_rxq_flags_clear(dev); } /** @@ -2151,7 +2150,7 @@ mlx5_flow_start(struct rte_eth_dev *dev, struct mlx5_flows *list) ret = flow_drv_apply(dev, flow, &error); if (ret < 0) goto error; - mlx5_flow_rxq_flags_set(dev, flow); + flow_rxq_flags_set(dev, flow); } return 0; error: @@ -2260,8 +2259,8 @@ mlx5_ctrl_flow_vlan(struct rte_eth_dev *dev, } for (i = 0; i != priv->reta_idx_n; ++i) queue[i] = (*priv->reta_idx)[i]; - flow = mlx5_flow_list_create(dev, &priv->ctrl_flows, &attr, items, - actions, &error); + flow = flow_list_create(dev, &priv->ctrl_flows, + &attr, items, actions, &error); if (!flow) return -rte_errno; return 0; @@ -2301,7 +2300,7 @@ mlx5_flow_destroy(struct rte_eth_dev *dev, { struct priv *priv = dev->data->dev_private; - mlx5_flow_list_destroy(dev, &priv->flows, flow); + flow_list_destroy(dev, &priv->flows, flow); return 0; } @@ -2609,9 +2608,8 @@ mlx5_fdir_filter_add(struct rte_eth_dev *dev, ret = mlx5_fdir_filter_convert(dev, fdir_filter, &attributes); if (ret) return ret; - flow = mlx5_flow_list_create(dev, &priv->flows, &attributes.attr, - attributes.items, attributes.actions, - &error); + flow = flow_list_create(dev, &priv->flows, &attributes.attr, + attributes.items, attributes.actions, &error); if (flow) { DRV_LOG(DEBUG, "port %u FDIR created %p", dev->data->port_id, (void *)flow);