tcp_lro.h (255010) | tcp_lro.h (294327) |
---|---|
1/*- 2 * Copyright (c) 2006, Myricom Inc. 3 * Copyright (c) 2008, Intel Corporation. | 1/*- 2 * Copyright (c) 2006, Myricom Inc. 3 * Copyright (c) 2008, Intel Corporation. |
4 * Copyright (c) 2016 Mellanox Technologies. |
|
4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
27 * $FreeBSD: head/sys/netinet/tcp_lro.h 255010 2013-08-28 23:00:34Z np $ | 28 * $FreeBSD: head/sys/netinet/tcp_lro.h 294327 2016-01-19 15:33:28Z hselasky $ |
28 */ 29 30#ifndef _TCP_LRO_H_ 31#define _TCP_LRO_H_ 32 33#include <sys/time.h> 34 | 29 */ 30 31#ifndef _TCP_LRO_H_ 32#define _TCP_LRO_H_ 33 34#include <sys/time.h> 35 |
36#ifndef TCP_LRO_ENTRIES 37/* Define default number of LRO entries per RX queue */ 38#define TCP_LRO_ENTRIES 8 39#endif 40 41#define TCP_LRO_SEQUENCE(mb) \ 42 (mb)->m_pkthdr.PH_loc.thirtytwo[0] 43 |
|
35struct lro_entry 36{ 37 SLIST_ENTRY(lro_entry) next; 38 struct mbuf *m_head; 39 struct mbuf *m_tail; 40 union { 41 struct ip *ip4; 42 struct ip6_hdr *ip6; --- 27 unchanged lines hidden (view full) --- 70#define source_ip4 lesource.s_ip4 71#define dest_ip4 ledest.d_ip4 72#define source_ip6 lesource.s_ip6 73#define dest_ip6 ledest.d_ip6 74 75/* NB: This is part of driver structs. */ 76struct lro_ctrl { 77 struct ifnet *ifp; | 44struct lro_entry 45{ 46 SLIST_ENTRY(lro_entry) next; 47 struct mbuf *m_head; 48 struct mbuf *m_tail; 49 union { 50 struct ip *ip4; 51 struct ip6_hdr *ip6; --- 27 unchanged lines hidden (view full) --- 79#define source_ip4 lesource.s_ip4 80#define dest_ip4 ledest.d_ip4 81#define source_ip6 lesource.s_ip6 82#define dest_ip6 ledest.d_ip6 83 84/* NB: This is part of driver structs. */ 85struct lro_ctrl { 86 struct ifnet *ifp; |
78 int lro_queued; 79 int lro_flushed; 80 int lro_bad_csum; 81 int lro_cnt; | 87 struct mbuf **lro_mbuf_data; 88 uint64_t lro_queued; 89 uint64_t lro_flushed; 90 uint64_t lro_bad_csum; 91 unsigned lro_cnt; 92 unsigned lro_mbuf_count; 93 unsigned lro_mbuf_max; |
82 83 struct lro_head lro_active; 84 struct lro_head lro_free; 85}; 86 87int tcp_lro_init(struct lro_ctrl *); | 94 95 struct lro_head lro_active; 96 struct lro_head lro_free; 97}; 98 99int tcp_lro_init(struct lro_ctrl *); |
100int tcp_lro_init_args(struct lro_ctrl *, struct ifnet *, unsigned, unsigned); |
|
88void tcp_lro_free(struct lro_ctrl *); 89void tcp_lro_flush_inactive(struct lro_ctrl *, const struct timeval *); 90void tcp_lro_flush(struct lro_ctrl *, struct lro_entry *); | 101void tcp_lro_free(struct lro_ctrl *); 102void tcp_lro_flush_inactive(struct lro_ctrl *, const struct timeval *); 103void tcp_lro_flush(struct lro_ctrl *, struct lro_entry *); |
104void tcp_lro_flush_all(struct lro_ctrl *); |
|
91int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t); | 105int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t); |
106void tcp_lro_queue_mbuf(struct lro_ctrl *, struct mbuf *); |
|
92 93#define TCP_LRO_CANNOT -1 94#define TCP_LRO_NOT_SUPPORTED 1 95 96#endif /* _TCP_LRO_H_ */ | 107 108#define TCP_LRO_CANNOT -1 109#define TCP_LRO_NOT_SUPPORTED 1 110 111#endif /* _TCP_LRO_H_ */ |