Skip to contentSkip to conversation

ehea: LRO support

RFC PATCH In review Jan-Bernd Themann 2 participants 2 messages Jul 30, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 3/4 ehea: LRO support

Added LRO support using the "SKB aggregate" interface

---
 drivers/net/ehea/ehea.h         |    9 ++++-
 drivers/net/ehea/ehea_ethtool.c |   15 +++++++
 drivers/net/ehea/ehea_main.c    |   82 +++++++++++++++++++++++++++++++++++---
 3 files changed, 98 insertions(+), 8 deletions(-)
drivers/net/ehea/ehea.h +8 -1
index d67f97b..70e33fe 100644
@@ -33,13 +33,14 @@
 #include <linux/ethtool.h>
 #include <linux/vmalloc.h>
 #include <linux/if_vlan.h>
+#include <linux/inet_lro.h>
 
 #include <asm/ibmebus.h>
 #include <asm/abs_addr.h>
 #include <asm/io.h>
 
 #define DRV_NAME	"ehea"
-#define DRV_VERSION	"EHEA_0073"
+#define DRV_VERSION	"EHEA_0074"
 
 /* eHEA capability flags */
 #define DLPAR_PORT_ADD_REM 1
@@ -58,6 +59,7 @@
 
 #define EHEA_SMALL_QUEUES
 #define EHEA_NUM_TX_QP 1
+#define EHEA_LRO_MAX_AGGR 64
 
 #ifdef EHEA_SMALL_QUEUES
 #define EHEA_MAX_CQE_COUNT      1023
@@ -84,6 +86,8 @@
 #define EHEA_RQ2_PKT_SIZE       1522
 #define EHEA_L_PKT_SIZE         256	/* low latency */
 
+#define MAX_LRO_DESCRIPTORS 8
+
 /* Send completion signaling */
 
 /* Protection Domain Identifier */
@@ -376,6 +380,8 @@ struct ehea_port_res {
 	u64 tx_packets;
 	u64 rx_packets;
 	u32 poll_counter;
+	struct net_lro_mgr lro_mgr;
+	struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS];
 };
 
 
@@ -427,6 +433,7 @@ struct ehea_port {
 	u32 msg_enable;
 	u32 sig_comp_iv;
 	u32 state;
+	u32 lro_max_aggr;
 	u8 full_duplex;
 	u8 autoneg;
 	u8 num_def_qps;
drivers/net/ehea/ehea_ethtool.c +15 -0
index decec8c..29ef7a9 100644
@@ -183,6 +183,9 @@ static char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = {
 	{"PR5 free_swqes"},
 	{"PR6 free_swqes"},
 	{"PR7 free_swqes"},
+	{"LRO aggregated"},
+	{"LRO flushed"},
+	{"LRO no_desc"},
 };
 
 static void ehea_get_strings(struct net_device *dev, u32 stringset, u8 *data)
@@ -239,6 +242,18 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
 	for (k = 0; k < 8; k++)
 		data[i++] = atomic_read(&port->port_res[k].swqe_avail);
 
+	for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
+		tmp |= port->port_res[k].lro_mgr.stats.aggregated;
+	data[i++] = tmp;
+
+	for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
+		tmp |= port->port_res[k].lro_mgr.stats.flushed;
+	data[i++] = tmp;
+
+	for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
+		tmp |= port->port_res[k].lro_mgr.stats.no_desc;
+	data[i++] = tmp;
+
 }
 
 const struct ethtool_ops ehea_ethtool_ops = {
drivers/net/ehea/ehea_main.c +75 -7

136 lines not on this page · raw message

Signature · 1 line
1.5.2
#1 lore raw
Quoted 9 lines · Jan-Bernd Themann

Added LRO support using the "SKB aggregate" interface

---
 drivers/net/ehea/ehea.h         |    9 ++++-
 drivers/net/ehea/ehea_ethtool.c |   15 +++++++
 drivers/net/ehea/ehea_main.c    |   82 +++++++++++++++++++++++++++++++++++---
 3 files changed, 98 insertions(+), 8 deletions(-)

<snip>

drivers/net/ehea/ehea_main.c module_param(rq2_entries, int, 0); · line 66

Quoted 2 lines
drivers/net/ehea/ehea_main.c +2 -0
+module_param(use_lro, int, 0);
+module_param(lro_max_aggr, int, 0);

this should obviously (and Stephen H. probably agrees) be implemented in ethtool instead, and opens up the question as to what changes we need to add to ethtool. ..

Auke