Received: by 2002:a17:90a:c8b:0:0:0:0 with SMTP id v11csp2304292pja; Fri, 19 Apr 2019 11:38:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzioLPWT0V1nhlaK2GHfcaPDKvNCD5nPufl8Xt96P4FhPQ++QW+zgQKdZ9nVwABnHiAlLLh X-Received: by 2002:a17:902:8a8b:: with SMTP id p11mr5235646plo.227.1555699098195; Fri, 19 Apr 2019 11:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555699098; cv=none; d=google.com; s=arc-20160816; b=HbyRfuO4BoNLVeYss2V8lOjN4A4HZjWkclRMRoum+DxPFJNavHe4WHV6q+puwbHem+ 2rrOmRcLMQNyeQrKVpWw5Tz8955wu5K2YbqM1bjp4slv1zBwkEZxY0jpSTt8rlCDLd4J w3DsoM9EzkRLkD68diNHiKzufYUb8ttO3p3REYhT39INiGMBdls3Au2sdpfivo/m7y+v n3cRSV/kTypcLHo8T4zkvvTOFGX+S6CRojlOgL11DaQzP55OK4cOOSaqkeKhXA2RK8nx AjMUaYJN91PkJIouFcaAD1Jn4SU4vi1LmumQ+2xUF1/tObE6kZyhByCmgsYhno3O0dJN wioQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FRVON0M3WXjIh+AZ8GZ2xUfdp/MQsd1QAOvoBPdoXgw=; b=gdIp0AZNzLemW/tm10fO/IcR/Va9D05OEmG7VwItRH65ijKy6xgZxcS6sWI1ALSG2a BjDN+GSLzC0Jcy6aWyXUtt3TEpTtH/K3ADeU18K46HwwFJ34xmUICPjkd22BKYwUJ40G zPjRKQ9gbwNJu07MubgirSQP+Bx8V713X7Xfv9POmSUvD0ngRFB9010//UoHYaoS5JOt dOV5fcbOIm7IAMLDTUQRfv6ap9be2I45hsCS4IiHLXX8jM8aqeVcUWJZB+zdhUWDLDQg Wj+qDzaznACbLN5g7+tiAKu4Fm6hI/xdnLqNkqJCqzImZdS1SyUcnR26exTcBqU+rmse w5lw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g97si4171049plb.70.2019.04.19.11.38.03; Fri, 19 Apr 2019 11:38:18 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728189AbfDSSgj (ORCPT + 99 others); Fri, 19 Apr 2019 14:36:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36128 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbfDSSgi (ORCPT ); Fri, 19 Apr 2019 14:36:38 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 97FCB30832C2; Fri, 19 Apr 2019 11:29:05 +0000 (UTC) Received: from hmswarspite.think-freely.org (ovpn-120-68.rdu2.redhat.com [10.10.120.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9738F5D9C5; Fri, 19 Apr 2019 11:29:04 +0000 (UTC) Date: Fri, 19 Apr 2019 07:29:02 -0400 From: Neil Horman To: Huazhong Tan Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, salil.mehta@huawei.com, yisen.zhuang@huawei.com, linuxarm@huawei.com, Weihang Li , Peng Li Subject: Re: [PATCH net-next 10/12] net: hns3: Add handling of MAC tunnel interruption Message-ID: <20190419112902.GA31368@hmswarspite.think-freely.org> References: <1555643147-52407-1-git-send-email-tanhuazhong@huawei.com> <1555643147-52407-11-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1555643147-52407-11-git-send-email-tanhuazhong@huawei.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 19 Apr 2019 11:29:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 19, 2019 at 11:05:45AM +0800, Huazhong Tan wrote: > From: Weihang Li > > MAC tnl interruptions are different from other type of RAS and MSI-X > errors, because some bits, such as OVF/LR/RF will occur during link up > and down. > > The drivers should clear status of all MAC tnl interruption bits but > shouldn't print any message that would mislead the users. > > In case that link down and re-up in a short time because of some reasons, > we record when they occurred, and users can query them by debugfs. > > Signed-off-by: Weihang Li > Signed-off-by: Peng Li > --- >> > bool en) > { > @@ -1611,6 +1636,7 @@ pci_ers_result_t hclge_handle_hw_ras_error(struct hnae3_ae_dev *ae_dev) > int hclge_handle_hw_msix_error(struct hclge_dev *hdev, > unsigned long *reset_requests) > { > + struct hclge_mac_tnl_stats mac_tnl_stats; > struct device *dev = &hdev->pdev->dev; > u32 mpf_bd_num, pf_bd_num, bd_num; > enum hnae3_reset_type reset_level; > @@ -1745,6 +1771,31 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev, > set_bit(HNAE3_GLOBAL_RESET, reset_requests); > } > > + /* query and clear mac tnl interruptions */ > + hclge_cmd_setup_basic_desc(&desc[0], HCLGE_OPC_QUERY_MAC_TNL_INT, > + true); > + ret = hclge_cmd_send(&hdev->hw, &desc[0], 1); Is this running in interrupt context ever? I don't think it is, but the function name makes me think otherwise. If it is, this could be unsafe as you take a spinlock in hclge_cmd_send, which is protected against bottom halves, but not interrupts. That could cause a deadlock if there is a path to get here directly from an interrupt context. Neil