From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 2798D7F6D for ; Wed, 25 Apr 2018 17:28:22 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id w3-v6so53736747wrg.2 for ; Wed, 25 Apr 2018 08:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=y22KGTmNfSjPaYeWtroqg9PAVcPJca0LYd2I9zvVvCY=; b=GIVhi8n/jF8gnPhYt455z44ShRn1JOSTlmndeeMMAsMgXJL2fjB5E4VGzuuNWxG9Fb ogw1OMrxO9Q9t5EOvFq3l/Q6hGtRIjYHxz3GKJ4ipAfqY8G4SFLjSvZ8Z4L78z9OAdkN XxeFcRdR6TqzebE2E1cNPBNmyaftO4QnssdkPzlo80IHTBsZd86WkMXl9A3yk4/TQ4nQ ubb2g9Q9ROpyQFokvuCilBxALU3ExMbFuVSoKvqqk4FFo8L29AcK3efmtceHF0pCoTnK YvEYS1MTWcDvBv/i5INQ/Si+Jra2b3BEyEdKN5S+why9tSsYHLan25U0RfdsHWeukVRU jeIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=y22KGTmNfSjPaYeWtroqg9PAVcPJca0LYd2I9zvVvCY=; b=mcR0UmFtJ7PIjy0u7AIogkAqI5x4iV2BN0InUV7BiT2FK/pCIsH2pC5Jlph/7tcgIZ YshAOukfh0YCXRXbS+Mx8lNNjUauHSnmaQry3P4i42RJqpU1Dlh0uwAa3PvqtMVI/U5x n76+5624BUAwAxtsUejXS+97XEXtxBW9FC7JbTjwiCUrrjb63D2Vgwl3dFQWBvf6f3/Y Qe62oWY9zMKpEitF188JGXkXbQfeNe7O7/LUIMgEroyrBwbtxhze5M4PqAx4Nrz0pnVy yc08gdJQoQqcjeX8Wsk6LhMgop7WzX9ygMD85x91XNdoY42KHAPJWMIOeNeQ+0AzaoZ2 4E7Q== X-Gm-Message-State: ALQs6tD4ni6Xh1WisPfO8bjqiHJn9MQPcAn1c1sBI6IiG4HfmXQ0Xhfc mQCNj4sNDM0299X5fhTnGrWycQ== X-Google-Smtp-Source: AIpwx482Ix3ptshJWYfLot4UYjhn3CXVyPOF91wl1rt4D41G9Vyf7Rqzf0P446HWx6eYRdgCGTs4Gw== X-Received: by 2002:adf:8df7:: with SMTP id o110-v6mr24811969wrb.251.1524670100861; Wed, 25 Apr 2018 08:28:20 -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 y42-v6sm26319962wry.21.2018.04.25.08.28.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 08:28:20 -0700 (PDT) Date: Wed, 25 Apr 2018 17:28:06 +0200 From: Adrien Mazarguil To: Thomas Monjalon , Ferruh Yigit , dev@dpdk.org Message-ID: <20180425151852.7676-15-adrien.mazarguil@6wind.com> References: <20180419100848.6178-1-adrien.mazarguil@6wind.com> <20180425151852.7676-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180425151852.7676-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v6 14/16] ethdev: rename physical port item 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: , X-List-Received-Date: Wed, 25 Apr 2018 15:28:22 -0000 While RTE_FLOW_ITEM_TYPE_PORT refers to physical ports of the underlying device using specific identifiers, these are often confused with DPDK port IDs exposed to applications in the global name space. Since this pattern item is seldom used, rename it RTE_FLOW_ITEM_PHY_PORT for better clarity. No ABI impact. Signed-off-by: Adrien Mazarguil Acked-by: Andrew Rybchenko --- v6 changes: Updated API changes section in release notes. --- app/test-pmd/cmdline_flow.c | 27 +++++++++++---------- app/test-pmd/config.c | 2 +- doc/guides/prog_guide/rte_flow.rst | 22 ++++++++--------- doc/guides/rel_notes/release_18_05.rst | 2 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +- lib/librte_ether/rte_flow.c | 2 +- lib/librte_ether/rte_flow.h | 31 ++++++++++-------------- 7 files changed, 43 insertions(+), 45 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 41103de67..f9f937277 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -87,8 +87,8 @@ enum index { ITEM_PF, ITEM_VF, ITEM_VF_ID, - ITEM_PORT, - ITEM_PORT_INDEX, + ITEM_PHY_PORT, + ITEM_PHY_PORT_INDEX, ITEM_RAW, ITEM_RAW_RELATIVE, ITEM_RAW_SEARCH, @@ -441,7 +441,7 @@ static const enum index next_item[] = { ITEM_ANY, ITEM_PF, ITEM_VF, - ITEM_PORT, + ITEM_PHY_PORT, ITEM_RAW, ITEM_ETH, ITEM_VLAN, @@ -482,8 +482,8 @@ static const enum index item_vf[] = { ZERO, }; -static const enum index item_port[] = { - ITEM_PORT_INDEX, +static const enum index item_phy_port[] = { + ITEM_PHY_PORT_INDEX, ITEM_NEXT, ZERO, }; @@ -1059,18 +1059,19 @@ static const struct token token_list[] = { .next = NEXT(item_vf, NEXT_ENTRY(UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY(struct rte_flow_item_vf, id)), }, - [ITEM_PORT] = { - .name = "port", - .help = "device-specific physical port index to use", - .priv = PRIV_ITEM(PORT, sizeof(struct rte_flow_item_port)), - .next = NEXT(item_port), + [ITEM_PHY_PORT] = { + .name = "phy_port", + .help = "match traffic from/to a specific physical port", + .priv = PRIV_ITEM(PHY_PORT, + sizeof(struct rte_flow_item_phy_port)), + .next = NEXT(item_phy_port), .call = parse_vc, }, - [ITEM_PORT_INDEX] = { + [ITEM_PHY_PORT_INDEX] = { .name = "index", .help = "physical port index", - .next = NEXT(item_port, NEXT_ENTRY(UNSIGNED), item_param), - .args = ARGS(ARGS_ENTRY(struct rte_flow_item_port, index)), + .next = NEXT(item_phy_port, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_phy_port, index)), }, [ITEM_RAW] = { .name = "raw", diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index a06514acc..d168e515d 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -993,7 +993,7 @@ static const struct { MK_FLOW_ITEM(ANY, sizeof(struct rte_flow_item_any)), MK_FLOW_ITEM(PF, 0), MK_FLOW_ITEM(VF, sizeof(struct rte_flow_item_vf)), - MK_FLOW_ITEM(PORT, sizeof(struct rte_flow_item_port)), + MK_FLOW_ITEM(PHY_PORT, sizeof(struct rte_flow_item_phy_port)), MK_FLOW_ITEM(RAW, sizeof(struct rte_flow_item_raw)), MK_FLOW_ITEM(ETH, sizeof(struct rte_flow_item_eth)), MK_FLOW_ITEM(VLAN, sizeof(struct rte_flow_item_vlan)), diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index a0a124aa2..4e053c24b 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -195,8 +195,8 @@ When supported, this effectively enables an application to reroute traffic not necessarily intended for it (e.g. coming from or addressed to different physical ports, VFs or applications) at the device level. -It complements the behavior of some pattern items such as `Item: PORT`_ and -is meaningless without them. +It complements the behavior of some pattern items such as `Item: PHY_PORT`_ +and is meaningless without them. When transferring flow rules, **ingress** and **egress** attributes (`Attribute: Traffic direction`_) keep their original meaning, as if @@ -583,15 +583,15 @@ separate entities, should be addressed through their own DPDK port IDs. | ``mask`` | ``id`` | zeroed to match any VF ID | +----------+----------+---------------------------+ -Item: ``PORT`` -^^^^^^^^^^^^^^ +Item: ``PHY_PORT`` +^^^^^^^^^^^^^^^^^^ -Matches packets coming from the specified physical port of the underlying -device. +Matches traffic originating from (ingress) or going to (egress) a physical +port of the underlying device. -The first PORT item overrides the physical port normally associated with the -specified DPDK input port (port_id). This item can be provided several times -to match additional physical ports. +The first PHY_PORT item overrides the physical port normally associated with +the specified DPDK input port (port_id). This item can be provided several +times to match additional physical ports. Note that physical ports are not necessarily tied to DPDK input ports (port_id) when those are not under DPDK control. Possible values are @@ -603,9 +603,9 @@ associated with a port_id should be retrieved by other means. - Default ``mask`` matches any port index. -.. _table_rte_flow_item_port: +.. _table_rte_flow_item_phy_port: -.. table:: PORT +.. table:: PHY_PORT +----------+-----------+--------------------------------+ | Field | Subfield | Value | diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst index ea133971f..86dd710d2 100644 --- a/doc/guides/rel_notes/release_18_05.rst +++ b/doc/guides/rel_notes/release_18_05.rst @@ -271,6 +271,8 @@ API Changes * PF and VF pattern items are now only accepted by PMDs that implement them (bnxt and i40e) when the transfer attribute is also present for consistency. + * Pattern item PORT was renamed PHY_PORT to avoid confusion with DPDK port + IDs. ABI Changes diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 396a0599a..51d36d346 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3232,7 +3232,7 @@ This section lists supported pattern items and their attributes, if any. - ``id {unsigned}``: VF ID. -- ``port``: device-specific physical port index to use. +- ``phy_port``: match traffic from/to a specific physical port. - ``index {unsigned}``: physical port index. diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c index 83b733ff0..36e277a4f 100644 --- a/lib/librte_ether/rte_flow.c +++ b/lib/librte_ether/rte_flow.c @@ -38,7 +38,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = { MK_FLOW_ITEM(ANY, sizeof(struct rte_flow_item_any)), MK_FLOW_ITEM(PF, 0), MK_FLOW_ITEM(VF, sizeof(struct rte_flow_item_vf)), - MK_FLOW_ITEM(PORT, sizeof(struct rte_flow_item_port)), + MK_FLOW_ITEM(PHY_PORT, sizeof(struct rte_flow_item_phy_port)), MK_FLOW_ITEM(RAW, sizeof(struct rte_flow_item_raw)), MK_FLOW_ITEM(ETH, sizeof(struct rte_flow_item_eth)), MK_FLOW_ITEM(VLAN, sizeof(struct rte_flow_item_vlan)), diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index f1c7a664e..2c7c4d009 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -84,7 +84,7 @@ struct rte_flow_attr { * applications) at the device level. * * It complements the behavior of some pattern items such as - * RTE_FLOW_ITEM_TYPE_PORT and is meaningless without them. + * RTE_FLOW_ITEM_TYPE_PHY_PORT and is meaningless without them. * * When transferring flow rules, ingress and egress attributes keep * their original meaning, as if processing traffic emitted or @@ -172,17 +172,12 @@ enum rte_flow_item_type { /** * [META] * - * Matches packets coming from the specified physical port of the - * underlying device. - * - * The first PORT item overrides the physical port normally - * associated with the specified DPDK input port (port_id). This - * item can be provided several times to match additional physical - * ports. + * Matches traffic originating from (ingress) or going to (egress) a + * physical port of the underlying device. * - * See struct rte_flow_item_port. + * See struct rte_flow_item_phy_port. */ - RTE_FLOW_ITEM_TYPE_PORT, + RTE_FLOW_ITEM_TYPE_PHY_PORT, /** * Matches a byte string of a given length at a given offset. @@ -388,13 +383,13 @@ static const struct rte_flow_item_vf rte_flow_item_vf_mask = { #endif /** - * RTE_FLOW_ITEM_TYPE_PORT + * RTE_FLOW_ITEM_TYPE_PHY_PORT * - * Matches packets coming from the specified physical port of the underlying - * device. + * Matches traffic originating from (ingress) or going to (egress) a + * physical port of the underlying device. * - * The first PORT item overrides the physical port normally associated with - * the specified DPDK input port (port_id). This item can be provided + * The first PHY_PORT item overrides the physical port normally associated + * with the specified DPDK input port (port_id). This item can be provided * several times to match additional physical ports. * * Note that physical ports are not necessarily tied to DPDK input ports @@ -407,13 +402,13 @@ static const struct rte_flow_item_vf rte_flow_item_vf_mask = { * * A zeroed mask can be used to match any port index. */ -struct rte_flow_item_port { +struct rte_flow_item_phy_port { uint32_t index; /**< Physical port index. */ }; -/** Default mask for RTE_FLOW_ITEM_TYPE_PORT. */ +/** Default mask for RTE_FLOW_ITEM_TYPE_PHY_PORT. */ #ifndef __cplusplus -static const struct rte_flow_item_port rte_flow_item_port_mask = { +static const struct rte_flow_item_phy_port rte_flow_item_phy_port_mask = { .index = 0x00000000, }; #endif -- 2.11.0