From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) by dpdk.org (Postfix) with ESMTP id E505B728E for ; Thu, 8 Mar 2018 03:51:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1859; q=dns/txt; s=iport; t=1520477488; x=1521687088; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=BO6cLbFGDnlsJtyQ9uSkO23BdRCTZA2z8ybVet6FhC0=; b=MOv0cYUB+tVTJ45li1nI1sTPdWQbN74ixIPx1nA3Re2ymy03efHROHCO g7rofG14/h8Z3W/LzTwEQ7dpdbKOdYsQMP6Cvt2/44zwLpFb7pynpjA2I iETtsmkkkP1ueizXuRwQn3nILZEAV2DJ/7qp9GeVNyWamBfIXIoQ56dC7 M=; X-IronPort-AV: E=Sophos;i="5.47,438,1515456000"; d="scan'208";a="364994638" Received: from rcdn-core-7.cisco.com ([173.37.93.143]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2018 02:51:28 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-7.cisco.com (8.14.5/8.14.5) with ESMTP id w282pRoj018502; Thu, 8 Mar 2018 02:51:27 GMT Received: by cisco.com (Postfix, from userid 392789) id A41FA20F2001; Wed, 7 Mar 2018 18:51:27 -0800 (PST) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim Date: Wed, 7 Mar 2018 18:47:01 -0800 Message-Id: <20180308024702.25974-10-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180308024702.25974-1-johndale@cisco.com> References: <20180306014634.28398-2-johndale@cisco.com> <20180308024702.25974-1-johndale@cisco.com> Subject: [dpdk-dev] [PATCH v3 09/10] net/enic: use memcpy to avoid strict aliasing warnings 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: Thu, 08 Mar 2018 02:51:29 -0000 From: Hyong Youb Kim Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_clsf.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c index 3ef1d0832..9d95201ec 100644 --- a/drivers/net/enic/enic_clsf.c +++ b/drivers/net/enic/enic_clsf.c @@ -111,7 +111,6 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, struct rte_eth_fdir_masks *masks) { struct filter_generic_1 *gp = &fltr->u.generic_1; - int i; fltr->type = FILTER_DPDK_1; memset(gp, 0, sizeof(*gp)); @@ -273,18 +272,14 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, ipv6_mask.proto = masks->ipv6_mask.proto; ipv6_val.proto = input->flow.ipv6_flow.proto; } - for (i = 0; i < 4; i++) { - *(uint32_t *)&ipv6_mask.src_addr[i * 4] = - masks->ipv6_mask.src_ip[i]; - *(uint32_t *)&ipv6_val.src_addr[i * 4] = - input->flow.ipv6_flow.src_ip[i]; - } - for (i = 0; i < 4; i++) { - *(uint32_t *)&ipv6_mask.dst_addr[i * 4] = - masks->ipv6_mask.src_ip[i]; - *(uint32_t *)&ipv6_val.dst_addr[i * 4] = - input->flow.ipv6_flow.dst_ip[i]; - } + memcpy(ipv6_mask.src_addr, masks->ipv6_mask.src_ip, + sizeof(ipv6_mask.src_addr)); + memcpy(ipv6_val.src_addr, input->flow.ipv6_flow.src_ip, + sizeof(ipv6_val.src_addr)); + memcpy(ipv6_mask.dst_addr, masks->ipv6_mask.dst_ip, + sizeof(ipv6_mask.dst_addr)); + memcpy(ipv6_val.dst_addr, input->flow.ipv6_flow.dst_ip, + sizeof(ipv6_val.dst_addr)); if (input->flow.ipv6_flow.tc) { ipv6_mask.vtc_flow = masks->ipv6_mask.tc << 12; ipv6_val.vtc_flow = input->flow.ipv6_flow.tc << 12; -- 2.16.2