DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Nalla Pradeep <pnalla@marvell.com>,
	Radha Mohan Chintakuntla <radhac@marvell.com>,
	Veerasenareddy Burru <vburru@marvell.com>
Cc: jerinj@marvell.com, dev@dpdk.org, sburla@marvell.com
Subject: Re: [dpdk-dev] [PATCH v2 11/11] net/octeontx_ep: Transmit data path function added
Date: Tue, 26 Jan 2021 15:35:36 +0000	[thread overview]
Message-ID: <c940d2fe-af3e-08c1-29f1-bacc7c2a6acf@intel.com> (raw)
In-Reply-To: <20210118093602.5449-11-pnalla@marvell.com>

On 1/18/2021 9:36 AM, Nalla Pradeep wrote:
> 1. Packet transmit function for both otx and otx2 are added.
> 2. Flushing transmit(command) queue when pending commands are more than
>     maximum allowed value (currently 16).
> 3. Scatter gather support if the packet spans multiple buffers.
> 
> Signed-off-by: Nalla Pradeep <pnalla@marvell.com>

<...>

> +uint16_t
> +otx_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
> +{
> +	struct otx_ep_instr_64B iqcmd;
> +	struct otx_ep_instr_queue *iq;
> +	struct otx_ep_device *otx_ep;
> +	struct rte_mbuf *m;
> +
> +	uint32_t iqreq_type, sgbuf_sz;
> +	int dbell, index, count = 0;
> +	unsigned int pkt_len, i;
> +	int gather, gsz;
> +	void *iqreq_buf;
> +	uint64_t dptr;
> +
> +	iq = (struct otx_ep_instr_queue *)tx_queue;
> +	otx_ep = iq->otx_ep_dev;
> +
> +	/* if (!otx_ep->started || !otx_ep->linkup) {
> +	 *	goto xmit_fail;
> +	 * }
> +	 */

Please drop the commented out code.

> +
> +	iqcmd.ih.u64 = 0;
> +	iqcmd.pki_ih3.u64 = 0;
> +	iqcmd.irh.u64 = 0;
> +
> +	/* ih invars */
> +	iqcmd.ih.s.fsz = OTX_EP_FSZ;
> +	iqcmd.ih.s.pkind = otx_ep->pkind; /* The SDK decided PKIND value */
> +
> +	/* pki ih3 invars */
> +	iqcmd.pki_ih3.s.w = 1;
> +	iqcmd.pki_ih3.s.utt = 1;
> +	iqcmd.pki_ih3.s.tagtype = ORDERED_TAG;
> +	/* sl will be sizeof(pki_ih3) */
> +	iqcmd.pki_ih3.s.sl = OTX_EP_FSZ + OTX_CUST_DATA_LEN;
> +
> +	/* irh invars */
> +	iqcmd.irh.s.opcode = OTX_EP_NW_PKT_OP;
> +
> +	for (i = 0; i < nb_pkts; i++) {
> +		m = pkts[i];
> +		if (m->nb_segs == 1) {
> +			/* dptr */
> +			dptr = rte_mbuf_data_iova(m);
> +			pkt_len = rte_pktmbuf_data_len(m);
> +			iqreq_buf = m;
> +			iqreq_type = OTX_EP_REQTYPE_NORESP_NET;
> +			gather = 0;
> +			gsz = 0;
> +		} else {
> +			struct otx_ep_buf_free_info *finfo;
> +			int j, frags, num_sg;
> +
> +			if (!(otx_ep->tx_offloads & DEV_TX_OFFLOAD_MULTI_SEGS))
> +				goto xmit_fail;
> +
> +			finfo = (struct otx_ep_buf_free_info *)rte_malloc(NULL,
> +							sizeof(*finfo), 0);
> +			if (finfo == NULL) {
> +				otx_ep_err("free buffer alloc failed\n");
> +				goto xmit_fail;
> +			}
> +			num_sg = (m->nb_segs + 3) / 4;
> +			sgbuf_sz = sizeof(struct otx_ep_sg_entry) * num_sg;
> +			finfo->g.sg =
> +				rte_zmalloc(NULL, sgbuf_sz, OTX_EP_SG_ALIGN);
> +			if (finfo->g.sg == NULL) {
> +				rte_free(finfo);
> +				otx_ep_err("sg entry alloc failed\n");
> +				goto xmit_fail;
> +			}
> +			gather = 1;
> +			gsz = m->nb_segs;
> +			finfo->g.num_sg = num_sg;
> +			finfo->g.sg[0].ptr[0] = rte_mbuf_data_iova(m);
> +			set_sg_size(&finfo->g.sg[0], m->data_len, 0);
> +			pkt_len = m->data_len;
> +			finfo->mbuf = m;
> +
> +			frags = m->nb_segs - 1;
> +			j = 1;
> +			m = m->next;
> +			while (frags--) {
> +				finfo->g.sg[(j >> 2)].ptr[(j & 3)] =
> +						rte_mbuf_data_iova(m);
> +				set_sg_size(&finfo->g.sg[(j >> 2)],
> +						m->data_len, (j & 3));
> +				pkt_len += m->data_len;
> +				j++;
> +				m = m->next;
> +			}
> +			dptr = rte_mem_virt2iova(finfo->g.sg);
> +			iqreq_buf = finfo;
> +			iqreq_type = OTX_EP_REQTYPE_NORESP_GATHER;
> +			if (pkt_len > OTX_EP_MAX_PKT_SZ) {
> +				rte_free(finfo->g.sg);
> +				rte_free(finfo);
> +				otx_ep_err("failed\n");
> +				goto xmit_fail;
> +			}
> +		}
> +		/* ih vars */
> +		iqcmd.ih.s.tlen = pkt_len + iqcmd.ih.s.fsz;
> +		iqcmd.ih.s.gather = gather;
> +		iqcmd.ih.s.gsz = gsz;
> +		/* PKI_IH3 vars */
> +		/* irh vars */
> +		/* irh.rlenssz = ; */

Ditto.

> +
> +		iqcmd.dptr = dptr;
> +		/* Swap FSZ(front data) here, to avoid swapping on
> +		 * OCTEON TX side rprt is not used so not swapping
> +		 */
> +		/* otx_ep_swap_8B_data(&iqcmd.rptr, 1); */

ditto

<...>

> +};
> +#define OTX_EP_64B_INSTR_SIZE	(sizeof(otx_ep_instr_64B))
> +

Is this macro used at all?

  reply	other threads:[~2021-01-26 15:35 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18  9:35 [dpdk-dev] [PATCH v2 01/11] net/octeontx_ep: add build and doc infrastructure Nalla Pradeep
2021-01-18  9:35 ` [dpdk-dev] [PATCH v2 02/11] net/octeontx_ep: add ethdev probe and remove Nalla Pradeep
2021-01-19 11:55   ` Jerin Jacob
2021-01-26 15:27   ` Ferruh Yigit
2021-01-27 11:45     ` [dpdk-dev] [EXT] " Pradeep Kumar Nalla
2021-01-18  9:35 ` [dpdk-dev] [PATCH v2 03/11] net/octeontx_ep: add device init and uninit Nalla Pradeep
2021-01-19 12:06   ` Jerin Jacob
2021-01-26 15:25   ` Ferruh Yigit
2021-01-18  9:35 ` [dpdk-dev] [PATCH v2 04/11] net/octeontx_ep: Added basic device setup Nalla Pradeep
2021-01-19 12:09   ` Jerin Jacob
2021-01-26 15:29   ` Ferruh Yigit
2021-01-18  9:35 ` [dpdk-dev] [PATCH v2 05/11] net/octeontx_ep: Add dev info get and configure Nalla Pradeep
2021-01-26 15:31   ` Ferruh Yigit
2021-01-28  7:03     ` [dpdk-dev] [EXT] " Pradeep Kumar Nalla
2021-01-18  9:35 ` [dpdk-dev] [PATCH v2 06/11] net/octeontx_ep: Added rxq setup and release Nalla Pradeep
2021-01-18  9:35 ` [dpdk-dev] [PATCH v2 07/11] net/octeontx_ep: Added tx queue " Nalla Pradeep
2021-01-18  9:35 ` [dpdk-dev] [PATCH v2 08/11] net/octeontx_ep: Setting up iq and oq registers Nalla Pradeep
2021-01-26 15:32   ` Ferruh Yigit
2021-01-18  9:36 ` [dpdk-dev] [PATCH v2 09/11] net/octeontx_ep: Added dev start and stop Nalla Pradeep
2021-01-26 15:32   ` Ferruh Yigit
2021-01-18  9:36 ` [dpdk-dev] [PATCH v2 10/11] net/octeontx_ep: Receive data path function added Nalla Pradeep
2021-01-26 15:33   ` Ferruh Yigit
2021-01-18  9:36 ` [dpdk-dev] [PATCH v2 11/11] net/octeontx_ep: Transmit " Nalla Pradeep
2021-01-26 15:35   ` Ferruh Yigit [this message]
2021-01-19 11:50 ` [dpdk-dev] [PATCH v2 01/11] net/octeontx_ep: add build and doc infrastructure Jerin Jacob
2021-01-26 15:09 ` Ferruh Yigit
2021-01-26 15:41 ` Ferruh Yigit
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 00/11] Octeon Tx/Tx2 Endpoint pmd Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 00/12] " Nalla Pradeep
2021-01-29 12:44     ` [dpdk-dev] [PATCH v7 " Nalla Pradeep
2021-01-29 14:08       ` Ferruh Yigit
2021-01-29 12:44     ` [dpdk-dev] [PATCH v7 01/12] raw/octeontx_ep: changed device id Nalla Pradeep
2021-02-11  0:58       ` Radha Mohan
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 02/12] net/octeontx_ep: add build and doc infrastructure Nalla Pradeep
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 03/12] net/octeontx_ep: add ethdev probe and remove Nalla Pradeep
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 04/12] net/octeontx_ep: add device init and uninit Nalla Pradeep
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 05/12] net/octeontx_ep: added basic device setup Nalla Pradeep
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 06/12] net/octeontx_ep: add dev info get and configure Nalla Pradeep
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 07/12] net/octeontx_ep: added rxq setup and release Nalla Pradeep
2021-01-29 14:04       ` Ferruh Yigit
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 08/12] net/octeontx_ep: added tx queue " Nalla Pradeep
2021-01-29 14:04       ` Ferruh Yigit
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 09/12] net/octeontx_ep: setting up iq and oq registers Nalla Pradeep
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 10/12] net/octeontx_ep: added dev start and stop Nalla Pradeep
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 11/12] net/octeontx_ep: receive data path function added Nalla Pradeep
2021-01-29 12:45     ` [dpdk-dev] [PATCH v7 12/12] net/octeontx_ep: transmit " Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 01/12] raw/octeontx_ep: changed device id Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 02/12] net/octeontx_ep: add build and doc infrastructure Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 03/12] net/octeontx_ep: add ethdev probe and remove Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 04/12] net/octeontx_ep: add device init and uninit Nalla Pradeep
2021-01-29  9:19     ` Ferruh Yigit
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 05/12] net/octeontx_ep: added basic device setup Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 06/12] net/octeontx_ep: add dev info get and configure Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 07/12] net/octeontx_ep: added rxq setup and release Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 08/12] net/octeontx_ep: added tx queue " Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 09/12] net/octeontx_ep: setting up iq and oq registers Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 10/12] net/octeontx_ep: added dev start and stop Nalla Pradeep
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 11/12] net/octeontx_ep: receive data path function added Nalla Pradeep
2021-01-29  9:24     ` Ferruh Yigit
2021-01-29  0:16   ` [dpdk-dev] [PATCH v6 12/12] net/octeontx_ep: transmit " Nalla Pradeep
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 01/11] net/octeontx_ep: add build and doc infrastructure Nalla Pradeep
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 02/11] net/octeontx_ep: add ethdev probe and remove Nalla Pradeep
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 03/11] net/octeontx_ep: add device init and uninit Nalla Pradeep
2021-01-28 16:55   ` Ferruh Yigit
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 04/11] net/octeontx_ep: added basic device setup Nalla Pradeep
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 05/11] net/octeontx_ep: add dev info get and configure Nalla Pradeep
2021-01-28 16:56   ` Ferruh Yigit
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 06/11] net/octeontx_ep: added rxq setup and release Nalla Pradeep
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 07/11] net/octeontx_ep: added tx queue " Nalla Pradeep
2021-01-28 16:57   ` Ferruh Yigit
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 08/11] net/octeontx_ep: setting up iq and oq registers Nalla Pradeep
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 09/11] net/octeontx_ep: added dev start and stop Nalla Pradeep
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 10/11] net/octeontx_ep: receive data path function added Nalla Pradeep
2021-01-28 16:58   ` Ferruh Yigit
2021-01-28 15:22 ` [dpdk-dev] [PATCH v5 11/11] net/octeontx_ep: transmit " Nalla Pradeep
2021-01-28 16:59   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c940d2fe-af3e-08c1-29f1-bacc7c2a6acf@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=pnalla@marvell.com \
    --cc=radhac@marvell.com \
    --cc=sburla@marvell.com \
    --cc=vburru@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).