]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sif: cq: transfer headroom attribute to user mode
authorKnut Omang <knut.omang@oracle.com>
Fri, 21 Oct 2016 06:23:39 +0000 (08:23 +0200)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Mon, 24 Oct 2016 16:06:02 +0000 (09:06 -0700)
This commit makes sure old libsif versions works
with the driver while providing a forward compatible
way of making additional changes to the extra
headroom in the CQs.

We anticipate to be able to trim
down the extra entries once we have PQP errors
handled transparently. This commit then ensures that
the headroom is only set in one place, at the
driver side, and that user mode just can
pick up the configured headroom from the kernel.
This is done by providing the used headroom
in a formerly reserved 32 bit field, thus no changes
to the packet size is necessary.

Nevertheless we increment the abi version from
3.6 to 3.7 to allow libsif to detect whether
the headroom field can be trusted.

Orabug: 24926265

Signed-off-by: Knut Omang <knut.omang@oracle.com>
Reviewed-by: franklin <osl04sys_no_grp@oracle.com>
drivers/infiniband/hw/sif/sif_cq.c
drivers/infiniband/hw/sif/sif_user.h
drivers/infiniband/hw/sif/version.c
drivers/infiniband/hw/sif/versioninfo.h

index 2087ea67dc36de66b2fb26b42469a72e389ebdfe..46b1ee9da9ae60c716a13a762a6bd0157408fbcc 100644 (file)
@@ -107,6 +107,8 @@ struct ib_cq *sif_create_cq(struct ib_device *ibdev, int entries,
                        user_mode = false;
                if (uc->abi_version < 0x0302) /* TBD: Remove - bw comp */
                        user_mode = !user_mode;
+               if (uc->abi_version < SIF_UVERBS_VERSION(3, 6))
+                       user_flags |= no_x_cqe;
        }
 
        cq = create_cq(pd, entries, comp_vector, proxy, user_mode, user_flags);
@@ -119,6 +121,8 @@ struct ib_cq *sif_create_cq(struct ib_device *ibdev, int entries,
 
                memset(&resp, 0, sizeof(resp));
                resp.cq_idx = cq->index;
+               if (user_mode)
+                       resp.headroom = cq->entries - cq->ibcq.cqe;
                ret = ib_copy_to_udata(udata, &resp, sizeof(resp));
                if (ret) {
                        destroy_cq(cq);
index 1e62f4806c6326eb6ee213a0ec0b690ee17d664d..b03974981dcc4065eaae008ce7b5f10d2770a07c 100644 (file)
@@ -21,7 +21,7 @@
  *
  */
 #define SIF_UVERBS_ABI_MAJOR_VERSION    3
-#define SIF_UVERBS_ABI_MINOR_VERSION    6
+#define SIF_UVERBS_ABI_MINOR_VERSION    7
 
 #define SIF_UVERBS_VERSION(x, y) ((x) << 8 | (y))
 
@@ -129,7 +129,7 @@ struct sif_create_cq_ext {
 
 struct sif_create_cq_resp_ext {
        __u32 cq_idx;
-       __u32 reserved;
+       __u32 headroom; /* #of reserved entries (not exposed to the user) in the CQ */
 };
 
 struct sif_create_qp_ext {
index dfc3a07fc9afdaec1543bf0786b997096651877b..e919c3ca07ec4a10271248df1a94e2296a45c863 100644 (file)
@@ -4,12 +4,12 @@
 
 struct sif_version sif_version = {
 .git_repo = "sifdrv [origin/master]",
-.last_commit = "titan_1.0.5.0 Retest last allocated entry with roundrobin allocation",
+.last_commit = "titan_1.0.6.0 cq: transfer headroom attribute to user mode",
 .git_status = "",
-.build_git_time = "Mon, 03 Oct 2016 10:12:59 +0000",
+.build_git_time = "Mon, 24 Oct 2016 11:51:44 +0000",
 .build_user = "komang",
 
 .git_psifapi_repo = "psifapi [origin/master]",
-.last_psifapi_commit = "titan_1.0.5.0 preparations for venus",
+.last_psifapi_commit = "titan_1.0.6.0 preparations for venus",
 .git_psifapi_status = "",
 };
index 36cdafaff1f482e66c9385515e156caa03c2d7e9..711cce6ec97272b6d04b2a3e75cbe5b781b5d8c7 100644 (file)
@@ -1,6 +1,6 @@
 /* Misc driver release info */
 
-#define BUILD_DATE "2016-10-03"
-#define BUILD_TIME "10:12:59"
-#define BUILD_EPOCH 1475489579
-#define TITAN_RELEASE "1.0.5.0"
+#define BUILD_DATE "2016-10-24"
+#define BUILD_TIME "11:51:44"
+#define BUILD_EPOCH 1477309904
+#define TITAN_RELEASE "1.0.6.0"