mm: Don't pin ZERO_PAGE in pin_user_pages()
[linux-block.git] / include / net / tso.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
e876f208
EG
2#ifndef _TSO_H
3#define _TSO_H
4
d7b061b8 5#include <linux/skbuff.h>
e876f208
EG
6#include <net/ip.h>
7
9c77b803 8#define TSO_HEADER_SIZE 256
f9cbe9a5 9
e876f208 10struct tso_t {
185c3e58
ED
11 int next_frag_idx;
12 int size;
13 void *data;
14 u16 ip_id;
761b331c 15 u8 tlen; /* transport header len */
185c3e58
ED
16 bool ipv6;
17 u32 tcp_seq;
e876f208
EG
18};
19
d7b061b8
YL
20/* Calculate the worst case buffer count */
21static inline int tso_count_descs(const struct sk_buff *skb)
22{
23 return skb_shinfo(skb)->gso_segs * 2 + skb_shinfo(skb)->nr_frags;
24}
25
504b9121 26void tso_build_hdr(const struct sk_buff *skb, char *hdr, struct tso_t *tso,
e876f208 27 int size, bool is_last);
504b9121 28void tso_build_data(const struct sk_buff *skb, struct tso_t *tso, int size);
761b331c 29int tso_start(struct sk_buff *skb, struct tso_t *tso);
e876f208
EG
30
31#endif /* _TSO_H */