[openib-general] ipoib: ignores dma mapping errors on TX?

Michael Krause krause at cup.hp.com
Tue Oct 10 11:26:21 PDT 2006


At 10:24 AM 10/10/2006, Tom Tucker wrote:

>Does anyone know what might happen if a device tries to bus master
>bad_dma_address. Does it get a pci-abort, an NMI, a bus err interrupt, all
>of the above?

It depends upon the platform.   Some will enter a containment mode and, for 
example, shutdown the PCI Bus or the PCIe Root Port.  Others may trigger a 
system error and shutdown the system.  These responses are in part, a 
policy of the implementation and how the system is implemented.  In future 
chipsets that contain IOMMU / Address Translation Protection Tables (ATPT) 
/ pick your favorite name, the error can be contained to a single device 
and the appropriate error recovery triggered without requiring the system 
to go down.   Again, all policy at the end of the day as to what action is 
triggered.  For most, the potential for silent data corruption is too high 
to risk that bus or Root Port from continuing to operate without a reset / 
flush so containment is used at a minimum.

Mike



>On 10/9/06 1:01 PM, "Roland Dreier" <rdreier at cisco.com> wrote:
>
> >     Michael> It seems that IPoIB ignores the possibility that
> >     Michael> dma_map_single with DMA_TO_DEVICE direction might return
> >     Michael> dma_mapping_error.
> >
> >     Michael> Is there some reason that such mappings can't fail?
> >
> > No, it's just an oversight.  Most network device drivers don't check
> > for DMA mapping errors but it's probably better to do so anyway.  I
> > added this to my queue:
> >
> > commit 8edaf479946022d67350d6c344952fb65064e51b
> > Author: Roland Dreier <rolandd at cisco.com>
> > Date:   Mon Oct 9 10:54:20 2006 -0700
> >
> >     IPoIB: Check for DMA mapping error for TX packets
> >
> >     Signed-off-by: Roland Dreier <rolandd at cisco.com>
> >
> > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
> > b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
> > index f426a69..8bf5e9e 100644
> > --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
> > +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
> > @@ -355,6 +355,11 @@ void ipoib_send(struct net_device *dev,
> > tx_req->skb = skb;
> > addr = dma_map_single(priv->ca->dma_device, skb->data, skb->len,
> >      DMA_TO_DEVICE);
> > + if (unlikely(dma_mapping_error(addr))) {
> > +  ++priv->stats.tx_errors;
> > +  dev_kfree_skb_any(skb);
> > +  return;
> > + }
> > pci_unmap_addr_set(tx_req, mapping, addr);
> >
> > if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1),
> >
> > _______________________________________________
> > openib-general mailing list
> > openib-general at openib.org
> > http://openib.org/mailman/listinfo/openib-general
> >
> > To unsubscribe, please visit 
> http://openib.org/mailman/listinfo/openib-general
> >
>
>
>
>_______________________________________________
>openib-general mailing list
>openib-general at openib.org
>http://openib.org/mailman/listinfo/openib-general
>
>To unsubscribe, please visit 
>http://openib.org/mailman/listinfo/openib-general






More information about the general mailing list