DPDK patches and discussions
 help / color / mirror / Atom feed
From: <pbhagavatula@marvell.com>
To: <jerinj@marvell.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	David Hunt <david.hunt@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>,
	Ori Kam <orika@mellanox.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	Radu Nicolau <radu.nicolau@intel.com>,
	Akhil Goyal <akhil.goyal@nxp.com>,
	Tomasz Kantecki <tomasz.kantecki@intel.com>,
	John McNamara <john.mcnamara@intel.com>,
	Harry van Haaren <harry.van.haaren@intel.com>,
	Xiaoyun Li <xiaoyun.li@intel.com>
Cc: <dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>
Subject: [dpdk-dev]  [RFC 3/3] examples: add Rx ptype offload
Date: Tue, 6 Aug 2019 13:32:04 +0530	[thread overview]
Message-ID: <20190806080206.1572-4-pbhagavatula@marvell.com> (raw)
In-Reply-To: <20190806080206.1572-1-pbhagavatula@marvell.com>

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_PTYPE as a offload requirement for applicable
examples.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/ip_fragmentation/main.c                | 7 +++++++
 examples/l3fwd-power/main.c                     | 8 ++++++++
 examples/l3fwd/main.c                           | 9 +++++++++
 examples/performance-thread/l3fwd-thread/main.c | 9 +++++++++
 examples/tep_termination/vxlan_setup.c          | 1 +
 5 files changed, 34 insertions(+)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 324d60773..2a9895542 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -904,6 +904,13 @@ main(int argc, char **argv)
 
 		/* limit the frame size to the maximum supported by NIC */
 		rte_eth_dev_info_get(portid, &dev_info);
+
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE)
+			local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_PTYPE;
+
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
 		    dev_info.max_rx_pktlen,
 		    local_port_conf.rxmode.max_rx_pkt_len);
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd8d9528f..875d60c06 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -2261,6 +2261,14 @@ main(int argc, char **argv)
 		dev_rxq_num = dev_info.max_rx_queues;
 		dev_txq_num = dev_info.max_tx_queues;
 
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) {
+			if (!parse_ptype)
+				port_conf.rxmode.offloads |=
+					DEV_RX_OFFLOAD_PTYPE;
+		} else {
+			parse_ptype = 1;
+		}
+
 		nb_rx_queue = get_port_n_rx_queues(portid);
 		if (nb_rx_queue > dev_rxq_num)
 			rte_exit(EXIT_FAILURE,
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 3800bad19..dfee880a0 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -875,6 +875,15 @@ main(int argc, char **argv)
 			nb_rx_queue, (unsigned)n_tx_queue );
 
 		rte_eth_dev_info_get(portid, &dev_info);
+
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) {
+			if (!parse_ptype)
+				local_port_conf.rxmode.offloads |=
+					DEV_RX_OFFLOAD_PTYPE;
+		} else {
+			parse_ptype = 1;
+		}
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 49d942407..f033326be 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -3560,6 +3560,15 @@ main(int argc, char **argv)
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
 		rte_eth_dev_info_get(portid, &dev_info);
+
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) {
+			if (!parse_ptype_on)
+				port_conf.rxmode.offloads |=
+					DEV_RX_OFFLOAD_PTYPE;
+		} else {
+			parse_ptype_on = 1;
+		}
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..3d2acecd5 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -69,6 +69,7 @@ uint8_t tep_filter_type[] = {RTE_TUNNEL_FILTER_IMAC_TENID,
 static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
+		.offloads = DEV_RX_OFFLOAD_PTYPE,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
-- 
2.17.1


  parent reply	other threads:[~2019-08-06  8:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06  8:02 [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload pbhagavatula
2019-08-06  8:02 ` [dpdk-dev] [RFC 1/3] ethdev: add ptype as an " pbhagavatula
2019-08-06  9:00   ` Andrew Rybchenko
2019-08-06 14:31     ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2019-08-06 15:45       ` Stephen Hemminger
2019-08-06 18:03         ` Andrew Rybchenko
2019-08-06  8:02 ` [dpdk-dev] [RFC 2/3] net: update Rx offload capabilities pbhagavatula
2019-08-06  8:02 ` pbhagavatula [this message]
2019-08-06  9:20   ` [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload Ananyev, Konstantin
2019-08-06 13:57     ` Pavan Nikhilesh Bhagavatula
2019-08-06  8:19 ` [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload Hemant Agrawal
2019-08-06  8:47   ` Pavan Nikhilesh Bhagavatula
2019-08-06  9:06     ` Andrew Rybchenko
2019-08-06 23:15       ` Stephen Hemminger

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=20190806080206.1572-4-pbhagavatula@marvell.com \
    --to=pbhagavatula@marvell.com \
    --cc=akhil.goyal@nxp.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=jerinj@marvell.com \
    --cc=john.mcnamara@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=orika@mellanox.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=radu.nicolau@intel.com \
    --cc=tomasz.kantecki@intel.com \
    --cc=xiaoyun.li@intel.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).