From patchwork Sun Aug 30 11:15:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wisam Jaddo X-Patchwork-Id: 76154 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 642E6A04AB; Sun, 30 Aug 2020 13:20:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F4F21C0C4; Sun, 30 Aug 2020 13:16:31 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00078.outbound.protection.outlook.com [40.107.0.78]) by dpdk.org (Postfix) with ESMTP id 9E3DE1C0B3 for ; Sun, 30 Aug 2020 13:16:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y9gyG4nIFvD13GlfFoZ4O2pdRCPxjBdAK3P3qhCKFj4+ia8tPLKcfa7qz8RcQo2AuCAy7qK8X2tB0Op/8RRulrRZ/6uAK5D4coPic9bWShrowII0D5UQEi/GKwR7Zat+q1LL8ytnJs88biMupbiGLl89SB0y3GjBsxmyxFdgIQ5Hh4Zq9dozPlPfbmOMvlwccyaKQpvRg4Uz9KnUzb/+Pr1IdLiY6yJ9XP8vYhbdnxGOfiJv6mFA3gTjOSv4Uv5V6QImWzE5Jl4tl/ZUOGfWKutdf7gIiB5HeHfvYk+TD41VBJgkjSgdDj85RoUfzZaHKpVMTVLnt65AOSx6cbc1Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W2PKFjq9wr9Mu1HzPpQiBnZ3HwI3i+7i3Io8I6uO6n0=; b=LMzfFib9WYfz6LIphgMsl1F7MMJemN/Uevzb2lAXw5RJi6Aac6k9iKZzpJlwU+PkEIp0HmP798Q1uh9cFQEs3yZ17NcxvUcLRfOOmAaoq9xexLa4DeQY6VV1ui28zmRxr7knkb8zw9G7uqcrB7Vc50WoejoygnKVqS3pCzIULt3vMQZ2SbY83ZXE/qLQpP3MTznWe8oMVV3nG6vHAwDTXYJ4hzBM3M2Euqg9fAUcO+vmnTvG7Ra0ALLDtTH19IM4Ja/7ILQTr6WdEJnQGVT95/sHfnhacO1YQO3S6Dz9gpiIAYCgpKXj97aeDo3y0ppWjOtmye9iZOdWqadg2KoPcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W2PKFjq9wr9Mu1HzPpQiBnZ3HwI3i+7i3Io8I6uO6n0=; b=i5Wgp5hLTnm6iw5SFAgFeIKDQTllL27gZk7O9SU+VdkbhCbeZedx0mAlmvG+Qbr/QvvCPIeYZ4KANPUwUi7Am64gUb2D7QPvgQ13J2YIMGK9X4BUesJnXpJ3bQSR2MhM9YddZ39dsrlS0gM9vUbFQRKWuV9/lkmN7NZzoJdNusE= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR0502MB3762.eurprd05.prod.outlook.com (2603:10a6:208:1b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.21; Sun, 30 Aug 2020 11:16:26 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::4c8a:9848:2e2a:3598]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::4c8a:9848:2e2a:3598%6]) with mapi id 15.20.3326.025; Sun, 30 Aug 2020 11:16:26 +0000 From: Wisam Jaddo To: dev@dpdk.org, thomas@monjalon.net, asafp@mellanox.com, akozyrev@nvidia.com, akozyrev@mellanox.com, arybchenko@solarflare.com, jackmin@mellanox.com Date: Sun, 30 Aug 2020 11:15:35 +0000 Message-Id: <20200830111544.4190-5-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200830111544.4190-1-wisamm@mellanox.com> References: <20200830111544.4190-1-wisamm@mellanox.com> X-ClientProxiedBy: AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Sun, 30 Aug 2020 11:16:25 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6aac7d01-1c43-4593-9735-08d84cd62271 X-MS-TrafficTypeDiagnostic: AM0PR0502MB3762: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4XzYdu5WoIVeut5gb1ZkvNAbJEQpTfhYQImXAshCiBzLxMvYwG89NRpM3v8VyVtGpHE3nXDxQCR0GBJ3oUcKcRiXkSTr11q1wLbOquh7etOFDFgodz1AOfIOhLqgcJZUvPvaLuJRHPxF2qISC+C7nkhpdh/sHWGl3GrTfyuNlVDZvAQhsKtrL9lYul/v+mXPZfzYxd302AXp8X4QmPmZwnT5mE+eS0MmjepakvtibPcKQeNH5Sur0y5XjH38DHpTCloysngn1Kss2WdPuFqaAgTmXOXKgGGeumvQCJJM/aLLx2m9E++jJcUF8IPyhnlG X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(478600001)(316002)(5660300002)(8886007)(30864003)(2906002)(6636002)(86362001)(36756003)(6666004)(1076003)(55016002)(8936002)(26005)(2616005)(7696005)(66946007)(66556008)(52116002)(83380400001)(16526019)(8676002)(186003)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: utQ78gGiLB0KyS4Af7jZ5/oP34pKam3CTJCn7V1ldElqMYztRrhRx8iomMvCQ7b6D25kOeBs7efLbuGnGbWu8xYlcsGoK8uxuAd0kKJsfkTZzR14TMtEI/zYeDOUyqjf9R2s6q98x/DMGUzl6dv9uRH4HwVCv7DOaDY+uZ1L1ms3btFteHtjXCEkH/dvPf14VlyPWTuxxViQf7bcFtMlhCsDYH2JsFis1YOPXJ8FX0YfIjUFKFVvcrpc0K9tSCYgJZmGv5MidCLZYZn+XNsuLLRmFddTl3t7Vn+IobPO5qwaMM2/sYjQ0zsSWwAHC7COG2mYeH/OyHGOAxCnXkEgyLZIbCYEdXx0mga++IznWmdxiIayn/+xH4nJUKYNyDlmYYsRkkYGvMhGcZw+mMBz3DphRFI/5xgQm0ertuRSRLeFo4K4VhIJov60Gkmsr4L1Vl5uX1NLcYqin+TzphrHr/zoyvScZfaAs/HM4Po02NBQPiD/OSyMfqca/gWwJ+PszRoeLbC1bkOSLjhjj7bMxhZa+lGmQv8rTmZmqbo1pkHW9/Hbct4L7LR09GDQBrzdLMVcet8Cwnzyi8pIlRgVtGml5TjZBIYD+UuntU2VAqKeDgZNhxyJ/zN71bWxuoZ9kHUqGYaVXT/dHKr4jNQoCg== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6aac7d01-1c43-4593-9735-08d84cd62271 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6610.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2020 11:16:25.9915 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eI8Il2houJLjV12BvS+4BGI24p+00wRIAyfijtZgB/oq8VmHDaQZmpEas34vnE65pOM33o6XB9hZGk4WcOwmYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3762 Subject: [dpdk-dev] [PATCH 04/13] app/flow-perf: add header modify actions support 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" Introduce headers modify actions in the app. All header modify actions will add different value for each flow, to make sure each flow will create and use it's own actions. Signed-off-by: Wisam Jaddo Acked-by: Alexander Kozyrev --- app/test-flow-perf/actions_gen.c | 344 +++++++++++++++++++++++++ app/test-flow-perf/main.c | 180 ++++++++++++- doc/guides/rel_notes/release_20_08.rst | 2 + doc/guides/tools/flow-perf.rst | 59 +++++ 4 files changed, 583 insertions(+), 2 deletions(-) diff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow-perf/actions_gen.c index d115cdd723..7e0637595a 100644 --- a/app/test-flow-perf/actions_gen.c +++ b/app/test-flow-perf/actions_gen.c @@ -21,6 +21,7 @@ struct additional_para { uint16_t next_table; uint16_t *queues; uint16_t queues_number; + uint32_t counter; }; /* Storage for struct rte_flow_action_rss including external data. */ @@ -181,6 +182,252 @@ add_count(struct rte_flow_action *actions, actions[actions_counter].conf = &count_action; } +static void +add_set_src_mac(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_mac set_mac; + uint32_t mac = para.counter; + uint16_t i; + + /* Mac address to be set is random each time */ + for (i = 0; i < RTE_ETHER_ADDR_LEN; i++) { + set_mac.mac_addr[i] = mac & 0xff; + mac = mac >> 8; + } + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_MAC_SRC; + actions[actions_counter].conf = &set_mac; +} + +static void +add_set_dst_mac(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_mac set_mac; + uint32_t mac = para.counter; + uint16_t i; + + /* Mac address to be set is random each time */ + for (i = 0; i < RTE_ETHER_ADDR_LEN; i++) { + set_mac.mac_addr[i] = mac & 0xff; + mac = mac >> 8; + } + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_MAC_DST; + actions[actions_counter].conf = &set_mac; +} + +static void +add_set_src_ipv4(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_ipv4 set_ipv4; + + /* IPv4 value to be set is random each time */ + set_ipv4.ipv4_addr = RTE_BE32(para.counter + 1); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC; + actions[actions_counter].conf = &set_ipv4; +} + +static void +add_set_dst_ipv4(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_ipv4 set_ipv4; + + /* IPv4 value to be set is random each time */ + set_ipv4.ipv4_addr = RTE_BE32(para.counter + 1); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_IPV4_DST; + actions[actions_counter].conf = &set_ipv4; +} + +static void +add_set_src_ipv6(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_ipv6 set_ipv6; + uint32_t ipv6 = para.counter; + uint8_t i; + + /* IPv6 value to set is random each time */ + for (i = 0; i < 16; i++) { + set_ipv6.ipv6_addr[i] = ipv6 & 0xff; + ipv6 = ipv6 >> 8; + } + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC; + actions[actions_counter].conf = &set_ipv6; +} + +static void +add_set_dst_ipv6(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_ipv6 set_ipv6; + uint32_t ipv6 = para.counter; + uint8_t i; + + /* IPv6 value to set is random each time */ + for (i = 0; i < 16; i++) { + set_ipv6.ipv6_addr[i] = ipv6 & 0xff; + ipv6 = ipv6 >> 8; + } + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_IPV6_DST; + actions[actions_counter].conf = &set_ipv6; +} + +static void +add_set_src_tp(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_tp set_tp; + uint32_t tp = para.counter; + + /* TP src port is random each time */ + if (tp > 0xffff) + tp = tp >> 16; + + set_tp.port = RTE_BE16(tp & 0xffff); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_TP_SRC; + actions[actions_counter].conf = &set_tp; +} + +static void +add_set_dst_tp(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_tp set_tp; + uint32_t tp = para.counter; + + /* TP src port is random each time */ + if (tp > 0xffff) + tp = tp >> 16; + + set_tp.port = RTE_BE16(tp & 0xffff); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_TP_DST; + actions[actions_counter].conf = &set_tp; +} + +static void +add_inc_tcp_ack(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static rte_be32_t value = RTE_BE32(1); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_INC_TCP_ACK; + actions[actions_counter].conf = &value; +} + +static void +add_dec_tcp_ack(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static rte_be32_t value = RTE_BE32(1); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK; + actions[actions_counter].conf = &value; +} + +static void +add_inc_tcp_seq(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static rte_be32_t value = RTE_BE32(1); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_INC_TCP_SEQ; + actions[actions_counter].conf = &value; +} + +static void +add_dec_tcp_seq(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static rte_be32_t value = RTE_BE32(1); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ; + actions[actions_counter].conf = &value; +} + +static void +add_set_ttl(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_ttl set_ttl; + uint32_t ttl_value = para.counter; + + /* Set ttl to random value each time */ + while (ttl_value > 0xff) + ttl_value = ttl_value >> 8; + + set_ttl.ttl_value = ttl_value; + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_TTL; + actions[actions_counter].conf = &set_ttl; +} + +static void +add_dec_ttl(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_DEC_TTL; +} + +static void +add_set_ipv4_dscp(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_dscp set_dscp; + uint32_t dscp_value = para.counter; + + /* Set dscp to random value each time */ + while (dscp_value > 0xff) + dscp_value = dscp_value >> 8; + + set_dscp.dscp = dscp_value; + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP; + actions[actions_counter].conf = &set_dscp; +} + +static void +add_set_ipv6_dscp(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_dscp set_dscp; + uint32_t dscp_value = para.counter; + + /* Set dscp to random value each time */ + while (dscp_value > 0xff) + dscp_value = dscp_value >> 8; + + set_dscp.dscp = dscp_value; + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP; + actions[actions_counter].conf = &set_dscp; +} + void fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions, uint32_t counter, uint16_t next_table, uint16_t hairpinq) @@ -202,6 +449,7 @@ fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions, .next_table = next_table, .queues = queues, .queues_number = RXQ_NUM, + .counter = counter, }; if (hairpinq != 0) { @@ -234,6 +482,102 @@ fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions, .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_SET_TAG), .funct = add_set_tag, }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_MAC_SRC + ), + .funct = add_set_src_mac, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_MAC_DST + ), + .funct = add_set_dst_mac, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC + ), + .funct = add_set_src_ipv4, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV4_DST + ), + .funct = add_set_dst_ipv4, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC + ), + .funct = add_set_src_ipv6, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV6_DST + ), + .funct = add_set_dst_ipv6, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_TP_SRC + ), + .funct = add_set_src_tp, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_TP_DST + ), + .funct = add_set_dst_tp, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_INC_TCP_ACK + ), + .funct = add_inc_tcp_ack, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK + ), + .funct = add_dec_tcp_ack, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_INC_TCP_SEQ + ), + .funct = add_inc_tcp_seq, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ + ), + .funct = add_dec_tcp_seq, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_TTL + ), + .funct = add_set_ttl, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_DEC_TTL + ), + .funct = add_dec_ttl, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP + ), + .funct = add_set_ipv4_dscp, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP + ), + .funct = add_set_ipv6_dscp, + }, { .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_QUEUE), .funct = add_queue, diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 0ff8080aa0..1f693d4ed1 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -138,6 +138,38 @@ usage(char *progname) printf(" --drop: add drop action in flow actions\n"); printf(" --hairpin-queue=N: add hairpin-queue action in flow actions\n"); printf(" --hairpin-rss=N: add hairpin-rss action in flow actions\n"); + printf(" --set-src-mac: add set src mac action to flow actions\n" + "Src mac to be set is random each flow\n"); + printf(" --set-dst-mac: add set dst mac action to flow actions\n" + "Dst mac to be set is random each flow\n"); + printf(" --set-src-ipv4: add set src ipv4 action to flow actions\n" + "Src ipv4 to be set is random each flow\n"); + printf(" --set-dst-ipv4 add set dst ipv4 action to flow actions\n" + "Dst ipv4 to be set is random each flow\n"); + printf(" --set-src-ipv6: add set src ipv6 action to flow actions\n" + "Src ipv6 to be set is random each flow\n"); + printf(" --set-dst-ipv6: add set dst ipv6 action to flow actions\n" + "Dst ipv6 to be set is random each flow\n"); + printf(" --set-src-tp: add set src tp action to flow actions\n" + "Src tp to be set is random each flow\n"); + printf(" --set-dst-tp: add set dst tp action to flow actions\n" + "Dst tp to be set is random each flow\n"); + printf(" --inc-tcp-ack: add inc tcp ack action to flow actions\n" + "tcp ack will be increments by 1\n"); + printf(" --dec-tcp-ack: add dec tcp ack action to flow actions\n" + "tcp ack will be decrements by 1\n"); + printf(" --inc-tcp-seq: add inc tcp seq action to flow actions\n" + "tcp seq will be increments by 1\n"); + printf(" --dec-tcp-seq: add dec tcp seq action to flow actions\n" + "tcp seq will be decrements by 1\n"); + printf(" --set-ttl: add set ttl action to flow actions\n" + "L3 ttl to be set is random each flow\n"); + printf(" --dec-ttl: add dec ttl action to flow actions\n" + "L3 ttl will be decrements by 1\n"); + printf(" --set-ipv4-dscp: add set ipv4 dscp action to flow actions\n" + "ipv4 dscp value to be set is random each flow\n"); + printf(" --set-ipv6-dscp: add set ipv6 dscp action to flow actions\n" + "ipv6 dscp value to be set is random each flow\n"); } static void @@ -304,7 +336,135 @@ args_parse(int argc, char **argv) .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_DROP), .map = &flow_actions[0], .map_idx = &actions_idx - } + }, + { + .str = "set-src-mac", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_MAC_SRC + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "set-dst-mac", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_MAC_DST + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "set-src-ipv4", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "set-dst-ipv4", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV4_DST + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "set-src-ipv6", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "set-dst-ipv6", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV6_DST + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "set-src-tp", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_TP_SRC + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "set-dst-tp", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_TP_DST + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "inc-tcp-ack", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_INC_TCP_ACK + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "dec-tcp-ack", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "inc-tcp-seq", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_INC_TCP_SEQ + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "dec-tcp-seq", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "set-ttl", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_TTL + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "dec-ttl", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_DEC_TTL + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "set-ipv4-dscp", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "set-ipv6-dscp", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, }; static const struct option lgopts[] = { @@ -346,6 +506,22 @@ args_parse(int argc, char **argv) { "drop", 0, 0, 0 }, { "hairpin-queue", 1, 0, 0 }, { "hairpin-rss", 1, 0, 0 }, + { "set-src-mac", 0, 0, 0 }, + { "set-dst-mac", 0, 0, 0 }, + { "set-src-ipv4", 0, 0, 0 }, + { "set-dst-ipv4", 0, 0, 0 }, + { "set-src-ipv6", 0, 0, 0 }, + { "set-dst-ipv6", 0, 0, 0 }, + { "set-src-tp", 0, 0, 0 }, + { "set-dst-tp", 0, 0, 0 }, + { "inc-tcp-ack", 0, 0, 0 }, + { "dec-tcp-ack", 0, 0, 0 }, + { "inc-tcp-seq", 0, 0, 0 }, + { "dec-tcp-seq", 0, 0, 0 }, + { "set-ttl", 0, 0, 0 }, + { "dec-ttl", 0, 0, 0 }, + { "set-ipv4-dscp", 0, 0, 0 }, + { "set-ipv6-dscp", 0, 0, 0 }, }; hairpin_queues_num = 0; @@ -368,7 +544,7 @@ args_parse(int argc, char **argv) else rte_exit(EXIT_SUCCESS, "flow group should be >= 0\n"); - printf("group %d ", flow_group); + printf("group %d / ", flow_group); } for (i = 0; i < RTE_DIM(flow_options); i++) diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst index d3ba4cd1d0..7c9d508a07 100644 --- a/doc/guides/rel_notes/release_20_08.rst +++ b/doc/guides/rel_notes/release_20_08.rst @@ -280,6 +280,8 @@ New Features moreover the app also now starts to support inner items matching as well. + * Start supporting header modify actions. + Removed Items ------------- diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst index 6941155fee..e225550e40 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -244,3 +244,62 @@ Actions: Add hairpin RSS action to all flows actions. The queues in RSS action will be all hairpin queues configured in the app. + +* ``--set-src-mac`` + Add set source mac action to all flows actions. + The mac to be set is random each flow. + +* ``--set-dst-mac`` + Add set destination mac action to all flows actions. + The mac to be set is random each flow. + +* ``-set-src-ipv4`` + Add set source ipv4 action to all flows actions. + The ipv4 header to be set is random each flow. + +* ``--set-dst-ipv4`` + Add set destination ipv4 action to all flows actions. + The ipv4 header to be set is random each flow. + +* ``--set-src-ipv6`` + Add set source ipv6 action to all flows actions. + The ipv6 header to be set is random each flow. + +* ``--set-dst-ipv6`` + Add set destination ipv6 action to all flows actions. + The ipv6 header to be set is random each flow. + +* ``--set-src-tp`` + Add set source tp action to all flows actions. + The tp sport header to be set is random each flow. + +* ``--set-dst-tp`` + Add set destination tp action to all flows actions. + The tp dport header to be set is random each flow. + +* ``--inc-tcp-ack`` + Add increment TCP acknowledgment by one to all flows actions. + +* ``--dec-tcp-ack`` + Add decrement TCP acknowledgment by one to all flows actions. + +* ``--inc-tcp-seq`` + Add increment TCP sequence by one to all flows actions. + +* ``--dec-tcp-seq`` + Add decrement TCP sequence by one to all flows actions. + +* ``--set-ttl`` + Add set IP ttl action to all flows actions. + The ttl value to be set is random each flow. + +* ``--dec-ttl`` + Add decrement IP ttl by one to all flows actions. + +* ``--set-ipv4-dscp`` + Add set IPv4 dscp action to all flows actions. + The dscp value to be is random each flow. + +* ``--set-ipv6-dscp`` + Add set IPv6 dscp action to all flows actions. + The dscp value to be is random each flow.