[dpdk-dev] [PATCH v2 1/3] net/octeontx: add support for event Rx adapter
Pavan Nikhilesh Bhagavatula
pbhagavatula at caviumnetworks.com
Tue Oct 24 08:56:22 CEST 2017
On Mon, Oct 23, 2017 at 11:39:42PM +0530, Jerin Jacob wrote:
> -----Original Message-----
> > Date: Wed, 18 Oct 2017 14:15:40 +0530
> > From: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> > To: jerin.jacob at caviumnetworks.com, santosh.shukla at caviumnetworks.com,
> > nikhil.rao at intel.com
> > Cc: dev at dpdk.org, Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH v2 1/3] net/octeontx: add support for event Rx
> > adapter
> > X-Mailer: git-send-email 2.7.4
> >
> > Add functions to modify and delete qos responsible for mapping eth queues
> > to event queues used for configuring event Rx adapter.
> > The mbox functions have been moved from octeontx_pkivf.c to
> > octeontx_pkivf.h to allow event_octeontx to access them.
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> > ---
> >
> > v2 changes:
> > - Improve conditional statement readability (Nikhil).
> >
> > This series depends on http://dpdk.org/dev/patchwork/patch/30430
> >
> >
> > static __rte_always_inline uint16_t __hot
> > __octeontx_xmit_pkts(void *lmtline_va, void *ioreg_va, int64_t *fc_status_va,
> > @@ -195,10 +107,8 @@ octeontx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
> > uint16_t __hot
> > octeontx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
> > {
> > - struct rte_mbuf *mbuf;
> > struct octeontx_rxq *rxq;
> > struct rte_event ev;
> > - octtx_wqe_t *wqe;
> > size_t count;
> > uint16_t valid_event;
> >
> > @@ -210,23 +120,7 @@ octeontx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
> > 1, 0);
> > if (!valid_event)
> > break;
> > -
> > - wqe = (octtx_wqe_t *)(uintptr_t)ev.u64;
> > - rte_prefetch_non_temporal(wqe);
> > -
> > - /* Get mbuf from wqe */
> > - mbuf = (struct rte_mbuf *)((uintptr_t)wqe -
> > - OCTTX_PACKET_WQE_SKIP);
> > - mbuf->packet_type =
> > - ptype_table[wqe->s.w2.lcty][wqe->s.w2.lety][wqe->s.w2.lfty];
> > - mbuf->data_off = RTE_PTR_DIFF(wqe->s.w3.addr, mbuf->buf_addr);
> > - mbuf->pkt_len = wqe->s.w1.len;
> > - mbuf->data_len = mbuf->pkt_len;
> > - mbuf->nb_segs = 1;
> > - mbuf->ol_flags = 0;
> > - mbuf->port = rxq->port_id;
>
> IMO, You don't need to move the mbuf conversion inline function to 2/3,
> Instead if we do in 1/3.It will functionality correct at 1/3.
>
> > - rte_mbuf_refcnt_set(mbuf, 1);
> > - rx_pkts[count++] = mbuf;
> > + rx_pkts[count++] = (struct rte_mbuf *)ev.u64;
>
> This will create build error on 32bit. You can avoid the typecast by
> changing to ev.mbuf.
> /export/dpdk-next-eventdev/drivers/net/octeontx/octeontx_rxtx.c: In
> function ‘octeontx_recv_pkts’:
> /export/dpdk-next-eventdev/drivers/net/octeontx/octeontx_rxtx.c:123:22:
> error: cast to pointer from integer of different size
> [-Werror=int-to-pointer-cast]
> rx_pkts[count++] = (struct rte_mbuf *)ev.u64;
> ^
> cc1: all warnings being treated as errors
Agreed, will move mbuf conversion to 1/3 and fix 32 bit compilation issues and
send a v3.
Thanks,
Pavan
More information about the dev
mailing list