From patchwork Thu Jul 9 08:00:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 73610 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 44623A0526; Thu, 9 Jul 2020 10:16:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B8251DFE7; Thu, 9 Jul 2020 10:14:31 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 8D5371DECC for ; Thu, 9 Jul 2020 10:14:19 +0200 (CEST) IronPort-SDR: 4NIaNbttXAHPf7yA5IwYySuS9WoFWwrRUeuf/XgdMS027K8CXunAOL7cj+BNUYpwZK5+oomM4x x4A983mTeNvw== X-IronPort-AV: E=McAfee;i="6000,8403,9676"; a="212869387" X-IronPort-AV: E=Sophos;i="5.75,331,1589266800"; d="scan'208";a="212869387" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2020 01:14:19 -0700 IronPort-SDR: 0a/UuUKMsLfAWbx9coW+xsGDzFfYRdl9Vz/tte7OGgg3vkI80nQHeP2GhYxeT7WKGjsI904Eo+ /duSd0xtiRvQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,331,1589266800"; d="scan'208";a="297989278" Received: from intel.sh.intel.com ([10.239.255.18]) by orsmga002.jf.intel.com with ESMTP; 09 Jul 2020 01:14:17 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Jeff Guo , Zhao1 Wei , Guinan Sun , Krzysztof Galazka , Piotr Pietruszewski Date: Thu, 9 Jul 2020 08:00:40 +0000 Message-Id: <20200709080046.65879-14-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200709080046.65879-1-guinanx.sun@intel.com> References: <20200702031329.4495-1-guinanx.sun@intel.com> <20200709080046.65879-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 13/19] net/ixgbe/base: initialize data field in struct buffer 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" While sending request using ixgbe_hic_unlocked() the data field in buffer struct is not used. It is set when the struct is overwritten by FW to deliver the response. To not pass random data to FW the whole structure should be zeroed before use. Signed-off-by: Krzysztof Galazka Signed-off-by: Piotr Pietruszewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao --- drivers/net/ixgbe/base/ixgbe_x550.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index d3363ff1d..8343efbc2 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -3126,6 +3126,7 @@ s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data) /* one word */ buffer.length = IXGBE_CPU_TO_BE16(sizeof(u16)); buffer.pad2 = 0; + buffer.data = 0; buffer.pad3 = 0; status = hw->mac.ops.acquire_swfw_sync(hw, mask); @@ -3186,6 +3187,7 @@ s32 ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw, buffer.address = IXGBE_CPU_TO_BE32((offset + current_word) * 2); buffer.length = IXGBE_CPU_TO_BE16(words_to_read * 2); buffer.pad2 = 0; + buffer.data = 0; buffer.pad3 = 0; status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer),