Linux Audio

Check our new training course

Loading...
v6.13.7
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef _TSO_H
 3#define _TSO_H
 4
 5#include <linux/skbuff.h>
 6#include <net/ip.h>
 7
 8#define TSO_HEADER_SIZE		256
 9
10struct 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;
18};
19
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
26void tso_build_hdr(const struct sk_buff *skb, char *hdr, struct tso_t *tso,
27		   int size, bool is_last);
28void tso_build_data(const struct sk_buff *skb, struct tso_t *tso, int size);
29int tso_start(struct sk_buff *skb, struct tso_t *tso);
30
31#endif	/* _TSO_H */
v5.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef _TSO_H
 3#define _TSO_H
 4
 
 5#include <net/ip.h>
 6
 7#define TSO_HEADER_SIZE		128
 8
 9struct tso_t {
10	int next_frag_idx;
11	void *data;
12	size_t size;
13	u16 ip_id;
14	bool ipv6;
15	u32 tcp_seq;
 
16};
17
18int tso_count_descs(struct sk_buff *skb);
19void tso_build_hdr(struct sk_buff *skb, char *hdr, struct tso_t *tso,
 
 
 
 
 
20		   int size, bool is_last);
21void tso_build_data(struct sk_buff *skb, struct tso_t *tso, int size);
22void tso_start(struct sk_buff *skb, struct tso_t *tso);
23
24#endif	/* _TSO_H */