aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ethtool.h2
-rw-r--r--include/linux/netdevice.h23
-rw-r--r--include/linux/skbuff.h26
-rw-r--r--include/linux/tcp.h2
4 files changed, 40 insertions, 13 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index cf2abeca92a0..c6310aef5ab0 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -411,6 +411,8 @@ struct ethtool_ops {
411#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ 411#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
412#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */ 412#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
413#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */ 413#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
414#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
415#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
414 416
415/* compatibility with older code */ 417/* compatibility with older code */
416#define SPARC_ETH_GSET ETHTOOL_GSET 418#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index cead6be467ed..bc747e5d7138 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -308,9 +308,13 @@ struct net_device
308#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ 308#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
309#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ 309#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
310#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ 310#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
311#define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ 311#define NETIF_F_GSO 2048 /* Enable software GSO. */
312#define NETIF_F_LLTX 4096 /* LockLess TX */ 312#define NETIF_F_LLTX 4096 /* LockLess TX */
313#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ 313
314 /* Segmentation offload features */
315#define NETIF_F_GSO_SHIFT 16
316#define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
317#define NETIF_F_UFO (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT)
314 318
315#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) 319#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
316#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) 320#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
@@ -402,6 +406,9 @@ struct net_device
402 struct list_head qdisc_list; 406 struct list_head qdisc_list;
403 unsigned long tx_queue_len; /* Max frames per queue allowed */ 407 unsigned long tx_queue_len; /* Max frames per queue allowed */
404 408
409 /* Partially transmitted GSO packet. */
410 struct sk_buff *gso_skb;
411
405 /* ingress path synchronizer */ 412 /* ingress path synchronizer */
406 spinlock_t ingress_lock; 413 spinlock_t ingress_lock;
407 struct Qdisc *qdisc_ingress; 414 struct Qdisc *qdisc_ingress;
@@ -536,6 +543,7 @@ struct packet_type {
536 struct net_device *, 543 struct net_device *,
537 struct packet_type *, 544 struct packet_type *,
538 struct net_device *); 545 struct net_device *);
546 struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg);
539 void *af_packet_priv; 547 void *af_packet_priv;
540 struct list_head list; 548 struct list_head list;
541}; 549};
@@ -686,7 +694,8 @@ extern int dev_change_name(struct net_device *, char *);
686extern int dev_set_mtu(struct net_device *, int); 694extern int dev_set_mtu(struct net_device *, int);
687extern int dev_set_mac_address(struct net_device *, 695extern int dev_set_mac_address(struct net_device *,
688 struct sockaddr *); 696 struct sockaddr *);
689extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev); 697extern int dev_hard_start_xmit(struct sk_buff *skb,
698 struct net_device *dev);
690 699
691extern void dev_init(void); 700extern void dev_init(void);
692 701
@@ -960,6 +969,7 @@ extern int netdev_max_backlog;
960extern int weight_p; 969extern int weight_p;
961extern int netdev_set_master(struct net_device *dev, struct net_device *master); 970extern int netdev_set_master(struct net_device *dev, struct net_device *master);
962extern int skb_checksum_help(struct sk_buff *skb, int inward); 971extern int skb_checksum_help(struct sk_buff *skb, int inward);
972extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg);
963#ifdef CONFIG_BUG 973#ifdef CONFIG_BUG
964extern void netdev_rx_csum_fault(struct net_device *dev); 974extern void netdev_rx_csum_fault(struct net_device *dev);
965#else 975#else
@@ -979,6 +989,13 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
979 989
980extern void linkwatch_run_queue(void); 990extern void linkwatch_run_queue(void);
981 991
992static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
993{
994 int feature = skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT;
995 return skb_shinfo(skb)->gso_size &&
996 (dev->features & feature) != feature;
997}
998
982#endif /* __KERNEL__ */ 999#endif /* __KERNEL__ */
983 1000
984#endif /* _LINUX_DEV_H */ 1001#endif /* _LINUX_DEV_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 66f8819f9568..16eef03ce0eb 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -134,9 +134,10 @@ struct skb_frag_struct {
134struct skb_shared_info { 134struct skb_shared_info {
135 atomic_t dataref; 135 atomic_t dataref;
136 unsigned short nr_frags; 136 unsigned short nr_frags;
137 unsigned short tso_size; 137 unsigned short gso_size;
138 unsigned short tso_segs; 138 /* Warning: this field is not always filled in (UFO)! */
139 unsigned short ufo_size; 139 unsigned short gso_segs;
140 unsigned short gso_type;
140 unsigned int ip6_frag_id; 141 unsigned int ip6_frag_id;
141 struct sk_buff *frag_list; 142 struct sk_buff *frag_list;
142 skb_frag_t frags[MAX_SKB_FRAGS]; 143 skb_frag_t frags[MAX_SKB_FRAGS];
@@ -168,6 +169,11 @@ enum {
168 SKB_FCLONE_CLONE, 169 SKB_FCLONE_CLONE,
169}; 170};
170 171
172enum {
173 SKB_GSO_TCPV4 = 1 << 0,
174 SKB_GSO_UDPV4 = 1 << 1,
175};
176
171/** 177/**
172 * struct sk_buff - socket buffer 178 * struct sk_buff - socket buffer
173 * @next: Next buffer in list 179 * @next: Next buffer in list
@@ -209,6 +215,8 @@ enum {
209 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 215 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
210 * @tc_index: Traffic control index 216 * @tc_index: Traffic control index
211 * @tc_verd: traffic control verdict 217 * @tc_verd: traffic control verdict
218 * @dma_cookie: a cookie to one of several possible DMA operations
219 * done by skb DMA functions
212 * @secmark: security marking 220 * @secmark: security marking
213 */ 221 */
214 222
@@ -345,7 +353,7 @@ extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
345extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, 353extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
346 int newheadroom, int newtailroom, 354 int newheadroom, int newtailroom,
347 gfp_t priority); 355 gfp_t priority);
348extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); 356extern int skb_pad(struct sk_buff *skb, int pad);
349#define dev_kfree_skb(a) kfree_skb(a) 357#define dev_kfree_skb(a) kfree_skb(a)
350extern void skb_over_panic(struct sk_buff *skb, int len, 358extern void skb_over_panic(struct sk_buff *skb, int len,
351 void *here); 359 void *here);
@@ -1122,16 +1130,15 @@ static inline int skb_cow(struct sk_buff *skb, unsigned int headroom)
1122 * 1130 *
1123 * Pads up a buffer to ensure the trailing bytes exist and are 1131 * Pads up a buffer to ensure the trailing bytes exist and are
1124 * blanked. If the buffer already contains sufficient data it 1132 * blanked. If the buffer already contains sufficient data it
1125 * is untouched. Returns the buffer, which may be a replacement 1133 * is untouched. Otherwise it is extended. Returns zero on
1126 * for the original, or NULL for out of memory - in which case 1134 * success. The skb is freed on error.
1127 * the original buffer is still freed.
1128 */ 1135 */
1129 1136
1130static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len) 1137static inline int skb_padto(struct sk_buff *skb, unsigned int len)
1131{ 1138{
1132 unsigned int size = skb->len; 1139 unsigned int size = skb->len;
1133 if (likely(size >= len)) 1140 if (likely(size >= len))
1134 return skb; 1141 return 0;
1135 return skb_pad(skb, len-size); 1142 return skb_pad(skb, len-size);
1136} 1143}
1137 1144
@@ -1292,6 +1299,7 @@ extern void skb_split(struct sk_buff *skb,
1292 struct sk_buff *skb1, const u32 len); 1299 struct sk_buff *skb1, const u32 len);
1293 1300
1294extern void skb_release_data(struct sk_buff *skb); 1301extern void skb_release_data(struct sk_buff *skb);
1302extern struct sk_buff *skb_segment(struct sk_buff *skb, int sg);
1295 1303
1296static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, 1304static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
1297 int len, void *buffer) 1305 int len, void *buffer)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 420a689c3fb4..8ebf497907f8 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -18,7 +18,6 @@
18#define _LINUX_TCP_H 18#define _LINUX_TCP_H
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/dmaengine.h>
22#include <asm/byteorder.h> 21#include <asm/byteorder.h>
23 22
24struct tcphdr { 23struct tcphdr {
@@ -161,6 +160,7 @@ struct tcp_info
161#ifdef __KERNEL__ 160#ifdef __KERNEL__
162 161
163#include <linux/skbuff.h> 162#include <linux/skbuff.h>
163#include <linux/dmaengine.h>
164#include <net/sock.h> 164#include <net/sock.h>
165#include <net/inet_connection_sock.h> 165#include <net/inet_connection_sock.h>
166#include <net/inet_timewait_sock.h> 166#include <net/inet_timewait_sock.h>