1 /****************************************************************************
2 * Solarflare driver for Xen network acceleration
4 * Copyright 2006-2008: Solarflare Communications Inc,
5 * 9501 Jeronimo Road, Suite 250,
6 * Irvine, CA 92618, USA
8 * Maintained by Solarflare Communications <linux-xen-drivers@solarflare.com>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License version 2 as published
12 * by the Free Software Foundation, incorporated herein by reference.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 ****************************************************************************
25 #ifndef NETFRONT_ACCEL_SSR_H
26 #define NETFRONT_ACCEL_SSR_H
28 #include <linux/skbuff.h>
30 #include <linux/tcp.h>
31 #include <linux/list.h>
35 /** State for Soft Segment Reassembly (SSR). */
37 struct netfront_accel_ssr_conn {
38 struct list_head link;
40 unsigned saddr, daddr;
41 unsigned short source, dest;
43 /** Number of in-order packets we've seen with payload. */
44 unsigned n_in_order_pkts;
46 /** Next in-order sequence number. */
49 /** Time we last saw a packet on this connection. */
50 unsigned long last_pkt_jiffies;
52 /** The SKB we are currently holding. If NULL, then all following
53 * fields are undefined.
57 /** The tail of the frag_list of SKBs we're holding. Only valid
58 * after at least one merge.
60 struct sk_buff *skb_tail;
62 /** The IP header of the skb we are holding. */
65 /** The TCP header of the skb we are holding. */
69 extern void netfront_accel_ssr_init(struct netfront_accel_ssr_state *st);
70 extern void netfront_accel_ssr_fini(netfront_accel_vnic *vnic,
71 struct netfront_accel_ssr_state *st);
74 __netfront_accel_ssr_end_of_burst(netfront_accel_vnic *vnic,
75 struct netfront_accel_ssr_state *st);
77 extern int netfront_accel_ssr_skb(netfront_accel_vnic *vnic,
78 struct netfront_accel_ssr_state *st,
82 netfront_accel_ssr_end_of_burst (netfront_accel_vnic *vnic,
83 struct netfront_accel_ssr_state *st) {
84 if ( ! list_empty(&st->conns) )
85 __netfront_accel_ssr_end_of_burst(vnic, st);
88 #endif /* NETFRONT_ACCEL_SSR_H */