From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id B8456379E for ; Fri, 16 Dec 2016 17:25:31 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id a197so38655238wmd.0 for ; Fri, 16 Dec 2016 08:25:31 -0800 (PST) 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=La+Tw5QgMJlBhARnCCJO2P+Dmw2g1G6S/kYUsSL0yuc=; b=EEYL/mYxlnv14YyC0YHnRq6gLtaYnWrvzH9UYmOzrOoYRxxCgAAf+xogWcgIegZuY1 PrVaz7QpDIeLR24tGh4SZNUU9xfGvsARXmvGfm2RbIq8p9IMHuqu7h1Y5IHhee2NRCCO vDL8X4Xu9Az7Go81uSyyQgd+GiTocDn73ucTIxnOOOLOoOBJC8qTLxn8iOuRwhyvrnmp p0RVGc7FriWDgFgccLW5JM0oce6wh6546ZRtK5CMvtW9FliFoBzuyfcY5+IpcUTPG1Ut /Wgde0vHp1dddjCEwh9BAwWL1xnNiN6L4jJrssFMx5MMfK2Jj/XF13RbPWtCVF9fJX30 rL1g== 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=La+Tw5QgMJlBhARnCCJO2P+Dmw2g1G6S/kYUsSL0yuc=; b=rJDqJ1YHsuBmKK6jdqtu7DDx+WuQnt/G5szRn2XbLnn2T3QTb46AaSAflDmQUaOb6U uNrjgzmcsVVc+khY3MFSkh9gYq5uvY5o8XJhw0FNW2FRhSR7uh9JX+c/8PMosHz2svoM 4/XCs+Ls5rJOi3JfwiRFYxn2lF6lI8FePF9qJJBEOQXvWG6DtUXdIBKLW9q4OXkYE2vh +Lm1INSP+OSEVpHGmqnJlHTKbd5ZDsNcN55CqcSX5m9DiSeGjzsMlrFq0E9EIWZWlp32 Ctuh5dzJCRZE1wIKnPqjkPXcL9ieaUdQCcJCITadKuEiwWOhcPQoWAjHrUCU+xO22TTH zcuA== X-Gm-Message-State: AIkVDXIvzZ5moIdDr/GHOCVZhXKzAZHlBudYz8EtdO7zyfU1GcHQJAbWSnl1FqGggSngCqOx X-Received: by 10.28.134.146 with SMTP id i140mr4000412wmd.100.1481905531196; Fri, 16 Dec 2016 08:25:31 -0800 (PST) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id c133sm4050459wme.12.2016.12.16.08.25.29 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 16 Dec 2016 08:25:30 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Fri, 16 Dec 2016 17:24:57 +0100 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 00/25] Generic flow API (rte_flow) 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: Fri, 16 Dec 2016 16:25:31 -0000 As previously discussed in RFC v1 [1], RFC v2 [2], with changes described in [3] (also pasted below), here is the first non-draft series for this new API. Its capabilities are so generic that its name had to be vague, it may be called "Generic flow API", "Generic flow interface" (possibly shortened as "GFI") to refer to the name of the new filter type, or "rte_flow" from the prefix used for its public symbols. I personally favor the latter. While it is currently meant to supersede existing filter types in order for all PMDs to expose a common filtering/classification interface, it may eventually evolve to cover the following ideas as well: - Rx/Tx offloads configuration through automatic offloads for specific packets, e.g. performing checksum on TCP packets could be expressed with an egress rule with a TCP pattern and a kind of checksum action. - RSS configuration (already defined actually). Could be global or per rule depending on hardware capabilities. - Switching configuration for devices with many physical ports; rules doing both ingress and egress could even be used to completely bypass software if supported by hardware. [1] http://dpdk.org/ml/archives/dev/2016-July/043365.html [2] http://dpdk.org/ml/archives/dev/2016-August/045383.html [3] http://dpdk.org/ml/archives/dev/2016-November/050044.html Changes since v1 series: - Added programmer's guide documentation for rte_flow. - Added depreciation notice for the legacy API. - Documented testpmd flow command. - Fixed missing rte_flow_flush symbol in rte_ether_version.map. - Cleaned up API documentation in rte_flow.h. - Replaced "min/max" parameters with "num" in struct rte_flow_item_any, to align behavior with other item definitions. - Fixed "type" (EtherType) size in struct rte_flow_item_eth. - Renamed "queues" to "num" in struct rte_flow_action_rss. - Fixed missing const in rte_flow_error_set() prototype definition. - Fixed testpmd flow create command that did not save the rte_flow object pointer, causing crashes. - Hopefully fixed all the remaining ICC/clang errors. - Replaced testpmd flow command's "fix" token with "is" for clarity. Changes since RFC v2: - New separate VLAN pattern item (previously part of the ETH definition), found to be much more convenient. - Removed useless "any" field from VF pattern item, the same effect can be achieved by not providing a specification structure. - Replaced bit-fields from the VXLAN pattern item to avoid endianness conversion issues on 24-bit fields. - Updated struct rte_flow_item with a new "last" field to create inclusive ranges. They are defined as the interval between (spec & mask) and (last & mask). All three parameters are optional. - Renamed ID action MARK. - Renamed "queue" fields in actions QUEUE and DUP to "index". - "rss_conf" field in RSS action is now const. - VF action now uses a 32 bit ID like its pattern item counterpart. - Removed redundant struct rte_flow_pattern, API functions now expect struct rte_flow_item lists terminated by END items. - Replaced struct rte_flow_actions for the same reason, with struct rte_flow_action lists terminated by END actions. - Error types (enum rte_flow_error_type) have been updated and the cause pointer in struct rte_flow_error is now const. - Function prototypes (rte_flow_create, rte_flow_validate) have also been updated for clarity. Additions: - Public wrapper functions rte_flow_{validate|create|destroy|flush|query} are now implemented in rte_flow.c, with their symbols exported and versioned. Related filter type RTE_ETH_FILTER_GENERIC has been added. - A separate header (rte_flow_driver.h) has been added for driver-side functionality, in particular struct rte_flow_ops which contains PMD callbacks returned by RTE_ETH_FILTER_GENERIC query. - testpmd now exposes most of this API through the new "flow" command. What remains to be done: - Using endian-aware integer types (rte_beX_t) where necessary for clarity. - API documentation (based on RFC). - testpmd flow command documentation (although context-aware command completion should already help quite a bit in this regard). - A few pattern item / action properties cannot be configured yet (e.g. rss_conf parameter for RSS action) and a few completions (e.g. possible queue IDs) should be added. Adrien Mazarguil (25): ethdev: introduce generic flow API doc: add rte_flow prog guide doc: announce depreciation of legacy filter types cmdline: add support for dynamic tokens cmdline: add alignment constraint app/testpmd: implement basic support for rte_flow app/testpmd: add flow command app/testpmd: add rte_flow integer support app/testpmd: add flow list command app/testpmd: add flow flush command app/testpmd: add flow destroy command app/testpmd: add flow validate/create commands app/testpmd: add flow query command app/testpmd: add rte_flow item spec handler app/testpmd: add rte_flow item spec prefix length app/testpmd: add rte_flow bit-field support app/testpmd: add item any to flow command app/testpmd: add various items to flow command app/testpmd: add item raw to flow command app/testpmd: add items eth/vlan to flow command app/testpmd: add items ipv4/ipv6 to flow command app/testpmd: add L4 items to flow command app/testpmd: add various actions to flow command app/testpmd: add queue actions to flow command doc: describe testpmd flow command MAINTAINERS | 4 + app/test-pmd/Makefile | 1 + app/test-pmd/cmdline.c | 32 + app/test-pmd/cmdline_flow.c | 2575 ++++++++++++++++++++++ app/test-pmd/config.c | 485 ++++ app/test-pmd/csumonly.c | 1 + app/test-pmd/flowgen.c | 1 + app/test-pmd/icmpecho.c | 1 + app/test-pmd/ieee1588fwd.c | 1 + app/test-pmd/iofwd.c | 1 + app/test-pmd/macfwd.c | 1 + app/test-pmd/macswap.c | 1 + app/test-pmd/parameters.c | 1 + app/test-pmd/rxonly.c | 1 + app/test-pmd/testpmd.c | 6 + app/test-pmd/testpmd.h | 27 + app/test-pmd/txonly.c | 1 + doc/api/doxy-api-index.md | 2 + doc/guides/prog_guide/index.rst | 1 + doc/guides/prog_guide/rte_flow.rst | 1853 ++++++++++++++++ doc/guides/rel_notes/deprecation.rst | 7 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 612 +++++ lib/librte_cmdline/cmdline_parse.c | 67 +- lib/librte_cmdline/cmdline_parse.h | 21 + lib/librte_ether/Makefile | 3 + lib/librte_ether/rte_eth_ctrl.h | 1 + lib/librte_ether/rte_ether_version.map | 11 + lib/librte_ether/rte_flow.c | 159 ++ lib/librte_ether/rte_flow.h | 942 ++++++++ lib/librte_ether/rte_flow_driver.h | 181 ++ 30 files changed, 6991 insertions(+), 9 deletions(-) create mode 100644 app/test-pmd/cmdline_flow.c create mode 100644 doc/guides/prog_guide/rte_flow.rst create mode 100644 lib/librte_ether/rte_flow.c create mode 100644 lib/librte_ether/rte_flow.h create mode 100644 lib/librte_ether/rte_flow_driver.h -- 2.1.4