From patchwork Thu Feb 21 12:07:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ophir Munk X-Patchwork-Id: 1046136 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444vWY1mZTz9s1b for ; Thu, 21 Feb 2019 23:52:24 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id B9F593A83; Thu, 21 Feb 2019 12:52:21 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 5EA123841 for ; Thu, 21 Feb 2019 12:48:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 30CEC78C for ; Thu, 21 Feb 2019 12:48:30 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from ophirmu@mellanox.com) with ESMTPS (AES256-SHA encrypted); 21 Feb 2019 14:48:28 +0200 Received: from localhost.localdomain (pegasus05.mtr.labs.mlnx [10.210.16.100]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x1LCmSkr014465; Thu, 21 Feb 2019 14:48:28 +0200 Received: from pegasus05.mtr.labs.mlnx (localhost [127.0.0.1]) by localhost.localdomain (8.14.7/8.14.7) with ESMTP id x1LC8VZu025065; Thu, 21 Feb 2019 12:08:31 GMT Received: (from root@localhost) by pegasus05.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id x1LC8Vc0025064; Thu, 21 Feb 2019 12:08:31 GMT From: Ophir Munk To: ovs-dev@openvswitch.org Date: Thu, 21 Feb 2019 12:07:50 +0000 Message-Id: <1550750870-25004-4-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1550750870-25004-1-git-send-email-ophirmu@mellanox.com> References: <1550506563-26782-3-git-send-email-ophirmu@mellanox.com> <1550750870-25004-1-git-send-email-ophirmu@mellanox.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Roni Bar Yanai , Flavio Leitner , Ilya Maximets Subject: [ovs-dev] [PATCH v2 3/3] netdev-rte-offloads: Rename netdev_dpdk_* functions X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Rename all the netdev_dpdk_* functions names (originated from the file netdev-dpdk.c) into the netdev_rte_offloads_* functions names. Signed-off-by: Ophir Munk --- lib/netdev-rte-offloads.c | 39 ++++++++++++++++++++------------------- lib/netdev-rte-offloads.h | 17 +++++++++-------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/lib/netdev-rte-offloads.c b/lib/netdev-rte-offloads.c index 0212156..d87a8c4 100644 --- a/lib/netdev-rte-offloads.c +++ b/lib/netdev-rte-offloads.c @@ -382,12 +382,12 @@ add_flow_rss_action(struct flow_actions *actions, } static int -netdev_dpdk_add_rte_flow_offload(struct netdev *netdev, - const struct match *match, - struct nlattr *nl_actions OVS_UNUSED, - size_t actions_len OVS_UNUSED, - const ovs_u128 *ufid, - struct offload_info *info) { +netdev_rte_offloads_add_flow(struct netdev *netdev, + const struct match *match, + struct nlattr *nl_actions OVS_UNUSED, + size_t actions_len OVS_UNUSED, + const ovs_u128 *ufid, + struct offload_info *info) { const struct rte_flow_attr flow_attr = { .group = 0, .priority = 0, @@ -596,8 +596,9 @@ end_proto_check: rss = add_flow_rss_action(&actions, netdev); add_flow_action(&actions, RTE_FLOW_ACTION_TYPE_END, NULL); - flow = netdev_dpdk_rte_flow_create(netdev, &flow_attr,patterns.items, - actions.actions, &error); + flow = netdev_dpdk_rte_flow_create(netdev, &flow_attr, + patterns.items, + actions.actions, &error); free(rss); if (!flow) { @@ -634,7 +635,7 @@ is_all_zero(const void *addr, size_t n) { * Check if any unsupported flow patterns are specified. */ static int -netdev_dpdk_validate_flow(const struct match *match) { +netdev_rte_offloads_validate_flow(const struct match *match) { struct match match_zero_wc; /* Create a wc-zeroed version of flow */ @@ -712,9 +713,9 @@ err: } static int -netdev_dpdk_destroy_rte_flow(struct netdev *netdev, - const ovs_u128 *ufid, - struct rte_flow *rte_flow) { +netdev_rte_offloads_destroy_flow(struct netdev *netdev, + const ovs_u128 *ufid, + struct rte_flow *rte_flow) { struct rte_flow_error error; int ret = netdev_dpdk_rte_flow_destroy(netdev, rte_flow, &error); @@ -732,7 +733,7 @@ netdev_dpdk_destroy_rte_flow(struct netdev *netdev, } int -netdev_dpdk_flow_put(struct netdev *netdev, struct match *match, +netdev_rte_offloads_flow_put(struct netdev *netdev, struct match *match, struct nlattr *actions, size_t actions_len, const ovs_u128 *ufid, struct offload_info *info, struct dpif_flow_stats *stats OVS_UNUSED) { @@ -745,23 +746,23 @@ netdev_dpdk_flow_put(struct netdev *netdev, struct match *match, */ rte_flow = ufid_to_rte_flow_find(ufid); if (rte_flow) { - ret = netdev_dpdk_destroy_rte_flow(netdev, ufid, rte_flow); + ret = netdev_rte_offloads_destroy_flow(netdev, ufid, rte_flow); if (ret < 0) { return ret; } } - ret = netdev_dpdk_validate_flow(match); + ret = netdev_rte_offloads_validate_flow(match); if (ret < 0) { return ret; } - return netdev_dpdk_add_rte_flow_offload(netdev, match, actions, - actions_len, ufid, info); + return netdev_rte_offloads_add_flow(netdev, match, actions, + actions_len, ufid, info); } int -netdev_dpdk_flow_del(struct netdev *netdev, const ovs_u128 *ufid, +netdev_rte_offloads_flow_del(struct netdev *netdev, const ovs_u128 *ufid, struct dpif_flow_stats *stats OVS_UNUSED) { struct rte_flow *rte_flow = ufid_to_rte_flow_find(ufid); @@ -770,6 +771,6 @@ netdev_dpdk_flow_del(struct netdev *netdev, const ovs_u128 *ufid, return -1; } - return netdev_dpdk_destroy_rte_flow(netdev, ufid, rte_flow); + return netdev_rte_offloads_destroy_flow(netdev, ufid, rte_flow); } diff --git a/lib/netdev-rte-offloads.h b/lib/netdev-rte-offloads.h index 573e214..1609171 100644 --- a/lib/netdev-rte-offloads.h +++ b/lib/netdev-rte-offloads.h @@ -24,15 +24,16 @@ struct nlattr; struct offload_info; struct dpif_flow_stats; -int netdev_dpdk_flow_put(struct netdev *netdev, struct match *match, - struct nlattr *actions, size_t actions_len, - const ovs_u128 *ufid, struct offload_info *info, - struct dpif_flow_stats *stats OVS_UNUSED); -int netdev_dpdk_flow_del(struct netdev *netdev, const ovs_u128 *ufid, - struct dpif_flow_stats *stats OVS_UNUSED); +int netdev_rte_offloads_flow_put(struct netdev *netdev, struct match *match, + struct nlattr *actions, size_t actions_len, + const ovs_u128 *ufid, + struct offload_info *info, + struct dpif_flow_stats *stats OVS_UNUSED); +int netdev_rte_offloads_flow_del(struct netdev *netdev, const ovs_u128 *ufid, + struct dpif_flow_stats *stats OVS_UNUSED); #define DPDK_FLOW_OFFLOAD_API \ - .flow_put = netdev_dpdk_flow_put, \ - .flow_del = netdev_dpdk_flow_del + .flow_put = netdev_rte_offloads_flow_put, \ + .flow_del = netdev_rte_offloads_flow_del #endif /* netdev-rte-offloads.h */