#define UK_NETBUF_F_PARTIAL_CSUM_BIT 1
#define UK_NETBUF_F_PARTIAL_CSUM (1 << UK_NETBUF_F_PARTIAL_CSUM_BIT)
+/* Indicates the packet should be sent with the help of TCP Segmentation
+ * Offloading. This requires that the device supports this.
+ */
+#define UK_NETBUF_F_GSO_TCPV4_BIT 2
+#define UK_NETBUF_F_GSO_TCPV4 (1 << UK_NETBUF_F_GSO_TCPV4_BIT)
+
struct uk_netbuf {
struct uk_netbuf *next;
struct uk_netbuf *prev;
* pointing to the checksum field
*/
+ uint16_t header_len; /**< Used if UK_NETBUF_F_GSO_* is set;
+ * Number of bytes to copy into each split
+ * packet as a header
+ */
+ uint16_t gso_size; /**< Used if UK_NETBUF_F_GSO_* is set;
+ * Maximum size of each packet beyond the header
+ */
+
uk_netbuf_dtor_t dtor; /**< Destructor callback */
struct uk_alloc *_a; /**< @internal Allocator for free'ing */
void *_b; /**< @internal Base address for free'ing */
#define UK_NETDEV_F_PARTIAL_CSUM_BIT 2
#define UK_NETDEV_F_PARTIAL_CSUM (1UL << UK_NETDEV_F_PARTIAL_CSUM_BIT)
+/* Indicates that the network device supports sending netbufs with the
+ * UK_NETBUF_F_GSO_TCPV4 bit set. */
+#define UK_NETDEV_F_TSO4_BIT 3
+#define UK_NETDEV_F_TSO4 (1UL << UK_NETDEV_F_TSO4_BIT)
+
#define uk_netdev_rxintr_supported(feature) \
(feature & (UK_NETDEV_F_RXQ_INTR))
#define uk_netdev_txintr_supported(feature) \
(feature & (UK_NETDEV_F_TXQ_INTR))
#define uk_netdev_partial_csum_supported(feature) \
(feature & (UK_NETDEV_F_PARTIAL_CSUM))
-
+#define uk_netdev_tso4_supported(feature) \
+ (feature & (UK_NETDEV_F_TSO4))
/**
* A structure used to describe network device capabilities.
*/