- Removed updates to if_ibytes, if_obytes, if_imcasts, and if_omcasts.
  These should not be handled by the driver.
- Add code to handle excessively fragmented mbufs when mapping TX frames.

Reviewed by:	ps
Approved by:	ps (mentor)
MFC after:	1 week
This commit is contained in:
davidch 2006-06-08 18:31:21 +00:00
parent b8f1ff9a05
commit 003705e187

View File

@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
/****************************************************************************/
/* BCE Driver Version */
/****************************************************************************/
char bce_driver_version[] = "v0.9.5";
char bce_driver_version[] = "v0.9.6";
/****************************************************************************/
@ -4640,10 +4640,32 @@ bce_tx_encap(struct bce_softc *sc, struct mbuf *m_head, u16 *prod,
bce_dma_map_tx_desc, &map_arg, BUS_DMA_NOWAIT);
if (error || map_arg.maxsegs == 0) {
BCE_PRINTF(sc, "%s(%d): Error mapping mbuf into TX chain!\n",
__FILE__, __LINE__);
rc = ENOBUFS;
goto bce_tx_encap_exit;
/* Try to defrag the mbuf if there are too many segments. */
if (error == EFBIG && map_arg.maxsegs != 0) {
struct mbuf *m0;
DBPRINT(sc, BCE_WARN, "%s(): fragmented mbuf (%d pieces)\n",
__FUNCTION__, map_arg.maxsegs);
m0 = m_defrag(m_head, M_DONTWAIT);
if (m0 != NULL) {
m_head = m0;
error = bus_dmamap_load_mbuf(sc->tx_mbuf_tag,
map, m_head, bce_dma_map_tx_desc, &map_arg,
BUS_DMA_NOWAIT);
}
}
/* Still getting an error after a defrag. */
if (error) {
BCE_PRINTF(sc,
"%s(%d): Error mapping mbuf into TX chain!\n",
__FILE__, __LINE__);
rc = ENOBUFS;
goto bce_tx_encap_exit;
}
}
/*
@ -5308,14 +5330,6 @@ bce_stats_update(struct bce_softc *sc)
*/
ifp->if_collisions = (u_long) stats->stat_EtherStatsCollisions;
ifp->if_ibytes = BCE_STATS(IfHCInOctets);
ifp->if_obytes = BCE_STATS(IfHCOutOctets);
ifp->if_imcasts = BCE_STATS(IfHCInMulticastPkts);
ifp->if_omcasts = BCE_STATS(IfHCOutMulticastPkts);
ifp->if_ierrors = (u_long) stats->stat_EtherStatsUndersizePkts +
(u_long) stats->stat_EtherStatsOverrsizePkts +
(u_long) stats->stat_IfInMBUFDiscards +