mxge: cleanup from purging EOL release compatibility
The FreeBSD version was being used to trigger preprocessor conditionals IFNET_BUF_RING and MXGE_VIRT_JUMBOS. Since those are no longer conditional, purge their effects. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/603 Differential Revision: https://reviews.freebsd.org/D35560
This commit is contained in:
parent
c98b837ad0
commit
6147584bc0
@ -92,9 +92,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <dev/mxge/mcp_gen_header.h>
|
#include <dev/mxge/mcp_gen_header.h>
|
||||||
/*#define MXGE_FAKE_IFP*/
|
/*#define MXGE_FAKE_IFP*/
|
||||||
#include <dev/mxge/if_mxge_var.h>
|
#include <dev/mxge/if_mxge_var.h>
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
#include <sys/buf_ring.h>
|
#include <sys/buf_ring.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_inet6.h"
|
#include "opt_inet6.h"
|
||||||
@ -1225,9 +1223,7 @@ mxge_reset(mxge_softc_t *sc, int interrupts_setup)
|
|||||||
*/
|
*/
|
||||||
cmd.data0 = sc->num_slices;
|
cmd.data0 = sc->num_slices;
|
||||||
cmd.data1 = MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE;
|
cmd.data1 = MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE;
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
cmd.data1 |= MXGEFW_SLICE_ENABLE_MULTIPLE_TX_QUEUES;
|
cmd.data1 |= MXGEFW_SLICE_ENABLE_MULTIPLE_TX_QUEUES;
|
||||||
#endif
|
|
||||||
status = mxge_send_cmd(sc, MXGEFW_CMD_ENABLE_RSS_QUEUES,
|
status = mxge_send_cmd(sc, MXGEFW_CMD_ENABLE_RSS_QUEUES,
|
||||||
&cmd);
|
&cmd);
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
@ -1605,11 +1601,6 @@ mxge_add_sysctls(mxge_softc_t *sc)
|
|||||||
0, "number of frames appended to lro merge"
|
0, "number of frames appended to lro merge"
|
||||||
"queues");
|
"queues");
|
||||||
|
|
||||||
#ifndef IFNET_BUF_RING
|
|
||||||
/* only transmit from slice 0 for now */
|
|
||||||
if (slice > 0)
|
|
||||||
continue;
|
|
||||||
#endif
|
|
||||||
SYSCTL_ADD_INT(ctx, children, OID_AUTO,
|
SYSCTL_ADD_INT(ctx, children, OID_AUTO,
|
||||||
"tx_req",
|
"tx_req",
|
||||||
CTLFLAG_RD, &ss->tx.req,
|
CTLFLAG_RD, &ss->tx.req,
|
||||||
@ -1964,7 +1955,7 @@ mxge_encap_tso(struct mxge_slice_state *ss, struct mbuf *m,
|
|||||||
|
|
||||||
tx->info[((cnt - 1) + tx->req) & tx->mask].flag = 1;
|
tx->info[((cnt - 1) + tx->req) & tx->mask].flag = 1;
|
||||||
mxge_submit_req(tx, tx->req_list, cnt);
|
mxge_submit_req(tx, tx->req_list, cnt);
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
if ((ss->sc->num_slices > 1) && tx->queue_active == 0) {
|
if ((ss->sc->num_slices > 1) && tx->queue_active == 0) {
|
||||||
/* tell the NIC to start polling this slice */
|
/* tell the NIC to start polling this slice */
|
||||||
*tx->send_go = 1;
|
*tx->send_go = 1;
|
||||||
@ -1972,7 +1963,7 @@ mxge_encap_tso(struct mxge_slice_state *ss, struct mbuf *m,
|
|||||||
tx->activate++;
|
tx->activate++;
|
||||||
wmb();
|
wmb();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drop:
|
drop:
|
||||||
@ -2170,7 +2161,7 @@ mxge_encap(struct mxge_slice_state *ss, struct mbuf *m)
|
|||||||
#endif
|
#endif
|
||||||
tx->info[((cnt - 1) + tx->req) & tx->mask].flag = 1;
|
tx->info[((cnt - 1) + tx->req) & tx->mask].flag = 1;
|
||||||
mxge_submit_req(tx, tx->req_list, cnt);
|
mxge_submit_req(tx, tx->req_list, cnt);
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
if ((ss->sc->num_slices > 1) && tx->queue_active == 0) {
|
if ((ss->sc->num_slices > 1) && tx->queue_active == 0) {
|
||||||
/* tell the NIC to start polling this slice */
|
/* tell the NIC to start polling this slice */
|
||||||
*tx->send_go = 1;
|
*tx->send_go = 1;
|
||||||
@ -2178,7 +2169,7 @@ mxge_encap(struct mxge_slice_state *ss, struct mbuf *m)
|
|||||||
tx->activate++;
|
tx->activate++;
|
||||||
wmb();
|
wmb();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drop:
|
drop:
|
||||||
@ -2188,7 +2179,6 @@ mxge_encap(struct mxge_slice_state *ss, struct mbuf *m)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
static void
|
static void
|
||||||
mxge_qflush(struct ifnet *ifp)
|
mxge_qflush(struct ifnet *ifp)
|
||||||
{
|
{
|
||||||
@ -2295,37 +2285,6 @@ mxge_transmit(struct ifnet *ifp, struct mbuf *m)
|
|||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
mxge_start_locked(struct mxge_slice_state *ss)
|
|
||||||
{
|
|
||||||
mxge_softc_t *sc;
|
|
||||||
struct mbuf *m;
|
|
||||||
struct ifnet *ifp;
|
|
||||||
mxge_tx_ring_t *tx;
|
|
||||||
|
|
||||||
sc = ss->sc;
|
|
||||||
ifp = sc->ifp;
|
|
||||||
tx = &ss->tx;
|
|
||||||
while ((tx->mask - (tx->req - tx->done)) > tx->max_desc) {
|
|
||||||
IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
|
|
||||||
if (m == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/* let BPF see it */
|
|
||||||
BPF_MTAP(ifp, m);
|
|
||||||
|
|
||||||
/* give it to the nic */
|
|
||||||
mxge_encap(ss, m);
|
|
||||||
}
|
|
||||||
/* ran out of transmit slots */
|
|
||||||
if ((sc->ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) {
|
|
||||||
sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE;
|
|
||||||
tx->stall++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
static void
|
static void
|
||||||
mxge_start(struct ifnet *ifp)
|
mxge_start(struct ifnet *ifp)
|
||||||
{
|
{
|
||||||
@ -2423,15 +2382,6 @@ mxge_get_buf_big(struct mxge_slice_state *ss, bus_dmamap_t map, int idx)
|
|||||||
rx->shadow[idx].addr_high =
|
rx->shadow[idx].addr_high =
|
||||||
htobe32(MXGE_HIGHPART_TO_U32(seg->ds_addr));
|
htobe32(MXGE_HIGHPART_TO_U32(seg->ds_addr));
|
||||||
|
|
||||||
#if MXGE_VIRT_JUMBOS
|
|
||||||
for (i = 1; i < cnt; i++) {
|
|
||||||
rx->shadow[idx + i].addr_low =
|
|
||||||
htobe32(MXGE_LOWPART_TO_U32(seg[i].ds_addr));
|
|
||||||
rx->shadow[idx + i].addr_high =
|
|
||||||
htobe32(MXGE_HIGHPART_TO_U32(seg[i].ds_addr));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
for (i = 0; i < rx->nbufs; i++) {
|
for (i = 0; i < rx->nbufs; i++) {
|
||||||
if ((idx & 7) == 7) {
|
if ((idx & 7) == 7) {
|
||||||
@ -2804,11 +2754,8 @@ mxge_tx_done(struct mxge_slice_state *ss, uint32_t mcp_idx)
|
|||||||
|
|
||||||
/* If we have space, clear IFF_OACTIVE to tell the stack that
|
/* If we have space, clear IFF_OACTIVE to tell the stack that
|
||||||
its OK to send packets */
|
its OK to send packets */
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
flags = &ss->if_drv_flags;
|
flags = &ss->if_drv_flags;
|
||||||
#else
|
|
||||||
flags = &ifp->if_drv_flags;
|
|
||||||
#endif
|
|
||||||
mtx_lock(&ss->tx.mtx);
|
mtx_lock(&ss->tx.mtx);
|
||||||
if ((*flags) & IFF_DRV_OACTIVE &&
|
if ((*flags) & IFF_DRV_OACTIVE &&
|
||||||
tx->req - tx->done < (tx->mask + 1)/4) {
|
tx->req - tx->done < (tx->mask + 1)/4) {
|
||||||
@ -2816,7 +2763,6 @@ mxge_tx_done(struct mxge_slice_state *ss, uint32_t mcp_idx)
|
|||||||
ss->tx.wake++;
|
ss->tx.wake++;
|
||||||
mxge_start_locked(ss);
|
mxge_start_locked(ss);
|
||||||
}
|
}
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
if ((ss->sc->num_slices > 1) && (tx->req == tx->done)) {
|
if ((ss->sc->num_slices > 1) && (tx->req == tx->done)) {
|
||||||
/* let the NIC stop polling this queue, since there
|
/* let the NIC stop polling this queue, since there
|
||||||
* are no more transmits pending */
|
* are no more transmits pending */
|
||||||
@ -2827,9 +2773,7 @@ mxge_tx_done(struct mxge_slice_state *ss, uint32_t mcp_idx)
|
|||||||
wmb();
|
wmb();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
mtx_unlock(&ss->tx.mtx);
|
mtx_unlock(&ss->tx.mtx);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mxge_media_type mxge_xfp_media_types[] =
|
static struct mxge_media_type mxge_xfp_media_types[] =
|
||||||
@ -3029,16 +2973,6 @@ mxge_intr(void *arg)
|
|||||||
uint32_t send_done_count;
|
uint32_t send_done_count;
|
||||||
uint8_t valid;
|
uint8_t valid;
|
||||||
|
|
||||||
#ifndef IFNET_BUF_RING
|
|
||||||
/* an interrupt on a non-zero slice is implicitly valid
|
|
||||||
since MSI-X irqs are not shared */
|
|
||||||
if (ss != sc->ss) {
|
|
||||||
mxge_clean_rx_done(ss);
|
|
||||||
*ss->irq_claim = be32toh(3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* make sure the DMA has finished */
|
/* make sure the DMA has finished */
|
||||||
if (!stats->valid) {
|
if (!stats->valid) {
|
||||||
return;
|
return;
|
||||||
@ -3291,22 +3225,13 @@ mxge_alloc_slice_rings(struct mxge_slice_state *ss, int rx_ring_entries,
|
|||||||
|
|
||||||
err = bus_dma_tag_create(sc->parent_dmat, /* parent */
|
err = bus_dma_tag_create(sc->parent_dmat, /* parent */
|
||||||
1, /* alignment */
|
1, /* alignment */
|
||||||
#if MXGE_VIRT_JUMBOS
|
|
||||||
4096, /* boundary */
|
|
||||||
#else
|
|
||||||
0, /* boundary */
|
0, /* boundary */
|
||||||
#endif
|
|
||||||
BUS_SPACE_MAXADDR, /* low */
|
BUS_SPACE_MAXADDR, /* low */
|
||||||
BUS_SPACE_MAXADDR, /* high */
|
BUS_SPACE_MAXADDR, /* high */
|
||||||
NULL, NULL, /* filter */
|
NULL, NULL, /* filter */
|
||||||
3*4096, /* maxsize */
|
3*4096, /* maxsize */
|
||||||
#if MXGE_VIRT_JUMBOS
|
|
||||||
3, /* num segs */
|
|
||||||
4096, /* maxsegsize*/
|
|
||||||
#else
|
|
||||||
1, /* num segs */
|
1, /* num segs */
|
||||||
MJUM9BYTES, /* maxsegsize*/
|
MJUM9BYTES, /* maxsegsize*/
|
||||||
#endif
|
|
||||||
BUS_DMA_ALLOCNOW, /* flags */
|
BUS_DMA_ALLOCNOW, /* flags */
|
||||||
NULL, NULL, /* lock */
|
NULL, NULL, /* lock */
|
||||||
&ss->rx_big.dmat); /* tag */
|
&ss->rx_big.dmat); /* tag */
|
||||||
@ -3351,12 +3276,6 @@ mxge_alloc_slice_rings(struct mxge_slice_state *ss, int rx_ring_entries,
|
|||||||
|
|
||||||
/* now allocate TX resources */
|
/* now allocate TX resources */
|
||||||
|
|
||||||
#ifndef IFNET_BUF_RING
|
|
||||||
/* only use a single TX ring for now */
|
|
||||||
if (ss != ss->sc->ss)
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ss->tx.mask = tx_ring_entries - 1;
|
ss->tx.mask = tx_ring_entries - 1;
|
||||||
ss->tx.max_desc = MIN(MXGE_MAX_SEND_DESC, tx_ring_entries / 4);
|
ss->tx.max_desc = MIN(MXGE_MAX_SEND_DESC, tx_ring_entries / 4);
|
||||||
|
|
||||||
@ -3469,19 +3388,9 @@ mxge_choose_params(int mtu, int *big_buf_size, int *cl_size, int *nbufs)
|
|||||||
*nbufs = 1;
|
*nbufs = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if MXGE_VIRT_JUMBOS
|
|
||||||
/* now we need to use virtually contiguous buffers */
|
|
||||||
*cl_size = MJUM9BYTES;
|
|
||||||
*big_buf_size = 4096;
|
|
||||||
*nbufs = mtu / 4096 + 1;
|
|
||||||
/* needs to be a power of two, so round up */
|
|
||||||
if (*nbufs == 3)
|
|
||||||
*nbufs = 4;
|
|
||||||
#else
|
|
||||||
*cl_size = MJUM9BYTES;
|
*cl_size = MJUM9BYTES;
|
||||||
*big_buf_size = MJUM9BYTES;
|
*big_buf_size = MJUM9BYTES;
|
||||||
*nbufs = 1;
|
*nbufs = 1;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -3503,21 +3412,16 @@ mxge_slice_open(struct mxge_slice_state *ss, int nbufs, int cl_size)
|
|||||||
/* get the lanai pointers to the send and receive rings */
|
/* get the lanai pointers to the send and receive rings */
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
#ifndef IFNET_BUF_RING
|
|
||||||
/* We currently only send from the first slice */
|
cmd.data0 = slice;
|
||||||
if (slice == 0) {
|
err = mxge_send_cmd(sc, MXGEFW_CMD_GET_SEND_OFFSET, &cmd);
|
||||||
#endif
|
ss->tx.lanai =
|
||||||
cmd.data0 = slice;
|
(volatile mcp_kreq_ether_send_t *)(sc->sram + cmd.data0);
|
||||||
err = mxge_send_cmd(sc, MXGEFW_CMD_GET_SEND_OFFSET, &cmd);
|
ss->tx.send_go = (volatile uint32_t *)
|
||||||
ss->tx.lanai =
|
(sc->sram + MXGEFW_ETH_SEND_GO + 64 * slice);
|
||||||
(volatile mcp_kreq_ether_send_t *)(sc->sram + cmd.data0);
|
ss->tx.send_stop = (volatile uint32_t *)
|
||||||
ss->tx.send_go = (volatile uint32_t *)
|
(sc->sram + MXGEFW_ETH_SEND_STOP + 64 * slice);
|
||||||
(sc->sram + MXGEFW_ETH_SEND_GO + 64 * slice);
|
|
||||||
ss->tx.send_stop = (volatile uint32_t *)
|
|
||||||
(sc->sram + MXGEFW_ETH_SEND_STOP + 64 * slice);
|
|
||||||
#ifndef IFNET_BUF_RING
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
cmd.data0 = slice;
|
cmd.data0 = slice;
|
||||||
err |= mxge_send_cmd(sc,
|
err |= mxge_send_cmd(sc,
|
||||||
MXGEFW_CMD_GET_SMALL_RX_OFFSET, &cmd);
|
MXGEFW_CMD_GET_SMALL_RX_OFFSET, &cmd);
|
||||||
@ -3640,13 +3544,7 @@ mxge_open(mxge_softc_t *sc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now give him the pointer to the stats block */
|
/* Now give him the pointer to the stats block */
|
||||||
for (slice = 0;
|
for (slice = 0; slice < sc->num_slices; slice++) {
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
slice < sc->num_slices;
|
|
||||||
#else
|
|
||||||
slice < 1;
|
|
||||||
#endif
|
|
||||||
slice++) {
|
|
||||||
ss = &sc->ss[slice];
|
ss = &sc->ss[slice];
|
||||||
cmd.data0 =
|
cmd.data0 =
|
||||||
MXGE_LOWPART_TO_U32(ss->fw_stats_dma.bus_addr);
|
MXGE_LOWPART_TO_U32(ss->fw_stats_dma.bus_addr);
|
||||||
@ -3691,13 +3589,11 @@ mxge_open(mxge_softc_t *sc)
|
|||||||
device_printf(sc->dev, "Couldn't bring up link\n");
|
device_printf(sc->dev, "Couldn't bring up link\n");
|
||||||
goto abort;
|
goto abort;
|
||||||
}
|
}
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
for (slice = 0; slice < sc->num_slices; slice++) {
|
for (slice = 0; slice < sc->num_slices; slice++) {
|
||||||
ss = &sc->ss[slice];
|
ss = &sc->ss[slice];
|
||||||
ss->if_drv_flags |= IFF_DRV_RUNNING;
|
ss->if_drv_flags |= IFF_DRV_RUNNING;
|
||||||
ss->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
ss->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
sc->ifp->if_drv_flags |= IFF_DRV_RUNNING;
|
sc->ifp->if_drv_flags |= IFF_DRV_RUNNING;
|
||||||
sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
||||||
|
|
||||||
@ -3714,17 +3610,13 @@ mxge_close(mxge_softc_t *sc, int down)
|
|||||||
{
|
{
|
||||||
mxge_cmd_t cmd;
|
mxge_cmd_t cmd;
|
||||||
int err, old_down_cnt;
|
int err, old_down_cnt;
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
struct mxge_slice_state *ss;
|
struct mxge_slice_state *ss;
|
||||||
int slice;
|
int slice;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
for (slice = 0; slice < sc->num_slices; slice++) {
|
for (slice = 0; slice < sc->num_slices; slice++) {
|
||||||
ss = &sc->ss[slice];
|
ss = &sc->ss[slice];
|
||||||
ss->if_drv_flags &= ~IFF_DRV_RUNNING;
|
ss->if_drv_flags &= ~IFF_DRV_RUNNING;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
|
sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
|
||||||
if (!down) {
|
if (!down) {
|
||||||
old_down_cnt = sc->down_cnt;
|
old_down_cnt = sc->down_cnt;
|
||||||
@ -3845,9 +3737,9 @@ mxge_watchdog_reset(mxge_softc_t *sc)
|
|||||||
if_link_state_change(sc->ifp,
|
if_link_state_change(sc->ifp,
|
||||||
LINK_STATE_DOWN);
|
LINK_STATE_DOWN);
|
||||||
}
|
}
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
num_tx_slices = sc->num_slices;
|
num_tx_slices = sc->num_slices;
|
||||||
#endif
|
|
||||||
/* grab all TX locks to ensure no tx */
|
/* grab all TX locks to ensure no tx */
|
||||||
for (s = 0; s < num_tx_slices; s++) {
|
for (s = 0; s < num_tx_slices; s++) {
|
||||||
ss = &sc->ss[s];
|
ss = &sc->ss[s];
|
||||||
@ -3874,9 +3766,7 @@ mxge_watchdog_reset(mxge_softc_t *sc)
|
|||||||
/* release all TX locks */
|
/* release all TX locks */
|
||||||
for (s = 0; s < num_tx_slices; s++) {
|
for (s = 0; s < num_tx_slices; s++) {
|
||||||
ss = &sc->ss[s];
|
ss = &sc->ss[s];
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
mxge_start_locked(ss);
|
mxge_start_locked(ss);
|
||||||
#endif
|
|
||||||
mtx_unlock(&ss->tx.mtx);
|
mtx_unlock(&ss->tx.mtx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3929,13 +3819,7 @@ mxge_watchdog(mxge_softc_t *sc)
|
|||||||
|
|
||||||
/* see if we have outstanding transmits, which
|
/* see if we have outstanding transmits, which
|
||||||
have been pending for more than mxge_ticks */
|
have been pending for more than mxge_ticks */
|
||||||
for (i = 0;
|
for (i = 0; (i < sc->num_slices) && (err == 0); i++) {
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
(i < sc->num_slices) && (err == 0);
|
|
||||||
#else
|
|
||||||
(i < 1) && (err == 0);
|
|
||||||
#endif
|
|
||||||
i++) {
|
|
||||||
tx = &sc->ss[i].tx;
|
tx = &sc->ss[i].tx;
|
||||||
if (tx->req != tx->done &&
|
if (tx->req != tx->done &&
|
||||||
tx->watchdog_req != tx->watchdog_done &&
|
tx->watchdog_req != tx->watchdog_done &&
|
||||||
@ -3983,7 +3867,6 @@ mxge_get_counter(struct ifnet *ifp, ift_counter cnt)
|
|||||||
for (int s = 0; s < sc->num_slices; s++)
|
for (int s = 0; s < sc->num_slices; s++)
|
||||||
rv += sc->ss[s].oerrors;
|
rv += sc->ss[s].oerrors;
|
||||||
return (rv);
|
return (rv);
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
case IFCOUNTER_OBYTES:
|
case IFCOUNTER_OBYTES:
|
||||||
for (int s = 0; s < sc->num_slices; s++)
|
for (int s = 0; s < sc->num_slices; s++)
|
||||||
rv += sc->ss[s].obytes;
|
rv += sc->ss[s].obytes;
|
||||||
@ -3996,7 +3879,6 @@ mxge_get_counter(struct ifnet *ifp, ift_counter cnt)
|
|||||||
for (int s = 0; s < sc->num_slices; s++)
|
for (int s = 0; s < sc->num_slices; s++)
|
||||||
rv += sc->ss[s].tx.br->br_drops;
|
rv += sc->ss[s].tx.br->br_drops;
|
||||||
return (rv);
|
return (rv);
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return (if_get_counter_default(ifp, cnt));
|
return (if_get_counter_default(ifp, cnt));
|
||||||
}
|
}
|
||||||
@ -4351,12 +4233,10 @@ mxge_free_slices(mxge_softc_t *sc)
|
|||||||
if (ss->fw_stats != NULL) {
|
if (ss->fw_stats != NULL) {
|
||||||
mxge_dma_free(&ss->fw_stats_dma);
|
mxge_dma_free(&ss->fw_stats_dma);
|
||||||
ss->fw_stats = NULL;
|
ss->fw_stats = NULL;
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
if (ss->tx.br != NULL) {
|
if (ss->tx.br != NULL) {
|
||||||
drbr_free(ss->tx.br, M_DEVBUF);
|
drbr_free(ss->tx.br, M_DEVBUF);
|
||||||
ss->tx.br = NULL;
|
ss->tx.br = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
mtx_destroy(&ss->tx.mtx);
|
mtx_destroy(&ss->tx.mtx);
|
||||||
}
|
}
|
||||||
if (ss->rx_done.entry != NULL) {
|
if (ss->rx_done.entry != NULL) {
|
||||||
@ -4407,10 +4287,6 @@ mxge_alloc_slices(mxge_softc_t *sc)
|
|||||||
* (including tx) are used used only on the first
|
* (including tx) are used used only on the first
|
||||||
* slice for now
|
* slice for now
|
||||||
*/
|
*/
|
||||||
#ifndef IFNET_BUF_RING
|
|
||||||
if (i > 0)
|
|
||||||
continue;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bytes = sizeof (*ss->fw_stats);
|
bytes = sizeof (*ss->fw_stats);
|
||||||
err = mxge_dma_alloc(sc, &ss->fw_stats_dma,
|
err = mxge_dma_alloc(sc, &ss->fw_stats_dma,
|
||||||
@ -4421,10 +4297,8 @@ mxge_alloc_slices(mxge_softc_t *sc)
|
|||||||
snprintf(ss->tx.mtx_name, sizeof(ss->tx.mtx_name),
|
snprintf(ss->tx.mtx_name, sizeof(ss->tx.mtx_name),
|
||||||
"%s:tx(%d)", device_get_nameunit(sc->dev), i);
|
"%s:tx(%d)", device_get_nameunit(sc->dev), i);
|
||||||
mtx_init(&ss->tx.mtx, ss->tx.mtx_name, NULL, MTX_DEF);
|
mtx_init(&ss->tx.mtx, ss->tx.mtx_name, NULL, MTX_DEF);
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
ss->tx.br = buf_ring_alloc(2048, M_DEVBUF, M_WAITOK,
|
ss->tx.br = buf_ring_alloc(2048, M_DEVBUF, M_WAITOK,
|
||||||
&ss->tx.mtx);
|
&ss->tx.mtx);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@ -4920,10 +4794,8 @@ mxge_attach(device_t dev)
|
|||||||
mxge_change_mtu(sc, mxge_initial_mtu);
|
mxge_change_mtu(sc, mxge_initial_mtu);
|
||||||
|
|
||||||
mxge_add_sysctls(sc);
|
mxge_add_sysctls(sc);
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
ifp->if_transmit = mxge_transmit;
|
ifp->if_transmit = mxge_transmit;
|
||||||
ifp->if_qflush = mxge_qflush;
|
ifp->if_qflush = mxge_qflush;
|
||||||
#endif
|
|
||||||
taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq",
|
taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq",
|
||||||
device_get_nameunit(sc->dev));
|
device_get_nameunit(sc->dev));
|
||||||
callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc);
|
callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc);
|
||||||
|
@ -40,10 +40,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#define MXGE_EEPROM_STRINGS_SIZE 256
|
#define MXGE_EEPROM_STRINGS_SIZE 256
|
||||||
#define MXGE_MAX_SEND_DESC 128
|
#define MXGE_MAX_SEND_DESC 128
|
||||||
|
|
||||||
#define MXGE_VIRT_JUMBOS 0
|
|
||||||
|
|
||||||
#define IFNET_BUF_RING 1
|
|
||||||
|
|
||||||
#ifndef VLAN_CAPABILITIES
|
#ifndef VLAN_CAPABILITIES
|
||||||
#define VLAN_CAPABILITIES(ifp)
|
#define VLAN_CAPABILITIES(ifp)
|
||||||
#define mxge_vlans_active(sc) (sc)->ifp->if_nvlans
|
#define mxge_vlans_active(sc) (sc)->ifp->if_nvlans
|
||||||
@ -146,9 +142,7 @@ typedef struct
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
struct mtx mtx;
|
struct mtx mtx;
|
||||||
#ifdef IFNET_BUF_RING
|
|
||||||
struct buf_ring *br;
|
struct buf_ring *br;
|
||||||
#endif
|
|
||||||
volatile mcp_kreq_ether_send_t *lanai; /* lanai ptr for sendq */
|
volatile mcp_kreq_ether_send_t *lanai; /* lanai ptr for sendq */
|
||||||
volatile uint32_t *send_go; /* doorbell for sendq */
|
volatile uint32_t *send_go; /* doorbell for sendq */
|
||||||
volatile uint32_t *send_stop; /* doorbell for sendq */
|
volatile uint32_t *send_stop; /* doorbell for sendq */
|
||||||
|
Loading…
Reference in New Issue
Block a user