From patchwork Fri Jun 12 03:24:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 71344 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47379A00BE; Fri, 12 Jun 2020 05:49:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 475F21BF83; Fri, 12 Jun 2020 05:46:43 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 371201BF80 for ; Fri, 12 Jun 2020 05:46:41 +0200 (CEST) IronPort-SDR: XQhmOH8kPxHgLXqQkn8grGMMMVpqRZhI+r2PJMYzSOj4MzbZiwZICVM7WamJC4cgQOo1bk0jCs AR98ZS3VLoGQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2020 20:46:40 -0700 IronPort-SDR: LMPOxHyBk6yWhiyk4vp1yS4Kz6nAt6byV6BU375mbM+a96bq1gp4jq976tjtVXWiLQtRhSBhAU sj5rl1EFXlBQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,501,1583222400"; d="scan'208";a="289759604" Received: from intel.sh.intel.com ([10.239.255.18]) by orsmga002.jf.intel.com with ESMTP; 11 Jun 2020 20:46:39 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Guinan Sun , =?utf-8?q?Stanis=C5=82aw_Grzeszczak?= Date: Fri, 12 Jun 2020 03:24:09 +0000 Message-Id: <20200612032410.20864-21-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200612032410.20864-1-guinanx.sun@intel.com> References: <20200612032410.20864-1-guinanx.sun@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 20/21] net/ixgbe/base: check Host Interface Return Status X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Writing to read-only fields returns a non-OK Return Status for shadow RAM write command for X550. This information was previously discarded. Testing Hints: check if write to a read-only field, e.g. PHY Module Pointer, returns an error. Signed-off-by: Stanisław Grzeszczak Signed-off-by: Guinan Sun --- drivers/net/ixgbe/base/ixgbe_x550.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index 8343efbc2..05199abb8 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -3248,7 +3248,18 @@ s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset, status = ixgbe_host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), - IXGBE_HI_COMMAND_TIMEOUT, false); + IXGBE_HI_COMMAND_TIMEOUT, true); + if (status != IXGBE_SUCCESS) { + DEBUGOUT2("for offset %04x failed with status %d\n", + offset, status); + return status; + } + + if (buffer.hdr.rsp.buf_lenh_status != FW_CEM_RESP_STATUS_SUCCESS) { + DEBUGOUT2("for offset %04x host interface return status %02x\n", + offset, buffer.hdr.rsp.buf_lenh_status); + return IXGBE_ERR_HOST_INTERFACE_COMMAND; + } return status; }