naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/0066-rdma-Add-MR-resource-tracking-information.patch

99be8f
From a7f1b85b6838bdab705aef188bb0c86626bc3391 Mon Sep 17 00:00:00 2001
99be8f
From: Andrea Claudi <aclaudi@redhat.com>
99be8f
Date: Mon, 25 Mar 2019 13:31:02 +0100
99be8f
Subject: [PATCH] rdma: Add MR resource tracking information
99be8f
99be8f
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1642479
99be8f
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1641914
99be8f
Upstream Status: iproute2.git commit 8958a15c040e0
99be8f
Conflicts: remove rdma chunks due to missing files
99be8f
99be8f
commit 8958a15c040e05f4f2c6f3946322202fdb875348
99be8f
Author: Steve Wise <swise@opengridcomputing.com>
99be8f
Date:   Thu Mar 29 09:10:41 2018 -0700
99be8f
99be8f
    rdma: Add MR resource tracking information
99be8f
99be8f
    Sample output:
99be8f
99be8f
    Without CAP_NET_ADMIN:
99be8f
99be8f
    $ rdma resource show mr mrlen 65536
99be8f
    dev mlx4_0 mrlen 65536 pid 0 comm [nvme_rdma]
99be8f
    dev cxgb4_0 mrlen 65536 pid 0 comm [nvme_rdma]
99be8f
99be8f
    With CAP_NET_ADMIN:
99be8f
99be8f
    # rdma resource show mr mrlen 65536
99be8f
    dev mlx4_0 rkey 0x12702 lkey 0x12702 iova 0x85724a000 mrlen 65536 pid 0 comm [nvme_rdma]
99be8f
    dev cxgb4_0 rkey 0x68fe4e9 lkey 0x68fe4e9 iova 0x835b91000 mrlen 65536 pid 0 comm [nvme_rdma]
99be8f
99be8f
    Signed-off-by: Steve Wise <swise@opengridcomputing.com>
99be8f
    Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
99be8f
    Signed-off-by: David Ahern <dsahern@gmail.com>
99be8f
---
99be8f
 include/json_writer.h |  2 ++
99be8f
 lib/json_writer.c     | 11 +++++++++++
99be8f
 2 files changed, 13 insertions(+)
99be8f
99be8f
diff --git a/include/json_writer.h b/include/json_writer.h
99be8f
index 1516aafba59df..34f2ccc2f5423 100644
99be8f
--- a/include/json_writer.h
99be8f
+++ b/include/json_writer.h
99be8f
@@ -39,6 +39,7 @@ void jsonw_bool(json_writer_t *self, bool value);
99be8f
 void jsonw_float(json_writer_t *self, double number);
99be8f
 void jsonw_float_fmt(json_writer_t *self, const char *fmt, double num);
99be8f
 void jsonw_uint(json_writer_t *self, uint64_t number);
99be8f
+void jsonw_xint(json_writer_t *self, uint64_t number);
99be8f
 void jsonw_hu(json_writer_t *self, unsigned short number);
99be8f
 void jsonw_int(json_writer_t *self, int64_t number);
99be8f
 void jsonw_null(json_writer_t *self);
99be8f
@@ -49,6 +50,7 @@ void jsonw_string_field(json_writer_t *self, const char *prop, const char *val);
99be8f
 void jsonw_bool_field(json_writer_t *self, const char *prop, bool value);
99be8f
 void jsonw_float_field(json_writer_t *self, const char *prop, double num);
99be8f
 void jsonw_uint_field(json_writer_t *self, const char *prop, uint64_t num);
99be8f
+void jsonw_xint_field(json_writer_t *self, const char *prop, uint64_t num);
99be8f
 void jsonw_hu_field(json_writer_t *self, const char *prop, unsigned short num);
99be8f
 void jsonw_int_field(json_writer_t *self, const char *prop, int64_t num);
99be8f
 void jsonw_null_field(json_writer_t *self, const char *prop);
99be8f
diff --git a/lib/json_writer.c b/lib/json_writer.c
99be8f
index 6b77d288cce2b..6aaa6b4170711 100644
99be8f
--- a/lib/json_writer.c
99be8f
+++ b/lib/json_writer.c
99be8f
@@ -226,6 +226,11 @@ void jsonw_uint(json_writer_t *self, uint64_t num)
99be8f
 	jsonw_printf(self, "%"PRIu64, num);
99be8f
 }
99be8f
 
99be8f
+void jsonw_xint(json_writer_t *self, uint64_t num)
99be8f
+{
99be8f
+	jsonw_printf(self, "%"PRIx64, num);
99be8f
+}
99be8f
+
99be8f
 void jsonw_lluint(json_writer_t *self, unsigned long long int num)
99be8f
 {
99be8f
 	jsonw_printf(self, "%llu", num);
99be8f
@@ -272,6 +277,12 @@ void jsonw_uint_field(json_writer_t *self, const char *prop, uint64_t num)
99be8f
 	jsonw_uint(self, num);
99be8f
 }
99be8f
 
99be8f
+void jsonw_xint_field(json_writer_t *self, const char *prop, uint64_t num)
99be8f
+{
99be8f
+	jsonw_name(self, prop);
99be8f
+	jsonw_xint(self, num);
99be8f
+}
99be8f
+
99be8f
 void jsonw_hu_field(json_writer_t *self, const char *prop, unsigned short num)
99be8f
 {
99be8f
 	jsonw_name(self, prop);
99be8f
-- 
d30c09
2.21.0
99be8f