[ofa-general] 4k MTU patch

Eli Cohen eli at mellanox.co.il
Tue Feb 5 04:44:09 PST 2008


Hi Shirley,

I see the following problems with the patch:

1.static inline void ipoib_sg_dma_unmap_rx(struct ipoib_dev_priv *priv,
+                                        u64 mapping[IPOIB_UD_RX_SG])
+{
+       ib_dma_unmap_single(priv->ca, mapping[0], IPOIB_UD_HEAD_SIZE, DMA_FROM_DEVICE);

==> use ib_dma_unmap_page()
+       ib_dma_unmap_single(priv->ca, mapping[1], PAGE_SIZE, DMA_FROM_DEVICE);
+}

2. When you allocate an SKB with ipoib_sg_alloc_rx_skb(), you allocate
and map both the linear data and the first fragment (in the case of 4K
mtu and 4K page size). But then you call ipoib_ud_skb_put_frags() to
potentially take the first fragment from the SKB for which a packet has
just received. This can cause a leak of one page (although I think this
case should never happen since the the length of packet is likely to
exceed the linear data of the SKB.

3. The 
if (ipoib_ud_need_sg(priv->max_ib_mtu)) {

in ipoib_ib_handle_rx_wc() can be eliminated - most of the code is
identical.






More information about the general mailing list