Deleted Added
full compact
t4_ddp.c (256281) t4_ddp.c (270297)
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: stable/10/sys/dev/cxgbe/tom/t4_ddp.c 251638 2013-06-11 21:20:23Z np $");
29__FBSDID("$FreeBSD: stable/10/sys/dev/cxgbe/tom/t4_ddp.c 270297 2014-08-21 19:54:02Z np $");
30
31#include "opt_inet.h"
32
33#include <sys/param.h>
34#include <sys/types.h>
35#include <sys/systm.h>
36#include <sys/kernel.h>
37#include <sys/ktr.h>

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

488static int
489do_rx_data_ddp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
490{
491 struct adapter *sc = iq->adapter;
492 const struct cpl_rx_data_ddp *cpl = (const void *)(rss + 1);
493 unsigned int tid = GET_TID(cpl);
494 uint32_t vld;
495 struct toepcb *toep = lookup_tid(sc, tid);
30
31#include "opt_inet.h"
32
33#include <sys/param.h>
34#include <sys/types.h>
35#include <sys/systm.h>
36#include <sys/kernel.h>
37#include <sys/ktr.h>

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

488static int
489do_rx_data_ddp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
490{
491 struct adapter *sc = iq->adapter;
492 const struct cpl_rx_data_ddp *cpl = (const void *)(rss + 1);
493 unsigned int tid = GET_TID(cpl);
494 uint32_t vld;
495 struct toepcb *toep = lookup_tid(sc, tid);
496 struct tom_data *td = toep->td;
496
497 KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__));
498 KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__));
499 KASSERT(!(toep->flags & TPF_SYNQE),
500 ("%s: toep %p claims to be a synq entry", __func__, toep));
501
502 vld = be32toh(cpl->ddpvld);
503 if (__predict_false(vld & DDP_ERR)) {
504 panic("%s: DDP error 0x%x (tid %d, toep %p)",
505 __func__, vld, tid, toep);
506 }
497
498 KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__));
499 KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__));
500 KASSERT(!(toep->flags & TPF_SYNQE),
501 ("%s: toep %p claims to be a synq entry", __func__, toep));
502
503 vld = be32toh(cpl->ddpvld);
504 if (__predict_false(vld & DDP_ERR)) {
505 panic("%s: DDP error 0x%x (tid %d, toep %p)",
506 __func__, vld, tid, toep);
507 }
508 if (toep->ulp_mode == ULP_MODE_ISCSI) {
509 m = m_get(M_NOWAIT, MT_DATA);
510 if (m == NULL)
511 CXGBE_UNIMPLEMENTED("mbuf alloc failure");
512 memcpy(mtod(m, unsigned char *), cpl,
513 sizeof(struct cpl_rx_data_ddp));
514 if (!t4_cpl_iscsi_callback(td, toep, m, CPL_RX_DATA_DDP))
515 return (0);
516 m_freem(m);
517 }
507
508 handle_ddp_data(toep, cpl->u.ddp_report, cpl->seq, be16toh(cpl->len));
509
510 return (0);
511}
512
513static int
514do_rx_ddp_complete(struct sge_iq *iq, const struct rss_header *rss,

--- 771 unchanged lines hidden ---
518
519 handle_ddp_data(toep, cpl->u.ddp_report, cpl->seq, be16toh(cpl->len));
520
521 return (0);
522}
523
524static int
525do_rx_ddp_complete(struct sge_iq *iq, const struct rss_header *rss,

--- 771 unchanged lines hidden ---