From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A77B7A0547; Thu, 29 Apr 2021 15:45:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92FF4410FF; Thu, 29 Apr 2021 15:45:27 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2047.outbound.protection.outlook.com [40.107.94.47]) by mails.dpdk.org (Postfix) with ESMTP id B7EEB410FF for ; Thu, 29 Apr 2021 15:45:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gNFeJaqHIUe7tFwsfixPLp11WG3hOg8UQJnllsCo3tQ7TQ9fk3M2bLfbJnk1VmCTJI82o8CoOJ/GjTgGb7eIZ58skUpLmM9SwiBY8Mc5ipaDJoKb67vt6+6sFexXaKTxHrYAGKtpsTYtuertqKymK498Ga1yqlrRzoBrdB350aUvAoYO8m2MzUoLCxL1Qx2PLxqyGLk78AGzR1/f/IytgpOt5L/xNowEwHhXe9UeGIFog38u7AFkWtXwER8IuWY+qm7bCHJgVos2U73Q3uYrUYQTfbpq9I5VqMo/N0XZ7oLtOYM4kaIfYprloVffF6Xlu0SDLAe7i51UWmvlfcbILA== 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=4HZ0vzVrPa62MC5bzLzFnXeWqDeiDXa27G63oFSVV84=; b=ajthhcaPmxbJs0GjZ1y1k21PI4CfcubD9hTfGSncay1p9j6t7ZqmHycvNU4UDjxfW0tOOwq9jAyzKGdJ/ozYjtpugz0vcL5rA15TcLkeA8Lp0H5EXKbmLpFJD4dTVL6HP6zTk+ud/F8xE6xnTaPM2jAhWEVUdlY9zIcspU4Yf9VKhTat/79YGkfpXPWBFLIrNh4oeXi2fPSLRB7ukFBjr9PZdixCRiPiaY+On+RnvLbQSECPLldLfBkQdvofw+93sSBtRxZl1sjNPwC9OEYAzDEAMBklfd0huA7aNFY/MdN//EzdMOgb9V8n3lK2Rcd9Lq7nhUA/h59BbCFB6Jj9rw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4HZ0vzVrPa62MC5bzLzFnXeWqDeiDXa27G63oFSVV84=; b=Azni1OOqfkfhpLQYF8nnmGEoM9IchAGjhgYNo8unchCm5hiGU77jfP9+rMhdAuqxcpyLe7oaxzgiDDgmK2wi2eaczYNnYmNxCOYovrcszdm7bUfTCApE2bRQKSuSe5szjLQ+Axv+vIynF8gVwVEA40uGXyMi7EYR6NWtAQaDnn/sS8ulT3bU7N3qhZMcAvA3+fXQ3kS30t6zrwFIuopO0DoijNPy2ye+hVVvRveR66BW4IPq7pIoi/CGbPdB7PgNXX3NLdBFjZzwCUpbBPnxnP5SlyTFW53Ghc91XQ7U5MIATnNkWxO+jbKu566UNiVzlmXlwjsbf/Aag9/9PTI2Xg== Received: from DM6PR12MB4987.namprd12.prod.outlook.com (2603:10b6:5:163::31) by DM5PR12MB1260.namprd12.prod.outlook.com (2603:10b6:3:78::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.26; Thu, 29 Apr 2021 13:45:23 +0000 Received: from DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::f5ce:c5a8:6aec:e308]) by DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::f5ce:c5a8:6aec:e308%7]) with mapi id 15.20.4042.027; Thu, 29 Apr 2021 13:45:23 +0000 From: Ori Kam To: Michael Baum , "dev@dpdk.org" CC: Matan Azrad , Raslan Darawsheh , Slava Ovsiienko Thread-Topic: [dpdk-dev] [PATCH 3/5] app/testpmd: support indirect counter action query Thread-Index: AQHXOpnKyfT3lCY1z0e077F4vQHmPqrLhjWA Date: Thu, 29 Apr 2021 13:45:22 +0000 Message-ID: References: <20210426124250.42771-1-michaelba@nvidia.com> <20210426124250.42771-4-michaelba@nvidia.com> In-Reply-To: <20210426124250.42771-4-michaelba@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [2a00:7c40:c360:2a4:8a6:7709:ae13:2a49] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dfb4848f-3b2f-4c74-ed1b-08d90b15097d x-ms-traffictypediagnostic: DM5PR12MB1260: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:935; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8DNbmAkHYUhujXfRBipvdpSO75SZFbpBRg8BVfh6wfagghTPfx9kr3J5//oqpTXQ03KZPOjdrJZ8ms6TQzed38fpRGNEuYrO7l6cEcy63VpR2qdIEzuNnovm9GF2K6zip3BmF1WuDcshtSApw1+U8ocp63zrG1KJtGLA+B2S7F7Q08jBwzpyYasSyJA1RMfCXrlKwG2EBGWBGlLVgBhBGJDzwqscWBECpzFbUtLPV34fPbL11KkHKEyeg5498ZWHYjIfZW/uZtJ6ye478wveNmnXTVy31+WZLhzJHOAlb7C4JbYmYxbRv73MXuraMfxvx7EFYVE1I025535Lz9FFJsOZggqGYSGJ1eIXhmjhVcA6rNdIacyl/leM8cBK4Ag9zO2AyZpgoBfhOWvnHkV2AxajE9AMuZknBKcHZ9EbU4tOVpVGIKT9q/KLcVaCWwZH41Nn9FjMdjkpFplOl3zuRYd7V2ZeLWvvmHciQ0Jhsh3nrfg6JKFl8EmzlHhKWhZkQoniRlpCtHiGWwNBLw9fQzgLQKc93QtjPZVqZfYqBhDds2u4oNlV7fRvVe5ze/fILJJgmL50yQYdLZicO745Eb8+SBCMVwU4lB2x/1DHpQU= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4987.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(39860400002)(376002)(136003)(396003)(366004)(110136005)(316002)(4326008)(2906002)(6506007)(66446008)(66946007)(54906003)(7696005)(478600001)(33656002)(53546011)(86362001)(38100700002)(64756008)(76116006)(71200400001)(83380400001)(122000001)(186003)(8676002)(9686003)(55016002)(5660300002)(107886003)(66476007)(8936002)(52536014)(66556008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?rFCTDPxoIXRiECwiNLCoyfGhWX4aBvAtY9wj5FITe/UTUJcbKMHSP9KaBuoN?= =?us-ascii?Q?6jR1uZKGZkDWGBKe88XS/m/rvqXGYHU5oHRI8bE2BVgkQ8oQ0Od24H4HpOkn?= =?us-ascii?Q?+jK5sXjOaM4fcVCEtb6idMVHtsWCefdM8BoGKnOe8aigICglUHMCIAOxvp0T?= =?us-ascii?Q?3k/oKwgBfniGpEbC3rdYfZjIIo75EA2WO/tcfBLB1hqGOgqeQqFS1yhQVuTA?= =?us-ascii?Q?JvT9iIhRuGm0qs8Yip9Yc7GGFK2hr1hRzNNdZqumY0BfLZrRljCSKU19eeQw?= =?us-ascii?Q?ta6FG8UdtgVa+/Zmc+4BYYRey1kOgWNopsDAOV73aGzbbyF9QXD44I/7vdSU?= =?us-ascii?Q?8y4NNeRqiuoCO7uQtYwsoWnT1fGBBwj9ilj+Lw/4kscgSnKjg/NTc8yYS0G/?= =?us-ascii?Q?RjazHVRLVrS768n2PnQ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ascii?Q?U0xlAW9jW6G+4MTzMEHhcLgxH9aqmiKNBSap/vx5CC2XC5HVABG4aDSBfR7K?= =?us-ascii?Q?78ezIHeFyzdMVs7490EHIANuTdKF?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4987.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfb4848f-3b2f-4c74-ed1b-08d90b15097d X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2021 13:45:22.9183 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KIKb2vkWXHPs9v/AIyx196C9aKW3/Jd0McpZ8QUpdFU8u6ItW4aQgQZs3QHrk58frNBtyot3WxVpCBKKBLUpCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1260 Subject: Re: [dpdk-dev] [PATCH 3/5] app/testpmd: support indirect counter action query X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Hi Michael, > -----Original Message----- > From: dev On Behalf Of Michael Baum > Sent: Monday, April 26, 2021 3:43 PM > To: dev@dpdk.org > Cc: Matan Azrad ; Raslan Darawsheh > ; Slava Ovsiienko > Subject: [dpdk-dev] [PATCH 3/5] app/testpmd: support indirect counter > action query >=20 > Counter action query was implemented as part of flow query, but was not > implemented as part of indirect action query. >=20 > This patch adds the required implementation. >=20 > Signed-off-by: Michael Baum > Acked-by: Matan Azrad > --- > app/test-pmd/config.c | 145 +++++++++++++++++++++++++++--------------- > -------- > 1 file changed, 77 insertions(+), 68 deletions(-) >=20 > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index > a9805cc..bedbfcb 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -1618,90 +1618,99 @@ struct rte_flow_action_handle * { > struct rte_flow_error error; > struct port_indirect_action *pia; > - uint64_t default_data; > - void *data =3D NULL; > - int ret =3D 0; > + union { > + struct rte_flow_query_count count; > + struct rte_flow_query_age age; > + struct rte_flow_action_conntrack ct; > + } query; >=20 > pia =3D action_get_by_id(port_id, id); > if (!pia) > return -EINVAL; > switch (pia->type) { > case RTE_FLOW_ACTION_TYPE_AGE: > - data =3D &default_data; > + case RTE_FLOW_ACTION_TYPE_COUNT: > break; > default: > - printf("Indirect action %u (type: %d) on port %u doesn't" > - " support query\n", id, pia->type, port_id); > - return -1; > + printf("Indirect action %u (type: %d) on port %u doesn't > support query\n", > + id, pia->type, port_id); > + return -ENOTSUP; > } > - if (rte_flow_action_handle_query(port_id, pia->handle, data, > &error)) > - ret =3D port_flow_complain(&error); > + /* Poisoning to make sure PMDs update it in case of error. */ > + memset(&error, 0x55, sizeof(error)); > + memset(&query, 0, sizeof(query)); > + if (rte_flow_action_handle_query(port_id, pia->handle, &query, > &error)) > + return port_flow_complain(&error); > switch (pia->type) { > case RTE_FLOW_ACTION_TYPE_AGE: > - if (!ret) { > - struct rte_flow_query_age *resp =3D data; > - > - printf("AGE:\n" > - " aged: %u\n" > - " sec_since_last_hit_valid: %u\n" > - " sec_since_last_hit: %" PRIu32 "\n", > - resp->aged, > - resp->sec_since_last_hit_valid, > - resp->sec_since_last_hit); > - } > - data =3D NULL; > + printf("Indirect AGE action:\n" > + " aged: %u\n" > + " sec_since_last_hit_valid: %u\n" > + " sec_since_last_hit: %" PRIu32 "\n", > + query.age.aged, > + query.age.sec_since_last_hit_valid, > + query.age.sec_since_last_hit); > + break; > + case RTE_FLOW_ACTION_TYPE_COUNT: > + printf("Indirect COUNT action:\n" > + " hits_set: %u\n" > + " bytes_set: %u\n" > + " hits: %" PRIu64 "\n" > + " bytes: %" PRIu64 "\n", > + query.count.hits_set, > + query.count.bytes_set, > + query.count.hits, > + query.count.bytes); > break; > case RTE_FLOW_ACTION_TYPE_CONNTRACK: > - if (!ret) { > - struct rte_flow_action_conntrack *ct =3D data; > - > - printf("Conntrack Context:\n" > - " Peer: %u, Flow dir: %s, Enable: %u\n" > - " Live: %u, SACK: %u, CACK: %u\n" > - " Packet dir: %s, Liberal: %u, State: %u\n" > - " Factor: %u, Retrans: %u, TCP flags: %u\n" > - " Last Seq: %u, Last ACK: %u\n" > - " Last Win: %u, Last End: %u\n", > - ct->peer_port, > - ct->is_original_dir ? "Original" : "Reply", > - ct->enable, ct->live_connection, > - ct->selective_ack, ct->challenge_ack_passed, > - ct->last_direction ? "Original" : "Reply", > - ct->liberal_mode, ct->state, > - ct->max_ack_window, ct->retransmission_limit, > - ct->last_index, ct->last_seq, ct->last_ack, > - ct->last_window, ct->last_end); > - printf(" Original Dir:\n" > - " scale: %u, fin: %u, ack seen: %u\n" > - " unacked data: %u\n Sent end: %u," > - " Reply end: %u, Max win: %u, Max ACK: %u\n", > - ct->original_dir.scale, > - ct->original_dir.close_initiated, > - ct->original_dir.last_ack_seen, > - ct->original_dir.data_unacked, > - ct->original_dir.sent_end, > - ct->original_dir.reply_end, > - ct->original_dir.max_win, > - ct->original_dir.max_ack); > - printf(" Reply Dir:\n" > - " scale: %u, fin: %u, ack seen: %u\n" > - " unacked data: %u\n Sent end: %u," > - " Reply end: %u, Max win: %u, Max ACK: %u\n", > - ct->reply_dir.scale, > - ct->reply_dir.close_initiated, > - ct->reply_dir.last_ack_seen, > - ct->reply_dir.data_unacked, > - ct->reply_dir.sent_end, ct->reply_dir.reply_end, > - ct->reply_dir.max_win, ct->reply_dir.max_ack); > - } > - data =3D NULL; > + printf("Conntrack Context:\n" > + " Peer: %u, Flow dir: %s, Enable: %u\n" > + " Live: %u, SACK: %u, CACK: %u\n" > + " Packet dir: %s, Liberal: %u, State: %u\n" > + " Factor: %u, Retrans: %u, TCP flags: %u\n" > + " Last Seq: %u, Last ACK: %u\n" > + " Last Win: %u, Last End: %u\n", > + query.ct.peer_port, > + query.ct.is_original_dir ? "Original" : "Reply", > + query.ct.enable, query.ct.live_connection, > + query.ct.selective_ack, query.ct.challenge_ack_passed, > + query.ct.last_direction ? "Original" : "Reply", > + query.ct.liberal_mode, query.ct.state, > + query.ct.max_ack_window, > query.ct.retransmission_limit, > + query.ct.last_index, query.ct.last_seq, > + query.ct.last_ack, query.ct.last_window, > + query.ct.last_end); > + printf(" Original Dir:\n" > + " scale: %u, fin: %u, ack seen: %u\n" > + " unacked data: %u\n Sent end: %u," > + " Reply end: %u, Max win: %u, Max ACK: %u\n", > + query.ct.original_dir.scale, > + query.ct.original_dir.close_initiated, > + query.ct.original_dir.last_ack_seen, > + query.ct.original_dir.data_unacked, > + query.ct.original_dir.sent_end, > + query.ct.original_dir.reply_end, > + query.ct.original_dir.max_win, > + query.ct.original_dir.max_ack); > + printf(" Reply Dir:\n" > + " scale: %u, fin: %u, ack seen: %u\n" > + " unacked data: %u\n Sent end: %u," > + " Reply end: %u, Max win: %u, Max ACK: %u\n", > + query.ct.reply_dir.scale, > + query.ct.reply_dir.close_initiated, > + query.ct.reply_dir.last_ack_seen, > + query.ct.reply_dir.data_unacked, > + query.ct.reply_dir.sent_end, > + query.ct.reply_dir.reply_end, > + query.ct.reply_dir.max_win, > + query.ct.reply_dir.max_ack); > break; > default: > - printf("Indirect action %u (type: %d) on port %u doesn't" > - " support query\n", id, pia->type, port_id); > - ret =3D -1; > + printf("Indirect action %u (type: %d) on port %u doesn't > support query\n", > + id, pia->type, port_id); > + break; > } > - return ret; > + return 0; > } >=20 > static struct port_flow_tunnel * > -- > 1.8.3.1 [Ori Kam]=20 Acked-by: Ori Kam Thanks, Ori