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 65ABAA0C43; Tue, 28 Sep 2021 16:25:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB03D410E5; Tue, 28 Sep 2021 16:25:05 +0200 (CEST) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by mails.dpdk.org (Postfix) with ESMTP id B3B1E40E3C for ; Tue, 28 Sep 2021 16:25:04 +0200 (CEST) Received: by mail-io1-f53.google.com with SMTP id s20so27575982ioa.4 for ; Tue, 28 Sep 2021 07:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PZhaD10Wwf2cFCmoG7G9nHD0A5zypgHgWEKHj9nolAc=; b=qt/e5Csbw2bCaMMxrxtGqNDvOfoVKbLyJgA1LgdnP8JipvqR99jSXAEcXq4yzSoA43 Z9v0rMFdxaBmjJBgANbWzYkYPCggryESFEcaMJtWB2IaruXgmmVMK2CzHmhCqgZpR3n9 HJyYwLdKxSCDgrQaPwK/w8yuuMgHvvbdD4RgMCMSVg3Qz8rpE/BkbtB821jNGbQft1oR iXhzUA5mZu6r4XVzxzORjj1QiB4kAdZrPny5Dmgok8s8tEVv6qgIXyBZm+sfeqRGX7bx QwFxOuZtfBfw7CWA6MVwNGSmZLWVTmOsdn1uOrdKQPvph9RSKpuPumxRRtcoFYsIeJ9z K8HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PZhaD10Wwf2cFCmoG7G9nHD0A5zypgHgWEKHj9nolAc=; b=Ep+lUdkJ0WgdeheIIUxBpE3RwhIg78+ncW/+xE62b48ayEnM33Gr5D056/MSZ4YIfL Szu+Dr7AiD4ddJUGaSwvqnSnuUvU+w4ODT7qaFo+GtXdJDXcPwtonVlFfgEvbz/kYh6R bjsP3b1qDVaNF0baLNNvN90DM0WnDFUKcRvKXdSq2yCi5Z8tvvz030EXoiG1Qr0QLhzz TcK3zprS11nz9MLVMFesa7F5lcIjGdHWb7gRNSl6cJryb0XlWtYQ0EmxmG6CJLPy8/iR W/+uKOc+yHiAkpEsLOajSYtAI7Eq6grKKcRB9DA1hdA2tZSBVpLVFUU3Mj25UfPEK8Zq I9hw== X-Gm-Message-State: AOAM531MML5aYyN0IZ5tFy+08QiwVHc+a6G0dG6jUumLOEh3Wnsautrw z/IfLAaS35gW7onO8mwoc4aF/+IrI5IJEYCX4DO2MRNkHUjE/A== X-Google-Smtp-Source: ABdhPJyLRaPMduMsE1sIym4GNKc6v5GM/uVhOPOo4P5wd2qSxSQC4/9cATFMQ6/Ct9US3uUGO3CBERnFMg+vSaASF1E= X-Received: by 2002:a05:6602:208f:: with SMTP id a15mr4069932ioa.123.1632839103886; Tue, 28 Sep 2021 07:25:03 -0700 (PDT) MIME-Version: 1.0 References: <20210914071451.3130703-1-ganapati.kundapura@intel.com> <20210916091532.1848770-1-ganapati.kundapura@intel.com> In-Reply-To: <20210916091532.1848770-1-ganapati.kundapura@intel.com> From: Jerin Jacob Date: Tue, 28 Sep 2021 19:54:37 +0530 Message-ID: To: Ganapati Kundapura Cc: "Jayatheerthan, Jay" , dpdk-dev , Ferruh Yigit Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] eventdev: update rx timestamp in mbuf using mbuf dynamic field 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 Sender: "dev" On Thu, Sep 16, 2021 at 2:45 PM Ganapati Kundapura wrote: > > Add support to register timestamp dynamic field in mbuf. > > Update the timestamp in mbuf for each packet before enqueuing > to event device if the timestamp is not already set. > > Adding the timestamp in Rx adapter avoids additional latency > due to the event device. > > Signed-off-by: Ganapati Kundapura > > --- > Depends-on: patch-97549(make Rx-adapter enqueue buffer as circular buffer) > > v2: > * Removed rte_ prefix from the internal function > > v1: > * Add support to register timestamp dynamic field in mbuf > --- > --- > lib/eventdev/rte_event_eth_rx_adapter.c | 33 +++++++++++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c > index f2dc695..fd79b28 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > > #include "rte_eventdev.h" > #include "eventdev_pmd.h" > @@ -240,6 +241,17 @@ struct eth_rx_queue_info { > > static struct rte_event_eth_rx_adapter **event_eth_rx_adapter; > > +/* Enable dynamic timestamp field in mbuf */ > +uint64_t event_eth_rx_timestamp_dynflag; > +int event_eth_rx_timestamp_dynfield_offset = -1; # If the scope is only this file. Please make both as "static" # Please fix the following check path and git log issue. Wrong headline case: "eventdev: update rx timestamp in mbuf using mbuf dynamic field": rx --> Rx Headline too long: eventdev: update rx timestamp in mbuf using mbuf dynamic field Feel free to add my Acked-By in the next version. > + > +static inline rte_mbuf_timestamp_t * > +rxa_timestamp_dynfield(struct rte_mbuf *mbuf) > +{ > + return RTE_MBUF_DYNFIELD(mbuf, > + event_eth_rx_timestamp_dynfield_offset, rte_mbuf_timestamp_t *); > +} > + > static inline int > rxa_validate_id(uint8_t id) > { > @@ -890,8 +902,18 @@ rxa_buffer_mbufs(struct rte_event_eth_rx_adapter *rx_adapter, > int do_rss; > uint16_t nb_cb; > uint16_t dropped; > + uint64_t ts, ts_mask; > > if (!eth_rx_queue_info->ena_vector) { > + ts = m->ol_flags & event_eth_rx_timestamp_dynflag ? > + 0 : rte_get_tsc_cycles(); > + > + /* 0xffff ffff ffff ffff if PKT_RX_TIMESTAMP is set, > + * otherwise 0 > + */ > + ts_mask = (uint64_t)(!(m->ol_flags & > + event_eth_rx_timestamp_dynflag)) - 1ULL; > + > /* 0xffff ffff if PKT_RX_RSS_HASH is set, otherwise 0 */ > rss_mask = ~(((m->ol_flags & PKT_RX_RSS_HASH) != 0) - 1); > do_rss = !rss_mask && !eth_rx_queue_info->flow_id_mask; > @@ -899,6 +921,9 @@ rxa_buffer_mbufs(struct rte_event_eth_rx_adapter *rx_adapter, > struct rte_event *ev; > > m = mbufs[i]; > + *rxa_timestamp_dynfield(m) = ts | > + (*rxa_timestamp_dynfield(m) & ts_mask); > + > ev = &buf->events[new_tail]; > > rss = do_rss ? rxa_do_softrss(m, rx_adapter->rss_key_be) > @@ -2238,6 +2263,14 @@ rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id, > event_eth_rx_adapter[id] = rx_adapter; > 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; > -- > 2.6.4 >