From patchwork Tue Oct 23 10:04:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 47227 X-Patchwork-Delegate: shahafs@mellanox.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 898341B471; Tue, 23 Oct 2018 12:04:30 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60087.outbound.protection.outlook.com [40.107.6.87]) by dpdk.org (Postfix) with ESMTP id 28F731B19A for ; Tue, 23 Oct 2018 12:04:14 +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=vXPwAkIkqPRucQ2IlWHVbcv6Te2FtielwA3TQyknt7I=; b=HiEqUaNVNqe3wvzB1EYOgAEgTTryyFprtns40EfF0LeKSVeZ5veV/532schje4YEkAk2dLf+H+mBF/VAucxPSdFk8hhXKptbPeL3d5n6GxC3cUrIujQtWpXC0BVYVS/Mm+jEZhkUVdrk7flBa2/B9sX63/EQCB/G00yez43ppws= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.186.150) by AM4PR05MB3380.eurprd05.prod.outlook.com (10.171.187.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.30; Tue, 23 Oct 2018 10:04:13 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::477:2091:24b4:439f]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::477:2091:24b4:439f%4]) with mapi id 15.20.1250.028; Tue, 23 Oct 2018 10:04:13 +0000 From: Slava Ovsiienko To: Slava Ovsiienko CC: "dev@dpdk.org" Thread-Topic: [PATCH v4 4/8] net/mlx5: simplify flow counters support check Thread-Index: AQHUare/O2tIo9kmKkK88sd3BetAyQ== Date: Tue, 23 Oct 2018 10:04:13 +0000 Message-ID: <1540289032-29628-5-git-send-email-viacheslavo@mellanox.com> References: <1539962470-10950-1-git-send-email-viacheslavo@mellanox.com> <1540289032-29628-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1540289032-29628-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0442.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::22) To AM4PR05MB3265.eurprd05.prod.outlook.com (2603:10a6:205:4::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3380; 6:59NPa8EpNVJLZuiLFnakF/g6KrMKoDiQXu+CjjtCuNW0TUG8Am6w3nMAylVxKC4KyCcEUfS6nmrTQmmuUJvNqAhSaZS9vDimwHQ2Lk0QAOe1kd1Qa7A5AFGj/+GC4GGYGVdNd1G7YY4QsqWqkrthee74gD5e3WH8eXnttM8tdiyWh28M4SR5f822PXL48CQVeX5+1KVdi7x+QUmZ4VrYdKgz2E4/VUHU5eQMtI3XEQmPxgIRw6xGb64EXvF4zk8LG0aoVsJv3GL1uOZDM9WOkPZyaokRoZ8aPjB1Rc5Ge+m8VANYKXc4eMEh3kQrjRVZCUSjcttY/Fco1LwfYOP8UD3LNpKu5i3BTrez2Vip8tOPG9I6FY+hFBV9Lr0EwRDVzNyvv+ffhQFKlXoJGKE/o2b+yCWeYXNMqF4b7U6in2MXHUWU9rweJHSmpjyjkzr4zl5DXAvKZB1rAPtmJb7PVA==; 5:grtQ/muVMBSe+7mQx0yQuruKLT/bYW+VhuWes10ptqXYOmtr0UZTeRe4QIUY5lOjqVDFHwxUQYkDd4fF1SJCMurNkLxyjEwqc3bSatNdyGODosGkz8aKjQygJigoWiXQxxJqlz2GHMaDylid1TLQlpBi5NDdCjonyiKErv5YzpU=; 7:YoR6MKDIjyPePaYu4IVL0EQcekPd0jvOqKM/wh0rkyR76QHQIiqfQ4wFowgwvHzb5/CsdlUxg8+7q4rxqr2FU3k5u+cMO+b6VvOEkBYakAHn1SN3y1F2Y4azaOrf4bT72ItVJo2UOPxSc/DhBFHlzipLBXs/cx/zgznVH+5cmq5ezYDOQt5yPYiclBwUgCY/d1qwh4M182MSsQ76bWzYPUyEc7uQuP8RZcHQxVZjW7IBxcJMZF6cYMS8Puts84zX x-ms-office365-filtering-correlation-id: dd6656a2-bc27-4a50-ddd0-08d638cee20f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3380; x-ms-traffictypediagnostic: AM4PR05MB3380: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB3380; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3380; x-forefront-prvs: 0834BAF534 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(346002)(39860400002)(376002)(366004)(199004)(189003)(71200400001)(6512007)(2906002)(478600001)(5660300001)(446003)(2616005)(14454004)(53936002)(6436002)(37006003)(3846002)(81156014)(6862004)(86362001)(36756003)(2900100001)(5250100002)(7736002)(305945005)(14444005)(6116002)(6486002)(105586002)(7049001)(316002)(97736004)(68736007)(71190400001)(52116002)(102836004)(4326008)(476003)(25786009)(99286004)(66066001)(106356001)(8676002)(81166006)(256004)(76176011)(6506007)(386003)(486006)(11346002)(6200100001)(26005)(186003)(8936002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3380; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: rR+KHAXiq7yM2v5l3WQhJy2xHTeITLse056Y93hUxv3aDgWUZCsKfa7QsBtPXMSssp0qC6Q1uFIICnbaZRiKwZKvn945cDGJ2gGB7RrJ+IlhkTqQ8mIHK1zWyRXcSapYFF7ySTur/uKs8EAjybePgNHqa28/CUfl/ttL5ap8kMp9l71wtQd7wHkOj+MRBUFgwkZ8p1qk5IigsexAG2ceR3c+30lwCdzeVBCOR1V2t0RacgFEx3UjkzzBP2Vk4vJaMn2ARKA1UN2E8c01Shj7g1knOuahlwN8M+Ph0s/VaMpcA0KqcOdu5ubowC2oNnXCKWDtBrwYbZGnwNeJU3HDbGRk3qpGCZ+NiJO/9mivE2k= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd6656a2-bc27-4a50-ddd0-08d638cee20f X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2018 10:04:13.0935 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3380 Subject: [dpdk-dev] [PATCH v4 4/8] net/mlx5: simplify flow counters support check 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" The redundant check of Flow counters support in runtime is removed. The flag flow_counter_en is eliminated from the code. The Verbs create counter function just returns an error if no counter support presented in the system. If there is no any of Flow counters configuration macro defined the log message is emited, indicating the missing counter support. mlx5_flow_validate_action_count() fuctnion is also updated due to flow_counter_en flag removal. Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5.c | 12 +++--------- drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_flow.c | 8 +------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index cb86a69..a6cae69 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -739,9 +739,6 @@ unsigned int mprq_max_stride_size_n = 0; unsigned int mprq_min_stride_num_n = 0; unsigned int mprq_max_stride_num_n = 0; -#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_V42 - struct ibv_counter_set_description cs_desc = { .counter_type = 0 }; -#endif struct ether_addr mac; char name[RTE_ETH_NAME_MAX_LEN]; int own_domain_id = 0; @@ -1009,12 +1006,9 @@ config.hw_csum = !!(attr.device_cap_flags_ex & IBV_DEVICE_RAW_IP_CSUM); DRV_LOG(DEBUG, "checksum offloading is %ssupported", (config.hw_csum ? "" : "not ")); -#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_V42 - config.flow_counter_en = !!attr.max_counter_sets; - mlx5_glue->describe_counter_set(ctx, 0, &cs_desc); - DRV_LOG(DEBUG, "counter type = %d, num of cs = %ld, attributes = %d", - cs_desc.counter_type, cs_desc.num_of_cs, - cs_desc.attributes); +#if !defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42) && \ + !defined(HAVE_IBV_DEVICE_COUNTERS_SET_V45) + DRV_LOG(DEBUG, "counters are not supported"); #endif config.ind_table_max_size = attr.rss_caps.max_rwq_indirection_table_size; diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index d14239c..74d87c0 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -114,7 +114,6 @@ struct mlx5_dev_config { unsigned int tunnel_en:1; /* Whether tunnel stateless offloads are supported. */ unsigned int mpls_en:1; /* MPLS over GRE/UDP is enabled. */ - unsigned int flow_counter_en:1; /* Whether flow counter is supported. */ unsigned int cqe_comp:1; /* CQE compression is enabled. */ unsigned int tso:1; /* Whether TSO is supported. */ unsigned int tx_vec_en:1; /* Tx vector is enabled. */ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index fcabab0..14288e4 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -921,16 +921,10 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority, * 0 on success, a negative errno value otherwise and rte_ernno is set. */ int -mlx5_flow_validate_action_count(struct rte_eth_dev *dev, +mlx5_flow_validate_action_count(struct rte_eth_dev *dev __rte_unused, const struct rte_flow_attr *attr, struct rte_flow_error *error) { - struct priv *priv = dev->data->dev_private; - - if (!priv->config.flow_counter_en) - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ACTION, NULL, - "flow counters are not supported."); if (attr->egress) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL,