DPDK patches and discussions
 help / color / mirror / Atom feed
From: Zhiyong Yang <zhiyong.yang@intel.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com,
	somnath.kotur@broadcom.com, Zhiyong Yang <zhiyong.yang@intel.com>
Subject: [dpdk-dev] [PATCH 4/5] net/bnxt: remove void pointer cast
Date: Mon, 26 Feb 2018 16:11:02 +0800	[thread overview]
Message-ID: <20180226081103.64154-5-zhiyong.yang@intel.com> (raw)
In-Reply-To: <20180226081103.64154-1-zhiyong.yang@intel.com>

Cc: ajit.khaparde@broadcom.com
Cc: somnath.kotur@broadcom.com
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 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

  parent reply	other threads:[~2018-02-26  8:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26  8:10 [dpdk-dev] [PATCH 0/5] remove void pointer explicit cast Zhiyong Yang
2018-02-26  8:10 ` [dpdk-dev] [PATCH 1/5] flow_classify: remove void pointer cast Zhiyong Yang
2018-03-14 11:02   ` Iremonger, Bernard
2018-02-26  8:11 ` [dpdk-dev] [PATCH 2/5] net/ixgbe: " Zhiyong Yang
2018-02-26  8:11 ` [dpdk-dev] [PATCH 3/5] net/e1000: " Zhiyong Yang
2018-02-26  8:11 ` Zhiyong Yang [this message]
2018-02-26  8:11 ` [dpdk-dev] [PATCH 5/5] net/sfc: " Zhiyong Yang
2018-02-26 11:03   ` Andrew Rybchenko
2018-02-27 13:45 ` [dpdk-dev] [PATCH 0/5] remove void pointer explicit cast Ferruh Yigit
2018-03-06 18:57 ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180226081103.64154-5-zhiyong.yang@intel.com \
    --to=zhiyong.yang@intel.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=somnath.kotur@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).