[ofa-general] Re: [PATCH 3/10] IB/core: Add LSO support

Roland Dreier rdreier at cisco.com
Fri Mar 28 14:39:37 PDT 2008


thanks, applied as below.

For now I left the IB_WR_LSO opcode rather than a send flag, since the
mlx4 internal implementation is as a new opcode.  However since this
is kernel-internal we can revisit this and I'm happy if the discussion
continues.

>From 86a0dd93c39739a39d6b5f7f67d4b2456c5f45ae Mon Sep 17 00:00:00 2001
From: Eli Cohen <eli at dev.mellanox.co.il>
Date: Mon, 17 Mar 2008 17:23:51 +0200
Subject: [PATCH] IB/core: Add IPoIB UD LSO support

LSO (large send offload) allows the networking stack to pass SKBs with
data size larger than the MTU to the IPoIB driver and have the HCA HW
fragment the data to multiple MSS-sized packets.  Add a device
capability flag IB_DEVICE_UD_TSO for devices that can perform TCP
segmentation offload, a new send work request opcode IB_WR_LSO,
header, hlen and mss fields for the work request structure, and a new
IB_WC_LSO completion type.

Signed-off-by: Eli Cohen <eli at mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd at cisco.com>
---
 include/rdma/ib_verbs.h |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 3ac7371..5fe7723 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -104,6 +104,7 @@ enum ib_device_cap_flags {
 	 * IPoIB driver may set NETIF_F_IP_CSUM for datagram mode.
 	 */
 	IB_DEVICE_UD_IP_CSUM		= (1<<18),
+	IB_DEVICE_UD_TSO		= (1<<19),
 	IB_DEVICE_SEND_W_INV		= (1<<21),
 };
 
@@ -412,6 +413,7 @@ enum ib_wc_opcode {
 	IB_WC_COMP_SWAP,
 	IB_WC_FETCH_ADD,
 	IB_WC_BIND_MW,
+	IB_WC_LSO,
 /*
  * Set value of IB_WC_RECV so consumers can test if a completion is a
  * receive by testing (opcode & IB_WC_RECV).
@@ -623,7 +625,8 @@ enum ib_wr_opcode {
 	IB_WR_SEND_WITH_IMM,
 	IB_WR_RDMA_READ,
 	IB_WR_ATOMIC_CMP_AND_SWP,
-	IB_WR_ATOMIC_FETCH_AND_ADD
+	IB_WR_ATOMIC_FETCH_AND_ADD,
+	IB_WR_LSO
 };
 
 enum ib_send_flags {
@@ -662,6 +665,9 @@ struct ib_send_wr {
 		} atomic;
 		struct {
 			struct ib_ah *ah;
+			void   *header;
+			int     hlen;
+			int     mss;
 			u32	remote_qpn;
 			u32	remote_qkey;
 			u16	pkey_index; /* valid for GSI only */
-- 
1.5.4.3




More information about the general mailing list