diff options
author | adrian <adrian@FreeBSD.org> | 2015-10-15 20:37:30 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2015-10-15 20:37:30 +0000 |
commit | b46146d7b72da58a889ee051e085a3f4a6d1aaaf (patch) | |
tree | 33a3eced80bf5fccb595a262d39904fc9b8fd89e /sys/dev | |
parent | 766753c6f7d99bd0ec7c6d3dd429424cb1b000b6 (diff) | |
download | FreeBSD-src-b46146d7b72da58a889ee051e085a3f4a6d1aaaf.zip FreeBSD-src-b46146d7b72da58a889ee051e085a3f4a6d1aaaf.tar.gz |
if_lem: Bring over the missing pieces from -HEAD to make NIC_PARAVIRT work.
The paravirt support for the driver and netmap code was already MFCed,
but the adapter and ifnet API bits weren't.
This was backported from -HEAD by Eric Melville <eric@freebsd.org>.
Submitted by: eric
Sponsored by: Norse Corp, Inc.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/e1000/if_lem.c | 2 | ||||
-rw-r--r-- | sys/dev/e1000/if_lem.h | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/e1000/if_lem.c b/sys/dev/e1000/if_lem.c index 7dc7d84..903cc28 100644 --- a/sys/dev/e1000/if_lem.c +++ b/sys/dev/e1000/if_lem.c @@ -951,7 +951,7 @@ lem_start_locked(struct ifnet *ifp) if (adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD) ifp->if_drv_flags |= IFF_DRV_OACTIVE; #ifdef NIC_PARAVIRT - if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE && adapter->csb && + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) && adapter->csb && adapter->csb->guest_csb_on && !(adapter->csb->guest_need_txkick & 1)) { adapter->csb->guest_need_txkick = 1; diff --git a/sys/dev/e1000/if_lem.h b/sys/dev/e1000/if_lem.h index 235277d..c67a761 100644 --- a/sys/dev/e1000/if_lem.h +++ b/sys/dev/e1000/if_lem.h @@ -265,6 +265,13 @@ #define PICOSECS_PER_TICK 20833 #define TSYNC_PORT 319 /* UDP port for the protocol */ +#ifdef NIC_PARAVIRT +#define E1000_PARA_SUBDEV 0x1101 /* special id */ +#define E1000_CSBAL 0x02830 /* csb phys. addr. low */ +#define E1000_CSBAH 0x02834 /* csb phys. addr. hi */ +#include <net/paravirt.h> +#endif + /* * Bus dma allocation structure used by * e1000_dma_malloc and e1000_dma_free. @@ -437,6 +444,15 @@ struct adapter { boolean_t pcix_82544; boolean_t in_detach; +#ifdef NIC_PARAVIRT + struct em_dma_alloc csb_mem; + struct paravirt_csb *csb; + uint32_t rx_retries; + uint32_t tdt_csb_count; + uint32_t tdt_reg_count; + uint32_t tdt_int_count; + uint32_t guest_need_kick_count; +#endif struct e1000_hw_stats stats; }; |