From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EC1E5A00B9 for ; Sun, 31 Mar 2019 15:10:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C74482F42; Sun, 31 Mar 2019 15:10:43 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50072.outbound.protection.outlook.com [40.107.5.72]) by dpdk.org (Postfix) with ESMTP id 1EA2B2B82 for ; Sun, 31 Mar 2019 15:10:43 +0200 (CEST) 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=thhNQOIL7o7D7uzOl9PvBpJ729QbV2hcZk/pnKnLhfw=; b=XuaamLOjmvD/uPifmybRgfuAFf1vlnRgOgFpLW9zIjIevfvpt/qxXB2/iWhnOI/te9rXS/LY9bTJfVuhYWXuuMrxyn3gpbF6KZZLpC5WeN4YZpYryfvmGwiF8QKZHl8WeXVF9IAShXPD000ofmBjiQYvXqKakhPgtVVpck3fYc0= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB3502.eurprd05.prod.outlook.com (10.170.239.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18; Sun, 31 Mar 2019 13:10:41 +0000 Received: from VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::bcb0:ed58:d76:cac]) by VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::bcb0:ed58:d76:cac%4]) with mapi id 15.20.1750.017; Sun, 31 Mar 2019 13:10:41 +0000 From: Dekel Peled To: Adrien Mazarguil CC: "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "bernard.iremonger@intel.com" , Yongseok Koh , Shahaf Shuler , "dev@dpdk.org" , Ori Kam Thread-Topic: [PATCH 2/3] app/testpmd: add actions to modify TCP header fields Thread-Index: AQHU3/FNWiu49GsTe0aNDB2tmNvShaYirziAgAMH/IA= Date: Sun, 31 Mar 2019 13:10:41 +0000 Message-ID: References: <1553177917-43297-1-git-send-email-dekelp@mellanox.com> <1553177917-43297-3-git-send-email-dekelp@mellanox.com> <20190329135857.GI4889@6wind.com> In-Reply-To: <20190329135857.GI4889@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2ebf945e-fa7c-4281-a662-08d6b5da4717 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB3502; x-ms-traffictypediagnostic: VI1PR05MB3502: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0993689CD1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(396003)(136003)(376002)(189003)(199004)(13464003)(26005)(81166006)(5660300002)(9686003)(107886003)(66066001)(4326008)(86362001)(71190400001)(76176011)(55016002)(476003)(102836004)(305945005)(6436002)(53936002)(54906003)(7736002)(316002)(3846002)(25786009)(105586002)(6246003)(11346002)(256004)(14454004)(6506007)(6116002)(97736004)(81156014)(8936002)(6916009)(229853002)(52536014)(74316002)(68736007)(99286004)(33656002)(186003)(486006)(478600001)(71200400001)(446003)(8676002)(7696005)(106356001)(2906002)(53546011); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3502; H:VI1PR05MB4224.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Px9TvepkcMYTuRq0RwssxgQsk60OGdSNgU/5LeDCciFuaIwGn9uM94yWhNJgAZInUu73UfHE79eUrGPPkVjX9RENDNyTkQ1E9l7hPlD0yq8qdboRcigWzapUPbk+83rRZNJRHd0uedh1FxBwXeJOEUr2HNksnYzVI4A0Ke3JP7OIgOwROqjR8Rpqy+hUsbd5l13ZDnsu/6vPMuv5JDGymBW6SyT5RUqsRM7GHqV3an362Aq8oolR8nKJncFnvWsB0eSjvSJ86r4OaoGh1u3HpGj0H25e1ECIkNu7EPoaumWtGZa5cygg+C5gKQOq0WYzv97D8PNYZ1BLHlPWgVDA1Rlr28JI2t40k8RSXpRqMV0FGzT/VQr0r6c38W7RN68LhOSMwx77AHbVU3TL24nFTP1YjAiZPUwv+lyR0+qaDRA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ebf945e-fa7c-4281-a662-08d6b5da4717 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Mar 2019 13:10:41.7692 (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-Transport-CrossTenantHeadersStamped: VI1PR05MB3502 Subject: Re: [dpdk-dev] [PATCH 2/3] app/testpmd: add actions to modify TCP header fields 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" Message-ID: <20190331131041.ERaOecyKvNT_TlA5K5-a8xuoOy3Rbt4k9O4dngS7qZU@z> Thanks, PSB. > -----Original Message----- > From: Adrien Mazarguil > Sent: Friday, March 29, 2019 4:59 PM > To: Dekel Peled > Cc: wenzhuo.lu@intel.com; jingjing.wu@intel.com; > bernard.iremonger@intel.com; Yongseok Koh ; > Shahaf Shuler ; dev@dpdk.org; Ori Kam > > Subject: Re: [PATCH 2/3] app/testpmd: add actions to modify TCP header > fields >=20 > On Thu, Mar 21, 2019 at 04:18:36PM +0200, Dekel Peled wrote: > > Add actions: > > - INC_TCP_SEQ - Increase sequence number in the outermost TCP header. > > - DEC_TCP_SEQ - Decrease sequence number in the outermost TCP > header. > > - INC_TCP_ACK - Increase acknowledgment number in the outermost TCP > > header. > > - DEC_TCP_ACK - Decrease acknowledgment number in the outermost TCP > > header. > > > > Original work by Xiaoyu Min. > > > > Signed-off-by: Dekel Peled >=20 > I suggest to merge this patch into the previous one. No reason for testpm= d > to be updated separately. >=20 I prefer it in separate patch since it is part of different SW module. > Some comments below. >=20 > > --- > > app/test-pmd/cmdline_flow.c | 100 > ++++++++++++++++++++++++++++ > > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 16 +++++ > > 2 files changed, 116 insertions(+) > > > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > > index 36659a6..5cd4ceb 100644 > > --- a/app/test-pmd/cmdline_flow.c > > +++ b/app/test-pmd/cmdline_flow.c > > @@ -271,6 +271,14 @@ enum index { > > ACTION_SET_MAC_SRC_MAC_SRC, > > ACTION_SET_MAC_DST, > > ACTION_SET_MAC_DST_MAC_DST, > > + ACTION_INC_TCP_SEQ, > > + ACTION_INC_TCP_SEQ_VALUE, > > + ACTION_DEC_TCP_SEQ, > > + ACTION_DEC_TCP_SEQ_VALUE, > > + ACTION_INC_TCP_ACK, > > + ACTION_INC_TCP_ACK_VALUE, > > + ACTION_DEC_TCP_ACK, > > + ACTION_DEC_TCP_ACK_VALUE, > > }; > > > > /** Maximum size for pattern in struct rte_flow_item_raw. */ @@ > > -884,6 +892,10 @@ struct parse_action_priv { > > ACTION_SET_TTL, > > ACTION_SET_MAC_SRC, > > ACTION_SET_MAC_DST, > > + ACTION_INC_TCP_SEQ, > > + ACTION_DEC_TCP_SEQ, > > + ACTION_INC_TCP_ACK, > > + ACTION_DEC_TCP_ACK, > > ZERO, > > }; > > > > @@ -1046,6 +1058,30 @@ struct parse_action_priv { > > ZERO, > > }; > > > > +static const enum index action_inc_tcp_seq[] =3D { > > + ACTION_INC_TCP_SEQ_VALUE, > > + ACTION_NEXT, > > + ZERO, > > +}; > > + > > +static const enum index action_dec_tcp_seq[] =3D { > > + ACTION_DEC_TCP_SEQ_VALUE, > > + ACTION_NEXT, > > + ZERO, > > +}; > > + > > +static const enum index action_inc_tcp_ack[] =3D { > > + ACTION_INC_TCP_ACK_VALUE, > > + ACTION_NEXT, > > + ZERO, > > +}; > > + > > +static const enum index action_dec_tcp_ack[] =3D { > > + ACTION_DEC_TCP_ACK_VALUE, > > + ACTION_NEXT, > > + ZERO, > > +}; > > + > > static int parse_init(struct context *, const struct token *, > > const char *, unsigned int, > > void *, unsigned int); > > @@ -2843,6 +2879,70 @@ static int comp_vc_action_rss_queue(struct > context *, const struct token *, > > (struct rte_flow_action_set_mac, mac_addr)), > > .call =3D parse_vc_conf, > > }, > > + [ACTION_INC_TCP_SEQ] =3D { > > + .name =3D "inc_tcp_seq", > > + .help =3D "increase TCP sequence number", > > + .priv =3D PRIV_ACTION(INC_TCP_SEQ, > > + sizeof(struct rte_flow_action_modify_tcp_seq)), > > + .next =3D NEXT(action_inc_tcp_seq), > > + .call =3D parse_vc, > > + }, > > + [ACTION_INC_TCP_SEQ_VALUE] =3D { > > + .name =3D "value", > > + .help =3D "the value to increase TCP sequence number by", > > + .next =3D NEXT(action_inc_tcp_seq, NEXT_ENTRY(UNSIGNED)), > > + .args =3D ARGS(ARGS_ENTRY_HTON > > + (struct rte_flow_action_modify_tcp_seq, value)), >=20 > You may need to remove HTON here depending on the chosen endian for > the API, see my comments on previous patch. >=20 > > + .call =3D parse_vc_conf, > > + }, > > + [ACTION_DEC_TCP_SEQ] =3D { > > + .name =3D "dec_tcp_seq", > > + .help =3D "decrease TCP sequence number", > > + .priv =3D PRIV_ACTION(DEC_TCP_SEQ, > > + sizeof(struct rte_flow_action_modify_tcp_seq)), > > + .next =3D NEXT(action_dec_tcp_seq), > > + .call =3D parse_vc, > > + }, > > + [ACTION_DEC_TCP_SEQ_VALUE] =3D { > > + .name =3D "value", > > + .help =3D "the value to decrease TCP sequence number by", > > + .next =3D NEXT(action_dec_tcp_seq, > NEXT_ENTRY(UNSIGNED)), > > + .args =3D ARGS(ARGS_ENTRY_HTON > > + (struct rte_flow_action_modify_tcp_seq, value)), >=20 > Same here. >=20 > > + .call =3D parse_vc_conf, > > + }, > > + [ACTION_INC_TCP_ACK] =3D { > > + .name =3D "inc_tcp_ack", > > + .help =3D "increase TCP acknowledgment number", > > + .priv =3D PRIV_ACTION(INC_TCP_ACK, > > + sizeof(struct rte_flow_action_modify_tcp_ack)), > > + .next =3D NEXT(action_inc_tcp_ack), > > + .call =3D parse_vc, > > + }, > > + [ACTION_INC_TCP_ACK_VALUE] =3D { > > + .name =3D "value", > > + .help =3D "the value to increase TCP acknowledgment number > by", > > + .next =3D NEXT(action_inc_tcp_ack, NEXT_ENTRY(UNSIGNED)), > > + .args =3D ARGS(ARGS_ENTRY_HTON > > + (struct rte_flow_action_modify_tcp_ack, value)), >=20 > Ditto. >=20 > > + .call =3D parse_vc_conf, > > + }, > > + [ACTION_DEC_TCP_ACK] =3D { > > + .name =3D "dec_tcp_ack", > > + .help =3D "decrease TCP acknowledgment number", > > + .priv =3D PRIV_ACTION(DEC_TCP_ACK, > > + sizeof(struct rte_flow_action_modify_tcp_ack)), > > + .next =3D NEXT(action_dec_tcp_ack), > > + .call =3D parse_vc, > > + }, > > + [ACTION_DEC_TCP_ACK_VALUE] =3D { > > + .name =3D "value", > > + .help =3D "the value to decrease TCP acknowledgment number > by", > > + .next =3D NEXT(action_dec_tcp_ack, > NEXT_ENTRY(UNSIGNED)), > > + .args =3D ARGS(ARGS_ENTRY_HTON > > + (struct rte_flow_action_modify_tcp_ack, value)), >=20 > Ditto. >=20 > > + .call =3D parse_vc_conf, > > + }, > > }; > > > > /** Remove and return last entry from argument stack. */ diff --git > > a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > index 1a12da4..c6f8b2c 100644 > > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > @@ -3961,6 +3961,22 @@ This section lists supported actions and their > attributes, if any. > > > > - ``mac_addr {MAC-48}``: new destination MAC address > > > > +- ``inc_tcp_seq``: Increase sequence number in the outermost TCP > > +header > > + > > + - ``value {unsigned}``: Value to increase TCP sequence number by > > + > > +- ``dec_tcp_seq``: Decrease sequence number in the outermost TCP > > +header > > + > > + - ``value {unsigned}``: Value to decrease TCP sequence number by > > + > > +- ``inc_tcp_ack``: Increase acknowledgment number in the outermost > > +TCP header > > + > > + - ``value {unsigned}``: Value to increase TCP acknowledgment number > > + by > > + > > +- ``dec_tcp_ack``: Decrease acknowledgment number in the outermost > > +TCP header > > + > > + - ``value {unsigned}``: Value to decrease TCP acknowledgment number > > + by >=20 > Please add missing "." to each line. Will add. >=20 > > + > > Destroying flow rules > > ~~~~~~~~~~~~~~~~~~~~~ > > > > -- > > 1.8.3.1 > > >=20 > -- > Adrien Mazarguil > 6WIND