From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20082.outbound.protection.outlook.com [40.107.2.82]) by dpdk.org (Postfix) with ESMTP id E3E444C96 for ; Sun, 21 Oct 2018 11:20:44 +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=ybr9OvSIKtZG8kfTR+VS+6N6z4gWWOp1vhFsCNEbh8I=; b=cpKXBshlO/uJBUPo3nBgwQAto+SuPn/GLK7aTWVc9kLEOv0p3BzVTrwyl9PUlpLS2pSTd7FCkPmQYROt5OEZe0DjLb5KR1pYkQpW+KKyv5cQmI3xDx0uWJcFZ+8m024xEXdjMs5htAdo5U4cy8sUrdzyJl4CT4+Du3oxz5NU4Ng= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4891.eurprd05.prod.outlook.com (20.176.235.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.25; Sun, 21 Oct 2018 09:20:43 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::80e:e6b:baf2:d973]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::80e:e6b:baf2:d973%3]) with mapi id 15.20.1250.028; Sun, 21 Oct 2018 09:20:43 +0000 From: Shahaf Shuler To: Slava Ovsiienko , Yongseok Koh CC: "dev@dpdk.org" Thread-Topic: [PATCH v3 2/6] net/mlx5: flow counters new configuration flags Thread-Index: AQHUZ79ycnfxiF9Ye0indc9i+rDNT6UpYjbQ Date: Sun, 21 Oct 2018 09:20:43 +0000 Message-ID: References: <1539784438-29242-1-git-send-email-viacheslavo@mellanox.com> <1539962470-10950-1-git-send-email-viacheslavo@mellanox.com> <1539962470-10950-3-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1539962470-10950-3-git-send-email-viacheslavo@mellanox.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=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4891; 6:QuLdwdupdZ/siMXOfduEEkZXxj4GR4qccXI/dConmH1UxIC5qJ/BiD+cuW0wM/BXlEVJoTrPkIUF5wcnmsn3W9FMqsghgDpHh5R0WPV7JXjXXH+qH59ATNs7u/kZ10tEoVH0oFlUMvPY/vMwhte2tPbN7NjgbJbnGHLiBdOjH1iH6jZngUE0yBxcrU7GOszDwALESibK7xX+dswIwnHX0ZCd5UD86/rLY+w2It/4BVI55rxOW2a2Zk9jKX9031dnCR3dbjAIS8rl+c3Lj8sLsqPzjGEpz7z9jNj/dxT7mdZUtgsi7fHixf3chBdv1akV7ioG5M+3BBwUwENYT+ZCVWwKGtKsAJw0Gor8oShqHCiSpohnJZCkmhmqzY93Z8sKcB7Lv3khR4zIPhar0Va8IXFwIecQo+Q75NoRKl+m4JXF8KYiiTg6F2Z4y9448YVYI6rZS3zwZIZeTJzm5C0yWw==; 5:7YiIqIwTM+1vtrAWXQRVPYOpGsBay9zIZS963L0rZJZti9YYKUlibqQpvc8eD/zv6/GzBg8bajQrVu/OC3n3uKzMSNCkR1lmEfiOmuQNqe+OK6mi4ZefNMSaGw4vAGyf1t2lHVlYc6byO8tNbuVVgUb70Fup0+MQAUJqMTtWdDU=; 7:VAlJngrbN6WzS2y9cwa9ZlIVD2FMS0ITNOwZF+b8oMa1FfcROWHr80zSzP6FO+TyM4RHbWG0z7sFp1xz+dzwhQfm+HHg601Et2oxCrV1c2ISFLBye55YItG7HTtFDQx6/dnSGCyVbGKslW1V+xDianb+R4zB1Xkf3MZA6uOxm/4anGsc1LrO3j2OBn8Ompluh0hKDvEOkDkP/tjkcj91wJbp2OxtjzmzysDygQX/IR9L5HkY5RMLx0sU7fkDx5V2 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 2e3d84ee-a2ad-4ed6-e898-08d637367a48 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4891; x-ms-traffictypediagnostic: DB7PR05MB4891: 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)(3002001)(10201501046)(3231355)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB7PR05MB4891; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4891; x-forefront-prvs: 083289FD26 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(396003)(376002)(39860400002)(346002)(199004)(189003)(33656002)(68736007)(74316002)(476003)(305945005)(81166006)(486006)(81156014)(2906002)(316002)(7736002)(97736004)(71200400001)(71190400001)(14454004)(6246003)(478600001)(6116002)(3846002)(5250100002)(2900100001)(19627235002)(7696005)(5660300001)(26005)(9686003)(76176011)(66066001)(86362001)(186003)(25786009)(102836004)(55016002)(256004)(575784001)(53936002)(4326008)(6636002)(99286004)(446003)(110136005)(106356001)(229853002)(8936002)(6506007)(8676002)(11346002)(6436002)(105586002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4891; H:DB7PR05MB4426.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: Q3oO5N2EcZNUdvPuvz/S4GOxIZkvDB1+Mu2t0bDbPwKIRkZcpnHBVdHuaVD2/slpxmL8YZkiBSY4hKdJK7sBv7qzMwxADGdMNTeadrnBfqpA88pF1IqzAm1YeZJXpZEKj5SLPQdYOokSHHUI2Gqw1pgnQotJh/TLNgHomxW99reuB6z8PVzG3xAEkDvwx7Y0VJqhmTrdITRfq2I5+QHurBGpMHJnC53TacZq68kI8ojUmKUDWqcrQjbyi6R8ZExgru7CQazDtI+r3m3Tb0cY9umqvIzFnSYSgwIhcL8Wucw0xa/RmDJeVaUjwK9QQosX1B4lAzvep10Hr2VvJfoANerEidY5RVNsC5wwWqrcQ9A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e3d84ee-a2ad-4ed6-e898-08d637367a48 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2018 09:20:43.8233 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4891 Subject: Re: [dpdk-dev] [PATCH v3 2/6] net/mlx5: flow counters new configuration flags 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: Sun, 21 Oct 2018 09:20:45 -0000 Friday, October 19, 2018 6:21 PM, Slava Ovsiienko: > Subject: [PATCH v3 2/6] net/mlx5: flow counters new configuration flags How about "net/mlx5: rename flow counter configuration macro" ? >=20 > In this part of patchset some modifications in compile configuration flag= s are > done.=20 Ditto.=20 The HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT is replaced with > HAVE_IBV_DEVICE_COUNTERS_SET_V42. At this stage it is just flag > renaming.=20 Up till here great. You can also add it is a preparation to the new counter= support were we will have 2 different configuration macros for the counter= s.=20 The patch should only rename the existing macro. The subsequent patch shoul= d add the new macro for the new counter support along with the implementati= on.=20 The below part should be on the commit log of that patch.=20 The new HAVE_IBV_DEVICE_COUNTERS_SET_V45 flag is > introduced. Both makefile and meson.build are changed, the flag > modifications are grouped, no more build system files modifications are > expected in this patchset, ones are grouped in this part. > HAVE_IBV_DEVICE_COUNTERS_SET_V45 is just introduced, no code > dependence in this part of pathset. >=20 > HAVE_IBV_DEVICE_COUNTERS_SET_V42 - is defined if system supports the > "old" flow counters functionality, MLNX_OFED version from > 4.2 to 4.4 is required. >=20 > HAVE_IBV_DEVICE_COUNTERS_SET_V45 - is defined if system supports the > "new" flow counters functionality, MLNX_OVED 4.5 (or higher) or Linux > rdma-core v19 (or higher) is required. >=20 > Neither HAVE_IBV_DEVICE_COUNTERS_SET_V42 not > HAVE_IBV_DEVICE_COUNTERS_SET_V45 is defined if there is no counters > support. >=20 > Signed-off-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/Makefile | 9 +++++++-- > drivers/net/mlx5/meson.build | 6 ++++-- > 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, 23 insertions(+), 16 deletions(-) >=20 > diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index > 1e9c0b4..28547d3 100644 > --- a/drivers/net/mlx5/Makefile > +++ b/drivers/net/mlx5/Makefile > @@ -157,9 +157,14 @@ 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 \ >>From this line > + infiniband/verbs.h \ > + type 'struct ibv_counter_set_init_attr' \ > + $(AUTOCONF_OUTPUT) Till this one you have an extra space at the start of the line. Need to hav= e all indentation with tabs.=20 > + $Q sh -- '$<' '$@' \ > + HAVE_IBV_DEVICE_COUNTERS_SET_V45 \ > infiniband/verbs.h \ > - type 'struct ibv_counter_set_init_attr' \ > + type 'struct ibv_counters_init_attr' \ > $(AUTOCONF_OUTPUT) > $Q sh -- '$<' '$@' \ > HAVE_RDMA_NL_NLDEV \ > diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build > index c192d44..1c4ed30 100644 > --- a/drivers/net/mlx5/meson.build > +++ b/drivers/net/mlx5/meson.build > @@ -79,8 +79,10 @@ 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', > - 'struct ibv_counter_set_init_attr', 'counter_set_id' ], > + [ 'HAVE_IBV_DEVICE_COUNTERS_SET_V42', > 'infiniband/verbs.h', > + 'struct ibv_counter_set_init_attr', 'counter_set_id' ], Same about the extra space.=20 > + [ 'HAVE_IBV_DEVICE_COUNTERS_SET_V45', > 'infiniband/verbs.h', > + 'struct ibv_counters_init_attr', 'comp_mask' ], > ] > # input array for meson symbol search: > # [ "MACRO to define if found", "header for the search", diff --git > a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > 13f2fd4..bb19085 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_flow_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; > -- > 1.8.3.1