* [PATCH 0/2] add telemetry for inline IPsec
@ 2022-02-10 6:53 Ankur Dwivedi
2022-02-10 6:53 ` [PATCH 1/2] net/cnxk: add telemetry for inline IPsec for cn9k Ankur Dwivedi
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Ankur Dwivedi @ 2022-02-10 6:53 UTC (permalink / raw)
To: dev
Cc: ndabilpuram, kirankumark, skori, skoteshwar, jerinj, anoobj,
ktejasree, Ankur Dwivedi
Adds telemetry function for inline ipsec in net CNXK driver.
This series depends on the following patch series:
Series: Adding new features and improvements in cnxk crypto PMD
http://patches.dpdk.org/project/dpdk/list/?series=21433
Ankur Dwivedi (2):
net/cnxk: add telemetry for inline IPsec for cn9k
net/cnxk: add telemetry for inline IPsec for cn10k
drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c | 292 +++++++++++++++++++
drivers/net/cnxk/meson.build | 1 +
2 files changed, 293 insertions(+)
create mode 100644 drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
--
2.28.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] net/cnxk: add telemetry for inline IPsec for cn9k
2022-02-10 6:53 [PATCH 0/2] add telemetry for inline IPsec Ankur Dwivedi
@ 2022-02-10 6:53 ` Ankur Dwivedi
2022-02-17 17:51 ` Jerin Jacob
2022-02-10 6:53 ` [PATCH 2/2] net/cnxk: add telemetry for inline IPsec for cn10k Ankur Dwivedi
2022-02-10 9:12 ` [PATCH 0/2] add telemetry for inline IPsec Bruce Richardson
2 siblings, 1 reply; 8+ messages in thread
From: Ankur Dwivedi @ 2022-02-10 6:53 UTC (permalink / raw)
To: dev
Cc: ndabilpuram, kirankumark, skori, skoteshwar, jerinj, anoobj,
ktejasree, Ankur Dwivedi
Adds telemetry function to get information about inline
outbound and inline inbound sa's. The function takes port id
as input. Some fields in the structures roc_onf_ipsec_outb_sa
and roc_onf_ipsec_inb_sa are returned as output.
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
---
drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c | 140 +++++++++++++++++++
drivers/net/cnxk/meson.build | 1 +
2 files changed, 141 insertions(+)
create mode 100644 drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
diff --git a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
new file mode 100644
index 0000000000..83015e11e2
--- /dev/null
+++ b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
@@ -0,0 +1,140 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2022 Marvell.
+ */
+
+#include <rte_telemetry.h>
+
+#include <roc_api.h>
+
+#include "cnxk_ethdev.h"
+
+#define STR_MAXLEN 20
+#define W0_MAXLEN 21
+
+static int
+copy_outb_sa_9k(struct rte_tel_data *d, uint32_t i, void *sa)
+{
+ struct roc_onf_ipsec_outb_sa *out_sa;
+ union {
+ struct roc_ie_onf_sa_ctl ctl;
+ uint64_t u64;
+ } w0;
+ char strw0[W0_MAXLEN];
+ char str[STR_MAXLEN];
+
+ out_sa = (struct roc_onf_ipsec_outb_sa *)sa;
+ w0.ctl = out_sa->ctl;
+
+ snprintf(str, sizeof(str), "outsa_w0_%u", i);
+ snprintf(strw0, sizeof(strw0), "%" PRIu64, w0.u64);
+ rte_tel_data_add_dict_string(d, str, strw0);
+
+ snprintf(str, sizeof(str), "outsa_src_%u", i);
+ rte_tel_data_add_dict_u64(d, str, out_sa->udp_src);
+
+ snprintf(str, sizeof(str), "outsa_dst_%u", i);
+ rte_tel_data_add_dict_u64(d, str, out_sa->udp_dst);
+
+ snprintf(str, sizeof(str), "outsa_isrc_%u", i);
+ rte_tel_data_add_dict_u64(d, str, out_sa->ip_src);
+
+ snprintf(str, sizeof(str), "outsa_idst_%u", i);
+ rte_tel_data_add_dict_u64(d, str, out_sa->ip_dst);
+
+ return 0;
+}
+
+static int
+copy_inb_sa_9k(struct rte_tel_data *d, uint32_t i, void *sa)
+{
+ struct roc_onf_ipsec_inb_sa *in_sa;
+ union {
+ struct roc_ie_onf_sa_ctl ctl;
+ uint64_t u64;
+ } w0;
+ char strw0[W0_MAXLEN];
+ char str[STR_MAXLEN];
+
+ in_sa = (struct roc_onf_ipsec_inb_sa *)sa;
+ w0.ctl = in_sa->ctl;
+
+ snprintf(str, sizeof(str), "insa_w0_%u", i);
+ snprintf(strw0, sizeof(strw0), "%" PRIu64, w0.u64);
+ rte_tel_data_add_dict_string(d, str, strw0);
+
+ snprintf(str, sizeof(str), "insa_esnh_%u", i);
+ rte_tel_data_add_dict_u64(d, str, in_sa->esn_hi);
+
+ snprintf(str, sizeof(str), "insa_esnl_%u", i);
+ rte_tel_data_add_dict_u64(d, str, in_sa->esn_low);
+
+ return 0;
+}
+
+static int
+ethdev_sec_tel_handle_info(const char *cmd __rte_unused, const char *params,
+ struct rte_tel_data *d)
+{
+ struct cnxk_eth_sec_sess *eth_sec, *tvar;
+ struct rte_eth_dev *eth_dev;
+ struct cnxk_eth_dev *dev;
+ uint16_t port_id;
+ char *end_p;
+ uint32_t i;
+ int ret;
+
+ port_id = strtoul(params, &end_p, 0);
+ if (errno != 0)
+ return -EINVAL;
+
+ if (*end_p != '\0')
+ plt_err("Extra parameters passed to telemetry, ignoring it");
+
+ if (!rte_eth_dev_is_valid_port(port_id)) {
+ plt_err("Invalid port id %u", port_id);
+ return -EINVAL;
+ }
+
+ eth_dev = &rte_eth_devices[port_id];
+ if (!eth_dev) {
+ plt_err("Ethdev not available");
+ return -EINVAL;
+ }
+
+ dev = cnxk_eth_pmd_priv(eth_dev);
+
+ rte_tel_data_start_dict(d);
+
+ rte_tel_data_add_dict_int(d, "nb_outb_sa", dev->outb.nb_sess);
+
+ i = 0;
+ if (dev->tx_offloads & RTE_ETH_TX_OFFLOAD_SECURITY) {
+ tvar = NULL;
+ RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->outb.list, entry, tvar) {
+ ret = copy_outb_sa_9k(d, i++, eth_sec->sa);
+ if (ret < 0)
+ return ret;
+ }
+ }
+
+ rte_tel_data_add_dict_int(d, "nb_inb_sa", dev->inb.nb_sess);
+
+ i = 0;
+ if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY) {
+ tvar = NULL;
+ RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->inb.list, entry, tvar) {
+ ret = copy_inb_sa_9k(d, i++, eth_sec->sa);
+ if (ret < 0)
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
+RTE_INIT(cnxk_ipsec_init_telemetry)
+{
+ rte_telemetry_register_cmd("/cnxk/ipsec/info",
+ ethdev_sec_tel_handle_info,
+ "Returns ipsec info. Parameters: port id");
+}
diff --git a/drivers/net/cnxk/meson.build b/drivers/net/cnxk/meson.build
index cd8c13bd1c..83af1f4d0c 100644
--- a/drivers/net/cnxk/meson.build
+++ b/drivers/net/cnxk/meson.build
@@ -15,6 +15,7 @@ sources = files(
'cnxk_ethdev_ops.c',
'cnxk_ethdev_sec.c',
'cnxk_ethdev_telemetry.c',
+ 'cnxk_ethdev_sec_telemetry.c',
'cnxk_link.c',
'cnxk_lookup.c',
'cnxk_ptp.c',
--
2.28.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] net/cnxk: add telemetry for inline IPsec for cn10k
2022-02-10 6:53 [PATCH 0/2] add telemetry for inline IPsec Ankur Dwivedi
2022-02-10 6:53 ` [PATCH 1/2] net/cnxk: add telemetry for inline IPsec for cn9k Ankur Dwivedi
@ 2022-02-10 6:53 ` Ankur Dwivedi
2022-02-10 9:12 ` [PATCH 0/2] add telemetry for inline IPsec Bruce Richardson
2 siblings, 0 replies; 8+ messages in thread
From: Ankur Dwivedi @ 2022-02-10 6:53 UTC (permalink / raw)
To: dev
Cc: ndabilpuram, kirankumark, skori, skoteshwar, jerinj, anoobj,
ktejasree, Ankur Dwivedi
Adds telemetry function to get information about inline
outbound and inline inbound sa's. The function takes port id
as input. Some fields in the structures roc_ot_ipsec_outb_sa
and roc_ot_ipsec_inb_sa are returned as output.
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
---
drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c | 156 ++++++++++++++++++-
1 file changed, 154 insertions(+), 2 deletions(-)
diff --git a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
index 83015e11e2..dfad5af8fe 100644
--- a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
+++ b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
@@ -71,6 +71,152 @@ copy_inb_sa_9k(struct rte_tel_data *d, uint32_t i, void *sa)
return 0;
}
+static int
+copy_outb_sa_10k(struct rte_tel_data *d, uint32_t i, void *sa)
+{
+ struct roc_ot_ipsec_outb_sa *out_sa;
+ struct rte_tel_data *outer_hdr;
+ char str[STR_MAXLEN];
+ char s64[W0_MAXLEN];
+ uint32_t j;
+
+ out_sa = (struct roc_ot_ipsec_outb_sa *)sa;
+
+ snprintf(str, sizeof(str), "outsa_w0_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, out_sa->w0.u64);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "outsa_w1_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, out_sa->w1.u64);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "outsa_w2_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, out_sa->w2.u64);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "outsa_w10_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, out_sa->w10.u64);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ outer_hdr = rte_tel_data_alloc();
+ if (!outer_hdr) {
+ plt_err("Could not allocate space for outer header");
+ return -ENOMEM;
+ }
+
+ rte_tel_data_start_array(outer_hdr, RTE_TEL_U64_VAL);
+
+ for (j = 0; j < RTE_DIM(out_sa->outer_hdr.ipv6.src_addr); j++)
+ rte_tel_data_add_array_u64(outer_hdr,
+ out_sa->outer_hdr.ipv6.src_addr[j]);
+
+ for (j = 0; j < RTE_DIM(out_sa->outer_hdr.ipv6.dst_addr); j++)
+ rte_tel_data_add_array_u64(outer_hdr,
+ out_sa->outer_hdr.ipv6.dst_addr[j]);
+
+ snprintf(str, sizeof(str), "outsa_outer_hdr_%u", i);
+ rte_tel_data_add_dict_container(d, str, outer_hdr, 0);
+
+ snprintf(str, sizeof(str), "outsa_errctl_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, out_sa->ctx.err_ctl.u64);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "outsa_esnval_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, out_sa->ctx.esn_val);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "outsa_hl_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, out_sa->ctx.hard_life);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "outsa_sl_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, out_sa->ctx.soft_life);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "outsa_octs_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, out_sa->ctx.mib_octs);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "outsa_pkts_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, out_sa->ctx.mib_pkts);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ return 0;
+}
+
+static int
+copy_inb_sa_10k(struct rte_tel_data *d, uint32_t i, void *sa)
+{
+ struct roc_ot_ipsec_inb_sa *in_sa;
+ struct rte_tel_data *outer_hdr;
+ char str[STR_MAXLEN];
+ char s64[W0_MAXLEN];
+ uint32_t j;
+
+ in_sa = (struct roc_ot_ipsec_inb_sa *)sa;
+
+ snprintf(str, sizeof(str), "insa_w0_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, in_sa->w0.u64);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "insa_w1_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, in_sa->w1.u64);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "insa_w2_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, in_sa->w2.u64);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "insa_w10_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, in_sa->w10.u64);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ outer_hdr = rte_tel_data_alloc();
+ if (!outer_hdr) {
+ plt_err("Could not allocate space for outer header");
+ return -ENOMEM;
+ }
+
+ rte_tel_data_start_array(outer_hdr, RTE_TEL_U64_VAL);
+
+ for (j = 0; j < RTE_DIM(in_sa->outer_hdr.ipv6.src_addr); j++)
+ rte_tel_data_add_array_u64(outer_hdr,
+ in_sa->outer_hdr.ipv6.src_addr[j]);
+
+ for (j = 0; j < RTE_DIM(in_sa->outer_hdr.ipv6.dst_addr); j++)
+ rte_tel_data_add_array_u64(outer_hdr,
+ in_sa->outer_hdr.ipv6.dst_addr[j]);
+
+ snprintf(str, sizeof(str), "insa_outer_hdr_%u", i);
+ rte_tel_data_add_dict_container(d, str, outer_hdr, 0);
+
+ snprintf(str, sizeof(str), "insa_arbase_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, in_sa->ctx.ar_base);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "insa_ar_validm_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, in_sa->ctx.ar_valid_mask);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "insa_hl_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, in_sa->ctx.hard_life);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "insa_sl_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, in_sa->ctx.soft_life);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "insa_octs_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, in_sa->ctx.mib_octs);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ snprintf(str, sizeof(str), "insa_pkts_%u", i);
+ snprintf(s64, sizeof(s64), "%" PRIu64, in_sa->ctx.mib_pkts);
+ rte_tel_data_add_dict_string(d, str, s64);
+
+ return 0;
+}
+
static int
ethdev_sec_tel_handle_info(const char *cmd __rte_unused, const char *params,
struct rte_tel_data *d)
@@ -111,7 +257,10 @@ ethdev_sec_tel_handle_info(const char *cmd __rte_unused, const char *params,
if (dev->tx_offloads & RTE_ETH_TX_OFFLOAD_SECURITY) {
tvar = NULL;
RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->outb.list, entry, tvar) {
- ret = copy_outb_sa_9k(d, i++, eth_sec->sa);
+ if (roc_model_is_cn10k())
+ ret = copy_outb_sa_10k(d, i++, eth_sec->sa);
+ else
+ ret = copy_outb_sa_9k(d, i++, eth_sec->sa);
if (ret < 0)
return ret;
}
@@ -123,7 +272,10 @@ ethdev_sec_tel_handle_info(const char *cmd __rte_unused, const char *params,
if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY) {
tvar = NULL;
RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->inb.list, entry, tvar) {
- ret = copy_inb_sa_9k(d, i++, eth_sec->sa);
+ if (roc_model_is_cn10k())
+ ret = copy_inb_sa_10k(d, i++, eth_sec->sa);
+ else
+ ret = copy_inb_sa_9k(d, i++, eth_sec->sa);
if (ret < 0)
return ret;
}
--
2.28.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] add telemetry for inline IPsec
2022-02-10 6:53 [PATCH 0/2] add telemetry for inline IPsec Ankur Dwivedi
2022-02-10 6:53 ` [PATCH 1/2] net/cnxk: add telemetry for inline IPsec for cn9k Ankur Dwivedi
2022-02-10 6:53 ` [PATCH 2/2] net/cnxk: add telemetry for inline IPsec for cn10k Ankur Dwivedi
@ 2022-02-10 9:12 ` Bruce Richardson
2022-02-10 10:04 ` [EXT] " Ankur Dwivedi
2 siblings, 1 reply; 8+ messages in thread
From: Bruce Richardson @ 2022-02-10 9:12 UTC (permalink / raw)
To: Ankur Dwivedi
Cc: dev, ndabilpuram, kirankumark, skori, skoteshwar, jerinj, anoobj,
ktejasree
On Thu, Feb 10, 2022 at 12:23:32PM +0530, Ankur Dwivedi wrote:
> Adds telemetry function for inline ipsec in net CNXK driver.
>
> This series depends on the following patch series:
>
> Series: Adding new features and improvements in cnxk crypto PMD
> http://patches.dpdk.org/project/dpdk/list/?series=21433
>
> Ankur Dwivedi (2): net/cnxk: add telemetry for inline IPsec for cn9k
> net/cnxk: add telemetry for inline IPsec for cn10k
>
Out of interest, is there any of this telemetry that could be made generic
and apply at a device-class or library level rather than being tied to the
cnxk driver only?
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [EXT] Re: [PATCH 0/2] add telemetry for inline IPsec
2022-02-10 9:12 ` [PATCH 0/2] add telemetry for inline IPsec Bruce Richardson
@ 2022-02-10 10:04 ` Ankur Dwivedi
2022-02-10 11:31 ` Bruce Richardson
0 siblings, 1 reply; 8+ messages in thread
From: Ankur Dwivedi @ 2022-02-10 10:04 UTC (permalink / raw)
To: Bruce Richardson
Cc: dev, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda,
Sunil Kumar Kori, Satha Koteswara Rao Kottidi,
Jerin Jacob Kollanukkaran, Anoob Joseph, Tejasree Kondoj
Hi Bruce,
Please see my comment inline.
Regards,
Ankur
>-----Original Message-----
>From: Bruce Richardson <bruce.richardson@intel.com>
>Sent: Thursday, February 10, 2022 2:42 PM
>To: Ankur Dwivedi <adwivedi@marvell.com>
>Cc: dev@dpdk.org; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>;
>Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori
><skori@marvell.com>; Satha Koteswara Rao Kottidi
><skoteshwar@marvell.com>; Jerin Jacob Kollanukkaran
><jerinj@marvell.com>; Anoob Joseph <anoobj@marvell.com>; Tejasree
>Kondoj <ktejasree@marvell.com>
>Subject: [EXT] Re: [PATCH 0/2] add telemetry for inline IPsec
>
>External Email
>
>----------------------------------------------------------------------
>On Thu, Feb 10, 2022 at 12:23:32PM +0530, Ankur Dwivedi wrote:
>> Adds telemetry function for inline ipsec in net CNXK driver.
>>
>> This series depends on the following patch series:
>>
>> Series: Adding new features and improvements in cnxk crypto PMD
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__patches.dpdk.org_p
>> roject_dpdk_list_-3Fseries-
>3D21433&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r
>>
>=ILjiNF3GF25y6QdHZUxMl6JrStU0MIuCtO5dMzn3Ybk&m=szcLmV4s_NiVroE4B
>vC5yW6
>>
>litxm6Pfo2ymX7QhE1qDSpKTa56lnfmMqfnohRfI6&s=VtKHr9SAo3R0g7lGPoSJlg
>xVxn
>> r2t_TYhHbfH7rS4sE&e=
>>
>> Ankur Dwivedi (2): net/cnxk: add telemetry for inline IPsec for cn9k
>> net/cnxk: add telemetry for inline IPsec for cn10k
>>
>Out of interest, is there any of this telemetry that could be made generic and
>apply at a device-class or library level rather than being tied to the cnxk driver
>only?
I could think of that the callback function registered in rte_telemetry_register_cmd() can be a generic one. The net device (eth_dev) may have ops registered, which can be called depending on dev->tx_offloads and dev->rx_offloads flags. However the data to be returned by telemetry might depend on the PMD.
Please let me know if this is possible.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [EXT] Re: [PATCH 0/2] add telemetry for inline IPsec
2022-02-10 10:04 ` [EXT] " Ankur Dwivedi
@ 2022-02-10 11:31 ` Bruce Richardson
2022-02-10 13:29 ` Ankur Dwivedi
0 siblings, 1 reply; 8+ messages in thread
From: Bruce Richardson @ 2022-02-10 11:31 UTC (permalink / raw)
To: Ankur Dwivedi
Cc: dev, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda,
Sunil Kumar Kori, Satha Koteswara Rao Kottidi,
Jerin Jacob Kollanukkaran, Anoob Joseph, Tejasree Kondoj,
ferruh.yigit
On Thu, Feb 10, 2022 at 10:04:22AM +0000, Ankur Dwivedi wrote:
> Hi Bruce,
>
> Please see my comment inline.
>
> Regards,
> Ankur
>
> >-----Original Message-----
> >From: Bruce Richardson <bruce.richardson@intel.com>
> >Sent: Thursday, February 10, 2022 2:42 PM
> >To: Ankur Dwivedi <adwivedi@marvell.com>
> >Cc: dev@dpdk.org; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>;
> >Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori
> ><skori@marvell.com>; Satha Koteswara Rao Kottidi
> ><skoteshwar@marvell.com>; Jerin Jacob Kollanukkaran
> ><jerinj@marvell.com>; Anoob Joseph <anoobj@marvell.com>; Tejasree
> >Kondoj <ktejasree@marvell.com>
> >Subject: [EXT] Re: [PATCH 0/2] add telemetry for inline IPsec
> >
> >External Email
> >
> >----------------------------------------------------------------------
> >On Thu, Feb 10, 2022 at 12:23:32PM +0530, Ankur Dwivedi wrote:
> >> Adds telemetry function for inline ipsec in net CNXK driver.
> >>
> >> This series depends on the following patch series:
> >>
> >> Series: Adding new features and improvements in cnxk crypto PMD
> >> https://urldefense.proofpoint.com/v2/url?u=http-3A__patches.dpdk.org_p
> >> roject_dpdk_list_-3Fseries-
> >3D21433&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r
> >>
> >=ILjiNF3GF25y6QdHZUxMl6JrStU0MIuCtO5dMzn3Ybk&m=szcLmV4s_NiVroE4B
> >vC5yW6
> >>
> >litxm6Pfo2ymX7QhE1qDSpKTa56lnfmMqfnohRfI6&s=VtKHr9SAo3R0g7lGPoSJlg
> >xVxn
> >> r2t_TYhHbfH7rS4sE&e=
> >>
> >> Ankur Dwivedi (2): net/cnxk: add telemetry for inline IPsec for cn9k
> >> net/cnxk: add telemetry for inline IPsec for cn10k
> >>
> >Out of interest, is there any of this telemetry that could be made generic and
> >apply at a device-class or library level rather than being tied to the cnxk driver
> >only?
> I could think of that the callback function registered in rte_telemetry_register_cmd() can be a generic one. The net device (eth_dev) may have ops registered, which can be called depending on dev->tx_offloads and dev->rx_offloads flags. However the data to be returned by telemetry might depend on the PMD.
> Please let me know if this is possible.
Thanks. So if I understand you correctly, the information returned would
vary based on the offload flags only? If that is the case, it does sound
like it could be generic, where the offload flags field in the return
information identify what other fields are present in the reply. That would
then make the telemetry generic and possible to implement at the ethdev
level. Is that all correct?
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [EXT] Re: [PATCH 0/2] add telemetry for inline IPsec
2022-02-10 11:31 ` Bruce Richardson
@ 2022-02-10 13:29 ` Ankur Dwivedi
0 siblings, 0 replies; 8+ messages in thread
From: Ankur Dwivedi @ 2022-02-10 13:29 UTC (permalink / raw)
To: Bruce Richardson
Cc: dev, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda,
Sunil Kumar Kori, Satha Koteswara Rao Kottidi,
Jerin Jacob Kollanukkaran, Anoob Joseph, Tejasree Kondoj,
ferruh.yigit
>-----Original Message-----
>From: Bruce Richardson <bruce.richardson@intel.com>
>Sent: Thursday, February 10, 2022 5:02 PM
>To: Ankur Dwivedi <adwivedi@marvell.com>
>Cc: dev@dpdk.org; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>;
>Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori
><skori@marvell.com>; Satha Koteswara Rao Kottidi
><skoteshwar@marvell.com>; Jerin Jacob Kollanukkaran
><jerinj@marvell.com>; Anoob Joseph <anoobj@marvell.com>; Tejasree
>Kondoj <ktejasree@marvell.com>; ferruh.yigit@intel.com
>Subject: Re: [EXT] Re: [PATCH 0/2] add telemetry for inline IPsec
>
>On Thu, Feb 10, 2022 at 10:04:22AM +0000, Ankur Dwivedi wrote:
>> Hi Bruce,
>>
>> Please see my comment inline.
>>
>> Regards,
>> Ankur
>>
>> >-----Original Message-----
>> >From: Bruce Richardson <bruce.richardson@intel.com>
>> >Sent: Thursday, February 10, 2022 2:42 PM
>> >To: Ankur Dwivedi <adwivedi@marvell.com>
>> >Cc: dev@dpdk.org; Nithin Kumar Dabilpuram
><ndabilpuram@marvell.com>;
>> >Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori
>> ><skori@marvell.com>; Satha Koteswara Rao Kottidi
>> ><skoteshwar@marvell.com>; Jerin Jacob Kollanukkaran
>> ><jerinj@marvell.com>; Anoob Joseph <anoobj@marvell.com>; Tejasree
>> >Kondoj <ktejasree@marvell.com>
>> >Subject: [EXT] Re: [PATCH 0/2] add telemetry for inline IPsec
>> >
>> >External Email
>> >
>> >---------------------------------------------------------------------
>> >- On Thu, Feb 10, 2022 at 12:23:32PM +0530, Ankur Dwivedi wrote:
>> >> Adds telemetry function for inline ipsec in net CNXK driver.
>> >>
>> >> This series depends on the following patch series:
>> >>
>> >> Series: Adding new features and improvements in cnxk crypto PMD
>> >> https://urldefense.proofpoint.com/v2/url?u=http-3A__patches.dpdk.or
>> >> g_p
>> >> roject_dpdk_list_-3Fseries-
>> >3D21433&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r
>> >>
>>
>>=ILjiNF3GF25y6QdHZUxMl6JrStU0MIuCtO5dMzn3Ybk&m=szcLmV4s_NiVroE4
>B
>> >vC5yW6
>> >>
>>
>>litxm6Pfo2ymX7QhE1qDSpKTa56lnfmMqfnohRfI6&s=VtKHr9SAo3R0g7lGPoSJl
>g
>> >xVxn
>> >> r2t_TYhHbfH7rS4sE&e=
>> >>
>> >> Ankur Dwivedi (2): net/cnxk: add telemetry for inline IPsec for
>> >> cn9k
>> >> net/cnxk: add telemetry for inline IPsec for cn10k
>> >>
>> >Out of interest, is there any of this telemetry that could be made
>> >generic and apply at a device-class or library level rather than
>> >being tied to the cnxk driver only?
>> I could think of that the callback function registered in
>rte_telemetry_register_cmd() can be a generic one. The net device (eth_dev)
>may have ops registered, which can be called depending on dev->tx_offloads
>and dev->rx_offloads flags. However the data to be returned by telemetry
>might depend on the PMD.
>> Please let me know if this is possible.
>
>Thanks. So if I understand you correctly, the information returned would vary
>based on the offload flags only? If that is the case, it does sound like it could
>be generic, where the offload flags field in the return information identify
>what other fields are present in the reply. That would then make the
>telemetry generic and possible to implement at the ethdev level. Is that all
>correct?
Apart from offload flags, the information would vary depending on what a PMD is
willing to provide. That's why I was thinking ops callback function will be required in
struct eth_dev_ops which will be PMD specific. This ops callback will be called from
the registered telemetry callback.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] net/cnxk: add telemetry for inline IPsec for cn9k
2022-02-10 6:53 ` [PATCH 1/2] net/cnxk: add telemetry for inline IPsec for cn9k Ankur Dwivedi
@ 2022-02-17 17:51 ` Jerin Jacob
0 siblings, 0 replies; 8+ messages in thread
From: Jerin Jacob @ 2022-02-17 17:51 UTC (permalink / raw)
To: Ankur Dwivedi, Ferruh Yigit
Cc: dpdk-dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
Satha Koteswara Rao Kottidi, Jerin Jacob, Anoob Joseph,
Tejasree Kondoj
On Thu, Feb 10, 2022 at 12:24 PM Ankur Dwivedi <adwivedi@marvell.com> wrote:
>
> Adds telemetry function to get information about inline
> outbound and inline inbound sa's. The function takes port id
> as input. Some fields in the structures roc_onf_ipsec_outb_sa
> and roc_onf_ipsec_inb_sa are returned as output.
Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/for-next-net. Thanks
>
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> ---
> drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c | 140 +++++++++++++++++++
> drivers/net/cnxk/meson.build | 1 +
> 2 files changed, 141 insertions(+)
> create mode 100644 drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
>
> diff --git a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
> new file mode 100644
> index 0000000000..83015e11e2
> --- /dev/null
> +++ b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
> @@ -0,0 +1,140 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(C) 2022 Marvell.
> + */
> +
> +#include <rte_telemetry.h>
> +
> +#include <roc_api.h>
> +
> +#include "cnxk_ethdev.h"
> +
> +#define STR_MAXLEN 20
> +#define W0_MAXLEN 21
> +
> +static int
> +copy_outb_sa_9k(struct rte_tel_data *d, uint32_t i, void *sa)
> +{
> + struct roc_onf_ipsec_outb_sa *out_sa;
> + union {
> + struct roc_ie_onf_sa_ctl ctl;
> + uint64_t u64;
> + } w0;
> + char strw0[W0_MAXLEN];
> + char str[STR_MAXLEN];
> +
> + out_sa = (struct roc_onf_ipsec_outb_sa *)sa;
> + w0.ctl = out_sa->ctl;
> +
> + snprintf(str, sizeof(str), "outsa_w0_%u", i);
> + snprintf(strw0, sizeof(strw0), "%" PRIu64, w0.u64);
> + rte_tel_data_add_dict_string(d, str, strw0);
> +
> + snprintf(str, sizeof(str), "outsa_src_%u", i);
> + rte_tel_data_add_dict_u64(d, str, out_sa->udp_src);
> +
> + snprintf(str, sizeof(str), "outsa_dst_%u", i);
> + rte_tel_data_add_dict_u64(d, str, out_sa->udp_dst);
> +
> + snprintf(str, sizeof(str), "outsa_isrc_%u", i);
> + rte_tel_data_add_dict_u64(d, str, out_sa->ip_src);
> +
> + snprintf(str, sizeof(str), "outsa_idst_%u", i);
> + rte_tel_data_add_dict_u64(d, str, out_sa->ip_dst);
> +
> + return 0;
> +}
> +
> +static int
> +copy_inb_sa_9k(struct rte_tel_data *d, uint32_t i, void *sa)
> +{
> + struct roc_onf_ipsec_inb_sa *in_sa;
> + union {
> + struct roc_ie_onf_sa_ctl ctl;
> + uint64_t u64;
> + } w0;
> + char strw0[W0_MAXLEN];
> + char str[STR_MAXLEN];
> +
> + in_sa = (struct roc_onf_ipsec_inb_sa *)sa;
> + w0.ctl = in_sa->ctl;
> +
> + snprintf(str, sizeof(str), "insa_w0_%u", i);
> + snprintf(strw0, sizeof(strw0), "%" PRIu64, w0.u64);
> + rte_tel_data_add_dict_string(d, str, strw0);
> +
> + snprintf(str, sizeof(str), "insa_esnh_%u", i);
> + rte_tel_data_add_dict_u64(d, str, in_sa->esn_hi);
> +
> + snprintf(str, sizeof(str), "insa_esnl_%u", i);
> + rte_tel_data_add_dict_u64(d, str, in_sa->esn_low);
> +
> + return 0;
> +}
> +
> +static int
> +ethdev_sec_tel_handle_info(const char *cmd __rte_unused, const char *params,
> + struct rte_tel_data *d)
> +{
> + struct cnxk_eth_sec_sess *eth_sec, *tvar;
> + struct rte_eth_dev *eth_dev;
> + struct cnxk_eth_dev *dev;
> + uint16_t port_id;
> + char *end_p;
> + uint32_t i;
> + int ret;
> +
> + port_id = strtoul(params, &end_p, 0);
> + if (errno != 0)
> + return -EINVAL;
> +
> + if (*end_p != '\0')
> + plt_err("Extra parameters passed to telemetry, ignoring it");
> +
> + if (!rte_eth_dev_is_valid_port(port_id)) {
> + plt_err("Invalid port id %u", port_id);
> + return -EINVAL;
> + }
> +
> + eth_dev = &rte_eth_devices[port_id];
> + if (!eth_dev) {
> + plt_err("Ethdev not available");
> + return -EINVAL;
> + }
> +
> + dev = cnxk_eth_pmd_priv(eth_dev);
> +
> + rte_tel_data_start_dict(d);
> +
> + rte_tel_data_add_dict_int(d, "nb_outb_sa", dev->outb.nb_sess);
> +
> + i = 0;
> + if (dev->tx_offloads & RTE_ETH_TX_OFFLOAD_SECURITY) {
> + tvar = NULL;
> + RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->outb.list, entry, tvar) {
> + ret = copy_outb_sa_9k(d, i++, eth_sec->sa);
> + if (ret < 0)
> + return ret;
> + }
> + }
> +
> + rte_tel_data_add_dict_int(d, "nb_inb_sa", dev->inb.nb_sess);
> +
> + i = 0;
> + if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY) {
> + tvar = NULL;
> + RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->inb.list, entry, tvar) {
> + ret = copy_inb_sa_9k(d, i++, eth_sec->sa);
> + if (ret < 0)
> + return ret;
> + }
> + }
> +
> + return 0;
> +}
> +
> +RTE_INIT(cnxk_ipsec_init_telemetry)
> +{
> + rte_telemetry_register_cmd("/cnxk/ipsec/info",
> + ethdev_sec_tel_handle_info,
> + "Returns ipsec info. Parameters: port id");
> +}
> diff --git a/drivers/net/cnxk/meson.build b/drivers/net/cnxk/meson.build
> index cd8c13bd1c..83af1f4d0c 100644
> --- a/drivers/net/cnxk/meson.build
> +++ b/drivers/net/cnxk/meson.build
> @@ -15,6 +15,7 @@ sources = files(
> 'cnxk_ethdev_ops.c',
> 'cnxk_ethdev_sec.c',
> 'cnxk_ethdev_telemetry.c',
> + 'cnxk_ethdev_sec_telemetry.c',
> 'cnxk_link.c',
> 'cnxk_lookup.c',
> 'cnxk_ptp.c',
> --
> 2.28.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-02-17 17:51 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 6:53 [PATCH 0/2] add telemetry for inline IPsec Ankur Dwivedi
2022-02-10 6:53 ` [PATCH 1/2] net/cnxk: add telemetry for inline IPsec for cn9k Ankur Dwivedi
2022-02-17 17:51 ` Jerin Jacob
2022-02-10 6:53 ` [PATCH 2/2] net/cnxk: add telemetry for inline IPsec for cn10k Ankur Dwivedi
2022-02-10 9:12 ` [PATCH 0/2] add telemetry for inline IPsec Bruce Richardson
2022-02-10 10:04 ` [EXT] " Ankur Dwivedi
2022-02-10 11:31 ` Bruce Richardson
2022-02-10 13:29 ` Ankur Dwivedi
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).