Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/101760/?format=api
http://patches.dpdk.org/api/patches/101760/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211015101511.699128-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": "<20211015101511.699128-6-radu.nicolau@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20211015101511.699128-6-radu.nicolau@intel.com", "date": "2021-10-15T10:15:09", "name": "[v8,5/7] 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/20211015101511.699128-6-radu.nicolau@intel.com/mbox/", "series": [ { "id": 19688, "url": "http://patches.dpdk.org/api/series/19688/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19688", "date": "2021-10-15T10:15:04", "name": "iavf: add iAVF IPsec inline crypto support", "version": 8, "mbox": "http://patches.dpdk.org/series/19688/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/101760/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/101760/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 8BDFDA0C4B;\n\tFri, 15 Oct 2021 12:28:00 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C8A1941207;\n\tFri, 15 Oct 2021 12:27:36 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id CA2FE411D8\n for <dev@dpdk.org>; Fri, 15 Oct 2021 12:27:33 +0200 (CEST)", "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 Oct 2021 03:27:33 -0700", "from silpixa00400884.ir.intel.com ([10.243.22.82])\n by orsmga006.jf.intel.com with ESMTP; 15 Oct 2021 03:27:31 -0700" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10137\"; a=\"208004320\"", "E=Sophos;i=\"5.85,375,1624345200\"; d=\"scan'208\";a=\"208004320\"", "E=Sophos;i=\"5.85,375,1624345200\"; d=\"scan'208\";a=\"442478967\"" ], "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, 15 Oct 2021 11:15:09 +0100", "Message-Id": "<20211015101511.699128-6-radu.nicolau@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20211015101511.699128-1-radu.nicolau@intel.com>", "References": "<20210909142428.750634-1-radu.nicolau@intel.com>\n <20211015101511.699128-1-radu.nicolau@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v8 5/7] 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>\nAcked-by: Jingjing Wu <jingjing.wu@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 e98c42ba08..90a7344bd5 100644\n--- a/drivers/net/iavf/iavf.h\n+++ b/drivers/net/iavf/iavf.h\n@@ -96,6 +96,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@@ -105,7 +124,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 6663e923db..8f35107f3a 100644\n--- a/drivers/net/iavf/iavf_ethdev.c\n+++ b/drivers/net/iavf/iavf_ethdev.c\n@@ -90,6 +90,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@@ -145,21 +146,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@@ -177,7 +194,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@@ -1559,7 +1576,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@@ -1621,7 +1638,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@@ -1641,6 +1669,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@@ -1651,6 +1700,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@@ -1663,11 +1713,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 5b40392c79..e8fecbd7bc 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": [ "v8", "5/7" ] }{ "id": 101760, "url": "