From patchwork Thu Aug 30 14:01:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 10581743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75FCA14BD for ; Thu, 30 Aug 2018 14:02:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6552E2BF57 for ; Thu, 30 Aug 2018 14:02:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59B012BF60; Thu, 30 Aug 2018 14:02:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F004F2BF5F for ; Thu, 30 Aug 2018 14:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729079AbeH3SEQ (ORCPT ); Thu, 30 Aug 2018 14:04:16 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:42462 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728991AbeH3SEQ (ORCPT ); Thu, 30 Aug 2018 14:04:16 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7UDxOFr175859; Thu, 30 Aug 2018 14:01:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=6/NM60rxDlccdBMlMnl1laotFjoPaLsNrX1e3qBKA40=; b=SSuL3rmNDKH0Hk6X9CyiwJb95wBYZ91AgE5U29fADEFrQvaTluDB9bS2fnwL5/TDda7T E/iiYjrAT5udJUG+/xAJJSjvQeUjC+/e6JtCXD5U5+sJQP1jyA2FaEt59QZoxbQZCBnv dcFWL2HlU8UkY/XZ5zFlgPifgObzwMrwAhUc3CnTYD36BBsd+zon8SQLDF+6PKE6lzr0 xOJ3qJeG6HTJAxoEMntTSUmp1FJ8PBDrey+iUUsFyyhnhivGvFXWnt/2O/x+/XC+Ksjr Q3rArEqTt91wc2+TWw+QXaKNoaKl5SoYiyYJ/LbMd0WR9osB6EnqwN7+zAceXM1KPkxE oA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2m2y2ptktg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Aug 2018 14:01:52 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7UE1kLg018770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Aug 2018 14:01:46 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w7UE1jdM015480; Thu, 30 Aug 2018 14:01:45 GMT Received: from localhost.localdomain (/77.138.186.148) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 30 Aug 2018 07:01:44 -0700 From: Yuval Shaia To: aditr@vmware.com, pv-drivers@vmware.com, dledford@redhat.com, jgg@mellanox.com, jgg@ziepe.ca, marcel.apfelbaum@gmail.com, linux-rdma@vger.kernel.org Cc: Yuval Shaia Subject: [PATCH] RDMA/vmw_pvrdma: Update device when link is doing down Date: Thu, 30 Aug 2018 17:01:29 +0300 Message-Id: <20180830140129.24878-1-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9000 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808300146 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When Ethernet function goes up the driver updates the device. Add support to device quiesce operation as a result of netdev down event. Since this operation might not be supported by the device yet a warning is printed and not error. While there fix the error message in the netdev up event. Signed-off-by: Yuval Shaia --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h | 1 + drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h index 6fd5a8f4e2f6..fe966393991c 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h @@ -167,6 +167,7 @@ enum pvrdma_device_ctl { PVRDMA_DEVICE_CTL_ACTIVATE, /* Activate device. */ PVRDMA_DEVICE_CTL_UNQUIESCE, /* Unquiesce device. */ PVRDMA_DEVICE_CTL_RESET, /* Reset device. */ + PVRDMA_DEVICE_CTL_QUIESCE, /* Quiesce device. */ }; enum pvrdma_intr_vector { diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c index a5719899f49a..0183faa2f54d 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c @@ -701,6 +701,15 @@ static void pvrdma_netdevice_event_handle(struct pvrdma_dev *dev, switch (event) { case NETDEV_REBOOT: case NETDEV_DOWN: + pvrdma_write_reg(dev, PVRDMA_REG_CTL, + PVRDMA_DEVICE_CTL_QUIESCE); + + mb(); + + if (pvrdma_read_reg(dev, PVRDMA_REG_ERR)) + dev_warn(&dev->pdev->dev, + "failed to quiesce device during link down\n"); + pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ERR); break; case NETDEV_UP: @@ -711,7 +720,7 @@ static void pvrdma_netdevice_event_handle(struct pvrdma_dev *dev, if (pvrdma_read_reg(dev, PVRDMA_REG_ERR)) dev_err(&dev->pdev->dev, - "failed to activate device during link up\n"); + "failed to unquiesce device during link up\n"); else pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ACTIVE); break;