From patchwork Tue Aug 30 06:06:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 9304901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 032DC601C0 for ; Tue, 30 Aug 2016 06:09:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7A0C28AC8 for ; Tue, 30 Aug 2016 06:09:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB44528ACD; Tue, 30 Aug 2016 06:09:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6324E28AC8 for ; Tue, 30 Aug 2016 06:09:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1becDC-000760-23; Tue, 30 Aug 2016 06:07:54 +0000 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1becCk-00072B-OG for linux-arm-kernel@lists.infradead.org; Tue, 30 Aug 2016 06:07:27 +0000 Received: by mail-pa0-x242.google.com with SMTP id vy10so610498pac.0 for ; Mon, 29 Aug 2016 23:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hHxhiVq3fkwKQhd9koElX26rvMPXrMN4EfGxouuQFQI=; b=Eiu6QEaGTLb1iTgdQ2qrNGohaMQeLqXYNGB7vqLvnSXBF2FN4EEu4SL+nsU9bT2lte aygSk0LpXCvvpON8qPrgf+B7SS9csuQqlghOwxIK/hzqYY7WaABPrAvfBRNrkjd6nhmO 1mnwZ16OMzecMdutmgu+LEsMK+7dZgCWld0YKXrIugYVPadgo82kllbZk/71tDnvvtxf syHpKZFZ9BLdaV2rQ1sdFs1Lp2WoNBXTx/uq6wDw4+j1Q9Jn+EzZm1wN4MCZIIsDEj6e kxKsr/truFcx69WqYwF78PRmu87uOFH2A26rHhzUO5IJrltWd/WJWu2uSLJzSoq7NexT /Wuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hHxhiVq3fkwKQhd9koElX26rvMPXrMN4EfGxouuQFQI=; b=YlWxwux6UbF9fFBFLvvjc0sos58biyYev7nzBD8P+Gf138A6QnJ0Y/4fuQ6s5xSx7E MtJYkueTtx17O5FHl82c2VGHk73QQ8HHCsv1UuyY/lV/6E+Z7FZqNEqA7E8fHbMXsXRk sPJQ546UTSTZindT0IARb5AVJvkDxULmDqWUrHrHikZ0wtiocaWFWwztLffKfbmtZ6lY Cj9aYaCswncFgvB/a/93by+g0YZvdsXNRkGzyFbNhbIE6SKrFBt1/4nCG5mSYsdYicSM yzwpRLNglqfNq52t6wwx0EBpv6dklXUPDw6gR4qtBF0GuwSxLuayq0aDczBlVbkHGImR IhJQ== X-Gm-Message-State: AE9vXwPguAyWVmOjTTqDe5b3JjiNynk0eus3DSmkRWf9krG2JNbzCtbhZRGqVdma2Hoz0Q== X-Received: by 10.66.76.9 with SMTP id g9mr3153974paw.51.1472537225632; Mon, 29 Aug 2016 23:07:05 -0700 (PDT) Received: from machine421.in.caveonetworks.com ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id b134sm53406602pfb.55.2016.08.29.23.07.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Aug 2016 23:07:04 -0700 (PDT) From: sunil.kovvuri@gmail.com To: netdev@vger.kernel.org Subject: [PATCH net 1/2] net: thunderx: Fix for HW issue while padding TSO packet Date: Tue, 30 Aug 2016 11:36:26 +0530 Message-Id: <1472537187-21951-2-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472537187-21951-1-git-send-email-sunil.kovvuri@gmail.com> References: <1472537187-21951-1-git-send-email-sunil.kovvuri@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160829_230726_896918_FE04DFD6 X-CRM114-Status: GOOD ( 12.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sunil Goutham , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sunil Goutham There is a issue in HW where-in while sending GSO sized pkts as part of TSO, if pkt len falls below configured min packet size i.e 60, NIC will zero PAD packet and also updates IP total length. Hence set this value to lessthan min pkt size of MAC + IP + TCP headers, BGX will anyway do the padding to transmit 64 byte pkt including FCS. Signed-off-by: Sunil Goutham --- drivers/net/ethernet/cavium/thunder/nic_main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/nic_main.c b/drivers/net/ethernet/cavium/thunder/nic_main.c index 16ed203..85cc782 100644 --- a/drivers/net/ethernet/cavium/thunder/nic_main.c +++ b/drivers/net/ethernet/cavium/thunder/nic_main.c @@ -251,9 +251,14 @@ static void nic_set_tx_pkt_pad(struct nicpf *nic, int size) int lmac; u64 lmac_cfg; - /* Max value that can be set is 60 */ - if (size > 60) - size = 60; + /* There is a issue in HW where-in while sending GSO sized + * pkts as part of TSO, if pkt len falls below this size + * NIC will zero PAD packet and also updates IP total length. + * Hence set this value to lessthan min pkt size of MAC+IP+TCP + * headers, BGX will do the padding to transmit 64 byte pkt. + */ + if (size > 52) + size = 52; for (lmac = 0; lmac < (MAX_BGX_PER_CN88XX * MAX_LMAC_PER_BGX); lmac++) { lmac_cfg = nic_reg_read(nic, NIC_PF_LMAC_0_7_CFG | (lmac << 3));