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 2C1CA4CB5 for ; Mon, 26 Feb 2018 09:11:12 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2018 00:11:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,396,1515484800"; d="scan'208";a="206974775" Received: from unknown (HELO dpdk5.bj.intel.com) ([172.16.182.198]) by fmsmga005.fm.intel.com with ESMTP; 26 Feb 2018 00:11:10 -0800 From: Zhiyong Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com, somnath.kotur@broadcom.com, Zhiyong Yang Date: Mon, 26 Feb 2018 16:11:02 +0800 Message-Id: <20180226081103.64154-5-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20180226081103.64154-1-zhiyong.yang@intel.com> References: <20180226081103.64154-1-zhiyong.yang@intel.com> Subject: [dpdk-dev] [PATCH 4/5] net/bnxt: remove void pointer cast 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: , X-List-Received-Date: Mon, 26 Feb 2018 08:11:12 -0000 Cc: ajit.khaparde@broadcom.com Cc: somnath.kotur@broadcom.com Signed-off-by: Zhiyong Yang --- drivers/net/bnxt/bnxt_filter.c | 44 ++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c index 032e8eed0..bbaae1a07 100644 --- a/drivers/net/bnxt/bnxt_filter.c +++ b/drivers/net/bnxt/bnxt_filter.c @@ -354,8 +354,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, } switch (item->type) { case RTE_FLOW_ITEM_TYPE_ETH: - eth_spec = (const struct rte_flow_item_eth *)item->spec; - eth_mask = (const struct rte_flow_item_eth *)item->mask; + eth_spec = item->spec; + eth_mask = item->mask; /* Source MAC address mask cannot be partially set. * Should be All 0's or all 1's. @@ -410,10 +410,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, break; case RTE_FLOW_ITEM_TYPE_VLAN: - vlan_spec = - (const struct rte_flow_item_vlan *)item->spec; - vlan_mask = - (const struct rte_flow_item_vlan *)item->mask; + vlan_spec = item->spec; + vlan_mask = item->mask; if (vlan_mask->tci & 0xFFFF && !vlan_mask->tpid) { /* Only the VLAN ID can be matched. */ filter->l2_ovlan = @@ -431,10 +429,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, break; case RTE_FLOW_ITEM_TYPE_IPV4: /* If mask is not involved, we could use EM filters. */ - ipv4_spec = - (const struct rte_flow_item_ipv4 *)item->spec; - ipv4_mask = - (const struct rte_flow_item_ipv4 *)item->mask; + ipv4_spec = item->spec; + ipv4_mask = item->mask; /* Only IP DST and SRC fields are maskable. */ if (ipv4_mask->hdr.version_ihl || ipv4_mask->hdr.type_of_service || @@ -483,10 +479,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, } break; case RTE_FLOW_ITEM_TYPE_IPV6: - ipv6_spec = - (const struct rte_flow_item_ipv6 *)item->spec; - ipv6_mask = - (const struct rte_flow_item_ipv6 *)item->mask; + ipv6_spec = item->spec; + ipv6_mask = item->mask; /* Only IP DST and SRC fields are maskable. */ if (ipv6_mask->hdr.vtc_flow || @@ -527,8 +521,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6; break; case RTE_FLOW_ITEM_TYPE_TCP: - tcp_spec = (const struct rte_flow_item_tcp *)item->spec; - tcp_mask = (const struct rte_flow_item_tcp *)item->mask; + tcp_spec = item->spec; + tcp_mask = item->mask; /* Check TCP mask. Only DST & SRC ports are maskable */ if (tcp_mask->hdr.sent_seq || @@ -564,8 +558,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, } break; case RTE_FLOW_ITEM_TYPE_UDP: - udp_spec = (const struct rte_flow_item_udp *)item->spec; - udp_mask = (const struct rte_flow_item_udp *)item->mask; + udp_spec = item->spec; + udp_mask = item->mask; if (udp_mask->hdr.dgram_len || udp_mask->hdr.dgram_cksum) { @@ -597,10 +591,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, } break; case RTE_FLOW_ITEM_TYPE_VXLAN: - vxlan_spec = - (const struct rte_flow_item_vxlan *)item->spec; - vxlan_mask = - (const struct rte_flow_item_vxlan *)item->mask; + vxlan_spec = item->spec; + vxlan_mask = item->mask; /* Check if VXLAN item is used to describe protocol. * If yes, both spec and mask should be NULL. * If no, both spec and mask shouldn't be NULL. @@ -646,10 +638,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, } break; case RTE_FLOW_ITEM_TYPE_NVGRE: - nvgre_spec = - (const struct rte_flow_item_nvgre *)item->spec; - nvgre_mask = - (const struct rte_flow_item_nvgre *)item->mask; + nvgre_spec = item->spec; + nvgre_mask = item->mask; /* Check if NVGRE item is used to describe protocol. * If yes, both spec and mask should be NULL. * If no, both spec and mask shouldn't be NULL. @@ -692,7 +682,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, } break; case RTE_FLOW_ITEM_TYPE_VF: - vf_spec = (const struct rte_flow_item_vf *)item->spec; + vf_spec = item->spec; vf = vf_spec->id; if (!BNXT_PF(bp)) { rte_flow_error_set(error, EINVAL, -- 2.13.3