Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/44073/?format=api
http://patches.dpdk.org/api/patches/44073/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180831085337.21419-6-adrien.mazarguil@6wind.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20180831085337.21419-6-adrien.mazarguil@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180831085337.21419-6-adrien.mazarguil@6wind.com", "date": "2018-08-31T09:01:09", "name": "[v3,5/7] net/bonding: switch to flow API object conversion function", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "d1f755b94bf9539b62ad526194617ad19567965c", "submitter": { "id": 165, "url": "http://patches.dpdk.org/api/people/165/?format=api", "name": "Adrien Mazarguil", "email": "adrien.mazarguil@6wind.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180831085337.21419-6-adrien.mazarguil@6wind.com/mbox/", "series": [ { "id": 1123, "url": "http://patches.dpdk.org/api/series/1123/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1123", "date": "2018-08-31T09:00:57", "name": "ethdev: add flow API object converter", "version": 3, "mbox": "http://patches.dpdk.org/series/1123/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/44073/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/44073/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C14FB5592;\n\tFri, 31 Aug 2018 11:01:45 +0200 (CEST)", "from mail-wm0-f68.google.com (mail-wm0-f68.google.com\n\t[74.125.82.68]) by dpdk.org (Postfix) with ESMTP id F2FAD4CC3\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 11:01:28 +0200 (CEST)", "by mail-wm0-f68.google.com with SMTP id j192-v6so4604372wmj.1\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 02:01:28 -0700 (PDT)", "from 6wind.com (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\te5-v6sm3021656wmh.29.2018.08.31.02.01.24\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 31 Aug 2018 02:01:24 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to;\n\tbh=WL1ZCGXmmmOi1dEv8prvXA3nQwRxNiW26HZHh7kqZKI=;\n\tb=xnnDmbQYhDMRv8SZiZhrdSnACRRucdjp6eJF389xwQF1CuVOwmw9uL9i5cgbQyvLy2\n\t4x5+5+zxfCTPsEhHEHwclcd2kNlNDEsYg4SZQsYEMlfID49x+yCHABcr+naJqZc6pE5n\n\tLJ8iQzDTAlfzvo+F8SYvb5pUjc3piKyDsvQTnMeSSXQARZ3Izd4AigDnRPV6ypV94/Jy\n\ttyIQpwDp9mRxeDJYJ2eODuFalKdAcZ8ybj4Otkui9nIQvLikeccqvX3Oc3BkqN4nw4U4\n\t97Uax1E1QuIwBer7V+QTuz+DDePWvPHqa6eqLYM47d76EWGcbCFuXhkaFsSdh0xqsOSE\n\tXkmA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to;\n\tbh=WL1ZCGXmmmOi1dEv8prvXA3nQwRxNiW26HZHh7kqZKI=;\n\tb=r198qaVg2ox8/qWbzrUVu4KQurNEH3i2Qyi8BoosY3XHQTbrHTEw6Ye6Hvf+XtxA0p\n\teEeRD0OChBqIVLTgY+cZqsVedV1tjTRwxDz1G6XSlU7CdCgSIoIdFiIHB7obv1Y71KuH\n\tccfEf3NxqvcEkmC8MHECODF96HHb6FErYpoWgbmGutwG2YI7m81Ohsv/MeM748X8iLCB\n\tZ00XhZ+gWuQ9xBmCOHFi36JFHYiQ7ppRKKwAKLeR+YFjbyOix//gTmXItz1QlweUq6zk\n\thhkkL/I2wbXyf2N+28GVYdirrQSTQvDCDbD/VBtcY2pF1Kf5ZuNwzeQpG0pXmYBsOY9d\n\tEK4g==", "X-Gm-Message-State": "APzg51AzmfGLbP3FsBz4MIGThT23r+3Eo0rUXUfZOYqhq86B4umbMGH3\n\tjtuO4GjXyyhXsdBZ//h0sor6zA==", "X-Google-Smtp-Source": "ANB0VdbZX+Z8q6LAtTHwX6ljAU78kKotvwhEYakPXlxl/qGCD+xJhb7f9Q3PwyuK8eu05381N5dJhg==", "X-Received": "by 2002:a1c:3e8f:: with SMTP id\n\tl137-v6mr3951783wma.132.1535706085720; \n\tFri, 31 Aug 2018 02:01:25 -0700 (PDT)", "Date": "Fri, 31 Aug 2018 11:01:09 +0200", "From": "Adrien Mazarguil <adrien.mazarguil@6wind.com>", "To": "Ferruh Yigit <ferruh.yigit@intel.com>", "Cc": "dev@dpdk.org, Declan Doherty <declan.doherty@intel.com>,\n\tChas Williams <chas3@att.com>", "Message-ID": "<20180831085337.21419-6-adrien.mazarguil@6wind.com>", "References": "<20180803132032.29038-1-adrien.mazarguil@6wind.com>\n\t<20180831085337.21419-1-adrien.mazarguil@6wind.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=us-ascii", "Content-Disposition": "inline", "In-Reply-To": "<20180831085337.21419-1-adrien.mazarguil@6wind.com>", "X-Mailer": "git-send-email 2.11.0", "Subject": "[dpdk-dev] [PATCH v3 5/7] net/bonding: switch to flow API object\n\tconversion function", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch replaces rte_flow_copy() with rte_flow_conv().\n\nSigned-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\nCc: Declan Doherty <declan.doherty@intel.com>\nCc: Chas Williams <chas3@att.com>\n--\nv3 changes:\n\n- Added build directives to allow experimental APIs, now needed for\n rte_flow_conv().\n\nv2 changes:\n\n- Patch was not present in original series.\n---\n drivers/net/bonding/Makefile | 1 +\n drivers/net/bonding/meson.build | 1 +\n drivers/net/bonding/rte_eth_bond_api.c | 6 ++---\n drivers/net/bonding/rte_eth_bond_flow.c | 31 +++++++++++++++++++------\n drivers/net/bonding/rte_eth_bond_private.h | 5 +++-\n 5 files changed, 33 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile\nindex acad16a1a..1893e3cad 100644\n--- a/drivers/net/bonding/Makefile\n+++ b/drivers/net/bonding/Makefile\n@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk\n #\n LIB = librte_pmd_bond.a\n \n+CFLAGS += -DALLOW_EXPERIMENTAL_API\n CFLAGS += -O3\n CFLAGS += $(WERROR_FLAGS)\n LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring\ndiff --git a/drivers/net/bonding/meson.build b/drivers/net/bonding/meson.build\nindex 602d28803..00374edb2 100644\n--- a/drivers/net/bonding/meson.build\n+++ b/drivers/net/bonding/meson.build\n@@ -3,6 +3,7 @@\n \n name = 'bond' #, james bond :-)\n version = 2\n+allow_experimental_apis = true\n sources = files('rte_eth_bond_api.c', 'rte_eth_bond_pmd.c', 'rte_eth_bond_flow.c',\n \t'rte_eth_bond_args.c', 'rte_eth_bond_8023ad.c', 'rte_eth_bond_alb.c')\n \ndiff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c\nindex 8bc04cfd1..a438fc509 100644\n--- a/drivers/net/bonding/rte_eth_bond_api.c\n+++ b/drivers/net/bonding/rte_eth_bond_api.c\n@@ -245,9 +245,9 @@ slave_rte_flow_prepare(uint16_t slave_id, struct bond_dev_private *internals)\n \t}\n \tTAILQ_FOREACH(flow, &internals->flow_list, next) {\n \t\tflow->flows[slave_id] = rte_flow_create(slave_port_id,\n-\t\t\t\t\t\t\t&flow->fd->attr,\n-\t\t\t\t\t\t\tflow->fd->items,\n-\t\t\t\t\t\t\tflow->fd->actions,\n+\t\t\t\t\t\t\tflow->rule.attr,\n+\t\t\t\t\t\t\tflow->rule.pattern,\n+\t\t\t\t\t\t\tflow->rule.actions,\n \t\t\t\t\t\t\t&ferror);\n \t\tif (flow->flows[slave_id] == NULL) {\n \t\t\tRTE_BOND_LOG(ERR, \"Cannot create flow for slave\"\ndiff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c\nindex 31e4bcaeb..f94d46ca4 100644\n--- a/drivers/net/bonding/rte_eth_bond_flow.c\n+++ b/drivers/net/bonding/rte_eth_bond_flow.c\n@@ -2,8 +2,11 @@\n * Copyright 2018 Mellanox Technologies, Ltd\n */\n \n+#include <stddef.h>\n+#include <string.h>\n #include <sys/queue.h>\n \n+#include <rte_errno.h>\n #include <rte_malloc.h>\n #include <rte_tailq.h>\n #include <rte_flow.h>\n@@ -16,19 +19,33 @@ bond_flow_alloc(int numa_node, const struct rte_flow_attr *attr,\n \t\t const struct rte_flow_action *actions)\n {\n \tstruct rte_flow *flow;\n-\tsize_t fdsz;\n+\tconst struct rte_flow_conv_rule rule = {\n+\t\t.attr_ro = attr,\n+\t\t.pattern_ro = items,\n+\t\t.actions_ro = actions,\n+\t};\n+\tstruct rte_flow_error error;\n+\tint ret;\n \n-\tfdsz = rte_flow_copy(NULL, 0, attr, items, actions);\n-\tflow = rte_zmalloc_socket(NULL, sizeof(struct rte_flow) + fdsz,\n+\tret = rte_flow_conv(RTE_FLOW_CONV_OP_RULE, NULL, 0, &rule, &error);\n+\tif (ret < 0) {\n+\t\tRTE_BOND_LOG(ERR, \"Unable to process flow rule (%s): %s\",\n+\t\t\t error.message ? error.message : \"unspecified\",\n+\t\t\t strerror(rte_errno));\n+\t\treturn NULL;\n+\t}\n+\tflow = rte_zmalloc_socket(NULL, offsetof(struct rte_flow, rule) + ret,\n \t\t\t\t RTE_CACHE_LINE_SIZE, numa_node);\n \tif (unlikely(flow == NULL)) {\n \t\tRTE_BOND_LOG(ERR, \"Could not allocate new flow\");\n \t\treturn NULL;\n \t}\n-\tflow->fd = (void *)((uintptr_t)flow + sizeof(*flow));\n-\tif (unlikely(rte_flow_copy(flow->fd, fdsz, attr, items, actions) !=\n-\t\t fdsz)) {\n-\t\tRTE_BOND_LOG(ERR, \"Failed to copy flow description\");\n+\tret = rte_flow_conv(RTE_FLOW_CONV_OP_RULE, &flow->rule, ret, &rule,\n+\t\t\t &error);\n+\tif (ret < 0) {\n+\t\tRTE_BOND_LOG(ERR, \"Failed to copy flow rule (%s): %s\",\n+\t\t\t error.message ? error.message : \"unspecified\",\n+\t\t\t strerror(rte_errno));\n \t\trte_free(flow);\n \t\treturn NULL;\n \t}\ndiff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h\nindex 43e0e448d..61202845e 100644\n--- a/drivers/net/bonding/rte_eth_bond_private.h\n+++ b/drivers/net/bonding/rte_eth_bond_private.h\n@@ -5,9 +5,11 @@\n #ifndef _RTE_ETH_BOND_PRIVATE_H_\n #define _RTE_ETH_BOND_PRIVATE_H_\n \n+#include <stdint.h>\n #include <sys/queue.h>\n \n #include <rte_ethdev_driver.h>\n+#include <rte_flow.h>\n #include <rte_spinlock.h>\n #include <rte_bitmap.h>\n #include <rte_flow_driver.h>\n@@ -93,7 +95,8 @@ struct rte_flow {\n \t/* Slaves flows */\n \tstruct rte_flow *flows[RTE_MAX_ETHPORTS];\n \t/* Flow description for synchronization */\n-\tstruct rte_flow_desc *fd;\n+\tstruct rte_flow_conv_rule rule;\n+\tuint8_t rule_data[];\n };\n \n typedef void (*burst_xmit_hash_t)(struct rte_mbuf **buf, uint16_t nb_pkts,\n", "prefixes": [ "v3", "5/7" ] }{ "id": 44073, "url": "