[ofa-general] 4k MTU patch

Shirley Ma xma at us.ibm.com
Tue Feb 5 07:34:05 PST 2008





general-bounces at lists.openfabrics.org wrote on 02/05/2008 04:44:09 AM:

> 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);
> +}

Good catch, I will fix it.

> 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.

The first buffer only has GRH + IPoIB header = 44 bytes, the first fragment
has the IP payload, the length can never be zero. Actually I can remove
that code from taking the first fragment. It's useless here.

> 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.

The skb free and allocation need this check, the rest of code can share
between 2K and 4K. I am trying to use one condition check here. Can you
please tell me how to totally eliminate it in details?

thanks
Shirley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080205/0a33b943/attachment.html>


More information about the general mailing list