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 7A276A0A0C; Sun, 13 Jun 2021 15:15:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 095754003F; Sun, 13 Jun 2021 15:15:07 +0200 (CEST) Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by mails.dpdk.org (Postfix) with ESMTP id 548084003E for ; Sun, 13 Jun 2021 15:15:06 +0200 (CEST) Received: by mail-il1-f172.google.com with SMTP id d1so9835339ils.5 for ; Sun, 13 Jun 2021 06:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3dsJ1WH/lwikFVFPOh+cWDsfy+QSWrjy7iOyub2ebuQ=; b=mCJHEyAXI0wnpUlxq/9fo625Rv0xKLimP7CseBwrZuMhQIkeccEz2N8CulXGFbHJRU 7qAT4uDXjT8yBdSSELf8H+To/aeeqlEpv8/xqeg6lYFL/xf8f1W+r98/VCP38DlT1o4b m5XZLbSnfefN8r5bNmodG4OmMJuI8k1Ueb+cBVMibyLC/YWdRUeSfxezGcxdzLS+pZ5g /+nBK/VQQff0SJ/607t51KdXs1kEA8857n01j/hLyA2uATRSM4mW5OUH2I18KG2qGA9i CdHSJm7sP0DEzkul6Z5Ul4WFxwNINnM3zl7Z+VpiGY+jLwPjinaqgK35ak7lX1DqVr9y YyLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3dsJ1WH/lwikFVFPOh+cWDsfy+QSWrjy7iOyub2ebuQ=; b=NcU7Uaqsv0s8DLUtDIfQOSmnzrhUo3dJ0S7AAyCaYRxoBRnBie04xfZYPoXziaL+2l pt1r1m6TvmJfnoPOf9nJ8mSAp4Yq+xLXeulypumzWjOq468Nc4vkMnNsMHiYmz8zRFxw FSFa5ph7p+x0meMw45Wl14NyBj8rpnFVQ9kU4rASAfRh49hEr0UEstaU5AE91tIVQkZw u+lo/to/khcm/aPMHn868NNbsaqTYTex8IW+5upXzo5ZD78OA8chkJicAxxINSPpbvQ2 rNQ8UGRWtsy0K/ck4TKzIh7si7RsFggbTawYdYHWUrO9Mp8fvn10UdfiZKd6tiuiW0eP O6Bw== X-Gm-Message-State: AOAM533yA/r9ps16BXFYCqe8JCHZc2/jE+53U3aLr+/qniWdbo1aVe6T EF36oFETe8/7d+fFVlZdFuUnHp5yZXGkSnKWVLs= X-Google-Smtp-Source: ABdhPJxMHAK/onMJKuvE36dbMZV0ciCB6Bkp3H2SU13CwGkCbz2MrWNwxlph0yP/QaS+aG+Kj4f0F7pWXACnIQEC35w= X-Received: by 2002:a92:1310:: with SMTP id 16mr10939641ilt.60.1623590105632; Sun, 13 Jun 2021 06:15:05 -0700 (PDT) MIME-Version: 1.0 References: <20210524130617.1621-1-pbhagavatula@marvell.com> <20210524130617.1621-2-pbhagavatula@marvell.com> In-Reply-To: <20210524130617.1621-2-pbhagavatula@marvell.com> From: Jerin Jacob Date: Sun, 13 Jun 2021 18:44:49 +0530 Message-ID: To: Pavan Nikhilesh Cc: Jerin Jacob , Shijith Thotton , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 2/2] event/cnxk: add Rx event vector fastpath 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 Mon, May 24, 2021 at 6:36 PM wrote: > > From: Pavan Nikhilesh > > Add Rx event vector fastpath to convert HW defined metadata into > rte_mbuf and rte_event_vector. > > Signed-off-by: Pavan Nikhilesh > --- > drivers/event/cnxk/cn10k_worker.h | 50 +++++++++++++++++++++++++++++++ > 1 file changed, 50 insertions(+) > > diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h > index b3f71202ad..8c2cd72873 100644 > --- a/drivers/event/cnxk/cn10k_worker.h > +++ b/drivers/event/cnxk/cn10k_worker.h > @@ -5,6 +5,8 @@ > #ifndef __CN10K_WORKER_H__ > #define __CN10K_WORKER_H__ > > +#include > + > #include "cnxk_ethdev.h" > #include "cnxk_eventdev.h" > #include "cnxk_worker.h" > @@ -101,6 +103,44 @@ cn10k_wqe_to_mbuf(uint64_t wqe, const uint64_t mbuf, uint8_t port_id, > mbuf_init.value, flags); > } > > +static __rte_always_inline void > +cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags, > + void *lookup_mem) > +{ > + union mbuf_initializer mbuf_init = { > + .fields = {.data_off = RTE_PKTMBUF_HEADROOM, > + .refcnt = 1, > + .nb_segs = 1, > + .port = port_id}, > + }; If there is performance improvement move mbuf_init population to slow path and store it in HWS software structure or so. > + struct rte_event_vector *vec; > + uint16_t nb_mbufs, non_vec; > + uint64_t **wqe; > + > + vec = (struct rte_event_vector *)vwqe; > + wqe = vec->u64s; > + > + nb_mbufs = RTE_ALIGN_FLOOR(vec->nb_elem, NIX_DESCS_PER_LOOP); > + nb_mbufs = cn10k_nix_recv_pkts_vector(&mbuf_init.value, vec->mbufs, > + nb_mbufs, flags | NIX_RX_VWQE_F, > + lookup_mem); > + wqe += nb_mbufs; > + non_vec = vec->nb_elem - nb_mbufs; > + > + while (non_vec) { > + struct nix_cqe_hdr_s *cqe = (struct nix_cqe_hdr_s *)wqe[0]; > + struct rte_mbuf *mbuf; > + > + mbuf = (struct rte_mbuf *)((char *)cqe - > + sizeof(struct rte_mbuf)); > + cn10k_nix_cqe_to_mbuf(cqe, cqe->tag, mbuf, lookup_mem, > + mbuf_init.value, flags); > + wqe[0] = (uint64_t *)mbuf; > + non_vec--; > + wqe++; > + } > +} > + > static __rte_always_inline uint16_t > cn10k_sso_hws_get_work(struct cn10k_sso_hws *ws, struct rte_event *ev, > const uint32_t flags, void *lookup_mem) > @@ -141,6 +181,16 @@ cn10k_sso_hws_get_work(struct cn10k_sso_hws *ws, struct rte_event *ev, > gw.u64[0] & 0xFFFFF, flags, > lookup_mem); > gw.u64[1] = mbuf; > + } else if (CNXK_EVENT_TYPE_FROM_TAG(gw.u64[0]) == > + RTE_EVENT_TYPE_ETHDEV_VECTOR) { > + uint8_t port = CNXK_SUB_EVENT_FROM_TAG(gw.u64[0]); > + __uint128_t vwqe_hdr = *(__uint128_t *)gw.u64[1]; > + > + vwqe_hdr = ((vwqe_hdr >> 64) & 0xFFF) | BIT_ULL(31) | > + ((vwqe_hdr & 0xFFFF) << 48) | > + ((uint64_t)port << 32); > + *(uint64_t *)gw.u64[1] = (uint64_t)vwqe_hdr; > + cn10k_process_vwqe(gw.u64[1], port, flags, lookup_mem); > } > } > > -- > 2.17.1 >