automatic DPDK test reports
 help / color / mirror / Atom feed
From: dpdklab@iol.unh.edu
To: test-report@dpdk.org
Cc: dpdk-test-reports@iol.unh.edu
Subject: [dpdk-test-report] |WARNING| pw99966 [PATCH] [v1] cryptodev: add telemetry endpoint for cryptodev info
Date: Tue,  5 Oct 2021 11:44:03 -0400 (EDT)	[thread overview]
Message-ID: <20211005154403.8BEB66D535@noxus.dpdklab.iol.unh.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 3630 bytes --]

Test-Label: iol-testing
Test-Status: WARNING
http://dpdk.org/patch/99966

_apply patch failure_

Submitter: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Wednesday, September 29 2021 06:45:23 
Applied on: CommitID:086d426406bd3f6fac96a15bbd871c7fe714bc2d
Apply patch set 99966 failed:

Checking patch lib/cryptodev/rte_cryptodev.c...
error: while searching for:
	return 0;
}

RTE_INIT(cryptodev_init_telemetry)
{
	rte_telemetry_register_cmd("/cryptodev/list", cryptodev_handle_dev_list,

error: patch failed: lib/cryptodev/rte_cryptodev.c:2481
error: while searching for:
	rte_telemetry_register_cmd("/cryptodev/stats",
			cryptodev_handle_dev_stats,
			"Returns the stats for a cryptodev. Parameters: int dev_id");
}

error: patch failed: lib/cryptodev/rte_cryptodev.c:2488
Applying patch lib/cryptodev/rte_cryptodev.c with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
diff a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c	(rejected hunks)
@@ -2481,6 +2481,72 @@ cryptodev_handle_dev_stats(const char *cmd __rte_unused,
 	return 0;
 }
 
+#define CRYPTO_CAPS_SZ                                                         \
+	(RTE_ALIGN_CEIL(sizeof(struct rte_cryptodev_capabilities),             \
+			sizeof(uint64_t)) /                                    \
+	 sizeof(uint64_t))
+
+static int
+crypto_caps_array(struct rte_tel_data *d,
+		  const struct rte_cryptodev_capabilities *capabilities)
+{
+	const struct rte_cryptodev_capabilities *dev_caps;
+	union caps_u {
+		struct rte_cryptodev_capabilities dev_caps;
+		uint64_t val[CRYPTO_CAPS_SZ];
+	} caps;
+	unsigned int i = 0, j, n = 0;
+
+	rte_tel_data_start_array(d, RTE_TEL_U64_VAL);
+
+	while ((dev_caps = &capabilities[i++])->op !=
+	   RTE_CRYPTO_OP_TYPE_UNDEFINED) {
+		memset(&caps, 0, sizeof(caps));
+		rte_memcpy(&caps.dev_caps, dev_caps, sizeof(capabilities[0]));
+		for (j = 0; j < CRYPTO_CAPS_SZ; j++)
+			rte_tel_data_add_array_u64(d, caps.val[j]);
+		++n;
+	}
+
+	return n;
+}
+
+static int
+cryptodev_handle_info(const char *cmd __rte_unused, const char *params,
+			  struct rte_tel_data *d)
+{
+	char name[RTE_CRYPTODEV_NAME_MAX_LEN];
+	struct rte_cryptodev_info dev_info;
+	struct rte_tel_data *crypto_caps;
+	struct rte_cryptodev *dev;
+	int crypto_caps_n;
+
+	if (params == NULL || strlen(params) == 0 || !isdigit(*params))
+		return -EINVAL;
+
+	rte_strlcpy(name, params, RTE_CRYPTODEV_NAME_LEN);
+	dev = rte_cryptodev_pmd_get_named_dev(name);
+	if (!dev)
+		return -EINVAL;
+
+	rte_tel_data_start_dict(d);
+	rte_tel_data_add_dict_int(d, "dev_id", dev->data->dev_id);
+	rte_tel_data_add_dict_int(d, "socket_id", dev->data->socket_id);
+	rte_tel_data_add_dict_int(d, "dev_started", dev->data->dev_started);
+
+	/* Crypto capabilities */
+	crypto_caps = rte_tel_data_alloc();
+	if (!crypto_caps)
+		return -ENOMEM;
+
+	rte_cryptodev_info_get(dev->data->dev_id, &dev_info);
+	crypto_caps_n = crypto_caps_array(crypto_caps, dev_info.capabilities);
+	rte_tel_data_add_dict_container(d, "crypto_caps", crypto_caps, 0);
+	rte_tel_data_add_dict_int(d, "crypto_caps_n", crypto_caps_n);
+
+	return 0;
+}
+
 RTE_INIT(cryptodev_init_telemetry)
 {
 	rte_telemetry_register_cmd("/cryptodev/list", cryptodev_handle_dev_list,
@@ -2488,4 +2554,6 @@ RTE_INIT(cryptodev_init_telemetry)
 	rte_telemetry_register_cmd("/cryptodev/stats",
 			cryptodev_handle_dev_stats,
 			"Returns the stats for a cryptodev. Parameters: int dev_id");
+	rte_telemetry_register_cmd("/cryptodev/info", cryptodev_handle_info,
+		"Returns cryptodev info. Parameters: pci id");
 }

https://lab.dpdk.org/results/dashboard/patchsets/19044/

UNH-IOL DPDK Community Lab

                 reply	other threads:[~2021-10-05 15:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211005154403.8BEB66D535@noxus.dpdklab.iol.unh.edu \
    --to=dpdklab@iol.unh.edu \
    --cc=dpdk-test-reports@iol.unh.edu \
    --cc=test-report@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).