From patchwork Wed Dec 3 14:36:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 417464 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 A59561400A0 for ; Thu, 4 Dec 2014 01:36:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753333AbaLCOgs (ORCPT ); Wed, 3 Dec 2014 09:36:48 -0500 Received: from mail-bn1bbn0102.outbound.protection.outlook.com ([157.56.111.102]:54496 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752848AbaLCOgr (ORCPT ); Wed, 3 Dec 2014 09:36:47 -0500 Received: from BLUPR02CA056.namprd02.prod.outlook.com (25.160.23.174) by BLUPR02MB193.namprd02.prod.outlook.com (10.242.189.148) with Microsoft SMTP Server (TLS) id 15.1.31.17; Wed, 3 Dec 2014 14:36:45 +0000 Received: from BL2FFO11FD025.protection.gbl (2a01:111:f400:7c09::187) by BLUPR02CA056.outlook.office365.com (2a01:111:e400:8ad::46) with Microsoft SMTP Server (TLS) id 15.1.31.17 via Frontend Transport; Wed, 3 Dec 2014 14:36:45 +0000 Received: from atltwp01.amd.com (165.204.84.221) by BL2FFO11FD025.mail.protection.outlook.com (10.173.161.104) with Microsoft SMTP Server id 15.1.6.13 via Frontend Transport; Wed, 3 Dec 2014 14:36:45 +0000 X-WSS-ID: 0NG0GL6-07-NM8-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 25655CAE7B6; Wed, 3 Dec 2014 08:36:42 -0600 (CST) Received: from SATLEXDAG06.amd.com (10.181.40.13) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 3 Dec 2014 08:37:14 -0600 Received: from tlendack-t1.amdoffice.net (10.180.168.240) by satlexdag06.amd.com (10.181.40.13) with Microsoft SMTP Server id 14.3.195.1; Wed, 3 Dec 2014 09:36:44 -0500 Subject: [PATCH net v2 2/2] amd-xgbe: Associate Tx SKB with proper ring descriptor From: Tom Lendacky To: CC: David Miller Date: Wed, 3 Dec 2014 08:36:42 -0600 Message-ID: <20141203143642.25084.29478.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20141203143630.25084.91079.stgit@tlendack-t1.amdoffice.net> References: <20141203143630.25084.91079.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(199003)(189002)(33646002)(87936001)(86362001)(53416004)(21056001)(19580395003)(97746001)(19580405001)(44976005)(110136001)(4396001)(31966008)(76176999)(62966003)(77156002)(54356999)(50466002)(50986999)(97736003)(83506001)(101416001)(99396003)(107046002)(2351001)(95666004)(103116003)(20776003)(47776003)(84676001)(229853001)(105586002)(23676002)(102836001)(120916001)(46102003)(92726001)(77096005)(68736005)(92566001)(64706001)(106466001)(71626003); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR02MB193; H:atltwp01.amd.com; FPR:; SPF:None; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB193; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601001); SRVR:BLUPR02MB193; X-Forefront-PRVS: 0414DF926F Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=Thomas.Lendacky@amd.com; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB193; X-OriginatorOrg: amd4.onmicrosoft.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The SKB for a Tx packet is associated with an xgbe_ring_data structure in the xgbe_map_tx_skb function. However, it is being saved in the structure after the last structure used when the SKB is mapped. Use the last used structure to save the SKB value. Signed-off-by: Tom Lendacky --- drivers/net/ethernet/amd/xgbe/xgbe-desc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 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/amd/xgbe/xgbe-desc.c b/drivers/net/ethernet/amd/xgbe/xgbe-desc.c index 43b7d2e..b15551b 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-desc.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-desc.c @@ -480,7 +480,11 @@ static int xgbe_map_tx_skb(struct xgbe_channel *channel, struct sk_buff *skb) } } - /* Save the skb address in the last entry */ + /* Save the skb address in the last entry. We always have some data + * that has been mapped so rdata is always advanced past the last + * piece of mapped data - use the entry pointed to by cur_index - 1. + */ + rdata = XGBE_GET_DESC_DATA(ring, cur_index - 1); rdata->skb = skb; /* Save the number of descriptor entries used */