Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Marvell if_mvgbe



On Mon, Oct 15, 2012 at 11:33:14AM +1300, Lloyd Parkes wrote:
> 
> On 13/10/2012, at 1:42 AM, Robert Swindells <rjs%fdy2.co.uk@localhost> wrote:
> 
> > I have been using the following patch for a while now on the
> > SheevaPlug, it should reduce the number of receive interrupts
> > generated by the ethernet controllers.
> 
> Great. The interrupt load on some of my older gear was so bad that I had to 
> retire that gear, so I approve of fewer interrupts.
> 
> > +static uint32_t
> > +mvgbe_ipg_rx(struct mvgbec_softc *csc, struct mvgbe_softc *sc)
> > +{
> > +
> > +   if (csc->sc_flags & FLAGS_IPG2)
> > +           return (((sc->sc_ipg_rx & 0x8000) << 10) |
> > +                   ((sc->sc_ipg_rx & 0x7fff) << 7));
> > +   else if (csc->sc_flags & FLAGS_IPG1)
> > +           return ((sc->sc_ipg_rx & 0x3fff) << 8);
> > +   else
> > +           return 0;
> > +}
> ...
> > +   if ((csc->sc_flags & FLAGS_IPG1) || (csc->sc_flags & FLAGS_IPG2))
> > +           sc->sc_ipg_rx = 768;
> 
> You need to replace all the numeric constants with #defines though.
> I can read and write network device drivers (that aren't too complicated),
> but I don't know what this code does without referring to the Marvell
> data sheets.

Also, remove the 'else' following the 'return's.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index