On Wed, May 31, 2017 at 20:40 +0200, Mike Belopuhov wrote:
> According to the FreeBSD driver, txp(4) is not setting up its TX
> ring correctly.  FreeBSD driver uses up to 16 fragments, while we
> use up to 252 which is suspicious.
> 
> This gets us in line with FreeBSD, introduces goodness of m_defrag
> and removes pesky if_deq_* thingies.
> 
> Does anyone still have the hardware (3com 3CR900 Typhoon) to test?
> OK's are welcome.
>

Forgot to mention, this "goto oactive" should never happen
because of the check at the start of the loop, but I'm not
too brave to just ditch it right now.

> @@ -1351,10 +1339,12 @@ txp_start(struct ifnet *ifp)
>               for (i = 0; i < sd->sd_map->dm_nsegs; i++) {
>                       if (++cnt >= (TX_ENTRIES - 4)) {
>                               bus_dmamap_sync(sc->sc_dmat, sd->sd_map,
>                                   0, sd->sd_map->dm_mapsize,
>                                   BUS_DMASYNC_POSTWRITE);
> +                             bus_dmamap_unload(sc->sc_dmat, sd->sd_map);
> +                             m_freem(m);
>                               goto oactive;
>                       }
>  
>                       fxd->frag_flags = FRAG_FLAGS_TYPE_FRAG |
>                           FRAG_FLAGS_VALID;
[...]
> @@ -1424,13 +1407,10 @@ txp_start(struct ifnet *ifp)
>       r->r_prod = prod;
>       r->r_cnt = cnt;
>       return;
>  
>  oactive:
> -     bus_dmamap_unload(sc->sc_dmat, sd->sd_map);
> -oactive1:
> -     ifq_deq_rollback(&ifp->if_snd, m);
>       ifq_set_oactive(&ifp->if_snd);
>       r->r_prod = firstprod;
>       r->r_cnt = firstcnt;
>  }
>  

Reply via email to