]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
mwifiex: modify skb->truesize for PCIE Rx
authorAvinash Patil <patila@marvell.com>
Tue, 5 Mar 2013 00:27:56 +0000 (16:27 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 6 Mar 2013 21:29:11 +0000 (16:29 -0500)
We allocate SKB buffers of 4K size to make sure that we process
RX AMSDU of 4K. So when skb->len is lesser than 4K; we should
modify skb->truesize. This resolves an issue where kernel has
allocated packets with 2K assumption and starts dropping packets
for large size data transfer.

This fix is already present for USB; extend it to PCIE.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/util.c

index 21553976b550ff8c3ab925e58a4f508fa0845033..54667e65ca47ba104764e99b2ce1fc95e9d183f7 100644 (file)
@@ -195,7 +195,7 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb)
        skb->protocol = eth_type_trans(skb, priv->netdev);
        skb->ip_summed = CHECKSUM_NONE;
 
-       /* This is required only in case of 11n and USB as we alloc
+       /* This is required only in case of 11n and USB/PCIE as we alloc
         * a buffer of 4K only if its 11N (to be able to receive 4K
         * AMSDU packets). In case of SD we allocate buffers based
         * on the size of packet and hence this is not needed.
@@ -212,7 +212,8 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb)
         * fragments. Currently we fail the Filesndl-ht.scr script
         * for UDP, hence this fix
         */
-       if ((priv->adapter->iface_type == MWIFIEX_USB) &&
+       if ((priv->adapter->iface_type == MWIFIEX_USB ||
+            priv->adapter->iface_type == MWIFIEX_PCIE) &&
            (skb->truesize > MWIFIEX_RX_DATA_BUF_SIZE))
                skb->truesize += (skb->len - MWIFIEX_RX_DATA_BUF_SIZE);