From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50053.outbound.protection.outlook.com [40.107.5.53]) by dpdk.org (Postfix) with ESMTP id 257A91B7D5 for ; Thu, 20 Dec 2018 07:46:05 +0100 (CET) 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=GmEOPkfSH47eIMKgworQiXOlSKILWvkFU6i8UVkYQXo=; b=JMWSBYHt5LWubWHwDyuOkAyUAw/m9Gu9RABsS3JqaLadXhMzxseaTg3OoJbfReyRlmSiAAcAaMTZXyQh2ynOd2ZsVwRmMgei24FoVhW3NhwUq7t6v1yymqrbRnPfBjaYooScqPJXKclxuMX1HvckMF6YWHOkZzEToqOt4b9nHjw= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB5753.eurprd05.prod.outlook.com (20.178.105.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.17; Thu, 20 Dec 2018 06:46:04 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::b0a0:72a4:7547:1c3c]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::b0a0:72a4:7547:1c3c%3]) with mapi id 15.20.1446.020; Thu, 20 Dec 2018 06:46:04 +0000 From: Shahaf Shuler To: Tom Barbette , "dev@dpdk.org" CC: "bruce.richardson@intel.com" , "john.mcnamara@intel.com" , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Yongseok Koh Thread-Topic: [PATCH 2/3] mlx5: Implement support for read_clock Thread-Index: AQHUl6HCCyJLzn3pNUq8mbBlgA4+cqWHL5vQ Date: Thu, 20 Dec 2018 06:46:03 +0000 Message-ID: References: <20181219134934.24693-1-barbette@kth.se> <20181219134934.24693-3-barbette@kth.se> In-Reply-To: <20181219134934.24693-3-barbette@kth.se> 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: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB5753; 6:bZl4boLUCmbv2RR4/obE/xHTv4GvBsi0dhO8qKcJhKqIeFEtvuH2/v4oXujJqnsF7FOr1ryGqUDyiZN3nZbYUuD+RD4oSmfwdVQu+av3zIAs+oa834q87h6034LNylX0DBv/y9oBjMFZY1q1f+90l7okbboXl0gm4CVHlDe1NsteNQjQZJGSIz9qetZyYAzbUTnYxF/OuDvKlGAr7DUNyY5kndsZONLUHZ3u8sqyrIkvgZmwkcKjKcINTccmgqK+nxlGRZXE+9IvmWsEQDcir8GhWh815uha7GZ6kIghKiz4tdAawnyO5t4rru08c3Okbpw44zWkAIW6SXWmReLMkdiTykHGKwTe+1wsZ07RAjg7Ptllm1mKTyV+6yeD3JT4aP8kZloBdNsgV4J3sT4aa+VTS6t8zKCXDWjJEQBZMl29dIS8u2RGmhmKcVGQrGfKybkDDRTIvbxgqAoMm5jgHQ==; 5:On2DzvcBcHntE+3MYtWfwZAr/4sf52zItjGnmcemNYy0Tz7gXExinznHgN4KWK+fHoAdHuanww/xLcVgjXKVmUYZxlPO06sb+6pX5r0hKbwMxBb6Krbqhaj9ur0Y6Qj6OtFSaHcbFXVcnpxVgyV84KV6quDt04GhdFDE5GMYDKk=; 7:Y9PiXKN+ea4g48/tpMm9jfFtFvFX0Xt8+lMbHBtsf/vynAEis/gEcWO3KdphIejdEfn7zoplO/Km2Nt1g87TE1SttnUFeSCxlaMzPJZ/tUS1MIy7O3Q7qMbOypF1N6qvZ2FiyHWiIVV5e/yddrYc4A== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 4accae92-d986-4e2e-92c7-08d66646cfd8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB5753; x-ms-traffictypediagnostic: DB7PR05MB5753: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(999002)(5005026)(6040522)(2401047)(8121501046)(93006095)(93001095)(3231475)(944501520)(52105112)(10201501046)(3002001)(6055026)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:DB7PR05MB5753; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB5753; x-forefront-prvs: 0892FA9A88 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(396003)(366004)(39860400002)(189003)(199004)(478600001)(305945005)(486006)(106356001)(476003)(66066001)(11346002)(446003)(105586002)(8676002)(8936002)(7736002)(2906002)(81166006)(81156014)(6506007)(256004)(5660300001)(14444005)(107886003)(53936002)(6246003)(102836004)(9686003)(7696005)(99286004)(55016002)(26005)(33656002)(68736007)(316002)(76176011)(25786009)(74316002)(186003)(3846002)(6116002)(4326008)(6436002)(97736004)(229853002)(86362001)(575784001)(110136005)(71190400001)(71200400001)(54906003)(14454004)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB5753; H:DB7PR05MB4426.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: ZnhXawaFNl5+abmhbp42T+JDg1U9pAalvlY5Q65fHj5Jcy+O3CBgmCtpmA1qmwSF0+E+Z+nzf2P0JgAooVoOjnKtLcSmMkJWhD9E+dmGTKeeiPEojXTCrrLWmFRigKIna+IPwZXtucxNDxxEOyf3uXwcJU0ZeFPm64j2f1ya6v1PTAQD1ITuVGPkHhmn3DgsgaADYj8FuJKrlJsMGwx62hpddPImPdd/QOAmxKUcWD/iy4kKmIdDjqYUaCyriHb4wBLcvVgGFFvNCtA4UEZqKwFLnwg4fTVSRPnPANBC9B3tbFV2zvg+50DcIYOKG2gp 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: 4accae92-d986-4e2e-92c7-08d66646cfd8 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2018 06:46:03.9856 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5753 Subject: Re: [dpdk-dev] [PATCH 2/3] mlx5: Implement support for read_clock 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: Thu, 20 Dec 2018 06:46:05 -0000 Wednesday, December 19, 2018 3:50 PM, Tom Barbette: > Subject: [PATCH 2/3] mlx5: Implement support for read_clock Implement -> implement (lower case)=20 >=20 > Signed-off-by: Tom Barbette Acked-by: Shahaf Shuler > --- > drivers/net/mlx5/Makefile | 2 +- > drivers/net/mlx5/meson.build | 2 +- > drivers/net/mlx5/mlx5.c | 1 + > drivers/net/mlx5/mlx5.h | 1 + > drivers/net/mlx5/mlx5_ethdev.c | 30 ++++++++++++++++++++++++++++++ > drivers/net/mlx5/mlx5_glue.c | 8 ++++++++ > drivers/net/mlx5/mlx5_glue.h | 2 ++ > 7 files changed, 44 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index > 895cdfeed..1353c1827 100644 > --- a/drivers/net/mlx5/Makefile > +++ b/drivers/net/mlx5/Makefile > @@ -8,7 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB =3D > librte_pmd_mlx5.a LIB_GLUE =3D $(LIB_GLUE_BASE).$(LIB_GLUE_VERSION) > LIB_GLUE_BASE =3D librte_pmd_mlx5_glue.so -LIB_GLUE_VERSION =3D 18.11.0 > +LIB_GLUE_VERSION =3D 19.02.0 >=20 > # Sources. > SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) +=3D mlx5.c diff --git > a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index > 28938db0f..8ba19e818 100644 > --- a/drivers/net/mlx5/meson.build > +++ b/drivers/net/mlx5/meson.build > @@ -4,7 +4,7 @@ >=20 > pmd_dlopen =3D get_option('enable_driver_mlx_glue') > LIB_GLUE_BASE =3D 'librte_pmd_mlx5_glue.so' > -LIB_GLUE_VERSION =3D '18.11.0' > +LIB_GLUE_VERSION =3D '19.02.0' > LIB_GLUE =3D LIB_GLUE_BASE + '.' + LIB_GLUE_VERSION if pmd_dlopen > dpdk_conf.set('RTE_LIBRTE_MLX5_DLOPEN_DEPS', 1) diff --git > a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > 9e5cab169..ed799ab5a 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -372,6 +372,7 @@ const struct eth_dev_ops mlx5_dev_ops =3D { > .xstats_reset =3D mlx5_xstats_reset, > .xstats_get_names =3D mlx5_xstats_get_names, > .dev_infos_get =3D mlx5_dev_infos_get, > + .read_clock =3D mlx5_read_clock, > .dev_supported_ptypes_get =3D mlx5_dev_supported_ptypes_get, > .vlan_filter_set =3D mlx5_vlan_filter_set, > .rx_queue_setup =3D mlx5_rx_queue_setup, diff --git > a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index > 75aeeb2b6..82f98334f 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -264,6 +264,7 @@ int mlx5_set_flags(struct rte_eth_dev *dev, unsigned > int keep, > unsigned int flags); > int mlx5_dev_configure(struct rte_eth_dev *dev); void > mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info= ); > +int mlx5_read_clock(struct rte_eth_dev *dev, uint64_t *time); > const uint32_t *mlx5_dev_supported_ptypes_get(struct rte_eth_dev *dev); = int > mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete); int > mlx5_force_link_status_change(struct rte_eth_dev *dev, int status); diff = --git > a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index > d178ed6a1..35bfbf769 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -557,6 +557,36 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct > rte_eth_dev_info *info) > } > } >=20 > +/** > + * Get device current raw clock counter > + * > + * @param dev > + * Pointer to Ethernet device structure. > + * @param[out] time > + * Current raw clock counter of the device. > + * > + * @return > + * 0 if the clock has correctly been read > + * The value of errno in case of error > + */ > +int > +mlx5_read_clock(struct rte_eth_dev *dev, uint64_t *clock) { > + struct priv *priv =3D dev->data->dev_private; > + struct ibv_values_ex values; > + int err =3D 0; > + > + values.comp_mask =3D IBV_VALUES_MASK_RAW_CLOCK; > + err =3D mlx5_glue->query_rt_values_ex(priv->ctx, &values); > + if (err !=3D 0) { > + DRV_LOG(WARNING, "Could not query the clock !"); > + return err; > + } > + *clock =3D values.raw_clock.tv_nsec; > + return 0; > +} > + > + > /** > * Get supported packet types. > * > diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c = index > dd10ad6de..e23296519 100644 > --- a/drivers/net/mlx5/mlx5_glue.c > +++ b/drivers/net/mlx5/mlx5_glue.c > @@ -86,6 +86,13 @@ mlx5_glue_query_device_ex(struct ibv_context > *context, > return ibv_query_device_ex(context, input, attr); } >=20 > +static int > +mlx5_glue_query_rt_values_ex(struct ibv_context *context, > + struct ibv_values_ex *values) > +{ > + return ibv_query_rt_values_ex(context, values); } > + > static int > mlx5_glue_query_port(struct ibv_context *context, uint8_t port_num, > struct ibv_port_attr *port_attr) @@ -491,6 +498,7 @@ > const struct mlx5_glue *mlx5_glue =3D &(const struct mlx5_glue){ > .close_device =3D mlx5_glue_close_device, > .query_device =3D mlx5_glue_query_device, > .query_device_ex =3D mlx5_glue_query_device_ex, > + .query_rt_values_ex =3D mlx5_glue_query_rt_values_ex, > .query_port =3D mlx5_glue_query_port, > .create_comp_channel =3D mlx5_glue_create_comp_channel, > .destroy_comp_channel =3D mlx5_glue_destroy_comp_channel, diff --git > a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h index > 2d92ba8bc..31ebee72a 100644 > --- a/drivers/net/mlx5/mlx5_glue.h > +++ b/drivers/net/mlx5/mlx5_glue.h > @@ -70,6 +70,8 @@ struct mlx5_glue { > int (*query_device_ex)(struct ibv_context *context, > const struct ibv_query_device_ex_input *input, > struct ibv_device_attr_ex *attr); > + int (*query_rt_values_ex)(struct ibv_context *context, > + struct ibv_values_ex *values); > int (*query_port)(struct ibv_context *context, uint8_t port_num, > struct ibv_port_attr *port_attr); > struct ibv_comp_channel *(*create_comp_channel) > -- > 2.17.1