From patchwork Mon Apr 12 07:43:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Pan X-Patchwork-Id: 419853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 305DFC433ED for ; Mon, 12 Apr 2021 07:43:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E66E2600CD for ; Mon, 12 Apr 2021 07:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236983AbhDLHns (ORCPT ); Mon, 12 Apr 2021 03:43:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236968AbhDLHnr (ORCPT ); Mon, 12 Apr 2021 03:43:47 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94557C061574 for ; Mon, 12 Apr 2021 00:43:29 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id l131so7519988oih.0 for ; Mon, 12 Apr 2021 00:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P/T6Ns85BhUFKOc+ZeWiNGWVmab9FfDlLPs5EqVU/fs=; b=Zufe5x1eph7jQ7xKlAUGSVrxI8KxJKaOuwQQOPXoryvn+8fC6pzHdzC4WlvbRQCmZl T/JUyjzK2FocHQ1aeQaHdAlvbEthkgnHi5/g+5vbAWtroXk+aRPAizRQ3PigfBMRN2hB Are43VK6WwfkRxdZ0bXGNtNE4NJmKNi5hPG2pRs8LlM5pIUKrrDbebxjd4PDLz4ETxDX oQoiJ7ZUDANeFIiCuPl4ilLqJrYRB25btElA9fMazpTJWRASDwgZppVtQ0nKE0j+cs92 bu5COvJBM9wSACjbIlNapDArd5m8plqEfwCV4w/LLqhOxLj7tMD5ZOAqkWKpoAfePUw9 3Scw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P/T6Ns85BhUFKOc+ZeWiNGWVmab9FfDlLPs5EqVU/fs=; b=DA+Eh1H++4Ckk+zgv/pCdDbYvO8ra1ojPxK2/AXpQ+n9vU4IZANFLT9581gdYUbmRG 1sGi2MxfoZrPISif4oL/DAF6xJkrHzf60FFF3YVbvXV1tvWFo7aLeAXzo7bUkiHoCPYO ZyQ4hf3CAcvlV15tVN56Sb5jN7k6KePTXIN98/4d8/j7zrLNmtTE4/tYdKjOt3AWtMUo /tdYn6NMWZUT9j7eMcCnAV1MYjLCiXeMyCZChIUtcddIdBavYgJylw0GRgw6LRqpYZEU F7sxNYhZQJORdBMqyGgRW66vJBtBeY7s6NMeG0PmCcxB6oVHdzGJ2Ku80etp2uhJ8YLL gdBw== X-Gm-Message-State: AOAM5321/zilcD9s9JkkHJ3QiuV9h+Bjn07Qeg7+2hBYKeJqL24Idigo jVWQkvlW1YFhZYduOgXeTlSF93tt2mU= X-Google-Smtp-Source: ABdhPJwwLCSnX9H748XejI4ea5RP1AfArsUj2p3kp3Ma16W+zcAHoCIS3BSzUBLIZaRZMQO7wJIUYQ== X-Received: by 2002:aca:bb06:: with SMTP id l6mr18421185oif.121.1618213408848; Mon, 12 Apr 2021 00:43:28 -0700 (PDT) Received: from pear.attlocal.net ([2600:1700:271:1a80:70fe:cfb5:1414:607d]) by smtp.gmail.com with ESMTPSA id f12sm2485676otf.65.2021.04.12.00.43.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Apr 2021 00:43:28 -0700 (PDT) From: Lijun Pan To: netdev@vger.kernel.org Cc: Lijun Pan Subject: [PATCH net-next 1/2] ibmvnic: improve failover sysfs entry Date: Mon, 12 Apr 2021 02:43:29 -0500 Message-Id: <20210412074330.9371-2-lijunp213@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210412074330.9371-1-lijunp213@gmail.com> References: <20210412074330.9371-1-lijunp213@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The current implementation replies on H_IOCTL call to issue a H_SESSION_ERR_DETECTED command to let the hypervisor to send a failover signal. However, it may not work while the vnic is already in error state, e.g., "ibmvnic 30000003 env3: rx buffer returned with rc 6". Add a last resort, that is to schedule a failover reset via CRQ command. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index ee9bf18c597f..d44a7b5b8f67 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -5512,14 +5512,14 @@ static ssize_t failover_store(struct device *dev, struct device_attribute *attr, rc = plpar_hcall_norets(H_VIOCTL, adapter->vdev->unit_address, H_SESSION_ERR_DETECTED, session_token, 0, 0); if (rc) { - netdev_err(netdev, "Client initiated failover failed, rc %ld\n", + netdev_err(netdev, + "H_VIOCTL initiated failover failed, rc %ld, trying to send CRQ_CMD, the last resort\n", rc); - return -EINVAL; + ibmvnic_reset(adapter, VNIC_RESET_FAILOVER); } return count; } - static DEVICE_ATTR_WO(failover); static unsigned long ibmvnic_get_desired_dma(struct vio_dev *vdev)