Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82818
b: refs/heads/master
c: 50c8ea8
h: refs/heads/master
v: v3
  • Loading branch information
Rusty Russell committed Feb 4, 2008
1 parent 21f4dd9 commit 79038f0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24a5ae5d0340d5a45df840b24a10d62aa9516116
refs/heads/master: 50c8ea8080700014872f2bbd7466d31ce0476290
3 changes: 2 additions & 1 deletion trunk/drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev)
}

if (skb_is_gso(skb)) {
hdr->hdr_len = skb_transport_header(skb) - skb->data;
hdr->gso_size = skb_shinfo(skb)->gso_size;
if (skb_shinfo(skb)->gso_type & SKB_GSO_TCP_ECN)
hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4_ECN;
Expand All @@ -255,7 +256,7 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev)
BUG();
} else {
hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE;
hdr->gso_size = 0;
hdr->gso_size = hdr->hdr_len = 0;
}

vnet_hdr_to_sg(sg, skb);
Expand Down
11 changes: 6 additions & 5 deletions trunk/include/linux/virtio_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ struct virtio_net_config
struct virtio_net_hdr
{
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
__u8 flags;
__u8 flags;
#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO)
/* FIXME: Do we need this? If they said they can handle ECN, do they care? */
#define VIRTIO_NET_HDR_GSO_TCPV4_ECN 2 // GSO frame, IPv4 TCP w/ ECN
#define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO)
#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
__u8 gso_type;
__u16 gso_size;
__u16 csum_start;
__u16 csum_offset;
__u8 gso_type;
__u16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
__u16 gso_size; /* Bytes to append to gso_hdr_len per frame */
__u16 csum_start; /* Position to start checksumming from */
__u16 csum_offset; /* Offset after that to place checksum */
};
#endif /* _LINUX_VIRTIO_NET_H */

0 comments on commit 79038f0

Please sign in to comment.