Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/100223/?format=api
http://patches.dpdk.org/api/patches/100223/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211001095130.3343083-6-radu.nicolau@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20211001095130.3343083-6-radu.nicolau@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20211001095130.3343083-6-radu.nicolau@intel.com", "date": "2021-10-01T09:51:29", "name": "[v4,5/6] net/iavf: add xstats support for inline IPsec crypto", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "b74df100047a72afeed51faa68978d1161c0abdd", "submitter": { "id": 743, "url": "http://patches.dpdk.org/api/people/743/?format=api", "name": "Radu Nicolau", "email": "radu.nicolau@intel.com" }, "delegate": { "id": 1540, "url": "http://patches.dpdk.org/api/users/1540/?format=api", "username": "qzhan15", "first_name": "Qi", "last_name": "Zhang", "email": "qi.z.zhang@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211001095130.3343083-6-radu.nicolau@intel.com/mbox/", "series": [ { "id": 19321, "url": "http://patches.dpdk.org/api/series/19321/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19321", "date": "2021-10-01T09:51:24", "name": "iavf: add iAVF IPsec inline crypto support", "version": 4, "mbox": "http://patches.dpdk.org/series/19321/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/100223/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/100223/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 598A3A0032;\n\tFri, 1 Oct 2021 12:02:46 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 62CF441185;\n\tFri, 1 Oct 2021 12:02:07 +0200 (CEST)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 5FBB641176\n for <dev@dpdk.org>; Fri, 1 Oct 2021 12:02:05 +0200 (CEST)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Oct 2021 03:01:50 -0700", "from silpixa00400884.ir.intel.com ([10.243.22.82])\n by FMSMGA003.fm.intel.com with ESMTP; 01 Oct 2021 03:01:47 -0700" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10123\"; a=\"310931306\"", "E=Sophos;i=\"5.85,337,1624345200\"; d=\"scan'208\";a=\"310931306\"", "E=Sophos;i=\"5.85,337,1624345200\"; d=\"scan'208\";a=\"556222548\"" ], "X-ExtLoop1": "1", "From": "Radu Nicolau <radu.nicolau@intel.com>", "To": "Jingjing Wu <jingjing.wu@intel.com>,\n\tBeilei Xing <beilei.xing@intel.com>", "Cc": "dev@dpdk.org, declan.doherty@intel.com, abhijit.sinha@intel.com,\n qi.z.zhang@intel.com, bruce.richardson@intel.com,\n konstantin.ananyev@intel.com, Radu Nicolau <radu.nicolau@intel.com>", "Date": "Fri, 1 Oct 2021 10:51:29 +0100", "Message-Id": "<20211001095130.3343083-6-radu.nicolau@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20211001095130.3343083-1-radu.nicolau@intel.com>", "References": "<20210909142428.750634-1-radu.nicolau@intel.com>\n <20211001095130.3343083-1-radu.nicolau@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v4 5/6] net/iavf: add xstats support for inline\n IPsec crypto", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add per queue counters for maintaining statistics for inline IPsec\ncrypto offload, which can be retrieved through the\nrte_security_session_stats_get() with more detailed errors through the\nrte_ethdev xstats.\n\nSigned-off-by: Declan Doherty <declan.doherty@intel.com>\nSigned-off-by: Radu Nicolau <radu.nicolau@intel.com>\n---\n drivers/net/iavf/iavf.h | 21 ++++++++-\n drivers/net/iavf/iavf_ethdev.c | 84 ++++++++++++++++++++++++++++------\n drivers/net/iavf/iavf_rxtx.h | 12 -----\n 3 files changed, 89 insertions(+), 28 deletions(-)", "diff": "diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h\nindex 934ef48278..d5f574b4b3 100644\n--- a/drivers/net/iavf/iavf.h\n+++ b/drivers/net/iavf/iavf.h\n@@ -92,6 +92,25 @@ struct iavf_adapter;\n struct iavf_rx_queue;\n struct iavf_tx_queue;\n \n+\n+struct iavf_ipsec_crypto_stats {\n+\tuint64_t icount;\n+\tuint64_t ibytes;\n+\tstruct {\n+\t\tuint64_t count;\n+\t\tuint64_t sad_miss;\n+\t\tuint64_t not_processed;\n+\t\tuint64_t icv_check;\n+\t\tuint64_t ipsec_length;\n+\t\tuint64_t misc;\n+\t} ierrors;\n+};\n+\n+struct iavf_eth_xstats {\n+\tstruct virtchnl_eth_stats eth_stats;\n+\tstruct iavf_ipsec_crypto_stats ips_stats;\n+};\n+\n /* Structure that defines a VSI, associated with a adapter. */\n struct iavf_vsi {\n \tstruct iavf_adapter *adapter; /* Backreference to associated adapter */\n@@ -101,7 +120,7 @@ struct iavf_vsi {\n \tuint16_t max_macaddrs; /* Maximum number of MAC addresses */\n \tuint16_t base_vector;\n \tuint16_t msix_intr; /* The MSIX interrupt binds to VSI */\n-\tstruct virtchnl_eth_stats eth_stats_offset;\n+\tstruct iavf_eth_xstats eth_stats_offset;\n };\n \n struct rte_flow;\ndiff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c\nindex 294be1a022..aad6a28585 100644\n--- a/drivers/net/iavf/iavf_ethdev.c\n+++ b/drivers/net/iavf/iavf_ethdev.c\n@@ -89,6 +89,7 @@ static const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev);\n static int iavf_dev_stats_get(struct rte_eth_dev *dev,\n \t\t\t struct rte_eth_stats *stats);\n static int iavf_dev_stats_reset(struct rte_eth_dev *dev);\n+static int iavf_dev_xstats_reset(struct rte_eth_dev *dev);\n static int iavf_dev_xstats_get(struct rte_eth_dev *dev,\n \t\t\t\t struct rte_eth_xstat *xstats, unsigned int n);\n static int iavf_dev_xstats_get_names(struct rte_eth_dev *dev,\n@@ -144,21 +145,37 @@ struct rte_iavf_xstats_name_off {\n \tunsigned int offset;\n };\n \n+#define _OFF_OF(a) offsetof(struct iavf_eth_xstats, a)\n static const struct rte_iavf_xstats_name_off rte_iavf_stats_strings[] = {\n-\t{\"rx_bytes\", offsetof(struct iavf_eth_stats, rx_bytes)},\n-\t{\"rx_unicast_packets\", offsetof(struct iavf_eth_stats, rx_unicast)},\n-\t{\"rx_multicast_packets\", offsetof(struct iavf_eth_stats, rx_multicast)},\n-\t{\"rx_broadcast_packets\", offsetof(struct iavf_eth_stats, rx_broadcast)},\n-\t{\"rx_dropped_packets\", offsetof(struct iavf_eth_stats, rx_discards)},\n+\t{\"rx_bytes\", _OFF_OF(eth_stats.rx_bytes)},\n+\t{\"rx_unicast_packets\", _OFF_OF(eth_stats.rx_unicast)},\n+\t{\"rx_multicast_packets\", _OFF_OF(eth_stats.rx_multicast)},\n+\t{\"rx_broadcast_packets\", _OFF_OF(eth_stats.rx_broadcast)},\n+\t{\"rx_dropped_packets\", _OFF_OF(eth_stats.rx_discards)},\n \t{\"rx_unknown_protocol_packets\", offsetof(struct iavf_eth_stats,\n \t\trx_unknown_protocol)},\n-\t{\"tx_bytes\", offsetof(struct iavf_eth_stats, tx_bytes)},\n-\t{\"tx_unicast_packets\", offsetof(struct iavf_eth_stats, tx_unicast)},\n-\t{\"tx_multicast_packets\", offsetof(struct iavf_eth_stats, tx_multicast)},\n-\t{\"tx_broadcast_packets\", offsetof(struct iavf_eth_stats, tx_broadcast)},\n-\t{\"tx_dropped_packets\", offsetof(struct iavf_eth_stats, tx_discards)},\n-\t{\"tx_error_packets\", offsetof(struct iavf_eth_stats, tx_errors)},\n+\t{\"tx_bytes\", _OFF_OF(eth_stats.tx_bytes)},\n+\t{\"tx_unicast_packets\", _OFF_OF(eth_stats.tx_unicast)},\n+\t{\"tx_multicast_packets\", _OFF_OF(eth_stats.tx_multicast)},\n+\t{\"tx_broadcast_packets\", _OFF_OF(eth_stats.tx_broadcast)},\n+\t{\"tx_dropped_packets\", _OFF_OF(eth_stats.tx_discards)},\n+\t{\"tx_error_packets\", _OFF_OF(eth_stats.tx_errors)},\n+\n+\t{\"inline_ipsec_crypto_ipackets\", _OFF_OF(ips_stats.icount)},\n+\t{\"inline_ipsec_crypto_ibytes\", _OFF_OF(ips_stats.ibytes)},\n+\t{\"inline_ipsec_crypto_ierrors\", _OFF_OF(ips_stats.ierrors.count)},\n+\t{\"inline_ipsec_crypto_ierrors_sad_lookup\",\n+\t\t\t_OFF_OF(ips_stats.ierrors.sad_miss)},\n+\t{\"inline_ipsec_crypto_ierrors_not_processed\",\n+\t\t\t_OFF_OF(ips_stats.ierrors.not_processed)},\n+\t{\"inline_ipsec_crypto_ierrors_icv_fail\",\n+\t\t\t_OFF_OF(ips_stats.ierrors.icv_check)},\n+\t{\"inline_ipsec_crypto_ierrors_length\",\n+\t\t\t_OFF_OF(ips_stats.ierrors.ipsec_length)},\n+\t{\"inline_ipsec_crypto_ierrors_misc\",\n+\t\t\t_OFF_OF(ips_stats.ierrors.misc)},\n };\n+#undef _OFF_OF\n \n #define IAVF_NB_XSTATS (sizeof(rte_iavf_stats_strings) / \\\n \t\tsizeof(rte_iavf_stats_strings[0]))\n@@ -176,7 +193,7 @@ static const struct eth_dev_ops iavf_eth_dev_ops = {\n \t.stats_reset = iavf_dev_stats_reset,\n \t.xstats_get = iavf_dev_xstats_get,\n \t.xstats_get_names = iavf_dev_xstats_get_names,\n-\t.xstats_reset = iavf_dev_stats_reset,\n+\t.xstats_reset = iavf_dev_xstats_reset,\n \t.promiscuous_enable = iavf_dev_promiscuous_enable,\n \t.promiscuous_disable = iavf_dev_promiscuous_disable,\n \t.allmulticast_enable = iavf_dev_allmulticast_enable,\n@@ -1543,7 +1560,7 @@ iavf_stat_update_32(uint64_t *offset, uint64_t *stat)\n static void\n iavf_update_stats(struct iavf_vsi *vsi, struct virtchnl_eth_stats *nes)\n {\n-\tstruct virtchnl_eth_stats *oes = &vsi->eth_stats_offset;\n+\tstruct virtchnl_eth_stats *oes = &vsi->eth_stats_offset.eth_stats;\n \n \tiavf_stat_update_48(&oes->rx_bytes, &nes->rx_bytes);\n \tiavf_stat_update_48(&oes->rx_unicast, &nes->rx_unicast);\n@@ -1605,7 +1622,18 @@ iavf_dev_stats_reset(struct rte_eth_dev *dev)\n \t\treturn ret;\n \n \t/* set stats offset base on current values */\n-\tvsi->eth_stats_offset = *pstats;\n+\tvsi->eth_stats_offset.eth_stats = *pstats;\n+\n+\treturn 0;\n+}\n+\n+static int\n+iavf_dev_xstats_reset(struct rte_eth_dev *dev)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n+\n+\tiavf_dev_stats_reset(dev);\n+\tmemset(&vf->vsi.eth_stats_offset, 0, sizeof(struct iavf_eth_xstats));\n \n \treturn 0;\n }\n@@ -1625,6 +1653,27 @@ static int iavf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,\n \treturn IAVF_NB_XSTATS;\n }\n \n+static void\n+iavf_dev_update_ipsec_xstats(struct rte_eth_dev *ethdev,\n+\t\tstruct iavf_ipsec_crypto_stats *ips)\n+{\n+\tuint16_t idx;\n+\tfor (idx = 0; idx < ethdev->data->nb_rx_queues; idx++) {\n+\t\tstruct iavf_rx_queue *rxq;\n+\t\tstruct iavf_ipsec_crypto_stats *stats;\n+\t\trxq = (struct iavf_rx_queue *)ethdev->data->rx_queues[idx];\n+\t\tstats = &rxq->stats.ipsec_crypto;\n+\t\tips->icount += stats->icount;\n+\t\tips->ibytes += stats->ibytes;\n+\t\tips->ierrors.count += stats->ierrors.count;\n+\t\tips->ierrors.sad_miss += stats->ierrors.sad_miss;\n+\t\tips->ierrors.not_processed += stats->ierrors.not_processed;\n+\t\tips->ierrors.icv_check += stats->ierrors.icv_check;\n+\t\tips->ierrors.ipsec_length += stats->ierrors.ipsec_length;\n+\t\tips->ierrors.misc += stats->ierrors.misc;\n+\t}\n+}\n+\n static int iavf_dev_xstats_get(struct rte_eth_dev *dev,\n \t\t\t\t struct rte_eth_xstat *xstats, unsigned int n)\n {\n@@ -1635,6 +1684,7 @@ static int iavf_dev_xstats_get(struct rte_eth_dev *dev,\n \tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n \tstruct iavf_vsi *vsi = &vf->vsi;\n \tstruct virtchnl_eth_stats *pstats = NULL;\n+\tstruct iavf_eth_xstats iavf_xtats = {0};\n \n \tif (n < IAVF_NB_XSTATS)\n \t\treturn IAVF_NB_XSTATS;\n@@ -1647,11 +1697,15 @@ static int iavf_dev_xstats_get(struct rte_eth_dev *dev,\n \t\treturn 0;\n \n \tiavf_update_stats(vsi, pstats);\n+\tiavf_xtats.eth_stats = *pstats;\n+\n+\tif (iavf_ipsec_crypto_supported(adapter))\n+\t\tiavf_dev_update_ipsec_xstats(dev, &iavf_xtats.ips_stats);\n \n \t/* loop over xstats array and values from pstats */\n \tfor (i = 0; i < IAVF_NB_XSTATS; i++) {\n \t\txstats[i].id = i;\n-\t\txstats[i].value = *(uint64_t *)(((char *)pstats) +\n+\t\txstats[i].value = *(uint64_t *)(((char *)&iavf_xtats) +\n \t\t\trte_iavf_stats_strings[i].offset);\n \t}\n \ndiff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h\nindex e009387aff..18bf8f4921 100644\n--- a/drivers/net/iavf/iavf_rxtx.h\n+++ b/drivers/net/iavf/iavf_rxtx.h\n@@ -165,18 +165,6 @@ struct iavf_txq_ops {\n \tvoid (*release_mbufs)(struct iavf_tx_queue *txq);\n };\n \n-struct iavf_ipsec_crypto_stats {\n-\tuint64_t icount;\n-\tuint64_t ibytes;\n-\tstruct {\n-\t\tuint64_t count;\n-\t\tuint64_t sad_miss;\n-\t\tuint64_t not_processed;\n-\t\tuint64_t icv_check;\n-\t\tuint64_t ipsec_length;\n-\t\tuint64_t misc;\n-\t} ierrors;\n-};\n \n struct iavf_rx_queue_stats {\n \tuint64_t reserved;\n", "prefixes": [ "v4", "5/6" ] }{ "id": 100223, "url": "