From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40083.outbound.protection.outlook.com [40.107.4.83]) by dpdk.org (Postfix) with ESMTP id C800D1B137 for ; Tue, 23 Oct 2018 12:04:12 +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=sJtPIZ9HKOykGFiDp5Y8heZLVfbhAlmhqGjPtx2MORw=; b=hyLZxCVrsAUVOZjRZCTLe5QD0EWfEf+ttwztyKwg1IlMe/1bSJD8CGqYsE3lsCdIPANjmG1oDSIX9uVezjNsYa7QepQov40rFIbpUlbIu6dpQ9X/juRimsUZPWI3gMx+NNFr1W4sLj4lJRmSIu00PvF2la3pcG5vsu67r1nmohY= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.186.150) by AM4PR05MB1619.eurprd05.prod.outlook.com (10.165.245.138) 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:11 +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:11 +0000 From: Slava Ovsiienko To: Slava Ovsiienko CC: "dev@dpdk.org" Thread-Topic: [PATCH v4 2/8] net/mlx5: rename flow counter configuration macro Thread-Index: AQHUare+bKIUHzQ/cEyKGhyggk3R6g== Date: Tue, 23 Oct 2018 10:04:11 +0000 Message-ID: <1540289032-29628-3-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; AM4PR05MB1619; 6:Fn5iyL5xJQfQNOQZHWXQkLN7hrn0SUvB920jALUixeCJ1LnRxcns0NW0ijOhbnCbXlRuuYSKYpWrZ6pT/0H3wMiep53fL08hgRfCS251rCYvDFduONEgxTN+fxdkWVtu/WEgQ76sZR9zvi5jfWj4TKU0LZ14ffHK0co7NIi5mbtroGVE3244+CiwHPN82yQg/klxjmhQFXc4+8yEtN26TKYk+S8V1oxihEu1Pz0n/g/OYBRG6w+v2OpkkzptjInZQVYKtSsr0dOxaq1waYYrNWO0uBcjzaSBWx3vPbNwYwKY+/ZjoUVuvohsBvnUdENjMDqNxHpdcgR7VYNuGiBMxO13dEJxOWz1Ax0iAnzgwGksW0ls/bL3NszzPpC1tnog+lgbPhkHYK/maCoPugWO1l08SXCC7wPP2oviqdGQ0rseMMZs+FI9HlaLA2e+TLnnMnleXWyeinTTiBMgFvweuVke+WpVqKP5InAYu5af6xw=; 5:b8yLA+LiLdJ8oP8ga2oAThSf9OQRFbK1ABzwcqPFEa56rH/4LShfSBgLoMIy6Mgy5FtT9JwIp9iRY29kh1SQ/W/m/HhDLOu8vzqj+qczEKM8t51XJWCRbUPZvYuQ95FAXPZC9kNX6jr2cjJZP6z13d2wsfTqpsz4NYxtg183BRQ=; 7:v+m9lgkS6Dn5jEcJKIkUukWi1VRx+mk5HCy98IU+K+3bAUGhA4/6KrGWRQR/nDf0/zq9tqr6kow+26ze3+hXY3OMpAh8Q4Ubb6Ce6ZI2hN/VAuBzI6llps8hxln+Gsqscv3nw2jrkT+OfcBQE1Bnn2GSOgzuuXAO1ly8arwWnTTlwD7lu6Hs8oxgD4kztswQ2bUlxCUTssjVY5L7ag0xXeLeYbyLOAqmdtoBq/iVXPQKIGLqj4VY2p2ZndX+57b3 x-ms-office365-filtering-correlation-id: a0baf08e-6cc2-4eb0-0855-08d638cee10f 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:AM4PR05MB1619; x-ms-traffictypediagnostic: AM4PR05MB1619: 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)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB1619; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1619; x-forefront-prvs: 0834BAF534 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(366004)(376002)(136003)(39860400002)(189003)(199004)(102836004)(6512007)(6116002)(6436002)(53936002)(11346002)(3846002)(99286004)(5250100002)(6200100001)(71200400001)(71190400001)(6486002)(26005)(186003)(66066001)(97736004)(52116002)(37006003)(106356001)(446003)(105586002)(68736007)(7049001)(316002)(6506007)(81166006)(8936002)(81156014)(305945005)(2900100001)(7736002)(386003)(4326008)(256004)(76176011)(8676002)(5660300001)(19627235002)(36756003)(575784001)(478600001)(14454004)(6862004)(476003)(86362001)(486006)(25786009)(2906002)(2616005)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1619; H:AM4PR05MB3265.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-microsoft-antispam-message-info: O9+E8vfnb/XEQvWcBa9r7WIvQeJ5cLh55os73075KuW6XFSwxbkcGi/CvdxNAy4eAL0osnXbEa9WYYrbJiMpPPVnjRWfdGBQp4QnPR/mcuIgMB5ejZZePAnvL3p7y+OoeWxmG5ErzTMTV9tT585+TEMW2TuFuU4fcPaL83lWuCMRC+wcYM7TFRoA/iuCvEBkMIqMEDyOkRidtE+1EB5NAJx2uOlZWC6rz+75wFxMuKDfW4NDTKLejLQp3fmGMkUV70P94fRwjqTC1xLrNb4JnTQPQdQo6xdixLs9FqcuOFnJstAkcHeGj/8ZrZglXTm3ZPT7+3weeTh3R1LYy0TpwNg+yQIeyf2tU/L0LrdnrEY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0baf08e-6cc2-4eb0-0855-08d638cee10f X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2018 10:04:11.3633 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1619 Subject: [dpdk-dev] [PATCH v4 2/8] net/mlx5: rename flow counter configuration macro 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: , X-List-Received-Date: Tue, 23 Oct 2018 10:04:13 -0000 The HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT is replaced with HAVE_IBV_DEVICE_COUNTERS_SET_V42. At this stage it is just macro renaming. This macro is defined if system supports the "old" Flow counters functionality, MLNX_OFED version from 4.2 to 4.4 is required. We need to do this preparation before introducing the new configuration macro (HAVE_IBV_DEVICE_COUNTERS_SET_V45) for the "new" Flow counters support. Both makefile and meson.build are changed. Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/Makefile | 2 +- drivers/net/mlx5/meson.build | 2 +- drivers/net/mlx5/mlx5.c | 4 ++-- drivers/net/mlx5/mlx5_flow_verbs.c | 10 +++++----- drivers/net/mlx5/mlx5_glue.c | 8 ++++---- drivers/net/mlx5/mlx5_glue.h | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index 1e9c0b4..124ee4e 100644 --- a/drivers/net/mlx5/Makefile +++ b/drivers/net/mlx5/Makefile @@ -157,7 +157,7 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-= h.sh enum ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ - HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT \ + HAVE_IBV_DEVICE_COUNTERS_SET_V42 \ infiniband/verbs.h \ type 'struct ibv_counter_set_init_attr' \ $(AUTOCONF_OUTPUT) diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index c192d44..e613a21 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -79,7 +79,7 @@ if build has_member_args =3D [ [ 'HAVE_IBV_MLX5_MOD_SWP', 'infiniband/mlx5dv.h', 'struct mlx5dv_sw_parsing_caps', 'sw_parsing_offloads' ], - [ 'HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT', 'infiniband/verbs.h', + [ 'HAVE_IBV_DEVICE_COUNTERS_SET_V42', 'infiniband/verbs.h', 'struct ibv_counter_set_init_attr', 'counter_set_id' ], ] # input array for meson symbol search: diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index cfff54e..cb86a69 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -739,7 +739,7 @@ unsigned int mprq_max_stride_size_n =3D 0; unsigned int mprq_min_stride_num_n =3D 0; unsigned int mprq_max_stride_num_n =3D 0; -#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_V42 struct ibv_counter_set_description cs_desc =3D { .counter_type =3D 0 }; #endif struct ether_addr mac; @@ -1009,7 +1009,7 @@ config.hw_csum =3D !!(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_SUPPORT +#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_V42 config.flow_counter_en =3D !!attr.max_counter_sets; mlx5_glue->describe_counter_set(ctx, 0, &cs_desc); DRV_LOG(DEBUG, "counter type =3D %d, num of cs =3D %ld, attributes =3D %d= ", diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flo= w_verbs.c index 6ddb13b..3d6fedb 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -60,7 +60,7 @@ cnt->ref_cnt++; return cnt; } -#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_V42 =20 struct mlx5_flow_counter tmpl =3D { .shared =3D shared, @@ -938,7 +938,7 @@ { const struct rte_flow_action_count *count =3D action->conf; struct rte_flow *flow =3D dev_flow->flow; -#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_V42 unsigned int size =3D sizeof(struct ibv_flow_spec_counter_action); struct ibv_flow_spec_counter_action counter =3D { .type =3D IBV_FLOW_SPEC_ACTION_COUNT, @@ -957,7 +957,7 @@ " context."); } *action_flags |=3D MLX5_FLOW_ACTION_COUNT; -#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_V42 counter.counter_set_handle =3D flow->counter->cs->handle; flow_verbs_spec_add(dev_flow, &counter, size); #endif @@ -1222,7 +1222,7 @@ detected_actions |=3D MLX5_FLOW_ACTION_RSS; break; case RTE_FLOW_ACTION_TYPE_COUNT: -#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_V42 size +=3D sizeof(struct ibv_flow_spec_counter_action); #endif detected_actions |=3D MLX5_FLOW_ACTION_COUNT; @@ -1665,7 +1665,7 @@ void *data __rte_unused, struct rte_flow_error *error) { -#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_V42 if (flow->actions & MLX5_FLOW_ACTION_COUNT) { struct rte_flow_query_count *qc =3D data; uint64_t counters[2] =3D {0, 0}; diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c index 48590df..889e074 100644 --- a/drivers/net/mlx5/mlx5_glue.c +++ b/drivers/net/mlx5/mlx5_glue.c @@ -215,7 +215,7 @@ mlx5_glue_create_counter_set(struct ibv_context *context, struct ibv_counter_set_init_attr *init_attr) { -#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42 (void)context; (void)init_attr; return NULL; @@ -227,7 +227,7 @@ static int mlx5_glue_destroy_counter_set(struct ibv_counter_set *cs) { -#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42 (void)cs; return ENOTSUP; #else @@ -240,7 +240,7 @@ uint16_t counter_set_id, struct ibv_counter_set_description *cs_desc) { -#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42 (void)context; (void)counter_set_id; (void)cs_desc; @@ -254,7 +254,7 @@ mlx5_glue_query_counter_set(struct ibv_query_counter_set_attr *query_attr, struct ibv_counter_set_data *cs_data) { -#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42 (void)query_attr; (void)cs_data; return ENOTSUP; diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h index f6e4e38..adee972 100644 --- a/drivers/net/mlx5/mlx5_glue.h +++ b/drivers/net/mlx5/mlx5_glue.h @@ -23,7 +23,7 @@ #define MLX5_GLUE_VERSION "" #endif =20 -#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42 struct ibv_counter_set; struct ibv_counter_set_data; struct ibv_counter_set_description; --=20 1.8.3.1