From patchwork Fri Jun 26 22:26:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Hofer X-Patchwork-Id: 488999 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AD62014031A for ; Sat, 27 Jun 2015 08:26:20 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752729AbbFZW0R (ORCPT ); Fri, 26 Jun 2015 18:26:17 -0400 Received: from mail-ig0-f176.google.com ([209.85.213.176]:36037 "EHLO mail-ig0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785AbbFZW0P (ORCPT ); Fri, 26 Jun 2015 18:26:15 -0400 Received: by igbiq7 with SMTP id iq7so22227815igb.1 for ; Fri, 26 Jun 2015 15:26:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=CazI34PNPT5XW/f0PLKAOumVXkn9nS7Rjy2mN0QAA1o=; b=GzBHgV7pq+AsA9v5lxQcyWS/HJPeb3IaK2ZQQU0f3jxYXJU0p/8ucjvId0Z5C4g6Im R2fJO5w9xnRDa84jY9d8l2ToZUf3z7J3fDXLVw+jaOb4xhilhUhk2SBsC8TBdmu2XYTY Vk/Nvv3S4/ngevw7W8swbGKyT6gxjqQsm97Zh2iIOxNhAy/AUhtvBd/fE+Vn/UODwVmD wiga+fNdRDnjeAQUt/xEc5kLc96TE1oJO3abO1aWEM5cmAIZkQpK+PzvW4FdC4s41e/5 0DXNszykzsTjwft994BLgiWHJCt0/wjbO+7B5D7Oq2sAfRIQg/G/urbroONHj3Xb/+3W lEKA== X-Gm-Message-State: ALoCoQn3HOgr3k4E/TlrBKOol7H1iW1PpJjki+n8eLkAIbQt6fGNWerfhnlvbdND8JYU85a3bQVy MIME-Version: 1.0 X-Received: by 10.107.168.150 with SMTP id e22mr5398870ioj.9.1435357574753; Fri, 26 Jun 2015 15:26:14 -0700 (PDT) Received: by 10.36.75.136 with HTTP; Fri, 26 Jun 2015 15:26:14 -0700 (PDT) Date: Fri, 26 Jun 2015 15:26:14 -0700 Message-ID: Subject: Re: [PATCH] update mvneta driver to support v6 checksums on TCP/UDP [1] From: Phil Hofer To: netdev@vger.kernel.org Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Phil Hofer The mvneta driver for Marvell 370 had TCP performance problems over IPv6. (In my tests of 10s runs with 64kB packets, I got about 560Mbps on IPv6 and 950Mbps on IPv4.) After this patch, IPv6 performance jumps up to about 860Mbps. This patch adds NETIF_F_CSUM_IPV6 to the list of interface features and uses the IPHeaderOk receive descriptor bit instead of the L3IP bit to determine whether or not to set CHECKSUM_UNNECESSARY. One feature that does *not* appear to work (yet) is TSO6. Signed off by: Phil Hofer --- drivers/net/ethernet/marvell/mvneta.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) if (l4_proto == IPPROTO_TCP) @@ -1288,13 +1293,16 @@ 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) && + /* IPHeadOk will be set for IPv6 + * and IPv4 packets with proper + * checksums. + */ + if ((status & MVNETA_RXD_IP_HEAD_OK) && (status & MVNETA_RXD_L4_CSUM_OK)) { skb->csum = 0; skb->ip_summed = CHECKSUM_UNNECESSARY; return; } - skb->ip_summed = CHECKSUM_NONE; } @@ -3129,7 +3137,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; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 5bdf782..f8f4667 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -338,7 +338,8 @@ struct mvneta_port { #define MVNETA_RXD_ERR_LEN BIT(18) #define MVNETA_RXD_ERR_RESOURCE (BIT(17) | BIT(18)) #define MVNETA_RXD_ERR_CODE_MASK (BIT(17) | BIT(18)) -#define MVNETA_RXD_L3_IP4 BIT(25) +#define MVNETA_RXD_L3_IP BIT(24) +#define MVNETA_RXD_IP_HEAD_OK BIT(25) #define MVNETA_RXD_FIRST_LAST_DESC (BIT(26) | BIT(27)) #define MVNETA_RXD_L4_CSUM_OK BIT(30) @@ -1235,9 +1236,13 @@ 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; + /* IPv6 packet header checksumming + * is not supported, but TCPv6 header + * checksumming *is* supported. + */ if (l3_proto == htons(ETH_P_IP)) command |= MVNETA_TXD_IP_CSUM; - else + else if (l3_proto == htons(ETH_P_IPV6)) command |= MVNETA_TX_L3_IP6;