From patchwork Sat Apr 19 01:59:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 340447 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 0C0971400FD for ; Sat, 19 Apr 2014 11:59:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754172AbaDSB7h (ORCPT ); Fri, 18 Apr 2014 21:59:37 -0400 Received: from mga03.intel.com ([143.182.124.21]:2813 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753868AbaDSB7b (ORCPT ); Fri, 18 Apr 2014 21:59:31 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 18 Apr 2014 18:59:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,887,1389772800"; d="scan'208";a="420972427" Received: from unknown (HELO jtkirshe-mobl.amr.corp.intel.com) ([10.255.12.27]) by azsmga001.ch.intel.com with ESMTP; 18 Apr 2014 18:59:30 -0700 From: Jeff Kirsher To: davem@davemloft.net Cc: Jesse Brandeburg , netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com, Jeff Kirsher Subject: [net 2/7] i40e: fix TCP flag replication for hardware offload Date: Fri, 18 Apr 2014 18:59:22 -0700 Message-Id: <1397872767-4001-3-git-send-email-jeffrey.t.kirsher@intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1397872767-4001-1-git-send-email-jeffrey.t.kirsher@intel.com> References: <1397872767-4001-1-git-send-email-jeffrey.t.kirsher@intel.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jesse Brandeburg As reported by Eric Dumazet, the i40e driver was allowing the hardware to replicate the PSH flag on all segments of a TSO operation. This patch fixes the first/middle/last TCP flags settings which makes the TSO operations work correctly. With this change we are now configuring the CWR bit to only be set in the first packet of a TSO, so this patch also enables TSO_ECN, in order to advertise to the stack that we do the right thing on the wire. Reported-by: Eric Dumazet Signed-off-by: Jesse Brandeburg Tested-by: Kavindya Deegala Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 861b722..59eada3 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -4271,6 +4271,14 @@ static int i40e_open(struct net_device *netdev) if (err) return err; + /* configure global TSO hardware offload settings */ + wr32(&pf->hw, I40E_GLLAN_TSOMSK_F, be32_to_cpu(TCP_FLAG_PSH | + TCP_FLAG_FIN) >> 16); + wr32(&pf->hw, I40E_GLLAN_TSOMSK_M, be32_to_cpu(TCP_FLAG_PSH | + TCP_FLAG_FIN | + TCP_FLAG_CWR) >> 16); + wr32(&pf->hw, I40E_GLLAN_TSOMSK_L, be32_to_cpu(TCP_FLAG_CWR) >> 16); + #ifdef CONFIG_I40E_VXLAN vxlan_get_rx_port(netdev); #endif @@ -6712,6 +6720,7 @@ static int i40e_config_netdev(struct i40e_vsi *vsi) NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_IPV6_CSUM | NETIF_F_TSO | + NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_RXCSUM | NETIF_F_NTUPLE |