Deleted Added
full compact
t4_cpl_io.c (251638) t4_cpl_io.c (255005)
1/*-
2 * Copyright (c) 2012 Chelsio Communications, Inc.
3 * All rights reserved.
4 * Written by: Navdeep Parhar <np@FreeBSD.org>
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:

--- 12 unchanged lines hidden (view full) ---

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 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2012 Chelsio Communications, Inc.
3 * All rights reserved.
4 * Written by: Navdeep Parhar <np@FreeBSD.org>
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:

--- 12 unchanged lines hidden (view full) ---

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 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/tom/t4_cpl_io.c 251638 2013-06-11 21:20:23Z np $");
29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/tom/t4_cpl_io.c 255005 2013-08-28 20:45:45Z np $");
30
31#include "opt_inet.h"
32
33#ifdef TCP_OFFLOAD
34#include <sys/param.h>
35#include <sys/types.h>
36#include <sys/kernel.h>
37#include <sys/ktr.h>

--- 505 unchanged lines hidden (view full) ---

543 struct sockbuf *sb = &so->so_snd;
544 int tx_credits;
545 struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx];
546
547 INP_WLOCK_ASSERT(inp);
548 KASSERT(toep->flags & TPF_FLOWC_WR_SENT,
549 ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid));
550
30
31#include "opt_inet.h"
32
33#ifdef TCP_OFFLOAD
34#include <sys/param.h>
35#include <sys/types.h>
36#include <sys/kernel.h>
37#include <sys/ktr.h>

--- 505 unchanged lines hidden (view full) ---

543 struct sockbuf *sb = &so->so_snd;
544 int tx_credits;
545 struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx];
546
547 INP_WLOCK_ASSERT(inp);
548 KASSERT(toep->flags & TPF_FLOWC_WR_SENT,
549 ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid));
550
551 if (__predict_false(toep->ulp_mode != ULP_MODE_NONE &&
552 toep->ulp_mode != ULP_MODE_TCPDDP))
553 CXGBE_UNIMPLEMENTED("ulp_mode");
551 KASSERT(toep->ulp_mode == ULP_MODE_NONE ||
552 toep->ulp_mode == ULP_MODE_TCPDDP ||
553 toep->ulp_mode == ULP_MODE_RDMA,
554 ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep));
554
555 /*
556 * This function doesn't resume by itself. Someone else must clear the
557 * flag and call this function.
558 */
559 if (__predict_false(toep->flags & TPF_TX_SUSPENDED))
560 return;
561

--- 276 unchanged lines hidden (view full) ---

838#ifdef USE_DDP_RX_FLOW_CONTROL
839 toep->rx_credits -= m->m_len; /* adjust for F_RX_FC_DDP */
840#endif
841 sbappendstream_locked(sb, m);
842 toep->sb_cc = sb->sb_cc;
843 }
844 socantrcvmore_locked(so); /* unlocks the sockbuf */
845
555
556 /*
557 * This function doesn't resume by itself. Someone else must clear the
558 * flag and call this function.
559 */
560 if (__predict_false(toep->flags & TPF_TX_SUSPENDED))
561 return;
562

--- 276 unchanged lines hidden (view full) ---

839#ifdef USE_DDP_RX_FLOW_CONTROL
840 toep->rx_credits -= m->m_len; /* adjust for F_RX_FC_DDP */
841#endif
842 sbappendstream_locked(sb, m);
843 toep->sb_cc = sb->sb_cc;
844 }
845 socantrcvmore_locked(so); /* unlocks the sockbuf */
846
846 KASSERT(tp->rcv_nxt == be32toh(cpl->rcv_nxt),
847 ("%s: rcv_nxt mismatch: %u %u", __func__, tp->rcv_nxt,
848 be32toh(cpl->rcv_nxt)));
847 if (toep->ulp_mode != ULP_MODE_RDMA) {
848 KASSERT(tp->rcv_nxt == be32toh(cpl->rcv_nxt),
849 ("%s: rcv_nxt mismatch: %u %u", __func__, tp->rcv_nxt,
850 be32toh(cpl->rcv_nxt)));
851 }
849
850 switch (tp->t_state) {
851 case TCPS_SYN_RECEIVED:
852 tp->t_starttime = ticks;
853 /* FALLTHROUGH */
854
855 case TCPS_ESTABLISHED:
856 tp->t_state = TCPS_CLOSE_WAIT;

--- 599 unchanged lines hidden ---
852
853 switch (tp->t_state) {
854 case TCPS_SYN_RECEIVED:
855 tp->t_starttime = ticks;
856 /* FALLTHROUGH */
857
858 case TCPS_ESTABLISHED:
859 tp->t_state = TCPS_CLOSE_WAIT;

--- 599 unchanged lines hidden ---