From patchwork Fri Dec 11 10:38:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ursula Braun X-Patchwork-Id: 555654 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 14BF91402D9 for ; Fri, 11 Dec 2015 21:39:25 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754830AbbLKKjU (ORCPT ); Fri, 11 Dec 2015 05:39:20 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:51985 "EHLO e06smtp13.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754810AbbLKKjQ (ORCPT ); Fri, 11 Dec 2015 05:39:16 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 Dec 2015 10:39:14 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 11 Dec 2015 10:39:12 -0000 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: ubraun@linux.vnet.ibm.com X-IBM-RcptTo: linux-s390@vger.kernel.org;netdev@vger.kernel.org Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id A9E011B0804B; Fri, 11 Dec 2015 10:39:41 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tBBAdBS548562308; Fri, 11 Dec 2015 10:39:11 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tBBAd9fh022164; Fri, 11 Dec 2015 03:39:11 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tBBAd0t7021612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA256 bits=256 verify=NO); Fri, 11 Dec 2015 03:39:09 -0700 From: Ursula Braun To: davem@davemloft.net, mschwid2@linux.vnet.ibm.com, heicars2@linux.vnet.ibm.com, netdev@vger.kernel.org, linux-s390@vger.kernel.org Cc: ubraunu@linux.vnet.ibm.com Subject: [PATCH 6/7] qeth: repair SBAL elements calculation Date: Fri, 11 Dec 2015 11:38:56 +0100 Message-Id: <1449830337-26091-7-git-send-email-ubraun@linux.vnet.ibm.com> X-Mailer: git-send-email 2.3.9 In-Reply-To: <1449830337-26091-1-git-send-email-ubraun@linux.vnet.ibm.com> References: <1449830337-26091-1-git-send-email-ubraun@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15121110-0013-0000-0000-000007F76BD5 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When sending skbs, qeth determines the number of qdio SBAL elements required. If qeth sends a fragmented skb, the SBAL element number calculation is wrong, because the fragmented data part is added twice in qeth_l3_tso_elements(). This patch makes sure fragmented data is handled in qeth_elements_for_frags() only, while qeth_l3_tso_elements() starts calculation of qdio SBAL elements just with the linear data part of the skb. Signed-off-by: Ursula Braun Reviewed-by: Thomas Richter --- drivers/s390/net/qeth_l3_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 9541167..b9d8ea4 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -2818,7 +2818,7 @@ static inline int qeth_l3_tso_elements(struct sk_buff *skb) { unsigned long tcpd = (unsigned long)tcp_hdr(skb) + tcp_hdr(skb)->doff * 4; - int tcpd_len = skb->len - (tcpd - (unsigned long)skb->data); + int tcpd_len = skb_headlen(skb) - (tcpd - (unsigned long)skb->data); int elements = PFN_UP(tcpd + tcpd_len - 1) - PFN_DOWN(tcpd); elements += qeth_get_elements_for_frags(skb);