accel/ivpu: Enable HWS by default on all platforms
[drm/drm-misc.git] / include / net / tso.h
blobe7e157ae0526c8d655aca67a8a49191ec870746b
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _TSO_H
3 #define _TSO_H
5 #include <linux/skbuff.h>
6 #include <net/ip.h>
8 #define TSO_HEADER_SIZE 256
10 struct tso_t {
11 int next_frag_idx;
12 int size;
13 void *data;
14 u16 ip_id;
15 u8 tlen; /* transport header len */
16 bool ipv6;
17 u32 tcp_seq;
20 /* Calculate the worst case buffer count */
21 static inline int tso_count_descs(const struct sk_buff *skb)
23 return skb_shinfo(skb)->gso_segs * 2 + skb_shinfo(skb)->nr_frags;
26 void tso_build_hdr(const struct sk_buff *skb, char *hdr, struct tso_t *tso,
27 int size, bool is_last);
28 void tso_build_data(const struct sk_buff *skb, struct tso_t *tso, int size);
29 int tso_start(struct sk_buff *skb, struct tso_t *tso);
31 #endif /* _TSO_H */