~ubuntu-branches/ubuntu/saucy/qemu/saucy

« back to all changes in this revision

Viewing changes to hw/net/vmxnet_tx_pkt.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-05-28 08:18:30 UTC
  • mfrom: (1.8.2) (10.1.37 sid)
  • Revision ID: package-import@ubuntu.com-20130528081830-87xl2z9fq516a814
Tags: 1.5.0+dfsg-2ubuntu1
* Merge 1.5.0+dfs-2 from debian unstable.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - Dropped patches:
    * 0001-fix-wrong-output-with-info-chardev-for-tcp-socket.patch
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * gridcentric patch - updated
    * linaro arm patches from qemu-linaro rebasing branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * QEMU VMWARE VMXNET* paravirtual NICs - TX packets abstraction
 
3
 *
 
4
 * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com)
 
5
 *
 
6
 * Developed by Daynix Computing LTD (http://www.daynix.com)
 
7
 *
 
8
 * Authors:
 
9
 * Dmitry Fleytman <dmitry@daynix.com>
 
10
 * Tamir Shomer <tamirs@daynix.com>
 
11
 * Yan Vugenfirer <yan@daynix.com>
 
12
 *
 
13
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 
14
 * See the COPYING file in the top-level directory.
 
15
 *
 
16
 */
 
17
 
 
18
#ifndef VMXNET_TX_PKT_H
 
19
#define VMXNET_TX_PKT_H
 
20
 
 
21
#include "stdint.h"
 
22
#include "stdbool.h"
 
23
#include "net/eth.h"
 
24
#include "exec/hwaddr.h"
 
25
 
 
26
/* define to enable packet dump functions */
 
27
/*#define VMXNET_TX_PKT_DEBUG*/
 
28
 
 
29
struct VmxnetTxPkt;
 
30
 
 
31
/**
 
32
 * Init function for tx packet functionality
 
33
 *
 
34
 * @pkt:            packet pointer
 
35
 * @max_frags:      max tx ip fragments
 
36
 * @has_virt_hdr:   device uses virtio header.
 
37
 */
 
38
void vmxnet_tx_pkt_init(struct VmxnetTxPkt **pkt, uint32_t max_frags,
 
39
    bool has_virt_hdr);
 
40
 
 
41
/**
 
42
 * Clean all tx packet resources.
 
43
 *
 
44
 * @pkt:            packet.
 
45
 */
 
46
void vmxnet_tx_pkt_uninit(struct VmxnetTxPkt *pkt);
 
47
 
 
48
/**
 
49
 * get virtio header
 
50
 *
 
51
 * @pkt:            packet
 
52
 * @ret:            virtio header
 
53
 */
 
54
struct virtio_net_hdr *vmxnet_tx_pkt_get_vhdr(struct VmxnetTxPkt *pkt);
 
55
 
 
56
/**
 
57
 * build virtio header (will be stored in module context)
 
58
 *
 
59
 * @pkt:            packet
 
60
 * @tso_enable:     TSO enabled
 
61
 * @csum_enable:    CSO enabled
 
62
 * @gso_size:       MSS size for TSO
 
63
 *
 
64
 */
 
65
void vmxnet_tx_pkt_build_vheader(struct VmxnetTxPkt *pkt, bool tso_enable,
 
66
    bool csum_enable, uint32_t gso_size);
 
67
 
 
68
/**
 
69
 * updates vlan tag, and adds vlan header in case it is missing
 
70
 *
 
71
 * @pkt:            packet
 
72
 * @vlan:           VLAN tag
 
73
 *
 
74
 */
 
75
void vmxnet_tx_pkt_setup_vlan_header(struct VmxnetTxPkt *pkt, uint16_t vlan);
 
76
 
 
77
/**
 
78
 * populate data fragment into pkt context.
 
79
 *
 
80
 * @pkt:            packet
 
81
 * @pa:             physical address of fragment
 
82
 * @len:            length of fragment
 
83
 *
 
84
 */
 
85
bool vmxnet_tx_pkt_add_raw_fragment(struct VmxnetTxPkt *pkt, hwaddr pa,
 
86
    size_t len);
 
87
 
 
88
/**
 
89
 * fix ip header fields and calculate checksums needed.
 
90
 *
 
91
 * @pkt:            packet
 
92
 *
 
93
 */
 
94
void vmxnet_tx_pkt_update_ip_checksums(struct VmxnetTxPkt *pkt);
 
95
 
 
96
/**
 
97
 * get length of all populated data.
 
98
 *
 
99
 * @pkt:            packet
 
100
 * @ret:            total data length
 
101
 *
 
102
 */
 
103
size_t vmxnet_tx_pkt_get_total_len(struct VmxnetTxPkt *pkt);
 
104
 
 
105
/**
 
106
 * get packet type
 
107
 *
 
108
 * @pkt:            packet
 
109
 * @ret:            packet type
 
110
 *
 
111
 */
 
112
eth_pkt_types_e vmxnet_tx_pkt_get_packet_type(struct VmxnetTxPkt *pkt);
 
113
 
 
114
/**
 
115
 * prints packet data if debug is enabled
 
116
 *
 
117
 * @pkt:            packet
 
118
 *
 
119
 */
 
120
void vmxnet_tx_pkt_dump(struct VmxnetTxPkt *pkt);
 
121
 
 
122
/**
 
123
 * reset tx packet private context (needed to be called between packets)
 
124
 *
 
125
 * @pkt:            packet
 
126
 *
 
127
 */
 
128
void vmxnet_tx_pkt_reset(struct VmxnetTxPkt *pkt);
 
129
 
 
130
/**
 
131
 * Send packet to qemu. handles sw offloads if vhdr is not supported.
 
132
 *
 
133
 * @pkt:            packet
 
134
 * @nc:             NetClientState
 
135
 * @ret:            operation result
 
136
 *
 
137
 */
 
138
bool vmxnet_tx_pkt_send(struct VmxnetTxPkt *pkt, NetClientState *nc);
 
139
 
 
140
/**
 
141
 * parse raw packet data and analyze offload requirements.
 
142
 *
 
143
 * @pkt:            packet
 
144
 *
 
145
 */
 
146
bool vmxnet_tx_pkt_parse(struct VmxnetTxPkt *pkt);
 
147
 
 
148
#endif