summaryrefslogtreecommitdiffstats
path: root/sys/net/if_var.h
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2014-11-03 12:38:29 +0000
committerhselasky <hselasky@FreeBSD.org>2014-11-03 12:38:29 +0000
commitfa183f01741aa54ff3ba0fcf31b7b1404b7a7e53 (patch)
tree1bba595c897541325069c2ad2bb01c04241c25c0 /sys/net/if_var.h
parent8dd879bfaf9ef726ec0754bd1c4368f02df4f798 (diff)
downloadFreeBSD-src-fa183f01741aa54ff3ba0fcf31b7b1404b7a7e53.zip
FreeBSD-src-fa183f01741aa54ff3ba0fcf31b7b1404b7a7e53.tar.gz
MFC r271946 and r272595:
Improve transmit sending offload, TSO, algorithm in general. This change allows all HCAs from Mellanox Technologies to function properly when TSO is enabled. See r271946 and r272595 for more details about this commit. Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r--sys/net/if_var.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 677a688..9312728 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -116,6 +116,12 @@ struct ifqueue {
struct mtx ifq_mtx;
};
+struct ifnet_hw_tsomax {
+ u_int tsomaxbytes; /* TSO total burst length limit in bytes */
+ u_int tsomaxsegcount; /* TSO maximum segment count */
+ u_int tsomaxsegsize; /* TSO maximum segment size in bytes */
+};
+
/*
* Structure defining a network interface.
*
@@ -204,10 +210,11 @@ struct ifnet {
u_int if_fib; /* interface FIB */
u_char if_alloctype; /* if_type at time of allocation */
- u_int if_hw_tsomax; /* tso burst length limit, the minimum
- * is (IP_MAXPACKET / 8).
- * XXXAO: Have to find a better place
- * for it eventually. */
+ u_int if_hw_tsomax; /* TSO total burst length
+ * limit in bytes. A value of
+ * zero means no limit. Have
+ * to find a better place for
+ * it eventually. */
/*
* Spare fields are added so that we can modify sensitive data
@@ -215,7 +222,14 @@ struct ifnet {
* be used with care where binary compatibility is required.
*/
char if_cspare[3];
- int if_ispare[4];
+ int if_ispare[2];
+
+ /*
+ * TSO fields for segment limits. If a field is zero below,
+ * there is no limit:
+ */
+ u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */
+ u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */
void *if_pspare[8]; /* 1 netmap, 7 TDB */
};
@@ -967,6 +981,10 @@ int ether_poll_register(poll_handler_t *h, struct ifnet *ifp);
int ether_poll_deregister(struct ifnet *ifp);
#endif /* DEVICE_POLLING */
+/* TSO */
+void if_hw_tsomax_common(struct ifnet *, struct ifnet_hw_tsomax *);
+int if_hw_tsomax_update(struct ifnet *, struct ifnet_hw_tsomax *);
+
#endif /* _KERNEL */
#endif /* !_NET_IF_VAR_H_ */
OpenPOWER on IntegriCloud