@@ -7,17 +7,27 @@
#include "res.h"
#include <inttypes.h>
+static bool resp_is_valid(struct nlattr **nla_line, bool raw)
+{
+ if (raw)
+ return nla_line[RDMA_NLDEV_ATTR_RES_RAW] ? true : false;
+ if (!nla_line[RDMA_NLDEV_ATTR_RES_MRLEN])
+ return MNL_CB_ERROR;
+ return true;
+}
+
static int res_mr_line(struct rd *rd, const char *name, int idx,
struct nlattr **nla_line)
{
uint32_t rkey = 0, lkey = 0;
uint64_t iova = 0, mrlen;
+ bool raw = rd->show_raw;
char *comm = NULL;
uint32_t pdn = 0;
uint32_t mrn = 0;
uint32_t pid = 0;
- if (!nla_line[RDMA_NLDEV_ATTR_RES_MRLEN])
+ if (!resp_is_valid(nla_line, raw))
return MNL_CB_ERROR;
if (nla_line[RDMA_NLDEV_ATTR_RES_RKEY])
@@ -69,6 +79,7 @@ static int res_mr_line(struct rd *rd, const char *name, int idx,
print_comm(rd, comm, nla_line);
print_driver_table(rd, nla_line[RDMA_NLDEV_ATTR_DRIVER]);
+ print_raw_data(rd, nla_line);
newline(rd);
out: