List patch comments

GET /api/patches/139740/comments/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Link: 
<http://patchwork.dpdk.org/api/patches/139740/comments/?format=api&page=1>; rel="first",
<http://patchwork.dpdk.org/api/patches/139740/comments/?format=api&page=1>; rel="last"
Vary: Accept
[ { "id": 169793, "web_url": "http://patchwork.dpdk.org/comment/169793/", "msgid": "<9025199c-585c-4779-9f4e-360845707088@amd.com>", "list_archive_url": "https://inbox.dpdk.org/dev/9025199c-585c-4779-9f4e-360845707088@amd.com", "date": "2024-05-01T16:25:59", "subject": "Re: [PATCH] net/af_packet: fix statistics", "submitter": { "id": 2700, "url": "http://patchwork.dpdk.org/api/people/2700/?format=api", "name": "Ferruh Yigit", "email": "ferruh.yigit@amd.com" }, "content": "On 4/30/2024 4:39 PM, Stephen Hemminger wrote:\n> The statistics in af_packet driver do not follow the standard\n> practice of other drivers:\n> \n> - Statistics should be maintained as 64 bit even on 32 bit.\n> \n\nack\n\n> - Remove the tx_error counter since it was not correct.\n> When transmit ring is full it is not an error and\n> the driver correctly returns only the number sent.\n> \n\nnack\nTransmit full is not only return case here.\nThere are actual errors continue to process relying this error calculation.\nAlso there are error cases like interface down.\nThose error cases should be handled individually if we remove this.\nI suggest split this change to separate patch.\n\n> - Query kernel to find the number of packets missed.\n> \n\nack.\n\n> - Do not mark statistics as volatile.\n> Instead, READ_ONCE() where necessary.\n> \n\nI did similar [1], and Mattias has some comments on it.\nIssue is not in the reader (stats_get) side. Without volatile writer\n(datapath thread) may end up *not* storing updated stats to memory.\n\nFor reader side, I expect value not been in the register when function\ncalled, so it ends up reading from memory, which doesn't require\nvolatile casting.\n\n[1]\nhttps://patchwork.dpdk.org/project/dpdk/patch/20240426143848.2280689-1-ferruh.yigit@amd.com/\n\n> Also, the variable namge igb_stats looks like a copy/paste leftover\n> \n> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>\n> ---\n> drivers/net/af_packet/rte_eth_af_packet.c | 82 +++++++++++++----------\n> 1 file changed, 48 insertions(+), 34 deletions(-)\n> \n> diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c\n> index 397a32db58..0313aee482 100644\n> --- a/drivers/net/af_packet/rte_eth_af_packet.c\n> +++ b/drivers/net/af_packet/rte_eth_af_packet.c\n> @@ -39,6 +39,10 @@\n> #define DFLT_FRAME_SIZE\t\t(1 << 11)\n> #define DFLT_FRAME_COUNT\t(1 << 9)\n> \n> +#ifndef READ_ONCE\n> +#define READ_ONCE(var) (*((volatile typeof(var) *)(&(var))))\n> +#endif\n> +\n> struct pkt_rx_queue {\n> \tint sockfd;\n> \n> @@ -51,8 +55,8 @@ struct pkt_rx_queue {\n> \tuint16_t in_port;\n> \tuint8_t vlan_strip;\n> \n> -\tvolatile unsigned long rx_pkts;\n> -\tvolatile unsigned long rx_bytes;\n> +\tuint64_t rx_pkts;\n> +\tuint64_t rx_bytes;\n> };\n> \n> struct pkt_tx_queue {\n> @@ -64,9 +68,8 @@ struct pkt_tx_queue {\n> \tunsigned int framecount;\n> \tunsigned int framenum;\n> \n> -\tvolatile unsigned long tx_pkts;\n> -\tvolatile unsigned long err_pkts;\n> -\tvolatile unsigned long tx_bytes;\n> +\tuint64_t tx_pkts;\n> +\tuint64_t tx_bytes;\n> };\n> \n> struct pmd_internals {\n> @@ -305,7 +308,6 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)\n> \n> \tpkt_q->framenum = framenum;\n> \tpkt_q->tx_pkts += num_tx;\n> -\tpkt_q->err_pkts += i - num_tx;\n> \tpkt_q->tx_bytes += num_tx_bytes;\n> \treturn i;\n> }\n> @@ -386,54 +388,66 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n> }\n> \n> static int\n> -eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *igb_stats)\n> +eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n> {\n> -\tunsigned i, imax;\n> -\tunsigned long rx_total = 0, tx_total = 0, tx_err_total = 0;\n> -\tunsigned long rx_bytes_total = 0, tx_bytes_total = 0;\n> +\tunsigned int i;\n> \tconst struct pmd_internals *internal = dev->data->dev_private;\n> +\tuint64_t bytes, packets;\n> +\n> +\tfor (i = 0; i < internal->nb_queues; i++) {\n> +\t\tconst struct pkt_rx_queue *rxq = &internal->rx_queue[i];\n> +\t\tstruct tpacket_stats pkt_stats;\n> +\t\tsocklen_t optlen = sizeof(pkt_stats);\n> +\t\tint fd = rxq->sockfd;\n> +\n> +\t\tbytes = READ_ONCE(rxq->rx_bytes);\n> +\t\tpackets = READ_ONCE(rxq->rx_pkts);\n> \n> -\timax = (internal->nb_queues < RTE_ETHDEV_QUEUE_STAT_CNTRS ?\n> -\t internal->nb_queues : RTE_ETHDEV_QUEUE_STAT_CNTRS);\n> -\tfor (i = 0; i < imax; i++) {\n> -\t\tigb_stats->q_ipackets[i] = internal->rx_queue[i].rx_pkts;\n> -\t\tigb_stats->q_ibytes[i] = internal->rx_queue[i].rx_bytes;\n> -\t\trx_total += igb_stats->q_ipackets[i];\n> -\t\trx_bytes_total += igb_stats->q_ibytes[i];\n> +\t\tstats->ipackets += packets;\n> +\t\tstats->ibytes += bytes;\n> +\n> +\t\tif (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {\n> +\t\t\tstats->q_ipackets[i] = packets;\n> +\t\t\tstats->q_ibytes[i] = bytes;\n> +\t\t}\n> +\n> +\t\tif (getsockopt(fd, SOL_PACKET, PACKET_STATISTICS, &pkt_stats, &optlen) < 0) {\n> +\t\t\tPMD_LOG_ERRNO(ERR, \"could not getet PACKET_STATISTICS on AF_PACKET socket\");\n> +\t\t\treturn -1;\n> +\t\t}\n> +\t\tstats->imissed = pkt_stats.tp_drops;\n> \t}\n> \n> -\timax = (internal->nb_queues < RTE_ETHDEV_QUEUE_STAT_CNTRS ?\n> -\t internal->nb_queues : RTE_ETHDEV_QUEUE_STAT_CNTRS);\n> -\tfor (i = 0; i < imax; i++) {\n> -\t\tigb_stats->q_opackets[i] = internal->tx_queue[i].tx_pkts;\n> -\t\tigb_stats->q_obytes[i] = internal->tx_queue[i].tx_bytes;\n> -\t\ttx_total += igb_stats->q_opackets[i];\n> -\t\ttx_err_total += internal->tx_queue[i].err_pkts;\n> -\t\ttx_bytes_total += igb_stats->q_obytes[i];\n> +\tfor (i = 0; i < internal->nb_queues; i++) {\n> +\t\tconst struct pkt_tx_queue *txq = &internal->tx_queue[i];\n> +\n> +\t\tbytes = READ_ONCE(txq->tx_bytes);\n> +\t\tpackets = READ_ONCE(txq->tx_pkts);\n> +\n> +\t\tstats->opackets += packets;\n> +\t\tstats->obytes += bytes;\n> +\n> +\t\tif (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {\n> +\t\t\tstats->q_opackets[i] = packets;\n> +\t\t\tstats->q_obytes[i] = bytes;\n> +\t\t}\n> \t}\n> \n> -\tigb_stats->ipackets = rx_total;\n> -\tigb_stats->ibytes = rx_bytes_total;\n> -\tigb_stats->opackets = tx_total;\n> -\tigb_stats->oerrors = tx_err_total;\n> -\tigb_stats->obytes = tx_bytes_total;\n> +\n> \treturn 0;\n> }\n> \n> static int\n> eth_stats_reset(struct rte_eth_dev *dev)\n> {\n> -\tunsigned i;\n> +\tunsigned int i;\n> \tstruct pmd_internals *internal = dev->data->dev_private;\n> \n> \tfor (i = 0; i < internal->nb_queues; i++) {\n> \t\tinternal->rx_queue[i].rx_pkts = 0;\n> \t\tinternal->rx_queue[i].rx_bytes = 0;\n> -\t}\n> \n> -\tfor (i = 0; i < internal->nb_queues; i++) {\n> \t\tinternal->tx_queue[i].tx_pkts = 0;\n> -\t\tinternal->tx_queue[i].err_pkts = 0;\n> \t\tinternal->tx_queue[i].tx_bytes = 0;\n> \t}\n>", "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 B05C943F5D;\n\tWed, 1 May 2024 18:26:08 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 72B0F402A8;\n\tWed, 1 May 2024 18:26:08 +0200 (CEST)", "from NAM10-DM6-obe.outbound.protection.outlook.com\n (mail-dm6nam10on2087.outbound.protection.outlook.com [40.107.93.87])\n by mails.dpdk.org (Postfix) with ESMTP id 77F974027F\n for <dev@dpdk.org>; Wed, 1 May 2024 18:26:06 +0200 (CEST)", "from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11)\n by PH7PR12MB7916.namprd12.prod.outlook.com (2603:10b6:510:26a::18)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Wed, 1 May\n 2024 16:26:03 +0000", "from CH2PR12MB4294.namprd12.prod.outlook.com\n ([fe80::282f:29d3:cac1:cde3]) by CH2PR12MB4294.namprd12.prod.outlook.com\n ([fe80::282f:29d3:cac1:cde3%7]) with mapi id 15.20.7519.035; Wed, 1 May 2024\n 16:26:03 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=OaAKELSoBkiWXwfR92PYHDJHjJfCWm0oAtQ4DxqDiFheK+3YzBZBsod4GEH9zdMpZmluhH+z3AAeikN6kcJpniwe69fzl02h5xbZm9Q/lGWWOy4JTfFEUPxWOJ4K7xPPaKGQSy+/CYiee9QQKkdigFwnhbpf60IsjsQKGcjpUhHEC/VTOxZ/AJMnd8LuzbVNJXJ9Bu65GFHH+aQuqRsAy93WXsrl58QmyeJUrMDFMsfusxdy6PXieLi+35FWkpeGmaKq/W/kG3LRlTJQze4zFZeZ2WD7IQLO1gp/P/wMv96FYzqCdHhnibuQbyLasKBWUjS4WepDG32fifgJi5/cYw==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=mOTHBOLyHdkQxyo1YK+ElTsqnmnEo7cyunKx4/USqVg=;\n b=IN6ooD1IIQUYw6OukRitaOpR9lZIZrVwG5JPOleE3owVAx78IIRYxXHB2etx3xomrBdzALT4flZmwTwAi172epLjbLzWU3xuIpZGsYL6eUfhB9YYNDGB3STC4GBBqRvlKgNe3CtBa1DjElxNPOXCHsoJyKfphSUBBp61sQplOgwhWtqLw5jJK+5OOQnj0ghSPIUL50aHgRyG44EtCuoAW0nI0M6mp/8Gw+VuQIl2stW6+CxYlRBJP4O5WLZjFs5t1YzoZkyC++maErDjdqGB75zDXuZ4Ivh9s8xd80eAqnG8ey6qQbZcaMDBxD6BW9H4cYICUtggNTQnNvjdV08apQ==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass\n header.d=amd.com; arc=none", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=mOTHBOLyHdkQxyo1YK+ElTsqnmnEo7cyunKx4/USqVg=;\n b=XLBYatj1Es8qsR5MGS+ExZUVPx/CKu6KXfJxiUezhDuVsqJ20WQQuPOaqyKCXFUY+29zuRiMcHZjzrbcmZFT3FXzxHTVncWaVEgIk3HJTPqb4JujTMlb/7QlslK49pJ2TlmMdQcA1tjJsQSXqrHPDOsaeFsz3iyWDx0r2Ytf9r0=", "Authentication-Results": "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=amd.com;", "Message-ID": "<9025199c-585c-4779-9f4e-360845707088@amd.com>", "Date": "Wed, 1 May 2024 17:25:59 +0100", "User-Agent": "Mozilla Thunderbird", "Subject": "Re: [PATCH] net/af_packet: fix statistics", "To": "Stephen Hemminger <stephen@networkplumber.org>, dev@dpdk.org", "Cc": "\"John W. Linville\" <linville@tuxdriver.com>, =?utf-8?q?Mattias_R=C3=B6nn?=\n\t=?utf-8?q?blom?= <hofors@lysator.liu.se>", "References": "<20240430154129.7347-1-stephen@networkplumber.org>", "Content-Language": "en-US", "From": "Ferruh Yigit <ferruh.yigit@amd.com>", "Autocrypt": "addr=ferruh.yigit@amd.com; keydata=\n xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9\n 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J\n eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg\n B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9\n RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ\n N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ\n vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S\n 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum\n CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA\n XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln\n aXQg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E6igdvkjfYmh+QOrHGZvpWXLTmffVf/AQ81wspzbfxJ7sYM4P8Mg5kKOsaoUdyA/2qVe\n cMh1CLUHXF1GlofpGbe1lj4KUJVse5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH\n dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk=", "In-Reply-To": "<20240430154129.7347-1-stephen@networkplumber.org>", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "7bit", "X-ClientProxiedBy": "LO2P265CA0212.GBRP265.PROD.OUTLOOK.COM\n (2603:10a6:600:9e::32) To CH2PR12MB4294.namprd12.prod.outlook.com\n (2603:10b6:610:a9::11)", "MIME-Version": "1.0", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "CH2PR12MB4294:EE_|PH7PR12MB7916:EE_", "X-MS-Office365-Filtering-Correlation-Id": "97e06ed2-43d3-4369-5c19-08dc69fb64e1", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;ARA:13230031|1800799015|376005|366007;", "X-Microsoft-Antispam-Message-Info": "=?utf-8?q?UvRrg6m9j9j1UR57zSnnTeFr22+QSUa?=\n\t=?utf-8?q?tV0iQy25pdm75RAawpnTuiiC+2JidJjkFk/a9H2AoMTx1ufGaXLw2RK9Pe9TBlUNd?=\n\t=?utf-8?q?X/Q41EnmryZ7T552vvyGRcSN3LZObfUE302cvIu9BO/G+Iw3Y54P7kPT1DVTM02ym?=\n\t=?utf-8?q?TnxaX3DpY1xSVQg0MEYvirlsDatUQTxEcCNfiSftxz9MUngrWbabvacDy9ILVlhJc?=\n\t=?utf-8?q?S0vB7I5+e5jLJyZwr6gLZYXyiWSm8wi4nLROLJDfFO6SJIs+lQu8ZMDUwk8FrhOjb?=\n\t=?utf-8?q?b/5K5FvYTI1BJ7hRLp7MKGNQy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hrWHE6yBTDe4eCLIe5zh/?=\n\t=?utf-8?q?53f39qwEvJ3Zc++zTSXP9tlWqAYDXFB8wbLqP4TM4jb9Ibnvuf2eMk2+DcthCAlAL?=\n\t=?utf-8?q?2TuMRiXd310GTeQlMSMnF25kVVb96pZzcVNg=3D=3D?=", "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230031)(1800799015)(376005)(366007); DIR:OUT; SFP:1101;", "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-MessageData-0": "=?utf-8?q?RENVg9XpyVwqnBebtC/LK/cdqa2A?=\n\t=?utf-8?q?4vVreBjV6cDmnymDkl3f/Jsjp74OC0D68g3o/UeWkUmHnisLh9K6sI4LiAA2PEmDS?=\n\t=?utf-8?q?d304V+zdYZdhSBPy3vogN3J/rLlw4Z2DAWFhn2FfUenRQTPIiAJydBErRmxLcyu6F?=\n\t=?utf-8?q?/wf+I2QDG1xy03RhknQWFb1o1LPNv/952PZ/hysml5tHRK2aMnM20cPlA5Fze3ITZ?=\n\t=?utf-8?q?DShADtcpZrB2v6Lap62GUGvUw5D8UW9tD3i0Y/RU/aL7dIT4NyDOLob8jN6dem+u3?=\n\t=?utf-8?q?Key0TtLimqY16uzsAcWiRNcY5Mxqs0QLHP5kL6olZZ1YUEUEu0VNOexPyLc2hOeS4?=\n\t=?utf-8?q?ViGXRY2w2OTGUbMCktomKQbdvC/SAGS+CAu4Z0xHMN8yFUg94rfeLa63At1EI5KWT?=\n\t=?utf-8?q?ehw4llHWa0DdDzhD/HZD4bCyH+VsskFDK1RGTYvQ1jPLRBAeAGYdmgE+Kzq4oxeqd?=\n\t=?utf-8?q?sPN2NLMObAcRx8o89uIvxEfF2vVCaqWRDLcp4bVqGt5S2HVRJH4zZAaaE18w4SxwP?=\n\t=?utf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y5m2vELXt36HFVKahfinLOjMORZ2SHFyQVo2+QpZ+/Mv0orGk?=\n\t=?utf-8?q?ARRLwsiTnxXWObkuaZ6NfYGOlwIzb1IvVqHmoCrQ0Hy4kg1ZQtBqvgcm69lkrcl65?=\n\t=?utf-8?q?VKWfpo9+omTAbVUgsXQE5DulXKDXenY0jEfdTDaFhpBPj8wQ8DZzYA2TmAhHcwje7?=\n\t=?utf-8?q?SeRiNUDVklGl?=", "X-OriginatorOrg": "amd.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 97e06ed2-43d3-4369-5c19-08dc69fb64e1", "X-MS-Exchange-CrossTenant-AuthSource": "CH2PR12MB4294.namprd12.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "01 May 2024 16:26:03.2312 (UTC)", "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted", "X-MS-Exchange-CrossTenant-Id": "3dd8961f-e488-4e60-8e11-a82d994e183d", "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED", "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n 9NIWtoRFvSnOmnef0kTV/e1NPwg15To/ADRQ7jjtBsIf/qY/Ctz2hKuYxhSQH5rn", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "PH7PR12MB7916", "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" }, "addressed": null }, { "id": 169795, "web_url": "http://patchwork.dpdk.org/comment/169795/", "msgid": "<20240501094208.5f9e4cf9@hermes.local>", "list_archive_url": "https://inbox.dpdk.org/dev/20240501094208.5f9e4cf9@hermes.local", "date": "2024-05-01T16:42:08", "subject": "Re: [PATCH] net/af_packet: fix statistics", "submitter": { "id": 27, "url": "http://patchwork.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "content": "On Wed, 1 May 2024 17:25:59 +0100\nFerruh Yigit <ferruh.yigit@amd.com> wrote:\n\n> On 4/30/2024 4:39 PM, Stephen Hemminger wrote:\n> > The statistics in af_packet driver do not follow the standard\n> > practice of other drivers:\n> > \n> > - Statistics should be maintained as 64 bit even on 32 bit.\n> > \n> \n> ack\n> \n> > - Remove the tx_error counter since it was not correct.\n> > When transmit ring is full it is not an error and\n> > the driver correctly returns only the number sent.\n> > \n> \n> nack\n> Transmit full is not only return case here.\n> There are actual errors continue to process relying this error calculation.\n> Also there are error cases like interface down.\n> Those error cases should be handled individually if we remove this.\n> I suggest split this change to separate patch.\n\nIt is possible to get errors, but the code wasn't looking for those.\nSee packet(7) man page.", "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 8F7A943F5D;\n\tWed, 1 May 2024 18:42:13 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2DBEE4027F;\n\tWed, 1 May 2024 18:42:13 +0200 (CEST)", "from mail-pf1-f169.google.com (mail-pf1-f169.google.com\n [209.85.210.169])\n by mails.dpdk.org (Postfix) with ESMTP id C1AB34021E\n for <dev@dpdk.org>; Wed, 1 May 2024 18:42:11 +0200 (CEST)", "by mail-pf1-f169.google.com with SMTP id\n d2e1a72fcca58-6f3e3d789cdso4766968b3a.1\n for <dev@dpdk.org>; Wed, 01 May 2024 09:42:11 -0700 (PDT)", "from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n l185-20020a6391c2000000b005ffd8019f01sm16993650pge.20.2024.05.01.09.42.10\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 01 May 2024 09:42:10 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1714581731;\n x=1715186531; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:subject:cc:to:from:date:from:to:cc:subject:date\n :message-id:reply-to;\n bh=AueaCzuI4T3n25mXLPzUNBh9Epe3Gtb4e4SK9yFe1Rc=;\n b=O5w7haTkXTo2vzi9Q/Yf0vzMbTtq5+r/FCtxGZwBYFZF7kFZleYs3mKPpWKCdM8PkV\n 0vIyhjPW4bFmQ/X95TzH5O0OlMYXUR2U0tXTz+9utovJw9sMKkNlUoZxnjWkworxFQ4U\n RUh4k1KTXtss3Q3KltnZfLcHRabQLcbxsJ9HO+V2M0wWcKcpJoNIvQBb39/quvUgJYX0\n fEtXxHeEGs1UJT7qvWuH19ZzD/nvaKZR3Qph2SWhgdzUMWEUicpx4HO/QWfiCjzJpjgQ\n aO7ZJvKNOe3VOJTJrWZCCNe5qpooTZGkyVrT4r99/LCWNrL7Xk6Zf2N476XyZz51G6JH\n Vszg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1714581731; x=1715186531;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=AueaCzuI4T3n25mXLPzUNBh9Epe3Gtb4e4SK9yFe1Rc=;\n b=ghd4e3gGDqkbc2OhzJUGK/ncjddevVtpvM2DY3vpdUQsaJ9pIPkWwK5qzbkDjqcioi\n hGeFXYkLNvmUq8OE+MV6VNYMOgAUxCIInTyXYWyaIG+PYgDZmrF8D/SPy7ZTtvEbtEfr\n tmPAVBvZ1/GOvD8D9RgMethrOfib4pW1g96JsJwWP1pqLdGfJ8J2OlutLb/wgvB0w5Tb\n EYbCL08F1a9twj8DaeKvZprGnYX4IgOscKP4XyiVWd+9nWHhvcKNUN7BNkeXgn2R4Qbz\n 9iOwSO4Oo4gm/bwJxbtzF6sIjh2KzW22aNKI+ASFmTdYnXfjfKYfOxumR5/T2w0H11Ne\n Vm2Q==", "X-Gm-Message-State": "AOJu0YxtECFUwCF0a5r74qbUPcGmwNl80aMRsYwMRyT0zPk9JxsGn2me\n 1mB6sRhqgHVw/4haA1u0UwCnpkw9kklPeJlp5y0jEIGYviAMKm/qhJFazTkf7hM=", "X-Google-Smtp-Source": "\n AGHT+IExmsG/qgll3bvxef5MV0rm4uwBObFWc8wjSpeiHeWNTYaFhI5ERJ5t7aBd7Sgw7OzwLECmuw==", "X-Received": "by 2002:a05:6a00:2448:b0:6ec:f712:8a69 with SMTP id\n d8-20020a056a00244800b006ecf7128a69mr3634353pfj.29.1714581730830;\n Wed, 01 May 2024 09:42:10 -0700 (PDT)", "Date": "Wed, 1 May 2024 09:42:08 -0700", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "Ferruh Yigit <ferruh.yigit@amd.com>", "Cc": "dev@dpdk.org, \"John W. Linville\" <linville@tuxdriver.com>, Mattias\n\t=?utf-8?b?UsO2bm5ibG9t?= <hofors@lysator.liu.se>", "Subject": "Re: [PATCH] net/af_packet: fix statistics", "Message-ID": "<20240501094208.5f9e4cf9@hermes.local>", "In-Reply-To": "<9025199c-585c-4779-9f4e-360845707088@amd.com>", "References": "<20240430154129.7347-1-stephen@networkplumber.org>\n <9025199c-585c-4779-9f4e-360845707088@amd.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=US-ASCII", "Content-Transfer-Encoding": "7bit", "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" }, "addressed": null }, { "id": 169796, "web_url": "http://patchwork.dpdk.org/comment/169796/", "msgid": "<20240501094303.751e95b4@hermes.local>", "list_archive_url": "https://inbox.dpdk.org/dev/20240501094303.751e95b4@hermes.local", "date": "2024-05-01T16:43:03", "subject": "Re: [PATCH] net/af_packet: fix statistics", "submitter": { "id": 27, "url": "http://patchwork.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "content": "On Wed, 1 May 2024 17:25:59 +0100\nFerruh Yigit <ferruh.yigit@amd.com> wrote:\n\n> > - Do not mark statistics as volatile.\n> > Instead, READ_ONCE() where necessary.\n> > \n> \n> I did similar [1], and Mattias has some comments on it.\n> Issue is not in the reader (stats_get) side. Without volatile writer\n> (datapath thread) may end up *not* storing updated stats to memory.\n> \n> For reader side, I expect value not been in the register when function\n> called, so it ends up reading from memory, which doesn't require\n> volatile casting.\n\nThese are per-queue stats, and anybody foolish enough to have multiple\nthreads sharing same queue without locking is playing with fire.\nIt is documented that DPDK PMD's don't support that.", "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 1145343F5D;\n\tWed, 1 May 2024 18:43:07 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BA6E04027F;\n\tWed, 1 May 2024 18:43:07 +0200 (CEST)", "from mail-pg1-f177.google.com (mail-pg1-f177.google.com\n [209.85.215.177])\n by mails.dpdk.org (Postfix) with ESMTP id 78AA14021E\n for <dev@dpdk.org>; Wed, 1 May 2024 18:43:06 +0200 (CEST)", "by mail-pg1-f177.google.com with SMTP id\n 41be03b00d2f7-5f415fd71f8so5525336a12.3\n for <dev@dpdk.org>; Wed, 01 May 2024 09:43:06 -0700 (PDT)", "from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n r12-20020a17090ad40c00b002a676e286d9sm1539627pju.43.2024.05.01.09.43.05\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 01 May 2024 09:43:05 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1714581785;\n x=1715186585; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:subject:cc:to:from:date:from:to:cc:subject:date\n :message-id:reply-to;\n bh=WAvYha926c9lo7/8VN45eEwSG008GePihTQZ3Uh9Jc4=;\n b=Kh6g0/ewxx2KAzkXrRJYlVYB9DeJcrtVELPGIPCWnO9KFvvGYHO8krwuANpBdmUmRU\n ZG7r4N+ul9F1vIcUGEnqAFngm3hlO7R/GcHO5qdU32oThzjee6lC7vTRZC/PCboShmnU\n AOEiA9DO5kU9QIoSn5RT30GgwOYcMkXGWYzhxlzKIFBLhwDbOfmXI9nMzK9uWivgHZef\n msztRh9zNr7k3DXtO/6Iu9Ux76IkCPPxvDt9NangIYJfaH9Z1xWYm8Jx5piEUNxuzFPt\n +Jh4jjznnZcwS4G6Dq0drYwcQpAFH6HOH8BBCrjYY1aBQuCq9UXdL28UFFVoIMW7HXMl\n 7aAw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1714581785; x=1715186585;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=WAvYha926c9lo7/8VN45eEwSG008GePihTQZ3Uh9Jc4=;\n b=vlT5UQAENRxmSnhrICswoO4LsG7SnHQOfbYkLWa5nTS3Ycohu+oTBCVmPzkvPdSdiQ\n XSryIIsgpB2nWAzJU/YXZuavcjlvtP1/Ae6U3BeOfm5Iwm85P22yK2gyalAg69TVMFB1\n yQiBXSmXbiqAMTRcWfeizo3OL3U93jySkvA3YEvwMEnNTVl0qkUo/+x3mFYzv1OwHtGx\n MPyVQDVKjyT4KUCC4abBMdtCuiZyCklyDbYUaX7XBhXod1nxzwXz6CiL2xHzvikYE9Iq\n 7YboO7QCnI6G48hhVFMRRqs/bIx5+1S0BpMBGlL0Kl+fIjRxj4PEPdNzCL6UftxOcTkX\n GRNg==", "X-Gm-Message-State": "AOJu0Yx2f4ZmUL9CDV40YLzZu/B1Vi89Mw3ssoA80zx3RXTh1ivgtKoM\n xEknXkfrBH33Lp0YT+rbCjj2/iifVA+d3yDZS5fy8znSYqOr/UlT8KKbzXNapPc=", "X-Google-Smtp-Source": "\n AGHT+IHadZlo1lprryEiKoW0t3JprfjVPODMUWmWzoov2KcfchzIPDZvMCDNuTPipTIBXrlUUfbV1A==", "X-Received": "by 2002:a17:90b:3b4a:b0:2b2:c84e:9124 with SMTP id\n ot10-20020a17090b3b4a00b002b2c84e9124mr3009928pjb.45.1714581785515;\n Wed, 01 May 2024 09:43:05 -0700 (PDT)", "Date": "Wed, 1 May 2024 09:43:03 -0700", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "Ferruh Yigit <ferruh.yigit@amd.com>", "Cc": "dev@dpdk.org, \"John W. Linville\" <linville@tuxdriver.com>, Mattias\n\t=?utf-8?b?UsO2bm5ibG9t?= <hofors@lysator.liu.se>", "Subject": "Re: [PATCH] net/af_packet: fix statistics", "Message-ID": "<20240501094303.751e95b4@hermes.local>", "In-Reply-To": "<9025199c-585c-4779-9f4e-360845707088@amd.com>", "References": "<20240430154129.7347-1-stephen@networkplumber.org>\n <9025199c-585c-4779-9f4e-360845707088@amd.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=US-ASCII", "Content-Transfer-Encoding": "7bit", "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" }, "addressed": null }, { "id": 169797, "web_url": "http://patchwork.dpdk.org/comment/169797/", "msgid": "<20240501094436.17ac8f00@hermes.local>", "list_archive_url": "https://inbox.dpdk.org/dev/20240501094436.17ac8f00@hermes.local", "date": "2024-05-01T16:44:36", "subject": "Re: [PATCH] net/af_packet: fix statistics", "submitter": { "id": 27, "url": "http://patchwork.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "content": "On Wed, 1 May 2024 17:25:59 +0100\nFerruh Yigit <ferruh.yigit@amd.com> wrote:\n\n> > - Remove the tx_error counter since it was not correct.\n> > When transmit ring is full it is not an error and\n> > the driver correctly returns only the number sent.\n> > \n> \n> nack\n> Transmit full is not only return case here.\n> There are actual errors continue to process relying this error calculation.\n> Also there are error cases like interface down.\n> Those error cases should be handled individually if we remove this.\n> I suggest split this change to separate patch.\n\nI see multiple drivers have copy/pasted same code and consider\ntransmit full as an error. It is not.\n\nThere should be a new statistic at ethdev layer that does record\ntransmit full, and make it across all drivers, but that would have\nto wait for ABI change.", "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 89FD543F5D;\n\tWed, 1 May 2024 18:44:40 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6A891402C7;\n\tWed, 1 May 2024 18:44:40 +0200 (CEST)", "from mail-pl1-f171.google.com (mail-pl1-f171.google.com\n [209.85.214.171])\n by mails.dpdk.org (Postfix) with ESMTP id 716C74027F\n for <dev@dpdk.org>; Wed, 1 May 2024 18:44:39 +0200 (CEST)", "by mail-pl1-f171.google.com with SMTP id\n d9443c01a7336-1e50a04c317so38661225ad.1\n for <dev@dpdk.org>; Wed, 01 May 2024 09:44:39 -0700 (PDT)", "from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n m6-20020a1709026bc600b001e99ffdbe56sm18449176plt.215.2024.05.01.09.44.38\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 01 May 2024 09:44:38 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1714581878;\n x=1715186678; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:subject:cc:to:from:date:from:to:cc:subject:date\n :message-id:reply-to;\n bh=1mbcjFmifsk/4RizH58rQnPB5WSyq4aEYkWM5Ht6pKk=;\n b=EvjRULyxWCGC6E8z3kf0TZnNqH8pPBHt8QPjxOSvGZApA1M1nLF7pQeO+MO9QXYKKW\n 0AlibE0PVag5P0DjrbtYX3UyS9wFOtdc42tdv2tGUWc8B5sDtCxZYEKLyx2p3p6pMxBP\n wE4fMlJSWRSsxDtIYGRYLmpwausNKwhLy1oy2OLPcvkptxz5yxDNV92EwUrAtT0/q/LZ\n c5JQm4069SxabJgd2vaoFVyGEGT73vbKP/eTpXJRLK/74Iwgg+dfe1gpiSEhG4GXzV6u\n M0eiteX6WsAceE4K23oZ35mzt2t0GjFtU3rNbLNayWhhzf7HYoDAEWxuSunVQCztaCvn\n YD0A==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1714581878; x=1715186678;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=1mbcjFmifsk/4RizH58rQnPB5WSyq4aEYkWM5Ht6pKk=;\n b=GSjnYAGbF6DEdRIjEynvwliYrUa3Y/njUvC+mDxwBzjy3WY9YJoMX3Fgw3FjNgmFnt\n CBSA54fey4/9w/v7XgyFJW3xgYWCHEwBl1ylt+Et6rkE59yBX4U39+G8z2mu4YWm8zEp\n BYFB+YYwClwECGFeHuU7ybED9RuSyDzwz6eWkEzDR/CwyEOluTSKTZeXsaOBB1Hev43S\n /VpRvngmWm0M7tL4H0EPfZoQIPdYeiYdEpBGkdAZG3LyyG8hGDnmhzA65xoJs4OmkCeS\n 0u4cLILuWw6LW4tuqn9HZNvR5XFRwl+aYtRokMGMXo+i7uMDwSVeLUoIpi6y/CHd1iiY\n a+pA==", "X-Gm-Message-State": "AOJu0Yy9jUzqVh5j5NlpgUaN0+B9d0Zk3Kcw+YlwuRRbKVneE+drbJ+P\n iPNKETX6EbYuskbZiT/IMw9W+tBr/WeTb/C8aA1NBDT3Va6CkHkRr2bPr92JK5I=", "X-Google-Smtp-Source": "\n AGHT+IG8TUx7zQd75fVwSzdkWG0bEt4xJrusb5PQg/ZoYA9RFhMOAuAoj7I6PAIaCgjpcBTuR6SJpw==", "X-Received": "by 2002:a17:903:2408:b0:1ec:bc3e:84a3 with SMTP id\n e8-20020a170903240800b001ecbc3e84a3mr1556513plo.14.1714581878472;\n Wed, 01 May 2024 09:44:38 -0700 (PDT)", "Date": "Wed, 1 May 2024 09:44:36 -0700", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "Ferruh Yigit <ferruh.yigit@amd.com>", "Cc": "dev@dpdk.org, \"John W. Linville\" <linville@tuxdriver.com>, Mattias\n\t=?utf-8?b?UsO2bm5ibG9t?= <hofors@lysator.liu.se>", "Subject": "Re: [PATCH] net/af_packet: fix statistics", "Message-ID": "<20240501094436.17ac8f00@hermes.local>", "In-Reply-To": "<9025199c-585c-4779-9f4e-360845707088@amd.com>", "References": "<20240430154129.7347-1-stephen@networkplumber.org>\n <9025199c-585c-4779-9f4e-360845707088@amd.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=US-ASCII", "Content-Transfer-Encoding": "7bit", "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" }, "addressed": null }, { "id": 169798, "web_url": "http://patchwork.dpdk.org/comment/169798/", "msgid": "<98CBD80474FA8B44BF855DF32C47DC35E9F411@smartserver.smartshare.dk>", "list_archive_url": "https://inbox.dpdk.org/dev/98CBD80474FA8B44BF855DF32C47DC35E9F411@smartserver.smartshare.dk", "date": "2024-05-01T18:18:50", "subject": "RE: [PATCH] net/af_packet: fix statistics", "submitter": { "id": 591, "url": "http://patchwork.dpdk.org/api/people/591/?format=api", "name": "Morten Brørup", "email": "mb@smartsharesystems.com" }, "content": "> From: Stephen Hemminger [mailto:stephen@networkplumber.org]\n> Sent: Wednesday, 1 May 2024 18.45\n> \n> On Wed, 1 May 2024 17:25:59 +0100\n> Ferruh Yigit <ferruh.yigit@amd.com> wrote:\n> \n> > > - Remove the tx_error counter since it was not correct.\n> > > When transmit ring is full it is not an error and\n> > > the driver correctly returns only the number sent.\n> > >\n> >\n> > nack\n> > Transmit full is not only return case here.\n> > There are actual errors continue to process relying this error\n> calculation.\n> > Also there are error cases like interface down.\n> > Those error cases should be handled individually if we remove this.\n> > I suggest split this change to separate patch.\n> \n> I see multiple drivers have copy/pasted same code and consider\n> transmit full as an error. It is not.\n\n+1\nTransmit full is certainly not an error!\n\n> \n> There should be a new statistic at ethdev layer that does record\n> transmit full, and make it across all drivers, but that would have\n> to wait for ABI change.\n\nWhat happens to these non-transmittable packets depend on the application.\nOur application discards them and count them in a (per-port, per-queue) application level counter tx_nodescr, which eventually becomes IF-MIB::ifOutDiscards in SNMP. I think many applications behave similarly, so having an ethdev layer tx_nodescr counter might be helpful.\nOther applications could try to retransmit them; if there are still no TX descriptors, they will be counted again.\n\nIn case anyone gets funny ideas: The PMD should still not free those non-transmitted packet mbufs, because the application might want to treat them differently than the transmitted packets, e.g. for latency stats or packet capture.", "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 7962B43F61;\n\tWed, 1 May 2024 20:18:57 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 426484027F;\n\tWed, 1 May 2024 20:18:57 +0200 (CEST)", "from dkmailrelay1.smartsharesystems.com\n (smartserver.smartsharesystems.com [77.243.40.215])\n by mails.dpdk.org (Postfix) with ESMTP id 2DB184021E\n for <dev@dpdk.org>; Wed, 1 May 2024 20:18:55 +0200 (CEST)", "from smartserver.smartsharesystems.com\n (smartserver.smartsharesys.local [192.168.4.10])\n by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 02E9020995;\n Wed, 1 May 2024 20:18:55 +0200 (CEST)" ], "Content-class": "urn:content-classes:message", "MIME-Version": "1.0", "Content-Type": "text/plain;\n\tcharset=\"UTF-8\"", "Content-Transfer-Encoding": "base64", "Subject": "RE: [PATCH] net/af_packet: fix statistics", "Date": "Wed, 1 May 2024 20:18:50 +0200", "X-MimeOLE": "Produced By Microsoft Exchange V6.5", "Message-ID": "<98CBD80474FA8B44BF855DF32C47DC35E9F411@smartserver.smartshare.dk>", "In-Reply-To": "<20240501094436.17ac8f00@hermes.local>", "X-MS-Has-Attach": "", "X-MS-TNEF-Correlator": "", "Thread-Topic": "[PATCH] net/af_packet: fix statistics", "Thread-Index": "Adqb5t4TsdgFLRpYQ3i9VrhkXXtfrwAClARg", "References": "<20240430154129.7347-1-stephen@networkplumber.org>\n <9025199c-585c-4779-9f4e-360845707088@amd.com>\n <20240501094436.17ac8f00@hermes.local>", "From": "=?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>", "To": "\"Stephen Hemminger\" <stephen@networkplumber.org>,\n \"Ferruh Yigit\" <ferruh.yigit@amd.com>", "Cc": "<dev@dpdk.org>, \"John W. Linville\" <linville@tuxdriver.com>, =?utf-8?q?M?=\n\t=?utf-8?q?attias_R=C3=B6nnblom?= <hofors@lysator.liu.se>", "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" }, "addressed": null }, { "id": 169807, "web_url": "http://patchwork.dpdk.org/comment/169807/", "msgid": "<cb0bf354-7c20-4a4d-8063-30f67dbeac47@amd.com>", "list_archive_url": "https://inbox.dpdk.org/dev/cb0bf354-7c20-4a4d-8063-30f67dbeac47@amd.com", "date": "2024-05-02T13:47:45", "subject": "Re: [PATCH] net/af_packet: fix statistics", "submitter": { "id": 2700, "url": "http://patchwork.dpdk.org/api/people/2700/?format=api", "name": "Ferruh Yigit", "email": "ferruh.yigit@amd.com" }, "content": "On 5/1/2024 7:18 PM, Morten Brørup wrote:\n>> From: Stephen Hemminger [mailto:stephen@networkplumber.org]\n>> Sent: Wednesday, 1 May 2024 18.45\n>>\n>> On Wed, 1 May 2024 17:25:59 +0100\n>> Ferruh Yigit <ferruh.yigit@amd.com> wrote:\n>>\n>>>> - Remove the tx_error counter since it was not correct.\n>>>> When transmit ring is full it is not an error and\n>>>> the driver correctly returns only the number sent.\n>>>>\n>>>\n>>> nack\n>>> Transmit full is not only return case here.\n>>> There are actual errors continue to process relying this error\n>> calculation.\n>>> Also there are error cases like interface down.\n>>> Those error cases should be handled individually if we remove this.\n>>> I suggest split this change to separate patch.\n>>\n>> I see multiple drivers have copy/pasted same code and consider\n>> transmit full as an error. It is not.\n> \n> +1\n> Transmit full is certainly not an error!\n> \n\nI am not referring to the transmit full case, there are error cases in\nthe driver:\n- oversized packets\n- vlan inserting failure\n\nIn above cases Tx loop continues, which relies at the end of the loop\nthese packets will be counted as error. We can't just remove error\ncounter, need to handle above.\n\n\n- poll on fd fails\n- poll on fd returns POLLERR (if down)\n\nIn above cases driver Tx loop breaks and all remaining packets counted\nas error.\n\n\n- sendto() fails\n\nAll packets sent to af_packet frame counted as error.\n\n\nAs you can see there are real error cases which are handled in the driver.\nThat is why instead of just removing error counter, I suggest handle it\nmore properly in a separate patch.\n\n>>\n>> There should be a new statistic at ethdev layer that does record\n>> transmit full, and make it across all drivers, but that would have\n>> to wait for ABI change.\n> \n> What happens to these non-transmittable packets depend on the application.\n> Our application discards them and count them in a (per-port, per-queue) application level counter tx_nodescr, which eventually becomes IF-MIB::ifOutDiscards in SNMP. I think many applications behave similarly, so having an ethdev layer tx_nodescr counter might be helpful.\n> Other applications could try to retransmit them; if there are still no TX descriptors, they will be counted again.\n> \n> In case anyone gets funny ideas: The PMD should still not free those non-transmitted packet mbufs, because the application might want to treat them differently than the transmitted packets, e.g. for latency stats or packet capture.\n>", "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 4204443F68;\n\tThu, 2 May 2024 15:47:53 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B36D9402B2;\n\tThu, 2 May 2024 15:47:52 +0200 (CEST)", "from NAM12-DM6-obe.outbound.protection.outlook.com\n (mail-dm6nam12on2084.outbound.protection.outlook.com [40.107.243.84])\n by mails.dpdk.org (Postfix) with ESMTP id D94BA40299\n for <dev@dpdk.org>; Thu, 2 May 2024 15:47:51 +0200 (CEST)", "from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11)\n by SJ0PR12MB7083.namprd12.prod.outlook.com (2603:10b6:a03:4ae::13)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.37; Thu, 2 May\n 2024 13:47:49 +0000", "from CH2PR12MB4294.namprd12.prod.outlook.com\n ([fe80::282f:29d3:cac1:cde3]) by CH2PR12MB4294.namprd12.prod.outlook.com\n ([fe80::282f:29d3:cac1:cde3%7]) with mapi id 15.20.7544.029; Thu, 2 May 2024\n 13:47:49 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=Gh5VuDH5F5VpdIfKZKkLFhgLgfPSW2h/42dOjpV+/ELLzKYAUoda/hVZmv+fR8kcVBF7kbX+CYa1HoC3s0SZQXzz/SItIn8/Sao4nYYZRd03PKgB/iDTt8RCJST2Zx00jJybGomeXJ8l40LWtO8V5aM4hWflFxTchxpTO4h//J7DXtlvgEAIeWZlov7SyuYS+0HGv/qMFYyjm1SGx3/q4227Fz7Ra1bEjnEfcEqLoZYDVGm+cTyn6ra/nTwkDSTkARLC7YaFUgcXr6CvGU4Tl6JyNzUYtsquZ0Vez/Bns1oj6LAxMVtJlyNjiIL/bUhrPmOzkC30CW1ZIwcvk+8e0g==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=lTXbZHttmIjMo1XCumDhQh97A1IRrUoxsLui24TQM5c=;\n b=kBG8CVcm1EGUWWvw116JXtcR0HIkr/r+xYmp/PT9JBsqAnvSRLHARp0r56m+sX1V8FJ/jmVBkYOrVDLezzp5Hqf00WGsBXo195fxt2bFIAnTjnkq/9lMEJ2AOw/uimKY+mSq4FddKdeMn/F90IciqfDzzngn07f0NKbjHt1Z/si/XFNWj/ZyxxOo0Ba2nhxZLqt70KbNUdQY+/Vr+GP0cswQ1IA6RzyBy65WMFrKGq/uWXzAGDaAWV4vsrnNBQzsJGXIsm3Age23XIO5hT5Q9SvihV6C3FGVVvu1E6/VHn0HyEmLrzaLwyQiUDVA9Zfq8/Yc9BuK7I4jTDSKlpu28Q==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass\n header.d=amd.com; arc=none", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=lTXbZHttmIjMo1XCumDhQh97A1IRrUoxsLui24TQM5c=;\n b=tNKz0Ej2265VO62QDhIDkKnkwlQEgskyB+g+9tH1TzMsXhCGSbc7ius1KiIUTU4/fv7W/xp/bL0zSkVs7QHXaxH9z0B5S5dD8a6l0dRVo7Jz18KBdOVJ7XTs9vx1bj3LG2OW9yOe2RqMtGPHucZSuOdzGtdjjVxL9Sx9v/5xABU=", "Authentication-Results": "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=amd.com;", "Message-ID": "<cb0bf354-7c20-4a4d-8063-30f67dbeac47@amd.com>", "Date": "Thu, 2 May 2024 14:47:45 +0100", "User-Agent": "Mozilla Thunderbird", "Subject": "Re: [PATCH] net/af_packet: fix statistics", "To": "=?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>,\n Stephen Hemminger <stephen@networkplumber.org>", "Cc": "dev@dpdk.org, \"John W. Linville\" <linville@tuxdriver.com>, =?utf-8?q?Mat?=\n\t=?utf-8?q?tias_R=C3=B6nnblom?= <hofors@lysator.liu.se>", "References": "<20240430154129.7347-1-stephen@networkplumber.org>\n <9025199c-585c-4779-9f4e-360845707088@amd.com>\n <20240501094436.17ac8f00@hermes.local>\n <98CBD80474FA8B44BF855DF32C47DC35E9F411@smartserver.smartshare.dk>", "Content-Language": "en-US", "From": "Ferruh Yigit <ferruh.yigit@amd.com>", "Autocrypt": "addr=ferruh.yigit@amd.com; keydata=\n xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9\n 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J\n eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg\n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+0Ioq\n b/oFAmR3IPsFCQTeZ44ACgkQVFM+0Ioqb/qINhAAtcor9bevHy22HvJvXX17IOpPSklZJAeQ\n Az43ZEo5kRlJ8mElc2g3RzYCvL/V3fSiIATxIsLq/MDtYhO8AAvklxND/u2zeBd7BkRZTZZX\n W1V1cM3oTvfx3LOhDu4f2ExQzCGdkzbXTRswSJIe1W0qwsDp+YPekbrsKp1maZArGeu+6FuW\n honeosIrWS98QJmscEhP8ooyJkLDCCOgEk+mJ/JBjzcJGuYn6+Iy/ApMw/vqiLGL1UWekcTA\n g18mREHqIR+A3ZvypIufSFB52oIs1zD/uh/MgmL62bY/Cw6M2SxiVxLRsav9TNkF6ZaNQCgn\n GqifliCEMvEuLZRBOZSYH2A/PfwjYW0Ss0Gyfywmb2IA990gcQsXxuCLG7pAbWaeYazoYYEQ\n NYmWatZNMAs68ERI2zvrVxdJ/fBWAllIEd0uQ4P05GtAHPdTIDQYp545+TPV7oyF0LfXcsQs\n SFVZE6igdvkjfYmh+QOrHGZvpWXLTmffVf/AQ81wspzbfxJ7sYM4P8Mg5kKOsaoUdyA/2qVe\n cMh1CLUHXF1GlofpGbe1lj4KUJVse5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH\n dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk=", "In-Reply-To": "\n <98CBD80474FA8B44BF855DF32C47DC35E9F411@smartserver.smartshare.dk>", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-ClientProxiedBy": "LO4P123CA0071.GBRP123.PROD.OUTLOOK.COM\n (2603:10a6:600:153::22) To CH2PR12MB4294.namprd12.prod.outlook.com\n (2603:10b6:610:a9::11)", "MIME-Version": "1.0", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "CH2PR12MB4294:EE_|SJ0PR12MB7083:EE_", "X-MS-Office365-Filtering-Correlation-Id": "b95eb9cf-09ce-45cf-3cca-08dc6aae7474", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;ARA:13230031|366007|376005|1800799015;", "X-Microsoft-Antispam-Message-Info": "=?utf-8?q?aGcysEY5kGoNpqUcKPTKc1FxT4rpRnM?=\n\t=?utf-8?q?UyGnfmshRLeNTMicS2isVu+0VSVpNAvVOSqS8LEaPrn+FfkndQvL/tQwzgZJM+DfO?=\n\t=?utf-8?q?iFi7USJ2227gN+TyiXHoNJb7HFEu+TsOB/YmI9G99DcqoyixXfnI6SB47DIk0m37i?=\n\t=?utf-8?q?dNdMgoks/xqQV8tKpUgygDGehof4BRlzrc1HTlgBqJPAaqAxucAXP4HDw44m+1CSf?=\n\t=?utf-8?q?8pzg7IboIx5QCz3zcuagekzNpsDmtZn74n1qz1eJvykjmQzFMPT+Y8ulhgTuWsGWT?=\n\t=?utf-8?q?nn6jx3s8h+ZJnMf/Oc4iszVav0266eYWKAylwEPIHqwt57E1z/AVGb+WCb2gjmuG5?=\n\t=?utf-8?q?zuyOqRe6GFhdBFVWK6nLACICrAFUGKUnsDDe+mAvgwFYqY5wYcHhSTYprzrxG97x9?=\n\t=?utf-8?q?QYQ29lRYbWfIBDpg82YDtSU+wx6wdqrTxnaMUypu8ymF3OZEl8sPVenrimK4/D8IJ?=\n\t=?utf-8?q?C8LwrlNEYGIBuHWOqmLXpxqxNp5FPzHzEYR5DhcOjkieEHAs4rIk4XcMhtKOp0JK1?=\n\t=?utf-8?q?jOx1V42+iMvM1Xy8YE1oaLY9kAXwraVarCb9+1bbGWb0xSHb0Hch5egGme5tASKW+?=\n\t=?utf-8?q?xqHVh/aDMyqFfmFkByX+iCq/ndRVuMGBT3INdTJNWykJLsvy8Ej0j+tAdq6gImGQg?=\n\t=?utf-8?q?7pOS/f7x0+x8kRhL+DhJm0ln+m+fbsr5+NSO+UekDRqNXH1yXgw0Y7um5/9TcyZBu?=\n\t=?utf-8?q?vRpPwDctk2GSdVrfBxLCkeZu/554eHUQ/i6W8bwMEYa3aImPDFAQgaLTzxczi/+Ob?=\n\t=?utf-8?q?tdDacmUYLE8EXnMwYdwknUizeubjNupGk2rc2iw3H0u/FejsxsIOIDFRTKDYuQgxJ?=\n\t=?utf-8?q?JmgmR50Ndmj0kqLlf1INfZBzgUEiBWi/kgTe3aBfV5GhV9DfNxcC1yNZZ2Fd5e35e?=\n\t=?utf-8?q?PyT2D8/NpeNVWoxrxcn7gTwcP/YeYTsZrUCNCOSNF7vKxwyEW/AcuMHg1QREULOR6?=\n\t=?utf-8?q?KNzWWeaRyUbb9rQLCbF7L3HWjikNnD3FKUHlSdeBgGSN3cNPtiVEupYcZM5u5V/Ht?=\n\t=?utf-8?q?HwVtR05Tgxo40u2krf07titbhwBoh7+mSU/6Vbo43zgkqCILNumBzqoEQe8/t9sOU?=\n\t=?utf-8?q?pJm1dZFT9ArevWnV0sg9OO4jdGWTYnJa80YZHlA27JXpABl67UGds8SP99C0UE6HP?=\n\t=?utf-8?q?ZLMbVwLnVG0ZO5SGse72Dgou5ADXM0FnLw0Kk/c1j5u08HOvivPtAuA+I9zmIUHeX?=\n\t=?utf-8?q?PseZeoXUiLui06kSgV5MLf4+EGK5LsJHFSLA=3D=3D?=", "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230031)(366007)(376005)(1800799015); DIR:OUT; SFP:1101;", "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-MessageData-0": "=?utf-8?q?DkjirYTCKmqr0CyR2HNOomC3u5qB?=\n\t=?utf-8?q?NPtWELCGOfBF6BKKmHtvq7I6JZtHWl+PIZLCEwBhmulmtotI99NXICKbVfkcYQyqL?=\n\t=?utf-8?q?KOJNhrHl+36j9VCY/ha/xceDuL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qp95cTQ76h?=\n\t=?utf-8?q?RxAmCAiglXmPxYnAwtdMA+j+ypDxJ6fU8DW6TpkPSI+T0Ahcmw4vyDN63WDdOmBQC?=\n\t=?utf-8?q?eNPRQ+fnTVBTSlgHOUBEDZ6m9MHuQt/+u+6BPQKFeLthIN6y6FGAGjOaaTuLrmrLQ?=\n\t=?utf-8?q?zj9bTsxeekW9TTcFeq+f7ag0Rw+G8M5XUDQnAPGFReQfnyLHADM4PJq5IVrEjtafW?=\n\t=?utf-8?q?YWbR0NT/pglsXaZftKRgOuL639xTR93uBalu6zzPqbhl23xXhBlrSt4JfJ8/yKna7?=\n\t=?utf-8?q?Sx2IkwZoBOx69pyITR1TlSMn/iwtL0CHL8S3bUTeWf9j+lj/Yq4a+D6FQ26YwTaY3?=\n\t=?utf-8?q?MZFVJP2X1HcGnOjjS6ZOEP7pq/a4NXx6hymLZ0kXERs/3BLF5fbCq1raP0uY2UWGz?=\n\t=?utf-8?q?/yPENYe/jwMM06nN/3xVMhJKjMu8feCS1yMRl0Lal2v2kmmbuTxNORWatkMZGnv2j?=\n\t=?utf-8?q?waW2uD74lCEs1XPAJLIz1uAPhMCkwkfJyp5PpKhBCooEpg9r+1XERKmkURzjkFknM?=\n\t=?utf-8?q?2f1AIGYd26wwNednUsc0PATd33CDQtwO9UsChDhiBRLsrDSjSypmwxFRUUtJoRQwu?=\n\t=?utf-8?q?EZSMgEYRt+zV?=", "X-OriginatorOrg": "amd.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n b95eb9cf-09ce-45cf-3cca-08dc6aae7474", "X-MS-Exchange-CrossTenant-AuthSource": "CH2PR12MB4294.namprd12.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "02 May 2024 13:47:49.3286 (UTC)", "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted", "X-MS-Exchange-CrossTenant-Id": "3dd8961f-e488-4e60-8e11-a82d994e183d", "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED", "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n aqdd29tdL/Htg9+Fzd9V3rLRplFQz/490VR577kLl1IqDSxVkwYnUracAxBX0c8U", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "SJ0PR12MB7083", "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" }, "addressed": null }, { "id": 169808, "web_url": "http://patchwork.dpdk.org/comment/169808/", "msgid": "<679a5189-2d15-432d-a47d-ddb7718a0bac@amd.com>", "list_archive_url": "https://inbox.dpdk.org/dev/679a5189-2d15-432d-a47d-ddb7718a0bac@amd.com", "date": "2024-05-02T13:48:42", "subject": "Re: [PATCH] net/af_packet: fix statistics", "submitter": { "id": 2700, "url": "http://patchwork.dpdk.org/api/people/2700/?format=api", "name": "Ferruh Yigit", "email": "ferruh.yigit@amd.com" }, "content": "On 5/1/2024 5:42 PM, Stephen Hemminger wrote:\n> On Wed, 1 May 2024 17:25:59 +0100\n> Ferruh Yigit <ferruh.yigit@amd.com> wrote:\n> \n>> On 4/30/2024 4:39 PM, Stephen Hemminger wrote:\n>>> The statistics in af_packet driver do not follow the standard\n>>> practice of other drivers:\n>>>\n>>> - Statistics should be maintained as 64 bit even on 32 bit.\n>>> \n>>\n>> ack\n>>\n>>> - Remove the tx_error counter since it was not correct.\n>>> When transmit ring is full it is not an error and\n>>> the driver correctly returns only the number sent.\n>>> \n>>\n>> nack\n>> Transmit full is not only return case here.\n>> There are actual errors continue to process relying this error calculation.\n>> Also there are error cases like interface down.\n>> Those error cases should be handled individually if we remove this.\n>> I suggest split this change to separate patch.\n> \n> It is possible to get errors, but the code wasn't looking for those.\n> See packet(7) man page.\n>\n\nSome of the error cases are in dpdk level, so we can't just rely on\naf_packet socket error counters.", "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 2BCBB43F68;\n\tThu, 2 May 2024 15:48:52 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1B6DD402B2;\n\tThu, 2 May 2024 15:48:52 +0200 (CEST)", "from NAM11-BN8-obe.outbound.protection.outlook.com\n (mail-bn8nam11on2061.outbound.protection.outlook.com [40.107.236.61])\n by mails.dpdk.org (Postfix) with ESMTP id 786BB40299\n for <dev@dpdk.org>; Thu, 2 May 2024 15:48:50 +0200 (CEST)", "from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11)\n by BL3PR12MB6594.namprd12.prod.outlook.com (2603:10b6:208:38d::13)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.28; Thu, 2 May\n 2024 13:48:47 +0000", "from CH2PR12MB4294.namprd12.prod.outlook.com\n ([fe80::282f:29d3:cac1:cde3]) by CH2PR12MB4294.namprd12.prod.outlook.com\n ([fe80::282f:29d3:cac1:cde3%7]) with mapi id 15.20.7544.029; Thu, 2 May 2024\n 13:48:46 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=corqJYk8hOiJqBJks0Oxamw7bYEi1Xmt4Db3Zj6VjlWPu9g5IwqpyISlmYYvtwy+uIJ8e5nFFNQ0wHPM1iYLBneMMYWMzOcp+2X/1QivHvFD8v/+MkYv/Inknr4rW9WjH01YhzJvOB0QcGmhG4OkKtPsNZStc9TPzakzSAYHqZT5bBgWklzNbBMaAKZElzVlXDTVm20JGc8m1uOWZ1qyQxkSWrvqmkavV2lCoXlT9FlKfoZK9W/WsFIAthFJANx8vrt3lH4awG2rrKQt21Z7Ss29dXNeIP5aBkJcd5DetZ9/FqCZazduvLF58XA8Mvl4TuruLrRT5Dy/pO/I79ESnA==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=sgWxfdTxDTkBjDN1GfYGtPyLi6dLX3yyxvOLZtoaZPE=;\n b=AJWjFhw+0mRXfEXVhDYTIvYGGQKs17+wBJRdUlrapCnAmVlbVCpC/zlHl0g9X8U/IZbGhPQrOymdZ40ulVVFKUKUp4t1MICIxpFfrtRMTB+lMc7ZlvGUytvEUV10oL9CfuxoF8lJ6/1opQ8UZeFksf/IcEVWxbAhMZ+NR4uRFocvf7I5b2JRj+npJ/aFEXd3crd/RsyDeN/y22uYjSAMfeakewcHdajU6SuwMOOrkK0sABN9lEwBPVtMVlHSxdubTznGLUrmaEebi4EflrI+6K6Q8V2iOA5FqiFThVHq7xArpuiQzGtK6iwDNxeAJtI9xHR5dKYZ98KiBozJU38ghQ==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass\n header.d=amd.com; arc=none", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=sgWxfdTxDTkBjDN1GfYGtPyLi6dLX3yyxvOLZtoaZPE=;\n b=yuQ/LsEM+07021a3CjGoBn9dz/tI22LC3SeA+Ug9gHJ0tHuHVhyeWQhvFr5Fa4y1rABE7ddoixMEVvv74jy1XM24eLvy8aU6B8Ux+Ka5FQ9UNXbZggMXxQE9R8ROwJh7b7F5Tfec2ZM/A1W9/XG4tnT1QqTSowoWrxRAgYp+dfs=", "Authentication-Results": "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=amd.com;", "Message-ID": "<679a5189-2d15-432d-a47d-ddb7718a0bac@amd.com>", "Date": "Thu, 2 May 2024 14:48:42 +0100", "User-Agent": "Mozilla Thunderbird", "Subject": "Re: [PATCH] net/af_packet: fix statistics", "To": "Stephen Hemminger <stephen@networkplumber.org>", "Cc": "dev@dpdk.org, \"John W. Linville\" <linville@tuxdriver.com>, =?utf-8?q?Mat?=\n\t=?utf-8?q?tias_R=C3=B6nnblom?= <hofors@lysator.liu.se>", "References": "<20240430154129.7347-1-stephen@networkplumber.org>\n <9025199c-585c-4779-9f4e-360845707088@amd.com>\n <20240501094208.5f9e4cf9@hermes.local>", "Content-Language": "en-US", "From": "Ferruh Yigit <ferruh.yigit@amd.com>", "Autocrypt": "addr=ferruh.yigit@amd.com; keydata=\n xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9\n 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J\n eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg\n B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9\n RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ\n N3AmBIxZ/A7UXBKLaOyZ+/i3sE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QzCGdkzbXTRswSJIe1W0qwsDp+YPekbrsKp1maZArGeu+6FuW\n honeosIrWS98QJmscEhP8ooyJkLDCCOgEk+mJ/JBjzcJGuYn6+Iy/ApMw/vqiLGL1UWekcTA\n g18mREHqIR+A3ZvypIufSFB52oIs1zD/uh/MgmL62bY/Cw6M2SxiVxLRsav9TNkF6ZaNQCgn\n GqifliCEMvEuLZRBOZSYH2A/PfwjYW0Ss0Gyfywmb2IA990gcQsXxuCLG7pAbWaeYazoYYEQ\n NYmWatZNMAs68ERI2zvrVxdJ/fBWAllIEd0uQ4P05GtAHPdTIDQYp545+TPV7oyF0LfXcsQs\n SFVZE6igdvkjfYmh+QOrHGZvpWXLTmffVf/AQ81wspzbfxJ7sYM4P8Mg5kKOsaoUdyA/2qVe\n cMh1CLUHXF1GlofpGbe1lj4KUJVse5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH\n dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk=", "In-Reply-To": "<20240501094208.5f9e4cf9@hermes.local>", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "7bit", "X-ClientProxiedBy": "LO4P123CA0061.GBRP123.PROD.OUTLOOK.COM\n (2603:10a6:600:153::12) To CH2PR12MB4294.namprd12.prod.outlook.com\n (2603:10b6:610:a9::11)", "MIME-Version": "1.0", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "CH2PR12MB4294:EE_|BL3PR12MB6594:EE_", "X-MS-Office365-Filtering-Correlation-Id": "e281bea9-3072-4749-8940-08dc6aae9670", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;ARA:13230031|376005|1800799015|366007;", "X-Microsoft-Antispam-Message-Info": "=?utf-8?q?K/tCasjmKeo0hThI7xNfnfpV8hIlh6a?=\n\t=?utf-8?q?laBlF37+8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iNp5xB8QyJ2CIPEurR4VqhSPP8D5xlxjqam3ojVOL6X?=\n\t=?utf-8?q?H68Ci0N7iSTFeg9bLjzUlBI2Rf00QXPsa88UX08JZbneIm/c069JhpXSk7le8Hf03?=\n\t=?utf-8?q?XVpZaiFvME373j9sXqZjEApiv6wUW2DJ7Wg8ZQ3ChyfUGH8b1y1STf59+yCK/T9F0?=\n\t=?utf-8?q?8McjFVui555c1HuOiCbhtMRz3Le5vTxDTslGAjwVBD3uUgZ2tvTH6Gv7ExAY1Rlfa?=\n\t=?utf-8?q?WczpzKcYZa3vWWzkBtGAr4f+rWlo6i8ZnYDii3vhnKfczxMJdOnlYlLiWbLfpvmqU?=\n\t=?utf-8?q?gUNkNrlGZ9D1g6AsC1qYkuHjmnndEONI3UkMaT/6/sTYeP8AgSaN/Fu6nev7hHHxb?=\n\t=?utf-8?q?hA1GnRHpFlyaD8wgBsOjm+jCtlLyiEXmMJzg=3D=3D?=", "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230031)(376005)(1800799015)(366007); DIR:OUT; SFP:1101;", "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-MessageData-0": "=?utf-8?q?xMYJHLnLxM/HUOikAEYeKc60abjD?=\n\t=?utf-8?q?E7pdaYaIhn5Mnimew7jelIcyPHp3VJK9Lw1aRMkdFm5nthBYiMj/SOLLTtxa9vcl8?=\n\t=?utf-8?q?Dy0mplwVU27LpS27ihhyTKc7Y/iOL4EAhr3jq71JvaZttRMcEje8m87QgXjYan371?=\n\t=?utf-8?q?Pk78lmVpz8sgeFNq13FvkSM8SfDUkFidb4vo3SvNFkn7fqhVgJh1gYS49cSuJvUi2?=\n\t=?utf-8?q?hXYq2rxqd4C8QvrNbfj6DoMCoxC5dyOkIh64UCDQr4mntg+N4X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H?=\n\t=?utf-8?q?803buRkfKqSRwQdnEjc34hNEqganlhSccw1SE3g/t8eRwI3RPtgjscTlFaq7aoImD?=\n\t=?utf-8?q?2r2Y0mDCN6DeBPO4ouVjl4UbwsmHWKnSBKGRXHHpubaNXpH22miwDOlsHRqlvJvaw?=\n\t=?utf-8?q?wUpxize+9hXZAC22T5dIW+0mTPWAUg3pK/6FAtTPIxb/tXQDMBytD08BKkjUJ6YSU?=\n\t=?utf-8?q?79upmINNIGBlnEsSoINFfmGPSZqqYEk1yaU0b5UkexmioF5RCyeIjYq8oJ8/X+zk7?=\n\t=?utf-8?q?EXmEE1/DTLsVXojfbxhT3ZVJZo8AYbDE8/JFFdQhI60ypyQHntLdOIXSTGFkqjaX/?=\n\t=?utf-8?q?j04inNN2sM7L5+w58FM3Xv8cOY6GMwEDXMQ5aGvawJ5G8Q4uK+6rgN6vmzAKW+lLm?=\n\t=?utf-8?q?Nqa+ymuj93+Bn4ZudNF6I7HCE9uRJ+cx41w7bDxmS+40Rx+FFItZb8FnkIXIn+w8P?=\n\t=?utf-8?q?6tjnSYjy0u3X?=", "X-OriginatorOrg": "amd.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n e281bea9-3072-4749-8940-08dc6aae9670", "X-MS-Exchange-CrossTenant-AuthSource": "CH2PR12MB4294.namprd12.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "02 May 2024 13:48:46.2431 (UTC)", "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted", "X-MS-Exchange-CrossTenant-Id": "3dd8961f-e488-4e60-8e11-a82d994e183d", "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED", "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n Xx+afIlI9PaqDosdjU9GUNIn82qfHY5GretO5kvL5r9o8y+P2XRb8rKq+uVOxzKq", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BL3PR12MB6594", "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" }, "addressed": null }, { "id": 169809, "web_url": "http://patchwork.dpdk.org/comment/169809/", "msgid": "<b802ad44-a705-4a1b-82ee-92e5d0b9e7d8@amd.com>", "list_archive_url": "https://inbox.dpdk.org/dev/b802ad44-a705-4a1b-82ee-92e5d0b9e7d8@amd.com", "date": "2024-05-02T14:12:43", "subject": "Re: [PATCH] net/af_packet: fix statistics", "submitter": { "id": 2700, "url": "http://patchwork.dpdk.org/api/people/2700/?format=api", "name": "Ferruh Yigit", "email": "ferruh.yigit@amd.com" }, "content": "On 5/1/2024 5:43 PM, Stephen Hemminger wrote:\n> On Wed, 1 May 2024 17:25:59 +0100\n> Ferruh Yigit <ferruh.yigit@amd.com> wrote:\n> \n>>> - Do not mark statistics as volatile.\n>>> Instead, READ_ONCE() where necessary.\n>>> \n>>\n>> I did similar [1], and Mattias has some comments on it.\n>> Issue is not in the reader (stats_get) side. Without volatile writer\n>> (datapath thread) may end up *not* storing updated stats to memory.\n>>\n>> For reader side, I expect value not been in the register when function\n>> called, so it ends up reading from memory, which doesn't require\n>> volatile casting.\n> \n> These are per-queue stats, and anybody foolish enough to have multiple\n> threads sharing same queue without locking is playing with fire.\n> It is documented that DPDK PMD's don't support that.\n>\n\nI am not referring multiple core sharing a queue, this is wrong for DPDK.\n\nFor single core case, if a variable doesn't have 'volatile' qualifier\nand load/stores are not atomic, as compiler is not aware that there may\nbe other threads will access this value, what prevents compiler to hold\nstats value in a register and store it memory at later stage, let say at\nthe end of the application forwarding loop?\n\nFor this case keeping 'volatile' qualifier works. But Mattias has a\nsuggestion to use \"normal load + normal add + atomic store\" in datapath.\n\n\nFor getting stats, which will be in different thread, you are already\ncasting it to 'volatile' to enforce compiler read from memory each time.\n\n\nAdditionally when we take stats reset into account, which can happen in\ndifferent thread, 'volatile' is not enough.\nFor reliable stats reset, either we need to use full atomics, or offset\nlogic which I am trying to in other patch.", "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 1E26E43F69;\n\tThu, 2 May 2024 16:12:51 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A4C29402B2;\n\tThu, 2 May 2024 16:12:50 +0200 (CEST)", "from NAM10-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam10on2070.outbound.protection.outlook.com [40.107.94.70])\n by mails.dpdk.org (Postfix) with ESMTP id 4CB8940299\n for <dev@dpdk.org>; Thu, 2 May 2024 16:12:49 +0200 (CEST)", "from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11)\n by SA0PR12MB4432.namprd12.prod.outlook.com (2603:10b6:806:98::16)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.28; Thu, 2 May\n 2024 14:12:47 +0000", "from CH2PR12MB4294.namprd12.prod.outlook.com\n ([fe80::282f:29d3:cac1:cde3]) by CH2PR12MB4294.namprd12.prod.outlook.com\n ([fe80::282f:29d3:cac1:cde3%7]) with mapi id 15.20.7544.029; Thu, 2 May 2024\n 14:12:47 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=HbWzZYADJ5w8V7SQfuh9hNyFxt7qhFYQKXxG5u99KRkZWe/pLdeEZnS2hCStUvQACXOA1woeGkFfYl/0eIf/jtUDqUzH31eK6wtc458XlWFlAKw4YBHPGh5BfnDW4XAq9ZTsbITv3gpDkoaCBbPD0MO0Fj6Z2rCgpl18iZsxvUbsfuOZUhZujLpBslTHzTGDr6OPFAdE3sAVyph5WJP54ZfHk9sLixpN01hO9SoI9mH9OnskO3Tkr7U5KiULcqgnj+Vu5NnHPCCozi6Sqt+cWlzrVtsLcD+B/DwklNkYbk9qh7HexdK3Kk/ZLBtxfgZuvr6UdSB4Woxt0MdEkPmVbg==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=p70Rsy2f4sRBVDxDpq9V1l6lZyASRTozf8ey791gx1Y=;\n b=hXEvbnJpYkLd3l9tFyt6VCqZ/ElDJMWJqo+70ihgWi492ivf3NB1COJMUkRDaXmpzgaU02jK3R0ttXTvefsz59UpiSHQ7GoIv1+GMx71D983NKvoHAm5iAnr8vuNYuQBWzAsVbXuXoz7lG9x3vxIGaGYvXinOyPjSpvRDMrIEhoORpLbF8zLB3TJCF10m2j+XjXOL3Hn7r34BCjgQMsc9Cb21yRca2bHuWekUOlU3YJXMYpFFt3Atu0TGslvTN6tYBYTZZAZdd+Q8nv0x/l5tEDSFObWoVv5Btl9in8PSxQp6R3gV4OGz7HauHFNcPi/wqvTQFVNGYKhpyYjmLRSUw==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass\n header.d=amd.com; arc=none", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=p70Rsy2f4sRBVDxDpq9V1l6lZyASRTozf8ey791gx1Y=;\n b=f24h/ogKzEV5K9gbXDZgq7WCDdxwwYtVAFenlPIkRsJJ5fq4WpKM0zSgZe/IoeZKp0qOM80RTqovvrNrQtYy86Gj51Qd8a+2B1mM5fhvuEd+br7rZbPYAA6oumSqbYM6ZCdqH0sv+Cx6RDSi+RbCuJ1K+r1SyaD3e0W6O0MqVy8=", "Authentication-Results": "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=amd.com;", "Message-ID": "<b802ad44-a705-4a1b-82ee-92e5d0b9e7d8@amd.com>", "Date": "Thu, 2 May 2024 15:12:43 +0100", "User-Agent": "Mozilla Thunderbird", "Subject": "Re: [PATCH] net/af_packet: fix statistics", "To": "Stephen Hemminger <stephen@networkplumber.org>", "Cc": "dev@dpdk.org, \"John W. Linville\" <linville@tuxdriver.com>, =?utf-8?q?Mat?=\n\t=?utf-8?q?tias_R=C3=B6nnblom?= <hofors@lysator.liu.se>, =?utf-8?q?Morten_Br?=\n\t=?utf-8?q?=C3=B8rup?= <mb@smartsharesystems.com>", "References": "<20240430154129.7347-1-stephen@networkplumber.org>\n <9025199c-585c-4779-9f4e-360845707088@amd.com>\n <20240501094303.751e95b4@hermes.local>", "Content-Language": "en-US", "From": "Ferruh Yigit <ferruh.yigit@amd.com>", "Autocrypt": "addr=ferruh.yigit@amd.com; keydata=\n xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9\n 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J\n eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg\n B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8T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or9bevHy22HvJvXX17IOpPSklZJAeQ\n Az43ZEo5kRlJ8mElc2g3RzYCvL/V3fSiIATxIsLq/MDtYhO8AAvklxND/u2zeBd7BkRZTZZX\n W1V1cM3oTvfx3LOhDu4f2ExQzCGdkzbXTRswSJIe1W0qwsDp+YPekbrsKp1maZArGeu+6FuW\n honeosIrWS98QJmscEhP8ooyJkLDCCOgEk+mJ/JBjzcJGuYn6+Iy/ApMw/vqiLGL1UWekcTA\n g18mREHqIR+A3ZvypIufSFB52oIs1zD/uh/MgmL62bY/Cw6M2SxiVxLRsav9TNkF6ZaNQCgn\n GqifliCEMvEuLZRBOZSYH2A/PfwjYW0Ss0Gyfywmb2IA990gcQsXxuCLG7pAbWaeYazoYYEQ\n NYmWatZNMAs68ERI2zvrVxdJ/fBWAllIEd0uQ4P05GtAHPdTIDQYp545+TPV7oyF0LfXcsQs\n SFVZE6igdvkjfYmh+QOrHGZvpWXLTmffVf/AQ81wspzbfxJ7sYM4P8Mg5kKOsaoUdyA/2qVe\n cMh1CLUHXF1GlofpGbe1lj4KUJVse5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH\n dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk=", "In-Reply-To": "<20240501094303.751e95b4@hermes.local>", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "7bit", "X-ClientProxiedBy": "LO2P265CA0497.GBRP265.PROD.OUTLOOK.COM\n (2603:10a6:600:13a::22) To CH2PR12MB4294.namprd12.prod.outlook.com\n (2603:10b6:610:a9::11)", "MIME-Version": "1.0", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "CH2PR12MB4294:EE_|SA0PR12MB4432:EE_", "X-MS-Office365-Filtering-Correlation-Id": "845fddae-a6b9-40a1-9add-08dc6ab1f142", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0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yBLEhWWr?=\n\t=?utf-8?q?CbDjNqK8TBymA0n/t35bfaflyuD176kRZ0FGhEJIrdoVap71Ght0eGec/p4V0yQMF?=\n\t=?utf-8?q?sVxiWmh2mJJ6lwJgnqgTYf7uk88qbpfg2fEP0U3VW7SzpSK6yXErHQHU09CxAzVBx?=\n\t=?utf-8?q?kF05ehvkK8nVi5N0rXVIMw3hypcG9l3ZpfnosAIMHqeuqPEZ4/YFehOn8pwnDiw+l?=\n\t=?utf-8?q?3TBhIRFIBXy2Fy/mRWvVf6vVJNjTDiAJQOhblzFOXUxhOXuH/AM3BJqzsrs+Kf3BE?=\n\t=?utf-8?q?//t5/3pEaAxOUEf7jpVBmDViLlvWMhE7UpnShI0upDjO8vjc1rEzG/AXqbcoUFcSF?=\n\t=?utf-8?q?vwidq+ELbEvjFKPeBm/gMCLWMpyXEmSawuUZRM68RnNmdmfEkyLn9nAJTnrYi6YlW?=\n\t=?utf-8?q?1BbSpveHAu2jhGCN/qmUp1/Fs0zsPpwah+npv+PvfP4QtqJlg/oZ+J4Bqekr7fFWl?=\n\t=?utf-8?q?MOPDzINRqgQpj45tFguAHrGqlwRD+BUPSKUQ=3D=3D?=", "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230031)(366007)(376005)(1800799015); DIR:OUT; SFP:1101;", "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-MessageData-0": "=?utf-8?q?y10rK6n8M3kC6wmCFUmXa9f7W1t+?=\n\t=?utf-8?q?02KzkCdgbVZgTZE+/eNlO41fEYtGqTkwboWlAFJTKZM0rL17qUnAldXS8zhvfT9YV?=\n\t=?utf-8?q?21B0RX1iR8W9Qtwnif/RdlGn2Jw+oOPcvxYS9uaXpaBhRlPFWHh66kR5jsM8VfJfH?=\n\t=?utf-8?q?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ySVoAcAoLksb321lTLzbiWJgrY?=\n\t=?utf-8?q?nhmHt12vFm+ADd2zj4ktrvQxrfM4Tixw6hZ9h7Alwk2RPND50fUqFZGfCJP+QHtQt?=\n\t=?utf-8?q?oNYx9+IwBY0n45vUqSYzCH6K8kSY4xY0nOkuK3XTugrj3s3CYpV73kY9B4qDqM7XL?=\n\t=?utf-8?q?sQI+15rk5nYySyPlBhvc2V82CzJp4KTGVm6bGQxh9mj3FyglaBSp69/cwLhv2A00Y?=\n\t=?utf-8?q?LuSYxdF4Rlf1/88i8B15Wg0/1wPNn5x+6ud84Pd+ho/MOvVzSNq7mNBDyRjjyBgJE?=\n\t=?utf-8?q?HXbTrC0kLEuLqlz9uPWINr00qrX8sW7YsGsPlrUcqPoKgt37+0d9ILMvcei7Qbzx0?=\n\t=?utf-8?q?AYNALtWdOzJ6tHJK7MaRKSEjoOEYGV9qQFnpNSJsW4VqYWN9sPNzlVIQjBd7Gg6vs?=\n\t=?utf-8?q?ssl1S2e66Elecqg+weoluHa735KSsu9mxcfZ7sk+mZSzx67oVdsTlCVQIaXVbGDv2?=\n\t=?utf-8?q?Q8E5uHANKapIIVkcYo3iuz1Mas3+lWTMri95egpSem/OPILrOqnHWDAXGObkQmxUv?=\n\t=?utf-8?q?tJ4fOLl0PcRP?=", "X-OriginatorOrg": "amd.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 845fddae-a6b9-40a1-9add-08dc6ab1f142", "X-MS-Exchange-CrossTenant-AuthSource": "CH2PR12MB4294.namprd12.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "02 May 2024 14:12:47.1218 (UTC)", "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted", "X-MS-Exchange-CrossTenant-Id": "3dd8961f-e488-4e60-8e11-a82d994e183d", "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED", "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n mYa58SRb3YpCnHpaG6QmejE8bmzOUF7S6JhQcoagmZMf5cqn7uI0sloZ5a4QO/O+", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "SA0PR12MB4432", "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" }, "addressed": null }, { "id": 169818, "web_url": "http://patchwork.dpdk.org/comment/169818/", "msgid": "<20240502091658.2d51ca75@hermes.local>", "list_archive_url": "https://inbox.dpdk.org/dev/20240502091658.2d51ca75@hermes.local", "date": "2024-05-02T16:16:58", "subject": "Re: [PATCH] net/af_packet: fix statistics", "submitter": { "id": 27, "url": "http://patchwork.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "content": "On Thu, 2 May 2024 15:12:43 +0100\nFerruh Yigit <ferruh.yigit@amd.com> wrote:\n\n> I am not referring multiple core sharing a queue, this is wrong for DPDK.\n> \n> For single core case, if a variable doesn't have 'volatile' qualifier\n> and load/stores are not atomic, as compiler is not aware that there may\n> be other threads will access this value, what prevents compiler to hold\n> stats value in a register and store it memory at later stage, let say at\n> the end of the application forwarding loop?\n\nNo other driver does this; it is not a problem since once rx/tx burst\nfunction returns, there is no state the compiler is aware of.\n\n\n> For this case keeping 'volatile' qualifier works. But Mattias has a\n> suggestion to use \"normal load + normal add + atomic store\" in datapath.\n> \n> \n> For getting stats, which will be in different thread, you are already\n> casting it to 'volatile' to enforce compiler read from memory each time.\n> \n> \n> Additionally when we take stats reset into account, which can happen in\n> different thread, 'volatile' is not enough.\n> For reliable stats reset, either we need to use full atomics, or offset\n> logic which I am trying to in other patch.\n\nIf you want to attack the problem in the general case, there should be\nstandard set of functions for handling per-core stats. If you look at\nLinux kernel you will see macros around this function:\n\nnetdev_core_stats_inc((struct net_device *dev, u32 offset) {\n\tstruct net_device_core_stats __percpu *p = READ_ONCE(dev->core_stats);\n\tunsigned long __percpu *field;\n...\n\tfield = (__force unsigned long __percpu *)((__force void *)p + offset);\n\tthis_cpu_inc(*field);\n}\n\nThe expansion of this_cpu_inc is nested but ends up being:\n\t*field += 1;\n\nNo volatile is needed.\n\nThe conclusion I reach from this is:\n\t- atomic is not needed for per-cpu data. See \"volatile considered harmful\"\n using a form of compiler barrier is useful but should be hidden in generic code.\n\t- what is the state of the better per-lcore patches?\n that should be used here.\n - need a more generic percpu stats infrastructure\n - ethedev needs to have a generic percpu infra and not reinvented in xdp, tap, packet, etc.", "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 E565243F6A;\n\tThu, 2 May 2024 18:17:05 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B63CC402B2;\n\tThu, 2 May 2024 18:17:05 +0200 (CEST)", "from mail-pj1-f50.google.com (mail-pj1-f50.google.com\n [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id E3FEA40299\n for <dev@dpdk.org>; Thu, 2 May 2024 18:17:03 +0200 (CEST)", "by mail-pj1-f50.google.com with SMTP id\n 98e67ed59e1d1-2b27c532e50so2151415a91.2\n for <dev@dpdk.org>; Thu, 02 May 2024 09:17:03 -0700 (PDT)", "from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n t14-20020a17090a510e00b002b2827dcb5esm1413166pjh.9.2024.05.02.09.16.59\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 02 May 2024 09:17:02 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1714666623;\n x=1715271423; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:subject:cc:to:from:date:from:to:cc:subject:date\n :message-id:reply-to;\n bh=y00Kl0PqCaUbIQ5dMbpplYf+ljqaoNAqe4XsVRb4Fbc=;\n b=NJlI7PKyj+AW43Jfj32HiLma0a0fk5j8V7m2q+rcoDIZ7WcYUHV6I3cFagc9NZ5lc7\n 4PGfMk6Yur6o6b8StfEzOY7XLZxdDk8Me9UY2gXZBriTQFhg95Uhy7hmprRrCHlTpMF1\n QRuqQqC36DD15sGeutDkpqzIdy/qpqhFkyYuaNy1ab59bjCC7/N+MEstP8KSHBweYBFz\n tWlUjOduxcizDiMCM87ZfZhsVu+yJlFGo/6/+FcG0wG1swlUYXXouu+fAPwCTTKfgxtV\n bO6176K2MiVpiN+2RQFUcsCEdqD8EDwxTaLIo25w+JwXOcV3dYmsjlRkmOri3j7Uij8Y\n c54A==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1714666623; x=1715271423;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=y00Kl0PqCaUbIQ5dMbpplYf+ljqaoNAqe4XsVRb4Fbc=;\n b=e0QLutagvJ1+44wZynk/RTwAnYwX7ftG2QLFDr0ErouxTRGAKlqfnGNKeg4e6CDVPB\n UyaGTN6HxE3FUpbT+YRwQjIsDsoF08/Np0+PweIH3Rm8TKbN7jC7e80XAfa8ngxZ9OXK\n D2pOZEhDj5aVlY8OwhC5qyPVRXtv6YhqA5x7qKMdnjJbgIPeqiXUSYXMcxZ4GjzHayq4\n 7tkJ3xwGTzsV65u5fPgg4s90fXx1zdU67jI/lSbB1/Q6e83uZgUq8kLoH5TokTOlXhr0\n qcuwM7QmmsMqbuDfNzT6yTAiTTXyyoHvj8vK1J/uq4wAQ3H/CaKi75NfBwHjm+bp2zuE\n ZwnA==", "X-Gm-Message-State": "AOJu0YzTso6iZpnZo63LLHphyo6iVB3HFLxfaVvzVDc4KezviMVbrTqb\n VOLfP8EtDzWXT8wPeDpDj7d8nvGi8eIAhud8PUiyxyMPKpI5G9tp9Nuag0RRQtA=", "X-Google-Smtp-Source": "\n AGHT+IEWwm+655letKQeTtWMsS+hEDMGNxAbtYCWY9Vz9m4kZYHDCwcGEgYHyX+Ckkc0NQzpudI97Q==", "X-Received": "by 2002:a17:90a:d914:b0:2b2:84a1:5cb with SMTP id\n c20-20020a17090ad91400b002b284a105cbmr274918pjv.9.1714666622810;\n Thu, 02 May 2024 09:17:02 -0700 (PDT)", "Date": "Thu, 2 May 2024 09:16:58 -0700", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "Ferruh Yigit <ferruh.yigit@amd.com>", "Cc": "dev@dpdk.org, \"John W. Linville\" <linville@tuxdriver.com>, Mattias\n\t=?utf-8?b?UsO2bm5ibG9t?= <hofors@lysator.liu.se>, Morten =?utf-8?q?Br=C3=B8?=\n\t=?utf-8?q?rup?= <mb@smartsharesystems.com>", "Subject": "Re: [PATCH] net/af_packet: fix statistics", "Message-ID": "<20240502091658.2d51ca75@hermes.local>", "In-Reply-To": "<b802ad44-a705-4a1b-82ee-92e5d0b9e7d8@amd.com>", "References": "<20240430154129.7347-1-stephen@networkplumber.org>\n <9025199c-585c-4779-9f4e-360845707088@amd.com>\n <20240501094303.751e95b4@hermes.local>\n <b802ad44-a705-4a1b-82ee-92e5d0b9e7d8@amd.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=US-ASCII", "Content-Transfer-Encoding": "7bit", "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" }, "addressed": null }, { "id": 169823, "web_url": "http://patchwork.dpdk.org/comment/169823/", "msgid": "<d4e5cea1-5067-4b1d-98e3-ebe8bd1f3772@lysator.liu.se>", "list_archive_url": "https://inbox.dpdk.org/dev/d4e5cea1-5067-4b1d-98e3-ebe8bd1f3772@lysator.liu.se", "date": "2024-05-02T17:57:55", "subject": "Re: [PATCH] net/af_packet: fix statistics", "submitter": { "id": 906, "url": "http://patchwork.dpdk.org/api/people/906/?format=api", "name": "Mattias Rönnblom", "email": "hofors@lysator.liu.se" }, "content": "On 2024-05-02 18:16, Stephen Hemminger wrote:\n> On Thu, 2 May 2024 15:12:43 +0100\n> Ferruh Yigit <ferruh.yigit@amd.com> wrote:\n> \n>> I am not referring multiple core sharing a queue, this is wrong for DPDK.\n>>\n>> For single core case, if a variable doesn't have 'volatile' qualifier\n>> and load/stores are not atomic, as compiler is not aware that there may\n>> be other threads will access this value, what prevents compiler to hold\n>> stats value in a register and store it memory at later stage, let say at\n>> the end of the application forwarding loop?\n> \n> No other driver does this; it is not a problem since once rx/tx burst\n> function returns, there is no state the compiler is aware of.\n> \n> \n>> For this case keeping 'volatile' qualifier works. But Mattias has a\n>> suggestion to use \"normal load + normal add + atomic store\" in datapath.\n>>\n>>\n>> For getting stats, which will be in different thread, you are already\n>> casting it to 'volatile' to enforce compiler read from memory each time.\n>>\n>>\n>> Additionally when we take stats reset into account, which can happen in\n>> different thread, 'volatile' is not enough.\n>> For reliable stats reset, either we need to use full atomics, or offset\n>> logic which I am trying to in other patch.\n> \n> If you want to attack the problem in the general case, there should be\n> standard set of functions for handling per-core stats. If you look at\n> Linux kernel you will see macros around this function:\n> \n> netdev_core_stats_inc((struct net_device *dev, u32 offset) {\n> \tstruct net_device_core_stats __percpu *p = READ_ONCE(dev->core_stats);\n> \tunsigned long __percpu *field;\n> ...\n> \tfield = (__force unsigned long __percpu *)((__force void *)p + offset);\n> \tthis_cpu_inc(*field);\n> }\n> \n> The expansion of this_cpu_inc is nested but ends up being:\n> \t*field += 1;\n> \n> No volatile is needed.\n> \n> The conclusion I reach from this is:\n> \t- atomic is not needed for per-cpu data. See \"volatile considered harmful\"\n> using a form of compiler barrier is useful but should be hidden in generic code.\n> \t- what is the state of the better per-lcore patches?\n> that should be used here.\n> - need a more generic percpu stats infrastructure\n> - ethedev needs to have a generic percpu infra and not reinvented in xdp, tap, packet, etc.\n> \n> \n\nIn this case, the counters are already effectively \"per-lcore\", since a \nsingle RX/TX queue pair is not MT safe, and thus is only used by one \nthread (or at least, by one thread at a time).\n\nMy impression is that both the Linux kernel and DPDK tend to assume that \nno load or store tearing occurs for accesses to small, naturally \naligned, integer types. I'm guessing it's also commonly assumed there \nare limits to how large section of the whole program the compiler may \nreason about, to eliminate data and code/instructions that have no \neffect on that thread. Thus, volatile are not needed to assure that for \nexample counter state is actually maintained, and updates actually occurs.\n\nI will continue work on the lcore variables patch set as soon as time \npermits. That will be after my attempts to complete the bitops and the \nbitset patch sets have concluded.", "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 7784043F6A;\n\tThu, 2 May 2024 19:57:59 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0A377402B2;\n\tThu, 2 May 2024 19:57:59 +0200 (CEST)", "from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3])\n by mails.dpdk.org (Postfix) with ESMTP id BD91C40299\n for <dev@dpdk.org>; Thu, 2 May 2024 19:57:57 +0200 (CEST)", "from mail.lysator.liu.se (localhost [127.0.0.1])\n by mail.lysator.liu.se (Postfix) with ESMTP id 27A9910C02\n for <dev@dpdk.org>; Thu, 2 May 2024 19:57:57 +0200 (CEST)", "by mail.lysator.liu.se (Postfix, from userid 1004)\n id 1BDBA10AF5; Thu, 2 May 2024 19:57:57 +0200 (CEST)", "from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se\n [62.63.215.114])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mail.lysator.liu.se (Postfix) with ESMTPSA id 9FE0610C01;\n Thu, 2 May 2024 19:57:55 +0200 (CEST)" ], "X-Spam-Checker-Version": "SpamAssassin 4.0.0 (2022-12-13) on\n hermod.lysator.liu.se", "X-Spam-Level": "", "X-Spam-Status": "No, score=-1.3 required=5.0 tests=ALL_TRUSTED,AWL,\n T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0", "X-Spam-Score": "-1.3", "Message-ID": "<d4e5cea1-5067-4b1d-98e3-ebe8bd1f3772@lysator.liu.se>", "Date": "Thu, 2 May 2024 19:57:55 +0200", "MIME-Version": "1.0", "User-Agent": "Mozilla Thunderbird", "Subject": "Re: [PATCH] net/af_packet: fix statistics", "To": "Stephen Hemminger <stephen@networkplumber.org>,\n Ferruh Yigit <ferruh.yigit@amd.com>", "Cc": "dev@dpdk.org, \"John W. Linville\" <linville@tuxdriver.com>, =?utf-8?q?Mor?=\n\t=?utf-8?q?ten_Br=C3=B8rup?= <mb@smartsharesystems.com>", "References": "<20240430154129.7347-1-stephen@networkplumber.org>\n <9025199c-585c-4779-9f4e-360845707088@amd.com>\n <20240501094303.751e95b4@hermes.local>\n <b802ad44-a705-4a1b-82ee-92e5d0b9e7d8@amd.com>\n <20240502091658.2d51ca75@hermes.local>", "Content-Language": "en-US", "From": "=?utf-8?q?Mattias_R=C3=B6nnblom?= <hofors@lysator.liu.se>", "In-Reply-To": "<20240502091658.2d51ca75@hermes.local>", "Content-Type": "text/plain; charset=UTF-8; format=flowed", "Content-Transfer-Encoding": "7bit", "X-Virus-Scanned": "ClamAV using ClamSMTP", "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" }, "addressed": null } ]