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 5C1B9A0C41; Thu, 16 Sep 2021 06:50:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F26104003F; Thu, 16 Sep 2021 06:50:41 +0200 (CEST) Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) by mails.dpdk.org (Postfix) with ESMTP id 797604003C for ; Thu, 16 Sep 2021 06:50:40 +0200 (CEST) Received: by mail-il1-f178.google.com with SMTP id q14so5399301ils.5 for ; Wed, 15 Sep 2021 21:50:40 -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=ShOZV5jxGAnGqw4QnL19q1X0qsA2wKFfCjFQMUmxodY=; b=U7dy4XShcrG+eJmgzk57244KCOQAtF7qcLEw8e4QUYjOj0rStyCWrNsALfRMtDscnF IuunqEQ3fGk49BGgWUtBi1TAuH9NKmaTpx0zeyQpTDR4DaYOipPS6fI4FiU1+uDNT9vB 7zIf/d4mpu2E4FYiqsU5YlZNI541nsOsjE3Ql3Yckt6VXc+D5lZDnFc6rH62V3T6bKQS HkhL1zOlph6+mId4o8uBK4HZD2Ep8C5Jp2D1gP9EAD+UHw4QNLSGnSlNEmsvXt4oq/bT IiURGLBaiMgqpNAgpV/SrRBT4FMswaVGWYvSp3f4ND37XO0P9hfwFL8tWcKlshmIoSOZ +YTA== 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=ShOZV5jxGAnGqw4QnL19q1X0qsA2wKFfCjFQMUmxodY=; b=JLSSvo7SGLNUr2bsEaYj1d568SuZWHwUfx0SsPAyo03C0EsCuuWIhCvClVaIm+ZoRl 5dn342o1vJdkmBu88BcEn53lmosa9oR3l63yZtPwIGlAoMud3sBSnaXbu+TeZGuX7Tmc VX3j1BRXw0ziOYtVKe1Yb2USWr8mTjApgthFp8ZzaCMs/R1r28cQbFlvyAtX9+5qlkfv R/oxo8z5WqJQ5da65yQ3JcJ46PpbJN4ybArr6PmnpRiCwnOhEthdKpCExSpLmxnBc/6d z7oDGn+hKLC+6eoBe4s8daKxcbuYak2iHFFQDCx5zXG4tGlgjyhx+GBXQNY4KxZlnCaY 5ovg== X-Gm-Message-State: AOAM531gVWXmLZH6Y/EIaC3YO1U3sgx3S8nySaMRqxDk2vZiRii/AZB4 R4iXrIEiYHsF+oVQ0C6t2kybApxmJwmjUrw/i/+CCM2Boec= X-Google-Smtp-Source: ABdhPJzO6QmbpLBLksHptqCYG1OSvcI90e/75oknLHb06/L2mW8bM8avNAilhAi1Vej2i0eRscto2wDUK/uLgEFBEuw= X-Received: by 2002:a92:6e12:: with SMTP id j18mr2610105ilc.243.1631767839804; Wed, 15 Sep 2021 21:50:39 -0700 (PDT) MIME-Version: 1.0 References: <20210914071451.3130703-1-ganapati.kundapura@intel.com> In-Reply-To: <20210914071451.3130703-1-ganapati.kundapura@intel.com> From: Jerin Jacob Date: Thu, 16 Sep 2021 10:20:13 +0530 Message-ID: To: Ganapati Kundapura , Ferruh Yigit Cc: "Jayatheerthan, Jay" , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v1] 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 Tue, Sep 14, 2021 at 12:44 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 > --- > lib/eventdev/rte_event_eth_rx_adapter.c | 35 +++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c > index de8ab05..9cb2550 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; > + > +static inline rte_mbuf_timestamp_t * > +rte_event_eth_rx_timestamp_dynfield(struct rte_mbuf *mbuf) Internal functions, please avoid using rte_ Rest looks good to me. Please send v2 as there are some patchwork failures too. I have rebased the next-eventdev tree. So v2 should be pass and we can merge it. Cc: @Ferruh Yigit > +{ > + 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,11 @@ rxa_buffer_mbufs(struct rte_event_eth_rx_adapter *rx_adapter, > struct rte_event *ev; > > m = mbufs[i]; > + *rte_event_eth_rx_timestamp_dynfield(m) = > + ts | > + (*rte_event_eth_rx_timestamp_dynfield(m) & > + ts_mask); > + > ev = &buf->events[new_tail]; > > rss = do_rss ? rxa_do_softrss(m, rx_adapter->rss_key_be) > @@ -2256,6 +2283,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 >