netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] improve mvneta (Marvell 370) driver TCPv6 performance
@ 2015-06-26 18:12 Phil Hofer
  2015-06-26 18:52 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Hofer @ 2015-06-26 18:12 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Petazzoni, Oren Laskin

TCP performance over IPv6 was only about 60% of IPv4 performance. This
patch makes up most (but not all) of the difference.

Signed off by: Thomas Petazzoni (thomas.petazzoni@free-electrons.com)

diff --git a/drivers/net/ethernet/marvell/mvneta.c
b/drivers/net/ethernet/marvell/mvneta.c
index 5bdf782..926c948 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -1235,13 +1235,17 @@ static u32 mvneta_txq_desc_csum(int l3_offs,
int l3_proto,
        command =  l3_offs    << MVNETA_TX_L3_OFF_SHIFT;
        command |= ip_hdr_len << MVNETA_TX_IP_HLEN_SHIFT;

-       if (l3_proto == htons(ETH_P_IP))
-               command |= MVNETA_TXD_IP_CSUM;
-       else
+       /* IPv6 packet header checksumming
+        * is not supported, but TCPv6 header
+        * checksumming *is* supported.
+        */
+       if (l3_proto == htons(ETH_P_IPV6))
                command |= MVNETA_TX_L3_IP6;
+       else
+               command |= MVNETA_TXD_IP_CSUM;

        if (l4_proto == IPPROTO_TCP)
-               command |=  MVNETA_TX_L4_CSUM_FULL;
+               command |= MVNETA_TX_L4_CSUM_FULL;
        else if (l4_proto == IPPROTO_UDP)
                command |= MVNETA_TX_L4_UDP | MVNETA_TX_L4_CSUM_FULL;
        else
@@ -1288,13 +1292,11 @@ static void mvneta_rx_error(struct mvneta_port *pp,
 static void mvneta_rx_csum(struct mvneta_port *pp, u32 status,
                           struct sk_buff *skb)
 {
-       if ((status & MVNETA_RXD_L3_IP4) &&
-           (status & MVNETA_RXD_L4_CSUM_OK)) {
+       if (status & MVNETA_RXD_L4_CSUM_OK) {
                skb->csum = 0;
                skb->ip_summed = CHECKSUM_UNNECESSARY;
                return;
        }
-
        skb->ip_summed = CHECKSUM_NONE;
 }

@@ -3129,7 +3131,7 @@ static int mvneta_probe(struct platform_device *pdev)

        netif_napi_add(dev, &pp->napi, mvneta_poll, NAPI_POLL_WEIGHT);

-       dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
+       dev->features = NETIF_F_SG| NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM | NETIF_F_TSO;
        dev->hw_features |= dev->features;
        dev->vlan_features |= dev->features;
        dev->priv_flags |= IFF_UNICAST_FLT;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-26 19:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-26 18:12 [PATCH] improve mvneta (Marvell 370) driver TCPv6 performance Phil Hofer
2015-06-26 18:52 ` Thomas Petazzoni
2015-06-26 19:57   ` Phil Hofer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).