From patchwork Mon Jun 27 10:05:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapati Kundapura X-Patchwork-Id: 113469 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 1D06AA0552; Mon, 27 Jun 2022 12:05:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE37F400D7; Mon, 27 Jun 2022 12:05:51 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 42BE9400D5 for ; Mon, 27 Jun 2022 12:05:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656324350; x=1687860350; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=w/F0OceeHCsvxFrjvo6YUFfIYYLR/wL4SUkNi82ZM2A=; b=Uxf65a9NxeJ0iN5k6WnTIWQA3AOmR3CX/4IyYa+PoQynS6hXKWDH7nWs smlVc4VlJRMyvXARIQiNaqq+LIOHfIRcKA+6rfo+qIjDqd1J+IAzGqKTz dH6W5emJPzz4OkAMLphnLWG0ZW+r7BOcFAlFXZXyBEbQkxMbaG7pbvvw1 eszWh+8OhBorwYe88MzoEncOlnj8tJjJ3YI+kPp7VlvceNOJEF0j4E2qK KdQlOBBtSn2DogOUsmTAs3SeWo1sHEi1Itbr6RWSPShaZzHoGf24zQsTT xSTKsf+xXyFZvAxf6ANnv9F1WzNA9akaj9qj9LJiL6VgZMYreJCzWyg8K A==; X-IronPort-AV: E=McAfee;i="6400,9594,10390"; a="345414920" X-IronPort-AV: E=Sophos;i="5.92,226,1650956400"; d="scan'208";a="345414920" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 03:05:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,226,1650956400"; d="scan'208";a="679519202" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by FMSMGA003.fm.intel.com with ESMTP; 27 Jun 2022 03:05:48 -0700 From: Ganapati Kundapura To: dev@dpdk.org, jay.jayatheerthan@intel.com, s.v.naga.harish.k@intel.com, jerinjacobk@gmail.com Subject: [PATCH v1 1/1] eventdev/eth_tx: use timestamp as dynamic mbuf field Date: Mon, 27 Jun 2022 05:05:44 -0500 Message-Id: <20220627100545.2085017-1-ganapati.kundapura@intel.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 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 Added support to register timestamp dynamic field in mbuf. Signed-off-by: Ganapati Kundapura diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index c700fb7..23d5df3 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -74,6 +74,10 @@ do {\ } \ } while (0) +/* enable dynamic timestamp field in mbuf */ +uint64_t event_eth_tx_timestamp_dynflag; +int event_eth_tx_timestamp_dynfield_offset = -1; + /* Tx retry callback structure */ struct txa_retry { /* Ethernet port id */ @@ -197,7 +201,7 @@ static int txa_dev_id_array_init(void) { if (txa_dev_id_array == NULL) { - int i; + int i, ret; txa_dev_id_array = txa_memzone_array_get("txa_adapter_array", sizeof(int), @@ -207,6 +211,16 @@ txa_dev_id_array_init(void) for (i = 0; i < RTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE; i++) txa_dev_id_array[i] = TXA_INVALID_DEV_ID; + + /* Register mbuf dynamic timestamp field */ + ret = rte_mbuf_dyn_tx_timestamp_register( + &event_eth_tx_timestamp_dynfield_offset, + &event_eth_tx_timestamp_dynflag); + if (ret != 0) { + RTE_EDEV_LOG_ERR("Error registering timestamp " + "field/flag"); + return -ENOMEM; + } } return 0; diff --git a/lib/eventdev/rte_event_eth_tx_adapter.h b/lib/eventdev/rte_event_eth_tx_adapter.h index 3908c2d..12e80a9 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.h +++ b/lib/eventdev/rte_event_eth_tx_adapter.h @@ -77,9 +77,19 @@ extern "C" { #include #include +#include #include "rte_eventdev.h" +extern int event_eth_tx_timestamp_dynfield_offset; + +static inline rte_mbuf_timestamp_t * +rte_event_eth_tx_timestamp_dynfield(struct rte_mbuf *mbuf) +{ + return RTE_MBUF_DYNFIELD(mbuf, + event_eth_tx_timestamp_dynfield_offset, rte_mbuf_timestamp_t *); +} + /** * Adapter configuration structure *