bge(4) one packet wedge
David Christensen
davidch at broadcom.com
Thu Aug 24 01:21:43 UTC 2006
> > > Could you please answer few questions?
> > >
> > > 1) I've found status tag is returned in status block even if
> > > bit 9 of Misc.
> > > Host Control Register is not set, is it ok?
> >
> > Which controller are you using? This bit is reserved on the 5700
> > (which didn't support tagged status mode) but all other controllers
> > should support it and all of the Broadcom drivers will always
> > enable it.
>
> I tested it on bcm5701 & bcm5721
>
> >
> > >
> > > 2) Status tag is returned in bits 0-7 of status tag field of
> > > status block,
> > > as long as i know it should be returned in bits 31-24,
> is it ok?
> >
> > Not sure what you mean by this. If you're seeing it in bits 31-24
> > of the status block then there may be an endian issue on
> your system.
> > Check that byte/word swapping is set correctly.
> >
> > >
> > > 3) If i try to return processed tag (at the end of ISR) in
> > > Mailbox 0 register:
> > > CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, status_tag << 24);
> > > it would lead to disabled interrupts.
> > > I've thought this should not happen cause in_isr bits
> > > (0-23) are cleared.
> >
> > Writing a non-zero value to bits 23:0 will cause the interrupt to
> > be disabled:
> >
> > CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 1);
> >
> > Writing all zeros to bits 23:0 will enable interrupts.
> >
> > CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, status_tag << 24);
> >
> > The tag value written to bits 31:24 does not affect the interrupt
> > state.
>
> Yes, this is i'm talking about:
> CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 0x01000000) would lead to _disabled_
> interrupts.
> Tested on bcm5701 & bcm5721.
Here's how it's done in Linux:
static void tg3_disable_ints(struct tg3 *tp)
{
tw32(TG3PCI_MISC_HOST_CTRL,
(tp->misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT));
tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
0x00000001);
}
static void tg3_enable_ints(struct tg3 *tp)
{
tp->irq_sync = 0;
wmb();
tw32(TG3PCI_MISC_HOST_CTRL,
(tp->misc_host_ctrl & ~MISC_HOST_CTRL_MASK_PCI_INT));
tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
(tp->last_tag << 24));
if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)
tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
(tp->last_tag << 24));
tg3_cond_int(tp);
}
>
> P.S. bcm5705 does not support tagged status mode, am i right?
No, the 5705 should support tagged status mode, only the 5788 doesn't
support it. The 5705 and 5788 are very closely related though.
> --
> Oleg.
More information about the freebsd-net
mailing list