Deleted Added
full compact
sfxge_tx.c (279179) sfxge_tx.c (279184)
1/*-
2 * Copyright (c) 2010-2011 Solarflare Communications, Inc.
3 * All rights reserved.
4 *
5 * This software was developed in part by Philip Paeps under contract for
6 * Solarflare Communications, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

38 *
39 * So, event queue plus label mapping to Tx queue index is:
40 * if event queue index is 0, TxQ-index = TxQ-label * [0..SFXGE_TXQ_NTYPES)
41 * else TxQ-index = SFXGE_TXQ_NTYPES + EvQ-index - 1
42 * See sfxge_get_txq_by_label() sfxge_ev.c
43 */
44
45#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2010-2011 Solarflare Communications, Inc.
3 * All rights reserved.
4 *
5 * This software was developed in part by Philip Paeps under contract for
6 * Solarflare Communications, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

38 *
39 * So, event queue plus label mapping to Tx queue index is:
40 * if event queue index is 0, TxQ-index = TxQ-label * [0..SFXGE_TXQ_NTYPES)
41 * else TxQ-index = SFXGE_TXQ_NTYPES + EvQ-index - 1
42 * See sfxge_get_txq_by_label() sfxge_ev.c
43 */
44
45#include <sys/cdefs.h>
46__FBSDID("$FreeBSD: head/sys/dev/sfxge/sfxge_tx.c 279179 2015-02-22 18:56:03Z arybchik $");
46__FBSDID("$FreeBSD: head/sys/dev/sfxge/sfxge_tx.c 279184 2015-02-22 19:25:57Z arybchik $");
47
48#include <sys/types.h>
49#include <sys/mbuf.h>
50#include <sys/smp.h>
51#include <sys/socket.h>
52#include <sys/sysctl.h>
53#include <sys/syslog.h>
54

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

1561 ctx, stat_list,
1562 OID_AUTO, sfxge_tx_stats[id].name,
1563 CTLTYPE_ULONG|CTLFLAG_RD,
1564 sc, id, sfxge_tx_stat_handler, "LU",
1565 "");
1566 }
1567}
1568
47
48#include <sys/types.h>
49#include <sys/mbuf.h>
50#include <sys/smp.h>
51#include <sys/socket.h>
52#include <sys/sysctl.h>
53#include <sys/syslog.h>
54

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

1561 ctx, stat_list,
1562 OID_AUTO, sfxge_tx_stats[id].name,
1563 CTLTYPE_ULONG|CTLFLAG_RD,
1564 sc, id, sfxge_tx_stat_handler, "LU",
1565 "");
1566 }
1567}
1568
1569uint64_t
1570sfxge_tx_get_drops(struct sfxge_softc *sc)
1571{
1572 unsigned int index;
1573 uint64_t drops = 0;
1574 struct sfxge_txq *txq;
1575
1576 /* Sum across all TX queues */
1577 for (index = 0; index < sc->txq_count; index++) {
1578 txq = sc->txq[index];
1579 /*
1580 * In theory, txq->put_overflow and txq->netdown_drops
1581 * should use atomic operation and other should be
1582 * obtained under txq lock, but it is just statistics.
1583 */
1584 drops += txq->drops + txq->get_overflow +
1585 txq->get_non_tcp_overflow +
1586 txq->put_overflow + txq->netdown_drops +
1587 txq->tso_pdrop_too_many + txq->tso_pdrop_no_rsrc;
1588 }
1589 return (drops);
1590}
1591
1569void
1570sfxge_tx_fini(struct sfxge_softc *sc)
1571{
1572 int index;
1573
1574 index = sc->txq_count;
1575 while (--index >= 0)
1576 sfxge_tx_qfini(sc, index);

--- 67 unchanged lines hidden ---
1592void
1593sfxge_tx_fini(struct sfxge_softc *sc)
1594{
1595 int index;
1596
1597 index = sc->txq_count;
1598 while (--index >= 0)
1599 sfxge_tx_qfini(sc, index);

--- 67 unchanged lines hidden ---