Received: by 10.213.65.68 with SMTP id h4csp2118153imn; Sun, 8 Apr 2018 20:09:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+JN3H/B/p2IWFtoffYB8UuKS1YwLljv3LBnL0qw1xwxK0WFo1HtyGDEV9PCtg+AQ/Yj1i0 X-Received: by 10.99.178.88 with SMTP id t24mr24336240pgo.212.1523243365625; Sun, 08 Apr 2018 20:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243365; cv=none; d=google.com; s=arc-20160816; b=tOsfKrXSuKPdKTwUe9myYkSBp8KzW3UuwiG1bRJdeGtw9qKRSjAYl4icdZ9pg3h1Qd eUeDNcTTCGOwCdL5jQQ8dR4yAAunV+fCCdqmNgGs3jyqYgbwkoWc9k8K4iOoIRfrj8n9 gcBjny6Sa3eAcgFfK80zFXlRCRAwqdz6CN5tOrFv0OKgE4D92t/pdoy/3CiT5815jySl 8GecJ+xIIjRIrgFH8Ej/UwRvQZ9mq5YfAN1aRzo48GNCBNIXXXifRgQIIXPUL1p4WA32 3kHN6iWUVmgeQOjpGdXmmO6hu0x5wI5egrOMdHzHd8lapGYl01NpODk0mz+QLTMSBcQy vXyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=l21n0JQvhzjMN3PZdoTnpkfPyBX4xsSTrMAlNhsFyio=; b=dBKhsop3520E7o5DGrR6/TpDpIYX4fiSyC/j/cubwUtI37J47EBZMx+/73VnSTiSSZ 358Vj3P9n8cjljf9LdqSVKJNFtNkHhc912W3swsxVLtYyFg1UO4KCOAgKAkgDOFhstn0 Dld2LeUVxJQ5UjhOeF+QKHNwol1UOyX4CFBE/0fAHS3sVNudW7CjvPkvd2yaMpohNQEU k0MBlVN8jmUiWZJesNvASflmBgr2BGlj/0fHMDzI/35LZr4/Kedi6Qm7c6rv1ZyoD64K PX1wqf+NKY7C0DQc7MWzW5l3r8hd0Is5UIj262nkj+vfEQs+3VfiJyLNWj21oyTuVYQz NG0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=XMAEwvfD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si5975459pgu.626.2018.04.08.20.08.48; Sun, 08 Apr 2018 20:09:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=XMAEwvfD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757446AbeDICbR (ORCPT + 99 others); Sun, 8 Apr 2018 22:31:17 -0400 Received: from mail-sn1nam02on0134.outbound.protection.outlook.com ([104.47.36.134]:61393 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754317AbeDIA2V (ORCPT ); Sun, 8 Apr 2018 20:28:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=l21n0JQvhzjMN3PZdoTnpkfPyBX4xsSTrMAlNhsFyio=; b=XMAEwvfD00zRVSctTQwfDhyjyZxe0M1SGLgzgUR1zM2ZFfKvUaH8eslVQP3dYnj1rlApy0fywvT0scZjzSDwh+2CYbTL+aeDG+O+ZDnoJt6NnKFetoR5cPUMkKZUK2HanS0ZbDsjF3dKJF6o1Yne1BtQflC1hYOPB5VQLLfl0nE= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0871.namprd21.prod.outlook.com (10.167.110.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.2; Mon, 9 Apr 2018 00:28:11 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:28:11 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Jacob Keller , Jeff Kirsher , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 069/293] ixgbe: avoid permanent lock of *_PTP_TX_IN_PROGRESS Thread-Topic: [PATCH AUTOSEL for 4.9 069/293] ixgbe: avoid permanent lock of *_PTP_TX_IN_PROGRESS Thread-Index: AQHTz5kGT8AfNTcEF0CHM8jFvsDt0A== Date: Mon, 9 Apr 2018 00:23:47 +0000 Message-ID: <20180409002239.163177-69-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0871;7:nfEf/MwOPBkPA4cguhwWPud9YuSHQmE744Hvn+jGTfbUK7vloFayGjSWV7X3/6pm/lfdnRhs0/QeKAYhhtR9nwa36cSc169J3k5kNAnWFB7841zFrYnWRfOSdsCd7JNpDK2UA68U1jtLltps4Igzcm9PuiGOAAoUcystrXSFXvKj9qxGPeVS06A+TeqLPCCuAEKyeP95MI+8D9kA2juymFY4Hh7KkuE4BmngWQQonczbEAWH6puSsjSLtfFqvg9w;20:pKq7LcP/wukuLqP4V7L+YI7mdFJQ3BVC7T6U0bG4Uo4qZ1axVjjlawTWW13wXp9xf6WRHLfYzOT6ffFqZ6zmbrmNII2xV1aX4HzoMtf/w/zFSHYrT5c7W2qTXaoLIWSPEfzPeu8PU+VLaQngLcJaKIkKo85NbC7Hu34LnRbZWUw= X-MS-Office365-Filtering-Correlation-Id: 0fc2a0bd-2cdc-466d-b54a-08d59db0c6aa x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB0871; x-ms-traffictypediagnostic: DM5PR2101MB0871: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0871;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0871; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(396003)(39380400002)(376002)(39860400002)(199004)(189003)(105586002)(8676002)(59450400001)(3660700001)(3280700002)(6506007)(81156014)(81166006)(14454004)(99286004)(72206003)(110136005)(8936002)(54906003)(305945005)(2906002)(316002)(10290500003)(478600001)(7736002)(53936002)(6512007)(486006)(11346002)(4326008)(86362001)(446003)(3846002)(102836004)(76176011)(476003)(25786009)(22452003)(36756003)(107886003)(6666003)(10090500001)(5660300001)(6486002)(86612001)(6436002)(2616005)(68736007)(26005)(1076002)(186003)(2501003)(5250100002)(2900100001)(106356001)(66066001)(6116002)(97736004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0871;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: l4SgD/L7UnnDGJVAkmRttuJAuuUH5RSgBLbWvH48jXat0YyqU2Ia2aRlJpuFZF7TK/HLlDIAEHjj9qfjurgxm4RR4F7bvO6cwy2jirqBzdVfszYDNbRKyhd7szVnsmBZ6+EfInMFr9h1p/bP7pOj+AIpPSyK0wIt2KgcnUyUd4Y+V85X/WV5bsf7Zmv0jKOB0Wa9CDyRUHkZXf7graDbOHLLMy3oHj8nDqScyApusctcaqX1Y5upThwzo6e9NMTJ2isUGEU1BcCFWfwYkRCYYyZ2tDlkbCsECvZVXuqVuU/V4Sz4XFdNTG+c6O+sjpMkhj8RPGPL4f4Tc4UrCUKGp6edb9dmXAzSBHibs2hZOsPNk3QklJMbV1+gcWqur8a7/l+32XKD/UsaXY8kmy5KNvONKiUbjKa7xDMz74MOBdM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fc2a0bd-2cdc-466d-b54a-08d59db0c6aa X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:23:47.3780 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0871 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jacob Keller [ Upstream commit 5fef124d9c75942dc5c2445a3faa8ad37cbf4c82 ] The ixgbe driver uses a state bit lock to avoid handling more than one Tx timestamp request at once. This is required because hardware is limited to a single set of registers for Tx timestamps. The state bit lock is not properly cleaned up during ixgbe_xmit_frame_ring() if the transmit fails such as due to DMA or TSO failure. In some hardware this results in blocking timestamps until the service task times out. In other hardware this results in a permanent lock of the timestamp bit because we never receive an interrupt indicating the timestamp occurred, since indeed the packet was never transmitted. Fix this by checking for DMA and TSO errors in ixgbe_xmit_frame_ring() and properly cleaning up after ourselves when these occur. Reported-by: Reported-by: David Mirabito Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/et= hernet/intel/ixgbe/ixgbe_main.c index a5428b6abdac..4856cf83f9e4 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -7472,9 +7472,9 @@ static inline int ixgbe_maybe_stop_tx(struct ixgbe_ri= ng *tx_ring, u16 size) #define IXGBE_TXD_CMD (IXGBE_TXD_CMD_EOP | \ IXGBE_TXD_CMD_RS) =20 -static void ixgbe_tx_map(struct ixgbe_ring *tx_ring, - struct ixgbe_tx_buffer *first, - const u8 hdr_len) +static int ixgbe_tx_map(struct ixgbe_ring *tx_ring, + struct ixgbe_tx_buffer *first, + const u8 hdr_len) { struct sk_buff *skb =3D first->skb; struct ixgbe_tx_buffer *tx_buffer; @@ -7601,7 +7601,7 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring, mmiowb(); } =20 - return; + return 0; dma_error: dev_err(tx_ring->dev, "TX DMA map failed\n"); =20 @@ -7617,6 +7617,8 @@ dma_error: } =20 tx_ring->next_to_use =3D i; + + return -1; } =20 static void ixgbe_atr(struct ixgbe_ring *ring, @@ -7917,13 +7919,21 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *s= kb, #ifdef IXGBE_FCOE xmit_fcoe: #endif /* IXGBE_FCOE */ - ixgbe_tx_map(tx_ring, first, hdr_len); + if (ixgbe_tx_map(tx_ring, first, hdr_len)) + goto cleanup_tx_timestamp; =20 return NETDEV_TX_OK; =20 out_drop: dev_kfree_skb_any(first->skb); first->skb =3D NULL; +cleanup_tx_timestamp: + if (unlikely(tx_flags & IXGBE_TX_FLAGS_TSTAMP)) { + dev_kfree_skb_any(adapter->ptp_tx_skb); + adapter->ptp_tx_skb =3D NULL; + cancel_work_sync(&adapter->ptp_tx_work); + clear_bit_unlock(__IXGBE_PTP_TX_IN_PROGRESS, &adapter->state); + } =20 return NETDEV_TX_OK; } --=20 2.15.1