From patchwork Tue Mar 8 08:14:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Helin" X-Patchwork-Id: 11176 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id AFBA85580; Tue, 8 Mar 2016 09:15:16 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B2BE14CE7 for ; Tue, 8 Mar 2016 09:15:14 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 08 Mar 2016 00:15:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,556,1449561600"; d="scan'208";a="61904678" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga004.fm.intel.com with ESMTP; 08 Mar 2016 00:15:08 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u288F6gC008547; Tue, 8 Mar 2016 16:15:06 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u288F2BT026731; Tue, 8 Mar 2016 16:15:04 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u288F2jM026727; Tue, 8 Mar 2016 16:15:02 +0800 From: Helin Zhang To: dev@dpdk.org Date: Tue, 8 Mar 2016 16:14:19 +0800 Message-Id: <1457424877-26234-12-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1457424877-26234-1-git-send-email-helin.zhang@intel.com> References: <1457278919-30800-1-git-send-email-helin.zhang@intel.com> <1457424877-26234-1-git-send-email-helin.zhang@intel.com> Subject: [dpdk-dev] [PATCH v5 11/29] i40e/base: fix up recent proxy bits for X722_SUPPORT X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The recently added proxy opcodes should be available only with X722_SUPPORT, so move them into the #ifdef, and reorder these to be in numerical order with the rest of the opcodes. Several structs that were added are unnecessary, so they are removed here. Fixes: 788fc17b2dec ("i40e/base: support proxy config for X722") Signed-off-by: Helin Zhang Acked-by: Jingjing Wu --- drivers/net/i40e/base/i40e_adminq_cmd.h | 46 +++++---------------------------- drivers/net/i40e/base/i40e_common.c | 14 +++++----- 2 files changed, 12 insertions(+), 48 deletions(-) v4: - Reworded the commit logs. - Splitted proxy related code changed to a standalone patch. diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index e2e17c5..ff6449c 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -139,6 +139,12 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, +#ifdef X722_SUPPORT + /* Proxy commands */ + i40e_aqc_opc_set_proxy_config = 0x0104, + i40e_aqc_opc_set_ns_proxy_table_entry = 0x0105, + +#endif /* LAA */ i40e_aqc_opc_mac_address_read = 0x0107, i40e_aqc_opc_mac_address_write = 0x0108, @@ -278,10 +284,6 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_get_rss_lut = 0x0B05, #endif - /* Proxy commands */ - i40e_aqc_opc_set_proxy_config = 0x0104, - i40e_aqc_opc_set_ns_proxy_table_entry = 0x0105, - /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -2466,40 +2468,4 @@ struct i40e_aqc_debug_modify_internals { I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_internals); -#ifdef X722_SUPPORT -struct i40e_aqc_set_proxy_config { - u8 reserved_1[4]; - u8 reserved_2[4]; - __le32 address_high; - __le32 address_low; -}; - -I40E_CHECK_CMD_LENGTH(i40e_aqc_set_proxy_config); - -struct i40e_aqc_set_proxy_config_resp { - u8 reserved[8]; - __le32 address_high; - __le32 address_low; -}; - -I40E_CHECK_CMD_LENGTH(i40e_aqc_set_proxy_config_resp); - -struct i40e_aqc_set_ns_proxy_table_entry { - u8 reserved_1[4]; - u8 reserved_2[4]; - __le32 address_high; - __le32 address_low; -}; - -I40E_CHECK_CMD_LENGTH(i40e_aqc_set_ns_proxy_table_entry); - -struct i40e_aqc_set_ns_proxy_table_entry_resp { - u8 reserved_1[4]; - u8 reserved_2[4]; - __le32 address_high; - __le32 address_low; -}; - -I40E_CHECK_CMD_LENGTH(i40e_aqc_set_ns_proxy_table_entry_resp); -#endif #endif /* _I40E_ADMINQ_CMD_H_ */ diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 67a5e21..cfe071b 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -5818,8 +5818,6 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw, struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; - struct i40e_aqc_set_proxy_config *cmd = - (struct i40e_aqc_set_proxy_config *) &desc.params.raw; enum i40e_status_code status; if (!proxy_config) @@ -5827,8 +5825,10 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_proxy_config); - cmd->address_high = CPU_TO_LE32(I40E_HI_DWORD((u64)proxy_config)); - cmd->address_low = CPU_TO_LE32(I40E_LO_DWORD((u64)proxy_config)); + desc.params.external.addr_high = + CPU_TO_LE32(I40E_HI_DWORD((u64)proxy_config)); + desc.params.external.addr_low = + CPU_TO_LE32(I40E_LO_DWORD((u64)proxy_config)); status = i40e_asq_send_command(hw, &desc, proxy_config, sizeof(struct i40e_aqc_arp_proxy_data), @@ -5851,8 +5851,6 @@ enum i40e_status_code i40e_aq_set_ns_proxy_table_entry(struct i40e_hw *hw, struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; - struct i40e_aqc_set_ns_proxy_table_entry *cmd = - (struct i40e_aqc_set_ns_proxy_table_entry *) &desc.params.raw; enum i40e_status_code status; if (!ns_proxy_table_entry) @@ -5861,9 +5859,9 @@ enum i40e_status_code i40e_aq_set_ns_proxy_table_entry(struct i40e_hw *hw, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_ns_proxy_table_entry); - cmd->address_high = + desc.params.external.addr_high = CPU_TO_LE32(I40E_HI_DWORD((u64)ns_proxy_table_entry)); - cmd->address_low = + desc.params.external.addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)ns_proxy_table_entry)); status = i40e_asq_send_command(hw, &desc, ns_proxy_table_entry,