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 19CE4425D1 for ; Mon, 18 Sep 2023 10:26:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1247B402EC; Mon, 18 Sep 2023 10:26:52 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5CE7D40263; Mon, 18 Sep 2023 10:26:49 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38HMs0LW006130; Mon, 18 Sep 2023 01:26:48 -0700 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=MX2gKNUZvQEQbTda63/fLQO9ndr0qeEHaMOY+7zoKmA=; b=gl+N0+TpgR1lgmFoonpmiZYrz2OqZQzJrbhSYnCHvUYFN5OE290wsP40V+yVxX/GqFXU rX09OBWt30MU08ins9EQ0ey/z8ozf/jkm6Z7bn4lPGOsiaSmopRHH5RF2msDi8UKEYMK oEesDb/3DngLMN0ml3eBcg4lbb/2W+uuVKTTg6bsrLatgko4abRpFdPHl+C3UfqrfJkc N6of6pmnzpYXQRQka7nlnVru93c76z36nD7x7lK0EVbWf29aBzeOlmPjp3wV0+vKYcFn jxhcvgHW+L9ldvxPRhCbtLzNyBNzLuJg3c5Yuh4mguPxI2dGTheFChHkY5+4doHr2die RQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3t59qpumf6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 18 Sep 2023 01:26:48 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 18 Sep 2023 01:26:46 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Mon, 18 Sep 2023 01:26:46 -0700 Received: from localhost.localdomain (unknown [10.28.36.158]) by maili.marvell.com (Postfix) with ESMTP id 948325B693C; Mon, 18 Sep 2023 01:26:44 -0700 (PDT) From: Rahul Bhansali To: , Naga Harish K S V , "Jerin Jacob" , Ganapati Kundapura CC: Rahul Bhansali , Subject: [PATCH] eventdev/eth_rx: fix timestamp field register in mbuf Date: Mon, 18 Sep 2023 13:55:53 +0530 Message-ID: <20230918082553.704859-1-rbhansali@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: TCRR0Yt4iPLFK1WMqnO7rgkZx5AeIQk- X-Proofpoint-GUID: TCRR0Yt4iPLFK1WMqnO7rgkZx5AeIQk- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-18_01,2023-09-15_01,2023-05-22_02 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org For eventdev internal port, timestamp dynamic field registration in mbuf is not required as that will be done from net device. For SW eventdev, Rx timestamp field registration will be done during Rx queue add operation as per device capabilities and offload configuration. Fixes: 83ab470d1259 ("eventdev/eth_rx: use timestamp as dynamic mbuf field") Cc: stable@dpdk.org Signed-off-by: Rahul Bhansali --- lib/eventdev/rte_event_eth_rx_adapter.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 3ebfa5366d..5a5fade466 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -2472,13 +2472,6 @@ rxa_create(uint8_t id, uint8_t dev_id, if (conf_cb == rxa_default_conf_cb) rx_adapter->default_cb_arg = 1; - if (rte_mbuf_dyn_rx_timestamp_register( - &event_eth_rx_timestamp_dynfield_offset, - &event_eth_rx_timestamp_dynflag) != 0) { - RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf\n"); - return -rte_errno; - } - rte_eventdev_trace_eth_rx_adapter_create(id, dev_id, conf_cb, conf_arg); return 0; @@ -2738,6 +2731,7 @@ rte_event_eth_rx_adapter_queue_add(uint8_t id, 1); } } else { + uint64_t dev_offloads; rte_spinlock_lock(&rx_adapter->rx_lock); dev_info->internal_event_port = 0; ret = rxa_init_service(rx_adapter, id); @@ -2749,6 +2743,17 @@ rte_event_eth_rx_adapter_queue_add(uint8_t id, rxa_sw_adapter_queue_count(rx_adapter)); } rte_spinlock_unlock(&rx_adapter->rx_lock); + + dev_offloads = dev_info->dev->data->dev_conf.rxmode.offloads; + if (dev_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { + if (rte_mbuf_dyn_rx_timestamp_register( + &event_eth_rx_timestamp_dynfield_offset, + &event_eth_rx_timestamp_dynflag) != 0) { + RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf\n"); + return -rte_errno; + } + } + } rte_eventdev_trace_eth_rx_adapter_queue_add(id, eth_dev_id, -- 2.25.1