From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CF6A1A0032; Mon, 13 Dec 2021 09:31:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 658D840E09; Mon, 13 Dec 2021 09:31:55 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 13D3C40140 for ; Mon, 13 Dec 2021 09:31:53 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BD7ieCv027462; Mon, 13 Dec 2021 00:31:53 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=i8mT8dmURZdNdPStovrWzgbdCtEyL84RYsgxQyZyboE=; b=AY4z1mEKLij/Ar0VBCM6vzed3AZtMqwRDOQ6UPAEtLvrslOEpyeWM+gS2LhH8oiQOED/ bT9ZN7raKwUW3oxbcnPhy46Hrqy0kLGyR57AONn7S6EcQWFpliuN4qxgf+vKUmBxl/tD uZ85QlLh7E0XYmQiZwmZeDSXZi+n6u7wpk5HGH3ZERWJPIfzDDCPVKhN8LUlmI0crA18 LfGxr5Su2+lqMUJgvhRmVgZ/axducYutrEY++lk75meH6xcyKqm832ODt1IhXss/NJth 8NAIr9xNoSL/zhGnxJJj9wzeIUOTC1U37O4bUE5tawgmh5QnHr7QhS/bQB+S7LRZrlqF yA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3cx21kg4pf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 13 Dec 2021 00:31:53 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 13 Dec 2021 00:31:51 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 13 Dec 2021 00:31:51 -0800 Received: from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176]) by maili.marvell.com (Postfix) with ESMTP id 3BB5A3F7045; Mon, 13 Dec 2021 00:31:48 -0800 (PST) From: To: , Jay Jayatheerthan CC: , Pavan Nikhilesh Subject: [PATCH] eventdev: fix missing internal port checks Date: Mon, 13 Dec 2021 14:01:43 +0530 Message-ID: <20211213083143.4233-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: shEYulEqeRllzRuQ8j2YH9PYBZVYMDwJ X-Proofpoint-ORIG-GUID: shEYulEqeRllzRuQ8j2YH9PYBZVYMDwJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-13_03,2021-12-10_01,2021-12-02_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Pavan Nikhilesh When event delivery is through internal port, stats are mainitained by HW and we should avoid reading SW data structures for stats. Fix missing internal port checks. Fixes: 995b150c1ae1 ("eventdev/eth_rx: add queue stats API") Signed-off-by: Pavan Nikhilesh --- lib/eventdev/rte_event_eth_rx_adapter.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 809416d9b7..da223aacac 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -2984,15 +2984,17 @@ rte_event_eth_rx_adapter_queue_stats_get(uint8_t id, return -EINVAL; } - queue_info = &dev_info->rx_queue[rx_queue_id]; - event_buf = queue_info->event_buf; - q_stats = queue_info->stats; + if (dev_info->internal_event_port == 0) { + queue_info = &dev_info->rx_queue[rx_queue_id]; + event_buf = queue_info->event_buf; + q_stats = queue_info->stats; - stats->rx_event_buf_count = event_buf->count; - stats->rx_event_buf_size = event_buf->events_size; - stats->rx_packets = q_stats->rx_packets; - stats->rx_poll_count = q_stats->rx_poll_count; - stats->rx_dropped = q_stats->rx_dropped; + stats->rx_event_buf_count = event_buf->count; + stats->rx_event_buf_size = event_buf->events_size; + stats->rx_packets = q_stats->rx_packets; + stats->rx_poll_count = q_stats->rx_poll_count; + stats->rx_dropped = q_stats->rx_dropped; + } dev = &rte_eventdevs[rx_adapter->eventdev_id]; if (dev->dev_ops->eth_rx_adapter_queue_stats_get != NULL) { @@ -3086,8 +3088,10 @@ rte_event_eth_rx_adapter_queue_stats_reset(uint8_t id, return -EINVAL; } - queue_info = &dev_info->rx_queue[rx_queue_id]; - rxa_queue_stats_reset(queue_info); + if (dev_info->internal_event_port == 0) { + queue_info = &dev_info->rx_queue[rx_queue_id]; + rxa_queue_stats_reset(queue_info); + } dev = &rte_eventdevs[rx_adapter->eventdev_id]; if (dev->dev_ops->eth_rx_adapter_queue_stats_reset != NULL) { -- 2.34.0