t4_sge.c (237263) | t4_sge.c (237436) |
---|---|
1/*- 2 * Copyright (c) 2011 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) 2011 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/t4_sge.c 237263 2012-06-19 07:34:13Z np $"); | 29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/t4_sge.c 237436 2012-06-22 07:51:15Z np $"); |
30 31#include "opt_inet.h" 32 33#include <sys/types.h> 34#include <sys/mbuf.h> 35#include <sys/socket.h> 36#include <sys/kernel.h> 37#include <sys/kdb.h> --- 1152 unchanged lines hidden (view full) --- 1190#define TXPKT_WR_HDR ((\ 1191 sizeof(struct fw_eth_tx_pkt_wr) + \ 1192 sizeof(struct cpl_tx_pkt_core) \ 1193 ) / 8 ) 1194 1195/* Header of a tx LSO WR, before SGL of first packet (in flits) */ 1196#define TXPKT_LSO_WR_HDR ((\ 1197 sizeof(struct fw_eth_tx_pkt_wr) + \ | 30 31#include "opt_inet.h" 32 33#include <sys/types.h> 34#include <sys/mbuf.h> 35#include <sys/socket.h> 36#include <sys/kernel.h> 37#include <sys/kdb.h> --- 1152 unchanged lines hidden (view full) --- 1190#define TXPKT_WR_HDR ((\ 1191 sizeof(struct fw_eth_tx_pkt_wr) + \ 1192 sizeof(struct cpl_tx_pkt_core) \ 1193 ) / 8 ) 1194 1195/* Header of a tx LSO WR, before SGL of first packet (in flits) */ 1196#define TXPKT_LSO_WR_HDR ((\ 1197 sizeof(struct fw_eth_tx_pkt_wr) + \ |
1198 sizeof(struct cpl_tx_pkt_lso) + \ | 1198 sizeof(struct cpl_tx_pkt_lso_core) + \ |
1199 sizeof(struct cpl_tx_pkt_core) \ 1200 ) / 8 ) 1201 1202int 1203t4_eth_tx(struct ifnet *ifp, struct sge_txq *txq, struct mbuf *m) 1204{ 1205 struct port_info *pi = (void *)ifp->if_softc; 1206 struct adapter *sc = pi->adapter; --- 1545 unchanged lines hidden (view full) --- 2752 pktlen = m->m_pkthdr.len; 2753 2754 /* 2755 * Do we have enough flits to send this frame out? 2756 */ 2757 ctrl = sizeof(struct cpl_tx_pkt_core); 2758 if (m->m_pkthdr.tso_segsz) { 2759 nflits = TXPKT_LSO_WR_HDR; | 1199 sizeof(struct cpl_tx_pkt_core) \ 1200 ) / 8 ) 1201 1202int 1203t4_eth_tx(struct ifnet *ifp, struct sge_txq *txq, struct mbuf *m) 1204{ 1205 struct port_info *pi = (void *)ifp->if_softc; 1206 struct adapter *sc = pi->adapter; --- 1545 unchanged lines hidden (view full) --- 2752 pktlen = m->m_pkthdr.len; 2753 2754 /* 2755 * Do we have enough flits to send this frame out? 2756 */ 2757 ctrl = sizeof(struct cpl_tx_pkt_core); 2758 if (m->m_pkthdr.tso_segsz) { 2759 nflits = TXPKT_LSO_WR_HDR; |
2760 ctrl += sizeof(struct cpl_tx_pkt_lso); | 2760 ctrl += sizeof(struct cpl_tx_pkt_lso_core); |
2761 } else 2762 nflits = TXPKT_WR_HDR; 2763 if (sgl->nsegs > 0) 2764 nflits += sgl->nflits; 2765 else { 2766 nflits += howmany(pktlen, 8); 2767 ctrl += pktlen; 2768 } --- 13 unchanged lines hidden (view full) --- 2782 } 2783 eq->flags |= EQ_STALLED; 2784 } 2785 2786 wr->equiq_to_len16 = htobe32(ctrl); 2787 wr->r3 = 0; 2788 2789 if (m->m_pkthdr.tso_segsz) { | 2761 } else 2762 nflits = TXPKT_WR_HDR; 2763 if (sgl->nsegs > 0) 2764 nflits += sgl->nflits; 2765 else { 2766 nflits += howmany(pktlen, 8); 2767 ctrl += pktlen; 2768 } --- 13 unchanged lines hidden (view full) --- 2782 } 2783 eq->flags |= EQ_STALLED; 2784 } 2785 2786 wr->equiq_to_len16 = htobe32(ctrl); 2787 wr->r3 = 0; 2788 2789 if (m->m_pkthdr.tso_segsz) { |
2790 struct cpl_tx_pkt_lso *lso = (void *)(wr + 1); | 2790 struct cpl_tx_pkt_lso_core *lso = (void *)(wr + 1); |
2791 struct ether_header *eh; 2792 struct ip *ip; 2793 struct tcphdr *tcp; 2794 2795 ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | F_LSO_FIRST_SLICE | 2796 F_LSO_LAST_SLICE; 2797 2798 eh = mtod(m, struct ether_header *); --- 601 unchanged lines hidden --- | 2791 struct ether_header *eh; 2792 struct ip *ip; 2793 struct tcphdr *tcp; 2794 2795 ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | F_LSO_FIRST_SLICE | 2796 F_LSO_LAST_SLICE; 2797 2798 eh = mtod(m, struct ether_header *); --- 601 unchanged lines hidden --- |