From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 47AFA558E for ; Tue, 29 Mar 2016 14:44:09 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 29 Mar 2016 05:44:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,410,1455004800"; d="scan'208";a="920956553" Received: from unknown ([10.217.248.155]) by orsmga001.jf.intel.com with SMTP; 29 Mar 2016 05:44:06 -0700 Received: by (sSMTP sendmail emulation); Tue, 29 Mar 2016 14:44:05 +0200 From: Daniel Mrzyglod To: jan@semihalf.com, jpa@semihalf.com, netanel@amazon.com, evgenys@amazon.com Cc: dev@dpdk.org Date: Tue, 29 Mar 2016 14:43:53 +0200 Message-Id: <1459255434-9936-2-git-send-email-danielx.t.mrzyglod@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1459255434-9936-1-git-send-email-danielx.t.mrzyglod@intel.com> References: <1459255434-9936-1-git-send-email-danielx.t.mrzyglod@intel.com> Subject: [dpdk-dev] [PATCH 1/2] ena: icc fix compilation errors 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: , X-List-Received-Date: Tue, 29 Mar 2016 12:44:10 -0000 Fix for multiple compilation errors for ICC error #188: enumerated type mixed with another type error #592: variable "flags" is used before its value is set In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/ena_ethdev.h(39), from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/ena_ethdev.c(41): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(982): error #188: enumerated type mixed with another type curr_moder_idx = *moder_tbl_idx; ^ In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/ena_ethdev.h(39), from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/ena_ethdev.c(41): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(994): error #188: enumerated type mixed with another type new_moder_idx = curr_moder_idx + 1; ^ In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/ena_ethdev.h(39), from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/ena_ethdev.c(41): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(1000): error #188: enumerated type mixed with another type new_moder_idx = curr_moder_idx - 1; ^ In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/ena_ethdev.h(39), from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/ena_ethdev.c(41): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(1004): error #188: enumerated type mixed with another type new_moder_idx = curr_moder_idx + 1; ^ compilation aborted for /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/ena_ethdev.c (code 2) /mnt/shared/dtmrzglx/hubabuba-ena/mk/internal/rte.compile-pre.mk:126: recipe for target 'ena_ethdev.o' failed make[6]: *** [ena_ethdev.o] Error 2 CC ena_com.o In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(34): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(982): error #188: enumerated type mixed with another type curr_moder_idx = *moder_tbl_idx; ^ In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(34): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(994): error #188: enumerated type mixed with another type new_moder_idx = curr_moder_idx + 1; ^ In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(34): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(1000): error #188: enumerated type mixed with another type new_moder_idx = curr_moder_idx - 1; ^ In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(34): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(1004): error #188: enumerated type mixed with another type new_moder_idx = curr_moder_idx + 1; ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(309): error #592: variable "flags" is used before its value is set ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(541): error #592: variable "flags" is used before its value is set ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(584): error #592: variable "flags" is used before its value is set ENA_SPINLOCK_LOCK(mmio_read->lock, flags); ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(1253): error #592: variable "flags" is used before its value is set ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(1298): error #592: variable "flags" is used before its value is set ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(2193): error #188: enumerated type mixed with another type rss->hash_func = get_resp.u.flow_hash_func.selected_func; ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(2279): error #188: enumerated type mixed with another type rc = ena_com_get_hash_ctrl(ena_dev, 0, NULL); ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(2326): error #188: enumerated type mixed with another type ena_com_get_hash_ctrl(ena_dev, 0, NULL); ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c(2363): error #188: enumerated type mixed with another type ena_com_get_hash_ctrl(ena_dev, 0, NULL); ^ compilation aborted for /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.c (code 2) /mnt/shared/dtmrzglx/hubabuba-ena/mk/internal/rte.compile-pre.mk:126: recipe for target 'ena_com.o' failed make[6]: *** [ena_com.o] Error 2 CC ena_eth_com.o In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_eth_com.h(40), from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_eth_com.c(34): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(982): error #188: enumerated type mixed with another type curr_moder_idx = *moder_tbl_idx; ^ In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_eth_com.h(40), from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_eth_com.c(34): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(994): error #188: enumerated type mixed with another type new_moder_idx = curr_moder_idx + 1; ^ In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_eth_com.h(40), from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_eth_com.c(34): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(1000): error #188: enumerated type mixed with another type new_moder_idx = curr_moder_idx - 1; ^ In file included from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_eth_com.h(40), from /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_eth_com.c(34): /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_com.h(1004): error #188: enumerated type mixed with another type new_moder_idx = curr_moder_idx + 1; ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_eth_com.c(239): error #188: enumerated type mixed with another type ena_rx_ctx->l3_proto = cdesc->status & ^ /mnt/shared/dtmrzglx/hubabuba-ena/drivers/net/ena/base/ena_eth_com.c(241): error #188: enumerated type mixed with another type ena_rx_ctx->l4_proto = ^ Signed-off-by: Daniel Mrzyglod --- drivers/net/ena/base/ena_com.c | 18 +++++++++--------- drivers/net/ena/base/ena_com.h | 8 ++++---- drivers/net/ena/base/ena_eth_com.c | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c index c7355eb..f886760 100644 --- a/drivers/net/ena/base/ena_com.c +++ b/drivers/net/ena/base/ena_com.c @@ -303,7 +303,7 @@ ena_com_submit_admin_cmd(struct ena_com_admin_queue *admin_queue, struct ena_admin_acq_entry *comp, size_t comp_size_in_bytes) { - unsigned long flags; + unsigned long flags = 0; struct ena_comp_ctx *comp_ctx; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); @@ -526,7 +526,7 @@ ena_com_wait_and_process_admin_cq_interrupts( struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags; + unsigned long flags = 0; int ret = 0; ENA_WAIT_EVENT_WAIT(comp_ctx->wait_event, @@ -571,7 +571,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev *ena_dev, u16 offset) volatile struct ena_admin_ena_mmio_req_read_less_resp *read_resp = mmio_read->read_resp; u32 mmio_read_reg, ret; - unsigned long flags; + unsigned long flags = 0; int i; ENA_MIGHT_SLEEP(); @@ -1248,7 +1248,7 @@ void ena_com_abort_admin_commands(struct ena_com_dev *ena_dev) void ena_com_wait_for_abort_completion(struct ena_com_dev *ena_dev) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; - unsigned long flags; + unsigned long flags = 0; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); while (ATOMIC32_READ(&admin_queue->outstanding_cmds) != 0) { @@ -1293,7 +1293,7 @@ bool ena_com_get_admin_running_state(struct ena_com_dev *ena_dev) void ena_com_set_admin_running_state(struct ena_com_dev *ena_dev, bool state) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; - unsigned long flags; + unsigned long flags = 0; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); ena_dev->admin_queue.running_state = state; @@ -2190,7 +2190,7 @@ int ena_com_get_hash_function(struct ena_com_dev *ena_dev, if (unlikely(rc)) return rc; - rss->hash_func = get_resp.u.flow_hash_func.selected_func; + rss->hash_func = (enum ena_admin_hash_functions)get_resp.u.flow_hash_func.selected_func; if (func) *func = rss->hash_func; @@ -2276,7 +2276,7 @@ int ena_com_set_default_hash_ctrl(struct ena_com_dev *ena_dev) int rc, i; /* Get the supported hash input */ - rc = ena_com_get_hash_ctrl(ena_dev, 0, NULL); + rc = ena_com_get_hash_ctrl(ena_dev, (enum ena_admin_flow_hash_proto)0, NULL); if (unlikely(rc)) return rc; @@ -2323,7 +2323,7 @@ int ena_com_set_default_hash_ctrl(struct ena_com_dev *ena_dev) /* In case of failure, restore the old hash ctrl */ if (unlikely(rc)) - ena_com_get_hash_ctrl(ena_dev, 0, NULL); + ena_com_get_hash_ctrl(ena_dev, (enum ena_admin_flow_hash_proto)0, NULL); return rc; } @@ -2360,7 +2360,7 @@ int ena_com_fill_hash_ctrl(struct ena_com_dev *ena_dev, /* In case of failure, restore the old hash ctrl */ if (unlikely(rc)) - ena_com_get_hash_ctrl(ena_dev, 0, NULL); + ena_com_get_hash_ctrl(ena_dev, (enum ena_admin_flow_hash_proto)0, NULL); return 0; } diff --git a/drivers/net/ena/base/ena_com.h b/drivers/net/ena/base/ena_com.h index a257a68..19e53ff 100644 --- a/drivers/net/ena/base/ena_com.h +++ b/drivers/net/ena/base/ena_com.h @@ -979,7 +979,7 @@ ena_com_calculate_interrupt_delay(struct ena_com_dev *ena_dev, */ return; - curr_moder_idx = *moder_tbl_idx; + curr_moder_idx = (enum ena_intr_moder_level)*moder_tbl_idx; if (unlikely(curr_moder_idx >= ENA_INTR_MAX_NUM_OF_LEVELS)) { ena_trc_err("Wrong moderation index %u\n", curr_moder_idx); return; @@ -991,17 +991,17 @@ ena_com_calculate_interrupt_delay(struct ena_com_dev *ena_dev, if (curr_moder_idx == ENA_INTR_MODER_LOWEST) { if ((pkts > curr_moder_entry->pkts_per_interval) || (bytes > curr_moder_entry->bytes_per_interval)) - new_moder_idx = curr_moder_idx + 1; + new_moder_idx = (enum ena_intr_moder_level)(curr_moder_idx + 1); } else { pred_moder_entry = &intr_moder_tbl[curr_moder_idx - 1]; if ((pkts <= pred_moder_entry->pkts_per_interval) || (bytes <= pred_moder_entry->bytes_per_interval)) - new_moder_idx = curr_moder_idx - 1; + new_moder_idx = (enum ena_intr_moder_level)(curr_moder_idx - 1); else if ((pkts > curr_moder_entry->pkts_per_interval) || (bytes > curr_moder_entry->bytes_per_interval)) { if (curr_moder_idx != ENA_INTR_MODER_HIGHEST) - new_moder_idx = curr_moder_idx + 1; + new_moder_idx = (enum ena_intr_moder_level)(curr_moder_idx + 1); } } new_moder_entry = &intr_moder_tbl[new_moder_idx]; diff --git a/drivers/net/ena/base/ena_eth_com.c b/drivers/net/ena/base/ena_eth_com.c index c5a6dfe..459e0bb 100644 --- a/drivers/net/ena/base/ena_eth_com.c +++ b/drivers/net/ena/base/ena_eth_com.c @@ -236,11 +236,11 @@ static inline void ena_com_create_and_store_tx_meta_desc( static inline void ena_com_rx_set_flags(struct ena_com_rx_ctx *ena_rx_ctx, struct ena_eth_io_rx_cdesc_base *cdesc) { - ena_rx_ctx->l3_proto = cdesc->status & - ENA_ETH_IO_RX_CDESC_BASE_L3_PROTO_IDX_MASK; - ena_rx_ctx->l4_proto = - (cdesc->status & ENA_ETH_IO_RX_CDESC_BASE_L4_PROTO_IDX_MASK) >> - ENA_ETH_IO_RX_CDESC_BASE_L4_PROTO_IDX_SHIFT; + ena_rx_ctx->l3_proto = (enum ena_eth_io_l3_proto_index)(cdesc->status & + ENA_ETH_IO_RX_CDESC_BASE_L3_PROTO_IDX_MASK); + ena_rx_ctx->l4_proto = (enum ena_eth_io_l4_proto_index) + ((cdesc->status & ENA_ETH_IO_RX_CDESC_BASE_L4_PROTO_IDX_MASK) >> + ENA_ETH_IO_RX_CDESC_BASE_L4_PROTO_IDX_SHIFT); ena_rx_ctx->l3_csum_err = (cdesc->status & ENA_ETH_IO_RX_CDESC_BASE_L3_CSUM_ERR_MASK) >> ENA_ETH_IO_RX_CDESC_BASE_L3_CSUM_ERR_SHIFT; -- 2.5.5