From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AA56FA05A1; Wed, 22 Apr 2020 04:12:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7A51F1C2BB; Wed, 22 Apr 2020 04:12:46 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60089.outbound.protection.outlook.com [40.107.6.89]) by dpdk.org (Postfix) with ESMTP id 3357A1C2B7 for ; Wed, 22 Apr 2020 04:12:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oe5DdlVvIXLkhF4hYU+mbzGt1om1HQ4KT9sQ+zwgm/T5ndu2uu83wtzWwnM7lC4qhkhcPG8AfGM5skyCNUKiy+q7izxEBMppex4Dr9HR/JCZYt40R4aSehbF0atIMNLpOZT6aV1CRRyCVFfbNy0rI1dI55hi6rJXngwO9TpRT3zzVVHjt1P9CMmzP6A9tlzBcerXEcsU02nctg6m9pQyT/pkOlwKZs4c8zjel1Ex0Tr0HsMDIm9xgaSRHTiZGIW+srbFS3lAJZYlFZzm9z+hkXmls+UUG6NHlZQUrxKrVNpD428Q2WC2a/aaEXW8QNBZDQtbqIK0p1afJwMdTQRy7g== 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=lpKHoJ53JgNcD/bQoT7jadd/fOQ2BSKH3bBiRU6a5wo=; b=bClkChZbmhrPjq3wMC4POjM4CG1e+88agqBmV81+afHuTLzMuA/R65dj0TGc/5Un7ZuH/P/T0rJwWhfuHobgp7wz9+XO/RU7nsjULO5CVJREjjuSDd8tIEzg0Y2BO5Nmond9DqGk7T/e0Dd8fxCBjddLBFaPV/I6GNJK/dMiWXjQTvFC+grzFgGvPQSUK93s98gAo6lG27mc01vt1CXaV6HMqmaYe+en2WvksXhQR1hNBK6x++R4ca9KLkAdVa+TbujMsmeAjyfv/7IOcT4OAQTpIvSizC2Ori5vsO5iiZeuqrUvJvpPB2r6SkDqFpRLWd22l9SNODHwdvvH1sHAlw== 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=lpKHoJ53JgNcD/bQoT7jadd/fOQ2BSKH3bBiRU6a5wo=; b=nWgN5/0kYNf5yOknVkZVKqdJGYGh5Xh+dYCpRgUzmzDJX9U02HO/UvM+MKtRVVjpaRZMtBGn0/Og+DKd8wEnPoEXHWGfMPwHNyjug/6zjksq4mgvU+ssT6kI9oa0Qd6TVsP+06udfBSsoogY3K2vruVr5S1kgObXkhvoeZg/1lQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; Received: from AM6PR05MB6567.eurprd05.prod.outlook.com (2603:10a6:20b:bc::23) by AM6PR05MB5975.eurprd05.prod.outlook.com (2603:10a6:20b:ac::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.27; Wed, 22 Apr 2020 02:12:42 +0000 Received: from AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::5513:b664:af25:6551]) by AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::5513:b664:af25:6551%5]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 02:12:42 +0000 Date: Wed, 22 Apr 2020 10:12:21 +0800 From: Xiaoyu Min To: "Iremonger, Bernard" Cc: "thomas@monjalon.net" , "asafp@mellanox.com" , "Lu, Wenzhuo" , "Wu, Jingjing" , "Mcnamara, John" , "Kovacevic, Marko" , "dev@dpdk.org" Message-ID: <20200422021221.irgsdgemb3bfjr6a@mellanox.com> References: <47cf5b417fb3c74c04e5a020dba700c5d748383d.1586958002.git.jackmin@mellanox.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-ClientProxiedBy: HK2PR0401CA0003.apcprd04.prod.outlook.com (2603:1096:202:2::13) To AM6PR05MB6567.eurprd05.prod.outlook.com (2603:10a6:20b:bc::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (2408:8025:34c:6fe0:f492:17b0:f1f3:6e3c) by HK2PR0401CA0003.apcprd04.prod.outlook.com (2603:1096:202:2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 02:12:35 +0000 X-Originating-IP: [2408:8025:34c:6fe0:f492:17b0:f1f3:6e3c] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ee4dc7d1-4eba-4880-8f39-08d7e662a375 X-MS-TrafficTypeDiagnostic: AM6PR05MB5975:|AM6PR05MB5975: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR05MB6567.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(366004)(396003)(136003)(39850400004)(376002)(346002)(66556008)(36756003)(52116002)(53546011)(7696005)(4326008)(55016002)(186003)(54906003)(5660300002)(16526019)(66946007)(316002)(86362001)(2616005)(1076003)(8886007)(2906002)(66476007)(6666004)(6916009)(8676002)(478600001)(81156014)(8936002)(41533002); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AM/qkz8zB496+/ktrO5vWht3C0S/jqbwVT1vpQQbJegmL7wC1VVX70Nl98/oI5iarvB3ITfp4wvDxMNvzEsws61a5qtbFS8wNyGxnq6cns5LbHLNLOABv4eTvz4FzTNeb4J1b0awiRRvSs7bM+uVzGm4dHaDmSru4x7eX1scZk/0hHr4sJ1b2D71oTAx/RuM9zl9cYAu8S4z/vJfPaikhjRGnTvg8joC+IlQysSCPyQ0K7lBCrr31vkhDyib1m+/phYSdjfGwrY48Oo0Tcw9/JDpl76UMreN60E8jArrwUkPoT6+CphpMl/bs1nAHJHiNlufseq/EIOoo5hY13OVslfR5FzEhQJn7kbwuWsY+AJYEmEUgfN78Af5hcGCxGmtghghvdbzk0rGGcVClPSsMnwWeD4r2xxyYm2dqTrbM211vI8cQ/mn5oc0vxsJrugJ3z3sob4NXONyE72/59u8o0G1emLxhhkdiDqBVOviLZ96JTyc3gZz9uKTWFCSmBDN X-MS-Exchange-AntiSpam-MessageData: yit/hJQhjSSKm9xDKdcDxngFEVLu6Coj+lHsBuXnipW5m2TlwpHeknekTtRyPnERXe6q5XI0Oji9opM1ouH5wZE93r1wJnZvgLOOr5y9fesskpj6b7P6ylPGJsXQJyJLbKVol3g6Ra9wKaDZaJTqRsYTA9yfwZOoBh5+Jta9CX5I5kTm8Q0sbV1+X/y/pWjcC2KqoO8VfBGHASqrrWvBiQ== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee4dc7d1-4eba-4880-8f39-08d7e662a375 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 02:12:42.6224 (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: I5xnOni/kNV41FbGChU8wA3LEi5dNMu9J00wHPUMfaYHxKzu+ZteUcqrd3XrxEH7/BhyyQU+UZtA7MDGljeTaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5975 Subject: Re: [dpdk-dev] [RFC] app/testpmd: add generic swap forwarding engine 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" On Tue, 20-04-21, 15:47, Iremonger, Bernard wrote: > Hi Xiaoyu, Hey Bernard, > > > -----Original Message----- > > From: Xiaoyu Min > > Sent: Wednesday, April 15, 2020 2:49 PM > > To: thomas@monjalon.net; asafp@mellanox.com; Lu, Wenzhuo > > ; Wu, Jingjing ; Iremonger, > > Bernard ; Mcnamara, John > > ; Kovacevic, Marko > > > > Cc: dev@dpdk.org > > Subject: [RFC] app/testpmd: add generic swap forwarding engine > > > > This RFC propose a generic `swap` forwarding engine, which could be seen as > > an extension of existing `macswap` but provide more flexibility. > > > > With this generic `swap` forwarding engine, we can `swap` the source and > > destination of L2/L3 address as well as the source and destination port of L4 > > according to the user inputs. > > > > This will be very helpful for developer/tester in some test scenarios. > > For example, connection tracking functinality in OVS, which needs to swap > > UDP ports in addition to L2/L3 addresses in order to complete one > > connection. > > > > Signed-off-by: Xiaoyu Min > > --- > > app/test-pmd/parameters.c | 2 ++ > > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 15 ++++++++++++++- > > 2 files changed, 16 insertions(+), 1 deletion(-) > > > > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index > > 404dba2b20..5c9aecd6cb 100644 > > --- a/app/test-pmd/parameters.c > > +++ b/app/test-pmd/parameters.c > > @@ -147,6 +147,8 @@ usage(char* progname) > > "is default).\n"); > > printf(" --forward-mode=N: set forwarding mode (N: %s).\n", > > list_pkt_forwarding_modes()); > > + printf(" --forward-mode=swap[:TYPE[,TYPE]]: set forwarding mode > > to swap " > > + "(TYPE: auto (default) or mac or ip or tp).\n"); > > printf(" --rss-ip: set RSS functions to IPv4/IPv6 only .\n"); > > printf(" --rss-udp: set RSS functions to IPv4/IPv6 + UDP.\n"); > > printf(" --rxq=N: set the number of RX queues per port to N.\n"); > > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > index dcee5de455..27f0600493 100644 > > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > @@ -298,7 +298,7 @@ set fwd > > Set the packet forwarding mode:: > > > > testpmd> set fwd (io|mac|macswap|flowgen| \ > > - rxonly|txonly|csum|icmpecho|noisy) (""|retry) > > + rxonly|txonly|csum|icmpecho|noisy|swap) (""|retry) > > > > ``retry`` can be specified for forwarding engines except ``rx_only``. > > > > @@ -336,6 +336,19 @@ The available information categories are: > > Simulate more realistic behavior of a guest machine engaged in receiving > > and sending packets performing Virtual Network Function (VNF). > > > > +* ``swap[:TYPE[,TYPE]*]``: Generic swap forwarding mode. > > + > > + Swap the source and destination address or/and source and destination > > port of packet according to ``TYPE`` before forwarding them. > > + ``TYPE`` could be: > > + > > + - ``auto``: swaps all supported fields (L2 to L4) if available, default. > > + > > + - ``mac``: swaps the source address and destination address of Ethernet, as > > same as ``macswap``. > > + > > + - ``ip``: swaps the source address and destination address of IP (v4 and v6). > > + > > + - ``tp``: swaps the source port and destination port of transport layer (TCP > > and UDP). > > + > > Example:: > > > > testpmd> set fwd rxonly > > -- > > 2.26.0 > > This patch is giving the following checkpatch errors: Sorry, I missed them. I'll fix this in PATCH. > > root@silpixa00399470:~/dpdk-next-net# /root/dpdk-next-net/devtools/checkpatches.sh /home/bairemon/patches_20_05_patchwork/RFC-app-testpmd-add-generic-swap-forwarding-engine > .patch > > ### [dpdk-dev] [RFC] app/testpmd: add generic swap forwarding engine > > ERROR:TRAILING_WHITESPACE: trailing whitespace > #97: FILE: doc/guides/testpmd_app_ug/testpmd_funcs.rst:340: > + $ > > ERROR:TRAILING_WHITESPACE: trailing whitespace > #102: FILE: doc/guides/testpmd_app_ug/testpmd_funcs.rst:345: > + $ > > ERROR:TRAILING_WHITESPACE: trailing whitespace > #104: FILE: doc/guides/testpmd_app_ug/testpmd_funcs.rst:347: > + $ > > ERROR:TRAILING_WHITESPACE: trailing whitespace > #106: FILE: doc/guides/testpmd_app_ug/testpmd_funcs.rst:349: > + $ > > total: 4 errors, 0 warnings, 35 lines checked > > > This seems to be just a documentation patch. > I don't see any code to implement the new forwarding feature. Yes, it's RFC so I just update the related documentation to describe the idea. The complete code implementation will be a comming PATCH if community is OK with this RFC. > > Regards, > > Bernard. > >