Deleted Added
full compact
oce_if.c (271551) oce_if.c (271849)
1/*-
2 * Copyright (C) 2013 Emulex
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

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

31 * Contact Information:
32 * freebsd-drivers@emulex.com
33 *
34 * Emulex
35 * 3333 Susan Street
36 * Costa Mesa, CA 92626
37 */
38
1/*-
2 * Copyright (C) 2013 Emulex
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

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

31 * Contact Information:
32 * freebsd-drivers@emulex.com
33 *
34 * Emulex
35 * 3333 Susan Street
36 * Costa Mesa, CA 92626
37 */
38
39/* $FreeBSD: head/sys/dev/oce/oce_if.c 271551 2014-09-13 20:52:01Z hselasky $ */
39/* $FreeBSD: head/sys/dev/oce/oce_if.c 271849 2014-09-19 03:51:26Z glebius $ */
40
41#include "opt_inet6.h"
42#include "opt_inet.h"
43
44#include "oce_if.h"
45
46/* UE Status Low CSR */
47static char *ue_status_low_desc[] = {

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

984 nicfrag->u0.dw[2] = 0;
985 nicfrag->u0.dw[3] = 0;
986 pd->wqe_idx = wq->ring->pidx;
987 RING_PUT(wq->ring, 1);
988 atomic_add_int(&wq->ring->num_used, 1);
989 pd->nsegs++;
990 }
991
40
41#include "opt_inet6.h"
42#include "opt_inet.h"
43
44#include "oce_if.h"
45
46/* UE Status Low CSR */
47static char *ue_status_low_desc[] = {

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

984 nicfrag->u0.dw[2] = 0;
985 nicfrag->u0.dw[3] = 0;
986 pd->wqe_idx = wq->ring->pidx;
987 RING_PUT(wq->ring, 1);
988 atomic_add_int(&wq->ring->num_used, 1);
989 pd->nsegs++;
990 }
991
992 sc->ifp->if_opackets++;
992 if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1);
993 wq->tx_stats.tx_reqs++;
994 wq->tx_stats.tx_wrbs += num_wqes;
995 wq->tx_stats.tx_bytes += m->m_pkthdr.len;
996 wq->tx_stats.tx_pkts++;
997
998 bus_dmamap_sync(wq->ring->dma.tag, wq->ring->dma.map,
999 BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
1000 reg_value = (num_wqes << 16) | wq->wq_id;

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

1270 } else {
1271 drbr_putback(ifp, br, next);
1272 wq->tx_stats.tx_stops ++;
1273 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1274 }
1275 break;
1276 }
1277 drbr_advance(ifp, br);
993 wq->tx_stats.tx_reqs++;
994 wq->tx_stats.tx_wrbs += num_wqes;
995 wq->tx_stats.tx_bytes += m->m_pkthdr.len;
996 wq->tx_stats.tx_pkts++;
997
998 bus_dmamap_sync(wq->ring->dma.tag, wq->ring->dma.map,
999 BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
1000 reg_value = (num_wqes << 16) | wq->wq_id;

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

1270 } else {
1271 drbr_putback(ifp, br, next);
1272 wq->tx_stats.tx_stops ++;
1273 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1274 }
1275 break;
1276 }
1277 drbr_advance(ifp, br);
1278 ifp->if_obytes += next->m_pkthdr.len;
1278 if_inc_counter(ifp, IFCOUNTER_OBYTES, next->m_pkthdr.len);
1279 if (next->m_flags & M_MCAST)
1279 if (next->m_flags & M_MCAST)
1280 ifp->if_omcasts++;
1280 if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1);
1281 ETHER_BPF_MTAP(ifp, next);
1282 }
1283
1284 return 0;
1285}
1286
1287
1288

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

1389 hw. But in some cases we have seen it comes
1390 with pvid. So if pvid == vlan, neglect vlan.
1391 */
1392 m->m_pkthdr.ether_vtag = vtag;
1393 m->m_flags |= M_VLANTAG;
1394 }
1395 }
1396
1281 ETHER_BPF_MTAP(ifp, next);
1282 }
1283
1284 return 0;
1285}
1286
1287
1288

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

1389 hw. But in some cases we have seen it comes
1390 with pvid. So if pvid == vlan, neglect vlan.
1391 */
1392 m->m_pkthdr.ether_vtag = vtag;
1393 m->m_flags |= M_VLANTAG;
1394 }
1395 }
1396
1397 sc->ifp->if_ipackets++;
1397 if_inc_counter(sc->ifp, IFCOUNTER_IPACKETS, 1);
1398#if defined(INET6) || defined(INET)
1399 /* Try to queue to LRO */
1400 if (IF_LRO_ENABLED(sc) &&
1401 (cqe->u0.s.ip_cksum_pass) &&
1402 (cqe->u0.s.l4_cksum_pass) &&
1403 (!cqe->u0.s.ip_ver) &&
1404 (rq->lro.lro_cnt != 0)) {
1405

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

1632 while (cqe->u0.dw[2]) {
1633 DW_SWAP((uint32_t *) cqe, sizeof(oce_rq_cqe));
1634
1635 RING_GET(rq->ring, 1);
1636 if (cqe->u0.s.error == 0) {
1637 oce_rx(rq, cqe->u0.s.frag_index, cqe);
1638 } else {
1639 rq->rx_stats.rxcp_err++;
1398#if defined(INET6) || defined(INET)
1399 /* Try to queue to LRO */
1400 if (IF_LRO_ENABLED(sc) &&
1401 (cqe->u0.s.ip_cksum_pass) &&
1402 (cqe->u0.s.l4_cksum_pass) &&
1403 (!cqe->u0.s.ip_ver) &&
1404 (rq->lro.lro_cnt != 0)) {
1405

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

1632 while (cqe->u0.dw[2]) {
1633 DW_SWAP((uint32_t *) cqe, sizeof(oce_rq_cqe));
1634
1635 RING_GET(rq->ring, 1);
1636 if (cqe->u0.s.error == 0) {
1637 oce_rx(rq, cqe->u0.s.frag_index, cqe);
1638 } else {
1639 rq->rx_stats.rxcp_err++;
1640 sc->ifp->if_ierrors++;
1640 if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1);
1641 /* Post L3/L4 errors to stack.*/
1642 oce_rx(rq, cqe->u0.s.frag_index, cqe);
1643 }
1644 rq->rx_stats.rx_compl++;
1645 cqe->u0.dw[2] = 0;
1646
1647#if defined(INET6) || defined(INET)
1648 if (IF_LRO_ENABLED(sc) && rq->lro_pkts_queued >= 16) {

--- 709 unchanged lines hidden ---
1641 /* Post L3/L4 errors to stack.*/
1642 oce_rx(rq, cqe->u0.s.frag_index, cqe);
1643 }
1644 rq->rx_stats.rx_compl++;
1645 cqe->u0.dw[2] = 0;
1646
1647#if defined(INET6) || defined(INET)
1648 if (IF_LRO_ENABLED(sc) && rq->lro_pkts_queued >= 16) {

--- 709 unchanged lines hidden ---