From patchwork Sat May 6 04:39:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 759256 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wKbdq5hHDz9s7k for ; Sat, 6 May 2017 14:39:42 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1E00DB3F; Sat, 6 May 2017 04:39:38 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 71F972C for ; Sat, 6 May 2017 04:39:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A0F1E136 for ; Sat, 6 May 2017 04:39:35 +0000 (UTC) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by relay7-d.mail.gandi.net (Postfix) with ESMTPS id 1F357114C; Sat, 6 May 2017 06:39:34 +0200 (CEST) Received: from mfilter17-d.gandi.net (mfilter17-d.gandi.net [217.70.178.145]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 0277EA80C7; Sat, 6 May 2017 06:39:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter17-d.gandi.net Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter17-d.gandi.net (mfilter17-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id swvko1se1Blv; Sat, 6 May 2017 06:39:32 +0200 (CEST) X-Originating-IP: 63.138.96.2 Received: from sigabrt.benpfaff.org (unknown [63.138.96.2]) (Authenticated sender: blp@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 2C317A80CB; Sat, 6 May 2017 06:39:31 +0200 (CEST) From: Ben Pfaff To: dev@openvswitch.org Date: Sat, 6 May 2017 00:39:30 -0400 Message-Id: <20170506043931.15834-1-blp@ovn.org> X-Mailer: git-send-email 2.10.2 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 1/2] sparse: Add rte_memcpy.h replacement header. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Without this replacement header, building netdev-dpdk.c provokes several "sparse" warnings: /usr/include/dpdk/rte_memcpy.h:515:33: warning: incorrect type in argument 1 (different type sizes) /usr/include/dpdk/rte_memcpy.h:515:33: expected long long const [usertype] *__P /usr/include/dpdk/rte_memcpy.h:515:33: got int const [usertype] * /usr/lib/gcc/i686-linux-gnu/6//include/emmintrin.h:698:20: error: undefined identifier '__builtin_ia32_loaddqu' /usr/lib/gcc/i686-linux-gnu/6//include/emmintrin.h:698:11: error: cast from unknown type /usr/lib/gcc/i686-linux-gnu/6//include/emmintrin.h:716:3: error: undefined identifier '__builtin_ia32_storedqu' /usr/lib/gcc/i686-linux-gnu/6//include/emmintrin.h:698:43: error: not a function /usr/lib/gcc/i686-linux-gnu/6//include/emmintrin.h:716:27: error: not a function ... Signed-off-by: Ben Pfaff Acked-by: Darrell Ball --- include/sparse/automake.mk | 1 + include/sparse/rte_memcpy.h | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 include/sparse/rte_memcpy.h diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk index 0456ee67d481..f3282c260414 100644 --- a/include/sparse/automake.mk +++ b/include/sparse/automake.mk @@ -10,6 +10,7 @@ noinst_HEADERS += \ include/sparse/pthread.h \ include/sparse/rte_atomic.h \ include/sparse/rte_lcore.h \ + include/sparse/rte_memcpy.h \ include/sparse/rte_vect.h \ include/sparse/sys/socket.h \ include/sparse/sys/wait.h diff --git a/include/sparse/rte_memcpy.h b/include/sparse/rte_memcpy.h new file mode 100644 index 000000000000..5cd3f013ea8b --- /dev/null +++ b/include/sparse/rte_memcpy.h @@ -0,0 +1,39 @@ +/* Copyright (c) 2017 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef RTE_MEMCPY_H +#define RTE_MEMCPY_H 1 + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +/* Include the same headers as the real rte_memcpy(). */ +#include +#include +#include +#include + +/* Declare the same functions as the real rte_memcpy.h, without defining them. + * This gives sparse the information it needs without provoking sparse's + * complaints about the implementations. */ +void rte_mov16(uint8_t *, const uint8_t *); +void rte_mov32(uint8_t *, const uint8_t *); +void rte_mov64(uint8_t *, const uint8_t *); +void rte_mov128(uint8_t *, const uint8_t *); +void rte_mov256(uint8_t *, const uint8_t *); +void *rte_memcpy(void *, const void *, size_t); + +#endif /* RTE_MEMCPY_H_WRAPPER */