From: Junfeng Guo <junfeng.guo@intel.com>
To: qi.z.zhang@intel.com, jingjing.wu@intel.com,
ferruh.yigit@amd.com, beilei.xing@intel.com
Cc: dev@dpdk.org, xiaoyun.li@intel.com, helin.zhang@intel.com,
Junfeng Guo <junfeng.guo@intel.com>,
Rushil Gupta <rushilg@google.com>,
Jordan Kimbrough <jrkim@google.com>,
Jeroen de Borst <jeroendb@google.com>
Subject: [RFC v3 08/10] net/gve: enable Tx checksum offload for DQO
Date: Fri, 17 Feb 2023 15:32:26 +0800 [thread overview]
Message-ID: <20230217073228.340815-9-junfeng.guo@intel.com> (raw)
In-Reply-To: <20230217073228.340815-1-junfeng.guo@intel.com>
Enable Tx checksum offload once any flag of L4 checksum is set.
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Rushil Gupta <rushilg@google.com>
Signed-off-by: Jordan Kimbrough <jrkim@google.com>
Signed-off-by: Jeroen de Borst <jeroendb@google.com>
---
drivers/net/gve/gve_ethdev.h | 4 ++++
drivers/net/gve/gve_tx_dqo.c | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
index a8e0dd5f3d..bca6e86ef0 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -38,6 +38,10 @@
#define GVE_MAX_MTU RTE_ETHER_MTU
#define GVE_MIN_MTU RTE_ETHER_MIN_MTU
+#define GVE_TX_CKSUM_OFFLOAD_MASK ( \
+ RTE_MBUF_F_TX_L4_MASK | \
+ RTE_MBUF_F_TX_TCP_SEG)
+
/* A list of pages registered with the device during setup and used by a queue
* as buffers
*/
diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index 450cf71a6b..e925d6c3d0 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -77,6 +77,7 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
uint16_t mask, sw_mask;
uint16_t nb_to_clean;
uint16_t nb_tx = 0;
+ uint64_t ol_flags;
uint16_t nb_used;
uint16_t tx_id;
uint16_t sw_id;
@@ -103,6 +104,7 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
if (txq->nb_free < tx_pkt->nb_segs)
break;
+ ol_flags = tx_pkt->ol_flags;
nb_used = tx_pkt->nb_segs;
do {
@@ -127,6 +129,9 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
/* fill the last descriptor with End of Packet (EOP) bit */
txd->pkt.end_of_packet = 1;
+ if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK)
+ txd->pkt.checksum_offload_enable = 1;
+
txq->nb_free -= nb_used;
txq->nb_used += nb_used;
}
--
2.34.1
next prev parent reply other threads:[~2023-02-17 7:39 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 2:53 [RFC 0/8] gve PMD enhancement Junfeng Guo
2023-01-18 2:53 ` [RFC 1/8] net/gve: add Rx queue setup for DQO Junfeng Guo
2023-01-18 2:53 ` [RFC 2/8] net/gve: support device start and close " Junfeng Guo
2023-01-18 2:53 ` [RFC 3/8] net/gve: support queue release and stop " Junfeng Guo
2023-01-18 2:53 ` [RFC 4/8] net/gve: support basic Tx data path " Junfeng Guo
2023-01-18 2:53 ` [RFC 5/8] net/gve: support basic Rx " Junfeng Guo
2023-01-18 2:53 ` [RFC 6/8] net/gve: support basic stats " Junfeng Guo
2023-01-18 2:53 ` [RFC 7/8] net/gve: support jumbo frame for GQI Junfeng Guo
2023-01-18 2:53 ` [RFC 8/8] net/gve: add AdminQ command to verify driver compatibility Junfeng Guo
2023-01-25 13:37 ` [RFC 0/8] gve PMD enhancement Li, Xiaoyun
2023-01-30 6:26 ` [RFC v2 0/9] " Junfeng Guo
2023-01-30 6:26 ` [RFC v2 1/9] net/gve: add Tx queue setup for DQO Junfeng Guo
2023-01-30 6:26 ` [RFC v2 2/9] net/gve: add Rx " Junfeng Guo
2023-01-30 6:26 ` [RFC v2 3/9] net/gve: support device start and close " Junfeng Guo
2023-01-30 6:26 ` [RFC v2 4/9] net/gve: support queue release and stop " Junfeng Guo
2023-01-30 6:26 ` [RFC v2 5/9] net/gve: support basic Tx data path " Junfeng Guo
2023-01-30 6:26 ` [RFC v2 6/9] net/gve: support basic Rx " Junfeng Guo
2023-01-30 18:32 ` Honnappa Nagarahalli
2023-01-30 6:26 ` [RFC v2 7/9] net/gve: support basic stats " Junfeng Guo
2023-01-30 18:27 ` Honnappa Nagarahalli
2023-01-30 6:26 ` [RFC v2 8/9] net/gve: support jumbo frame for GQI Junfeng Guo
2023-01-30 6:26 ` [RFC v2 9/9] net/gve: add AdminQ command to verify driver compatibility Junfeng Guo
2023-02-17 7:32 ` [RFC v3 00/10] gve PMD enhancement Junfeng Guo
2023-02-17 7:32 ` [RFC v3 01/10] net/gve: add Tx queue setup for DQO Junfeng Guo
2023-02-17 7:32 ` [RFC v3 02/10] net/gve: add Rx " Junfeng Guo
2023-02-17 7:32 ` [RFC v3 03/10] net/gve: support device start and close " Junfeng Guo
2023-02-17 7:32 ` [RFC v3 04/10] net/gve: support queue release and stop " Junfeng Guo
2023-02-17 7:32 ` [RFC v3 05/10] net/gve: support basic Tx data path " Junfeng Guo
2023-02-17 7:32 ` [RFC v3 06/10] net/gve: support basic Rx " Junfeng Guo
2023-02-17 15:17 ` Honnappa Nagarahalli
2023-02-23 5:32 ` Guo, Junfeng
2023-02-17 7:32 ` [RFC v3 07/10] net/gve: support basic stats " Junfeng Guo
2023-02-17 15:28 ` Honnappa Nagarahalli
2023-02-17 7:32 ` Junfeng Guo [this message]
2023-02-17 7:32 ` [RFC v3 09/10] net/gve: support jumbo frame for GQI Junfeng Guo
2023-02-17 7:32 ` [RFC v3 10/10] net/gve: add AdminQ command to verify driver compatibility Junfeng Guo
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=20230217073228.340815-9-junfeng.guo@intel.com \
--to=junfeng.guo@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=helin.zhang@intel.com \
--cc=jeroendb@google.com \
--cc=jingjing.wu@intel.com \
--cc=jrkim@google.com \
--cc=qi.z.zhang@intel.com \
--cc=rushilg@google.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).