From: Harman Kalra <hkalra@marvell.com>
To: John McNamara <john.mcnamara@intel.com>,
Pablo de Lara <pablo.de.lara.guarch@intel.com>,
Bruce Richardson <bruce.richardson@intel.com>,
Harry van Haaren <harry.van.haaren@intel.com>,
Xiaoyun Li <xiaoyun.li@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Harman Kalra <hkalra@marvell.com>,
"barbette@kth.se" <barbette@kth.se>
Subject: [dpdk-dev] [PATCH] examples/rxtx_callbacks: fix HW timestamp enable
Date: Thu, 25 Jul 2019 15:51:57 +0000 [thread overview]
Message-ID: <1564069902-3500-1-git-send-email-hkalra@marvell.com> (raw)
Offloafing Rx timestamp is a device capability than queue capability.
Hence the logic to enable HW timestamp via DEV_RX_OFFLOAD_TIMESTAMP
flag should be before device configuration.
Fixes: cd1dadeb9b2a ("examples/rxtx_callbacks: support HW timestamp")
Cc: barbette@kth.se
Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
examples/rxtx_callbacks/main.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index c1abe9e1a..dbcd9f4fc 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -117,6 +117,15 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+ if (hw_timestamping) {
+ if (!(dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP)) {
+ printf("\nERROR: Port %u does not support hardware timestamping\n"
+ , port);
+ return -1;
+ }
+ port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
+ }
+
retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
if (retval != 0)
return retval;
@@ -127,15 +136,6 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
rxconf = dev_info.default_rxconf;
- if (hw_timestamping) {
- if (!(dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP)) {
- printf("\nERROR: Port %u does not support hardware timestamping\n"
- , port);
- return -1;
- }
- rxconf.offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
- }
-
for (q = 0; q < rx_rings; q++) {
retval = rte_eth_rx_queue_setup(port, q, nb_rxd,
rte_eth_dev_socket_id(port), &rxconf, mbuf_pool);
--
2.18.0
next reply other threads:[~2019-07-25 15:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 15:51 Harman Kalra [this message]
2019-07-27 17:14 ` Jerin Jacob Kollanukkaran
2019-07-27 20:34 ` [dpdk-dev] [PATCH v2 1/2] net/octeontx2: fix ptp performance issue Harman Kalra
2019-07-27 20:34 ` [dpdk-dev] [PATCH v2 2/2] net/octeontx2: support read clock API Harman Kalra
2019-07-29 22:18 ` [dpdk-dev] [PATCH] examples/rxtx_callbacks: fix HW timestamp enable Thomas Monjalon
2019-07-30 6:57 ` [dpdk-dev] [EXT] " Harman Kalra
2019-07-30 7:11 ` Thomas Monjalon
2019-07-30 7:46 ` [dpdk-dev] [PATCH v2] " Harman Kalra
2019-07-30 9:13 ` Thomas Monjalon
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=1564069902-3500-1-git-send-email-hkalra@marvell.com \
--to=hkalra@marvell.com \
--cc=barbette@kth.se \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=harry.van.haaren@intel.com \
--cc=john.mcnamara@intel.com \
--cc=pablo.de.lara.guarch@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).