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 212CD426B5 for ; Wed, 4 Oct 2023 06:40:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18CDC402CF; Wed, 4 Oct 2023 06:40:15 +0200 (CEST) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by mails.dpdk.org (Postfix) with ESMTP id 611E64027A; Wed, 4 Oct 2023 06:40:12 +0200 (CEST) Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-65af7e20f39so10737986d6.2; Tue, 03 Oct 2023 21:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696394411; x=1696999211; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=A5dasuGvbawRjC3wVBOjM4u2qwjL7cEVRzKa+izqZ/o=; b=Vd6xxNvts1DEhnkqmycXdTLlpDRPV9cE7pEs2QANsYGvzCU4xMC2ULq0Re8hiuKDuz IJcQrE8+psxxSJtrMlT59j1iwneT6NsGpvcXITVWhEjqSe8GrSDUfgjFQifBg/G1FF+i AjOxxxYMlUA2PZ9F/3iHh52pNDxdfeX6rmS6fyuIKlqMGNBbMWXR6IRrAlRBC3HsGd6T 36ImC8YuuFguw+ePMQPBRKvDUOCheJzLQ8sV6oOfC10LtizbpxeSlsLl+8tkfjfXfsWO IuHNLPsuXTbAyJ3M1SDaj4RKyB/nqvnXKoh/iK5jvFxw0OdBEsXHCNdDwXDtSyukWAI5 n+kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696394411; x=1696999211; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A5dasuGvbawRjC3wVBOjM4u2qwjL7cEVRzKa+izqZ/o=; b=sGpK7DzJlnvhrLdh3GmwbvnX3CE7paOLVpr1cAeqd4NxG0Kv3RLaayTDJafdmLv6aI PXnDmA3CofyWeFTfI2lLaRFnOtm/E+pS/DWPluGBsRALxOVJ3iX4Y5lyw7TWBY/GmSKX YHbUVQfWTVRE4pe3j8nWaKNuc5ddwgf3w6nwb0e+J6NgsLyqaXWzNOAOsTu7J+RqPWPR jfKg9bj0c4iAkpw5qIokUcCr310L9lCwwhVZBlXzc19JPXCtwO6uAow9JUa4HOH/yptM yq5DfGZE6iIsh2IQ+pyQ5K/ucM9t8ACgrPU4Fzg1k0Ob9ZEv9AGDSYEl62tRvlbbhd3Z 5GlA== X-Gm-Message-State: AOJu0YwzPf8ytDH/iazPXk81EhO4dwCiuqzKd0OPy/g/zKOJz2u1d10h EDTb7i91UJxJ0Kw/AEyu8z30bYvtV5GRLRUt9vc= X-Google-Smtp-Source: AGHT+IEoHBWeGPhuORpx1VsgIIBQT5UQfupKt77WmwuFnlOCmhGKsbta/1b74Rh3HwI98G1fjYHMJ1gkWIa2K2n8TmY= X-Received: by 2002:a05:622a:4cb:b0:418:1059:dfbc with SMTP id q11-20020a05622a04cb00b004181059dfbcmr1333791qtx.45.1696394411352; Tue, 03 Oct 2023 21:40:11 -0700 (PDT) MIME-Version: 1.0 References: <20231003183956.1270510-1-jerinj@marvell.com> In-Reply-To: <20231003183956.1270510-1-jerinj@marvell.com> From: Nithin Dabilpuram Date: Wed, 4 Oct 2023 10:09:59 +0530 Message-ID: Subject: Re: [dpdk-dev] [PATCH] common/cnxk: fix direct rte symbol usage To: jerinj@marvell.com Cc: dev@dpdk.org, Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Long Li , Tyler Retzlaff , David Marchand , Konstantin Ananyev , Thomas Monjalon , =?UTF-8?Q?Morten_Br=C3=B8rup?= , Andrew Rybchenko , Liron Himi , stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Acked-by: Nithin Dabilpuram On Wed, Oct 4, 2023 at 2:36=E2=80=AFAM wrote: > > From: Jerin Jacob > > The common code is shared between different driver environments, > introduce missing plt_ abstractions of missing rte_ symbols and > use plt symbols to avoid changing roc_* files. > > Also update the thread name for outbound soft expiry thread > in a7ba40b2b1bf7. > > Fixes: 3d4e27fd7ff0 ("use abstracted bit count functions") > Fixes: a7ba40b2b1bf ("drivers: convert to internal control threads") > Fixes: c88d3638c7fc ("common/cnxk: support REE") > Cc: stable@dpdk.org > > Signed-off-by: Jerin Jacob > --- > drivers/common/cnxk/roc_dev.c | 2 +- > drivers/common/cnxk/roc_dev_priv.h | 2 +- > drivers/common/cnxk/roc_nix_inl_dev.c | 4 ++-- > drivers/common/cnxk/roc_nix_inl_priv.h | 2 +- > drivers/common/cnxk/roc_nix_tm.c | 2 +- > drivers/common/cnxk/roc_nix_tm_utils.c | 2 +- > drivers/common/cnxk/roc_npa.c | 2 +- > drivers/common/cnxk/roc_npc.c | 2 +- > drivers/common/cnxk/roc_npc.h | 2 +- > drivers/common/cnxk/roc_npc_mcam.c | 8 ++++---- > drivers/common/cnxk/roc_platform.h | 8 +++++++- > drivers/common/cnxk/roc_ree.c | 4 ++-- > drivers/common/cnxk/roc_ree.h | 2 +- > 13 files changed, 24 insertions(+), 18 deletions(-) > > diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.= c > index e41235ea8a..865e2f97c7 100644 > --- a/drivers/common/cnxk/roc_dev.c > +++ b/drivers/common/cnxk/roc_dev.c > @@ -1166,7 +1166,7 @@ dev_active_vfs(struct dev *dev) > int i, count =3D 0; > > for (i =3D 0; i < MAX_VFPF_DWORD_BITS; i++) > - count +=3D rte_popcount32(dev->active_vfs[i]); > + count +=3D plt_popcount32(dev->active_vfs[i]); > > return count; > } > diff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc= _dev_priv.h > index c1a37aa4f0..5b2c5096f8 100644 > --- a/drivers/common/cnxk/roc_dev_priv.h > +++ b/drivers/common/cnxk/roc_dev_priv.h > @@ -73,7 +73,7 @@ dev_is_afvf(uint16_t pf_func) > struct mbox_sync { > bool start_thread; > uint8_t msg_avail; > - rte_thread_t pfvf_msg_thread; > + plt_thread_t pfvf_msg_thread; > pthread_cond_t pfvf_msg_cond; > pthread_mutex_t mutex; > }; > diff --git a/drivers/common/cnxk/roc_nix_inl_dev.c b/drivers/common/cnxk/= roc_nix_inl_dev.c > index 6aa191410b..614d0858e5 100644 > --- a/drivers/common/cnxk/roc_nix_inl_dev.c > +++ b/drivers/common/cnxk/roc_nix_inl_dev.c > @@ -826,7 +826,7 @@ nix_inl_outb_poll_thread_setup(struct nix_inl_dev *in= l_dev) > soft_exp_consumer_cnt =3D 0; > soft_exp_poll_thread_exit =3D false; > rc =3D plt_thread_create_control(&inl_dev->soft_exp_poll_thread, > - "outb-poll", nix_inl_outb_poll_thread, inl_dev); > + "outb-soft-exp-poll", nix_inl_outb_poll_thread, i= nl_dev); > if (rc) { > plt_bitmap_free(inl_dev->soft_exp_ring_bmap); > plt_free(inl_dev->soft_exp_ring_bmap_mem); > @@ -1028,7 +1028,7 @@ roc_nix_inl_dev_fini(struct roc_nix_inl_dev *roc_in= l_dev) > > if (inl_dev->set_soft_exp_poll) { > soft_exp_poll_thread_exit =3D true; > - rte_thread_join(inl_dev->soft_exp_poll_thread, NULL); > + plt_thread_join(inl_dev->soft_exp_poll_thread, NULL); > plt_bitmap_free(inl_dev->soft_exp_ring_bmap); > plt_free(inl_dev->soft_exp_ring_bmap_mem); > plt_free(inl_dev->sa_soft_exp_ring); > diff --git a/drivers/common/cnxk/roc_nix_inl_priv.h b/drivers/common/cnxk= /roc_nix_inl_priv.h > index b2b89227b1..3217f4ebc1 100644 > --- a/drivers/common/cnxk/roc_nix_inl_priv.h > +++ b/drivers/common/cnxk/roc_nix_inl_priv.h > @@ -67,7 +67,7 @@ struct nix_inl_dev { > struct roc_cpt_lf cpt_lf; > > /* OUTB soft expiry poll thread */ > - rte_thread_t soft_exp_poll_thread; > + plt_thread_t soft_exp_poll_thread; > uint32_t soft_exp_poll_freq; > uint64_t *sa_soft_exp_ring; > bool set_soft_exp_poll; > diff --git a/drivers/common/cnxk/roc_nix_tm.c b/drivers/common/cnxk/roc_n= ix_tm.c > index a24bce9e70..ece88b5e99 100644 > --- a/drivers/common/cnxk/roc_nix_tm.c > +++ b/drivers/common/cnxk/roc_nix_tm.c > @@ -11,7 +11,7 @@ bitmap_ctzll(uint64_t slab) > if (slab =3D=3D 0) > return 0; > > - return rte_ctz64(slab); > + return plt_ctz64(slab); > } > > void > diff --git a/drivers/common/cnxk/roc_nix_tm_utils.c b/drivers/common/cnxk= /roc_nix_tm_utils.c > index c14517c9ea..8e3da95a45 100644 > --- a/drivers/common/cnxk/roc_nix_tm_utils.c > +++ b/drivers/common/cnxk/roc_nix_tm_utils.c > @@ -927,7 +927,7 @@ nix_tm_resource_avail(struct nix *nix, uint8_t hw_lvl= , bool contig) > /* Count bit set */ > start_pos =3D pos; > do { > - count +=3D rte_popcount64(slab); > + count +=3D plt_popcount64(slab); > if (!plt_bitmap_scan(bmp, &pos, &slab)) > break; > } while (pos !=3D start_pos); > diff --git a/drivers/common/cnxk/roc_npa.c b/drivers/common/cnxk/roc_npa.= c > index 1943bc5420..b76b8e2342 100644 > --- a/drivers/common/cnxk/roc_npa.c > +++ b/drivers/common/cnxk/roc_npa.c > @@ -400,7 +400,7 @@ bitmap_ctzll(uint64_t slab) > if (slab =3D=3D 0) > return 0; > > - return rte_ctz64(slab); > + return plt_ctz64(slab); > } > > static int > diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.= c > index 94c8e94400..f36f5e42c8 100644 > --- a/drivers/common/cnxk/roc_npc.c > +++ b/drivers/common/cnxk/roc_npc.c > @@ -1435,7 +1435,7 @@ roc_npc_sdp_channel_get(struct roc_npc *roc_npc, ui= nt16_t *chan_base, uint16_t * > num_chan =3D nix->rx_chan_cnt - 1; > if (num_chan) { > range =3D *chan_base ^ (*chan_base + num_chan); > - num_bits =3D (sizeof(uint32_t) * 8) - rte_clz32(range) - = 1; > + num_bits =3D (sizeof(uint32_t) * 8) - plt_clz32(range) - = 1; > /* Set mask for (15 - numbits) MSB bits */ > *chan_mask =3D (uint16_t)~GENMASK(num_bits, 0); > } else { > diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.= h > index 5a7117eae4..cf7e6c9548 100644 > --- a/drivers/common/cnxk/roc_npc.h > +++ b/drivers/common/cnxk/roc_npc.h > @@ -359,7 +359,7 @@ struct roc_npc_flow_age { > uint32_t aged_flows_cnt; > uint32_t start_id; > uint32_t end_id; > - rte_thread_t aged_flows_poll_thread; > + plt_thread_t aged_flows_poll_thread; > struct plt_bitmap *aged_flows; > void *age_mem; > bool aged_flows_get_thread_exit; > diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc= _npc_mcam.c > index 8ec4bef472..41edec7d8d 100644 > --- a/drivers/common/cnxk/roc_npc_mcam.c > +++ b/drivers/common/cnxk/roc_npc_mcam.c > @@ -745,7 +745,7 @@ npc_mcam_alloc_and_write(struct npc *npc, struct roc_= npc_flow *flow, struct npc_ > * For all other rules, set LA LTYPE to match both 1st pa= ss and 2nd pass ltypes. > */ > if (pst->is_second_pass_rule || (!pst->is_second_pass_rul= e && pst->has_eth_type)) { > - la_offset =3D rte_popcount32(npc->keyx_supp_nmask= [flow->nix_intf] & > + la_offset =3D plt_popcount32(npc->keyx_supp_nmask= [flow->nix_intf] & > ((1ULL << 9 /* LA = offset */) - 1)); > la_offset *=3D 4; > > @@ -790,7 +790,7 @@ npc_set_vlan_ltype(struct npc_parse_state *pst) > uint8_t lb_offset; > > lb_offset =3D > - rte_popcount32(pst->npc->keyx_supp_nmask[pst->nix_intf] & > + plt_popcount32(pst->npc->keyx_supp_nmask[pst->nix_intf] & > ((1ULL << NPC_LTYPE_LB_OFFSET) - 1)); > lb_offset *=3D 4; > > @@ -812,7 +812,7 @@ npc_set_ipv6ext_ltype_mask(struct npc_parse_state *ps= t) > uint64_t val, mask; > > lc_offset =3D > - rte_popcount32(pst->npc->keyx_supp_nmask[pst->nix_intf] & > + plt_popcount32(pst->npc->keyx_supp_nmask[pst->nix_intf] & > ((1ULL << NPC_LTYPE_LC_OFFSET) - 1)); > lc_offset *=3D 4; > > @@ -835,7 +835,7 @@ npc_set_ipv6ext_ltype_mask(struct npc_parse_state *ps= t) > * zero in LFLAG. > */ > if (pst->npc->keyx_supp_nmask[pst->nix_intf] & (1ULL << NPC_LFLAG= _LC_OFFSET)) { > - lcflag_offset =3D rte_popcount32(pst->npc->keyx_supp_nmas= k[pst->nix_intf] & > + lcflag_offset =3D plt_popcount32(pst->npc->keyx_supp_nmas= k[pst->nix_intf] & > ((1ULL << NPC_LFLAG_LC= _OFFSET) - 1)); > lcflag_offset *=3D 4; > > diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc= _platform.h > index 1e535a527d..ba23b2e0d7 100644 > --- a/drivers/common/cnxk/roc_platform.h > +++ b/drivers/common/cnxk/roc_platform.h > @@ -137,6 +137,7 @@ > #define plt_seqcount_write_begin rte_seqcount_write_begin > #define plt_seqcount_write_end rte_seqcount_write_end > > +#define plt_thread_t rte_thread_t > #define plt_intr_callback_register rte_intr_callback_register > #define plt_intr_callback_unregister rte_intr_callback_unregister > #define plt_intr_disable rte_intr_disable > @@ -146,7 +147,7 @@ > #define plt_thread_join rte_thread_join > > static inline bool > -plt_thread_is_valid(rte_thread_t thr) > +plt_thread_is_valid(plt_thread_t thr) > { > return thr.opaque_id ? true : false; > } > @@ -209,6 +210,11 @@ plt_thread_is_valid(rte_thread_t thr) > #define plt_bit_relaxed_set64 rte_bit_relaxed_set64 > #define plt_bit_relaxed_clear64 rte_bit_relaxed_clear64 > > +#define plt_popcount32 rte_popcount32 > +#define plt_popcount64 rte_popcount64 > +#define plt_clz32 rte_clz32 > +#define plt_ctz64 rte_ctz64 > + > #define plt_mmap mmap > #define PLT_PROT_READ PROT_READ > #define PLT_PROT_WRITE PROT_WRITE > diff --git a/drivers/common/cnxk/roc_ree.c b/drivers/common/cnxk/roc_ree.= c > index 1eb2ae7272..b6392658c3 100644 > --- a/drivers/common/cnxk/roc_ree.c > +++ b/drivers/common/cnxk/roc_ree.c > @@ -441,7 +441,7 @@ static void > roc_ree_lf_err_intr_unregister(struct roc_ree_vf *vf, uint16_t msix_off, > uintptr_t base) > { > - struct rte_pci_device *pci_dev =3D vf->pci_dev; > + struct plt_pci_device *pci_dev =3D vf->pci_dev; > > /* Disable error interrupts */ > plt_write64(~0ull, base + REE_LF_MISC_INT_ENA_W1C); > @@ -468,7 +468,7 @@ static int > roc_ree_lf_err_intr_register(struct roc_ree_vf *vf, uint16_t msix_off, > uintptr_t base) > { > - struct rte_pci_device *pci_dev =3D vf->pci_dev; > + struct plt_pci_device *pci_dev =3D vf->pci_dev; > int ret; > > /* Disable error interrupts */ > diff --git a/drivers/common/cnxk/roc_ree.h b/drivers/common/cnxk/roc_ree.= h > index e138e4de66..bf994e7124 100644 > --- a/drivers/common/cnxk/roc_ree.h > +++ b/drivers/common/cnxk/roc_ree.h > @@ -68,7 +68,7 @@ struct roc_ree_qp { > /**< Base address where BAR is mapped */ > struct roc_ree_pending_queue pend_q; > /**< Pending queue */ > - rte_iova_t iq_dma_addr; > + plt_iova_t iq_dma_addr; > /**< Instruction queue address */ > uint32_t roc_regexdev_jobid; > /**< Job ID */ > -- > 2.42.0 >