Re: ixgbe: Set IXGBE_RSC_CB(skb)->DMA field to zero afterunmapping the address

From: Benjamin Herrenschmidt
Date: Tue Mar 23 2010 - 19:41:11 EST


On Tue, 2010-03-23 at 10:40 -0700, Malli wrote:
>
> Yes. I just realized that i can't assign a zero magic "bad" value. It
> is only
> valid in x86/arm/m68k/alpha architecures and not in spark & PowerPC
> arch,
> (it should be ~0). In some other architecutres it throws a BUG() on
> with
> dma_mapping_error() checks. So the patch is not a total bogus in some
> architectures :(.
>
> May be it is best to create an internal FLAG in IXGBE_RSC_CB(skb)
> which can be used to avoid this double freeing.

I suppose if Linus reads that he'll just come back and say "you idiots,
just make 0 invalid everywhere" like he did for interrupts tho :-) It
wouldn't be too hard for us to make the IOMMU allocator always skip "0".

But for now, I'd suggest you add a flag.

Cheers,
Ben.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/