All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next V2 0/9] Add completion timestamping support
@ 2015-05-31 12:14 Or Gerlitz
       [not found] ` <1433074457-26437-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 64+ messages in thread
From: Or Gerlitz @ 2015-05-31 12:14 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Amir Vadai, Tal Alon, Or Gerlitz

Hi Doug,

This patchset adds completion timestamping supports for verbs consumers. 

Reviewing the weekend threads, we've changed the flag time to reflect
that this is completion time-stamp and folded the mlx4 actual support 
into one patch.

Regarding the related user-space support, it's possible to add what you
were suggesting, ibv_get_raw_cqe_timestamp() -- returns ts in cycles and 
ibv_get_cqe_timestamp() -- returns ts in ns, this makes the value returned
by the poll cq verb an opaque one that must go through one of  the convertors.

We would to go for one helper ibv_get_timestamp(uint64_t raw_time, flag) which 
could get the raw time-stamp and one of the following flags: RAW_TIME, RAW_NS_TIME.

We think this would address the reviewer comments for the kernel submission.

The user-space code is in (still uses IB_CQ_FLAGS_TIMESTAMP and miss the 
conversion functions) 

 https://github.com/matanb10/libibverbs timestamp-v1
 https://github.com/matanb10/libmlx4 timestamp-v1

Timestamping is used by applications in order to know when a WQE was 
received/transmitted by the HW. The value is given is HCA hardware cycles,
but could be easily converted as the hardware's core clock frequecny is 
available through extension of query device. 

Moreover, we add an ability to read the HCA's current clock. This could be 
useful on order to synchronize events to the wall clock.

This functionality is achieved by adding/extending the following verbs:

create_cq - create_cq is extended in order to allow passing creation flags
to the CQ creation function. We change IB/core --> vendors API
to be easily extendible by passing a struct which contains
comp_vectors, cqe and the new flags parameter. In order to create
CQ which supports timestamping, IB_CQ_FLAGS_TIMESTAMP_COMPLETION should be given.

query_device - We extend query_device uverb further by giving the hardware's
clock frequency and the timestamp mask (the number of timestamp
bits which are supported). If timestamp isn't supported, 0 is returned.

In order to read the timestamp in the WQE, the user needs to query the device 
for support, create an appropriate CQ (using the extanded uverb with
IB_CQ_FLAGS_TIMESTAMP_COMPLETION) and poll the CQ with an extended poll_cq verb (currently,
only implemented in user-space).

In mlx4, allowing the user to read the core clock efficiently involves mapping
this area of the hardware to user-space (being done by using a mmap command)
and reading the clock from the correct offset of the page. 

This offset is returned in the vendor's specific data from mlx4's kernel driver 
to the mlx4's user-space driver. query_device is modified in order to support
passing this vendor specific data. A user-space application could use a new
verb in order to read the hardware's clock.

Translating the hardware's clock into ms could be done by dividing this
value by hca_core_clock (which is returned by the extended version of
query_device uverb).

A user-space application could get the current HW's clock by executing

ibv_query_values_ex(struct ibv_context *context, uint32_t q_values,
                    struct ibv_values_ex *values)

The function gets a mask of the values to query and return their values.
Vendors could either implement this as a uverb command or use their 
user-space driver to return those values directly from the HW (the mlx4 way).

Matan and Or.

Changes from V1:
 (1) fixed lustre IB's code build
 (2) squashed mlx4 V1 9-11 patches into one
 (3) changed IB_CQ_FLAGS_TIMESTAMP --> IB_CQ_FLAGS_TIMESTAMP_COMPLETION

Changes from V0:
(1) Pass ib_cq_init_attr instead of cqe and comp_vector.
(2) Fix unneeded indentation.
(3) Change flags to u32.
(4) Add const to create_cq's ib_cq_init_attr argument in vendor implementation.

Matan Barak (9):
  IB/core: Change provider's API of create_cq to be extendible
  IB/core: Change ib_create_cq to use struct ib_cq_init_attr
  IB/core: Add CQ creation time-stamping flag
  IB/core: Extend ib_uverbs_create_cq
  IB/core: Add timestamp_mask and hca_core_clock to query_device
  IB/core: Pass hardware specific data in query_device
  IB/mlx4: Add mmap call to map the hardware clock
  IB/mlx4: Support extended create_cq and query_device uverbs
  IB/mlx4: Add support for CQ time-stamping

 drivers/infiniband/core/device.c                   |    6 +-
 drivers/infiniband/core/mad.c                      |    5 +-
 drivers/infiniband/core/uverbs.h                   |    1 +
 drivers/infiniband/core/uverbs_cmd.c               |  188 ++++++++++++++++----
 drivers/infiniband/core/uverbs_main.c              |    1 +
 drivers/infiniband/core/verbs.c                    |    4 +-
 drivers/infiniband/hw/amso1100/c2_provider.c       |   14 ++-
 drivers/infiniband/hw/cxgb3/iwch_provider.c        |   19 ++-
 drivers/infiniband/hw/cxgb4/cq.c                   |    9 +-
 drivers/infiniband/hw/cxgb4/iw_cxgb4.h             |    8 +-
 drivers/infiniband/hw/cxgb4/provider.c             |    8 +-
 drivers/infiniband/hw/ehca/ehca_cq.c               |    7 +-
 drivers/infiniband/hw/ehca/ehca_hca.c              |    6 +-
 drivers/infiniband/hw/ehca/ehca_iverbs.h           |    6 +-
 drivers/infiniband/hw/ehca/ehca_main.c             |    6 +-
 drivers/infiniband/hw/ipath/ipath_cq.c             |    9 +-
 drivers/infiniband/hw/ipath/ipath_verbs.c          |    7 +-
 drivers/infiniband/hw/ipath/ipath_verbs.h          |    3 +-
 drivers/infiniband/hw/mlx4/cq.c                    |   13 ++-
 drivers/infiniband/hw/mlx4/mad.c                   |    5 +-
 drivers/infiniband/hw/mlx4/main.c                  |   67 +++++++-
 drivers/infiniband/hw/mlx4/mlx4_ib.h               |   19 ++-
 drivers/infiniband/hw/mlx5/cq.c                    |   10 +-
 drivers/infiniband/hw/mlx5/main.c                  |   19 ++-
 drivers/infiniband/hw/mlx5/mlx5_ib.h               |    5 +-
 drivers/infiniband/hw/mthca/mthca_provider.c       |   15 ++-
 drivers/infiniband/hw/nes/nes_verbs.c              |   17 ++-
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c        |   13 ++-
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h        |    9 +-
 drivers/infiniband/hw/qib/qib_cq.c                 |   11 +-
 drivers/infiniband/hw/qib/qib_verbs.c              |    6 +-
 drivers/infiniband/hw/qib/qib_verbs.h              |    5 +-
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c       |   16 ++-
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h       |   10 +-
 drivers/infiniband/ulp/ipoib/ipoib_verbs.c         |    9 +-
 drivers/infiniband/ulp/iser/iser_verbs.c           |    6 +-
 drivers/infiniband/ulp/isert/ib_isert.c            |    6 +-
 drivers/infiniband/ulp/srp/ib_srp.c                |   10 +-
 drivers/infiniband/ulp/srpt/ib_srpt.c              |    5 +-
 drivers/net/ethernet/mellanox/mlx4/main.c          |   19 ++
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c    |    7 +-
 include/linux/mlx4/device.h                        |    9 +
 include/rdma/ib_verbs.h                            |   25 ++-
 include/uapi/rdma/ib_user_verbs.h                  |   19 ++
 net/9p/trans_rdma.c                                |    5 +-
 net/rds/ib_cm.c                                    |    8 +-
 net/rds/iw_cm.c                                    |    8 +-
 net/sunrpc/xprtrdma/svc_rdma_transport.c           |   10 +-
 net/sunrpc/xprtrdma/verbs.c                        |   10 +-
 49 files changed, 564 insertions(+), 139 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2015-06-11 19:48 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-31 12:14 [PATCH for-next V2 0/9] Add completion timestamping support Or Gerlitz
     [not found] ` <1433074457-26437-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-05-31 12:14   ` [PATCH for-next V2 1/9] IB/core: Change provider's API of create_cq to be extendible Or Gerlitz
     [not found]     ` <1433074457-26437-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-06-01  9:21       ` Devesh Sharma
2015-06-01 17:00       ` Jason Gunthorpe
2015-05-31 12:14   ` [PATCH for-next V2 2/9] IB/core: Change ib_create_cq to use struct ib_cq_init_attr Or Gerlitz
     [not found]     ` <1433074457-26437-3-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-06-01 16:53       ` Jason Gunthorpe
     [not found]         ` <20150601165335.GB14391-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-02  7:29           ` Matan Barak
     [not found]             ` <CAAKD3BAyNpEKwM7xu=LzFo2F=qP=EN9ZteL2yyAgBVuPNmvtqA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-02 17:27               ` Jason Gunthorpe
     [not found]                 ` <20150602172711.GB17776-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-03  9:04                   ` Matan Barak
     [not found]                     ` <CAAKD3BA7ZD4Gx5c16Ak+0_64rzazw+7n4frkuKHyrvdT=8ac6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-03 16:02                       ` Jason Gunthorpe
2015-05-31 12:14   ` [PATCH for-next V2 3/9] IB/core: Add CQ creation time-stamping flag Or Gerlitz
2015-05-31 12:14   ` [PATCH for-next V2 4/9] IB/core: Extend ib_uverbs_create_cq Or Gerlitz
2015-05-31 12:14   ` [PATCH for-next V2 5/9] IB/core: Add timestamp_mask and hca_core_clock to query_device Or Gerlitz
2015-05-31 12:14   ` [PATCH for-next V2 6/9] IB/core: Pass hardware specific data in query_device Or Gerlitz
     [not found]     ` <1433074457-26437-7-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-06-01  9:24       ` Devesh Sharma
2015-05-31 12:14   ` [PATCH for-next V2 7/9] IB/mlx4: Add mmap call to map the hardware clock Or Gerlitz
2015-05-31 12:14   ` [PATCH for-next V2 8/9] IB/mlx4: Support extended create_cq and query_device uverbs Or Gerlitz
     [not found]     ` <1433074457-26437-9-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-06-01 16:56       ` Jason Gunthorpe
     [not found]         ` <20150601165649.GC14391-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-02  7:21           ` Matan Barak
     [not found]             ` <CAAKD3BBsTFYKwOBK+6u04x6deRYzjYESJzbpyy83UtoChZhpOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-02 17:07               ` Jason Gunthorpe
     [not found]                 ` <20150602170736.GA17776-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-03  8:57                   ` Matan Barak
     [not found]                     ` <CAAKD3BARPocK1zZ2nYV0xWHqEASJTYbp1aQxwymi-TYTyK_vGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-03 16:31                       ` Jason Gunthorpe
     [not found]                         ` <20150603163146.GD12073-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-03 18:58                           ` Or Gerlitz
     [not found]                             ` <CAJ3xEMhGdX-35WAjauKZE7+Wg39kbXP35UzYX33J6OB8g_9rYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-03 19:16                               ` Jason Gunthorpe
     [not found]                                 ` <20150603191609.GB7902-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-03 19:35                                   ` Or Gerlitz
     [not found]                                     ` <CAJ3xEMiPkxf_Qu40AozMRWZaY-dAfEyAOZGyT9VYsNpQO1Q-Zw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-03 20:38                                       ` Jason Gunthorpe
2015-05-31 12:14   ` [PATCH for-next V2 9/9] IB/mlx4: Add support for CQ time-stamping Or Gerlitz
2015-05-31 12:31   ` [PATCH for-next V2 0/9] Add completion timestamping support Or Gerlitz
2015-05-31 19:00   ` Doug Ledford
     [not found]     ` <1433098827.114391.179.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-01  9:30       ` Matan Barak
     [not found]         ` <CAAKD3BBo9A5AV9Uv-q1TgSQ6hs-oSUn5QsUT+5+6mk1RwW7AUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-01 11:25           ` Doug Ledford
     [not found]             ` <1433157904.114391.188.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-01 13:58               ` Christoph Lameter
     [not found]                 ` <alpine.DEB.2.11.1506010852360.26845-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-06-01 16:39                   ` Doug Ledford
2015-06-01 16:43               ` Jason Gunthorpe
     [not found]                 ` <20150601164322.GA14391-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-01 17:00                   ` Doug Ledford
     [not found]                     ` <1433178057.114391.208.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-01 17:29                       ` Jason Gunthorpe
2015-06-02 14:35                   ` Doug Ledford
     [not found]                     ` <1433255724.114391.225.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-02 14:44                       ` Or Gerlitz
     [not found]                         ` <556DC167.5070205-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-06-02 14:53                           ` Doug Ledford
2015-06-02 18:08                       ` Jason Gunthorpe
     [not found]                         ` <20150602180844.GD17776-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-02 18:51                           ` Doug Ledford
     [not found]                             ` <1433271083.40123.1.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-02 19:04                               ` Jason Gunthorpe
     [not found]                                 ` <20150602190410.GA23362-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-02 19:56                                   ` Doug Ledford
2015-06-03 19:48                           ` Or Gerlitz
     [not found]                             ` <CAJ3xEMjZqwJC8=HrMBv_eSVKVtLW7qjVZNjtuD28octGPtYu6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-03 20:46                               ` Jason Gunthorpe
     [not found]                                 ` <20150603204633.GE7902-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-04  0:55                                   ` Christoph Lameter
     [not found]                                     ` <alpine.DEB.2.11.1506031953500.11879-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-06-04  4:25                                       ` Jason Gunthorpe
     [not found]                                         ` <20150604042540.GA8837-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-06  8:16                                           ` Christoph Lameter
     [not found]                                             ` <alpine.DEB.2.11.1506060304480.29634-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-06-06 15:45                                               ` Doug Ledford
     [not found]                                                 ` <1433605546.40123.217.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-06 20:25                                                   ` Or Gerlitz
2015-06-07  4:42                                                   ` Jason Gunthorpe
2015-06-07  4:49                                                   ` Christoph Lameter
2015-06-04 16:17                           ` Hefty, Sean
     [not found]                             ` <1828884A29C6694DAF28B7E6B8A82373A8FE4F16-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-06-04 16:47                               ` Jason Gunthorpe
     [not found]                                 ` <20150604164759.GC27699-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-06-04 17:24                                   ` Hefty, Sean
     [not found]                                     ` <1828884A29C6694DAF28B7E6B8A82373A8FE4F98-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-06-06  8:27                                       ` Christoph Lameter
     [not found]                                         ` <alpine.DEB.2.11.1506060318570.29860-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-06-08 16:40                                           ` Hefty, Sean
     [not found]                                             ` <1828884A29C6694DAF28B7E6B8A82373A8FE5AB8-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-06-10  1:26                                               ` Christoph Lameter
     [not found]                                                 ` <alpine.DEB.2.11.1506092018190.6681-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-06-10  8:45                                                   ` Or Gerlitz
     [not found]                                                     ` <5577F93F.9030405-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-06-10 23:54                                                       ` Doug Ledford
2015-06-10 16:04                                                   ` Hefty, Sean
     [not found]                                                     ` <1828884A29C6694DAF28B7E6B8A82373A8FE6746-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-06-11 15:24                                                       ` Christoph Lameter
     [not found]                                                         ` <alpine.DEB.2.11.1506111010580.18426-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-06-11 19:48                                                           ` Hefty, Sean
2015-06-04 17:30                               ` Doug Ledford

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.