From patchwork Fri May 13 11:40:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 67761 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp218631qge; Fri, 13 May 2016 04:40:57 -0700 (PDT) X-Received: by 10.140.89.202 with SMTP id v68mr14491266qgd.95.1463139657632; Fri, 13 May 2016 04:40:57 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id v63si11787497qhc.83.2016.05.13.04.40.57; Fri, 13 May 2016 04:40:57 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id 4269061651; Fri, 13 May 2016 11:40:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id BB470615DA; Fri, 13 May 2016 11:40:52 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 4B639615E1; Fri, 13 May 2016 11:40:51 +0000 (UTC) Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by lists.linaro.org (Postfix) with ESMTPS id 5C7816107B for ; Fri, 13 May 2016 11:40:50 +0000 (UTC) Received: from demuprx017.emea.nsn-intra.net ([10.150.129.56]) by demumfd002.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id u4DBenDj019357 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 13 May 2016 11:40:49 GMT Received: from 10.144.19.15 ([10.144.104.109]) by demuprx017.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id u4DBemBm002167 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 13 May 2016 13:40:48 +0200 From: Matias Elo To: lng-odp@lists.linaro.org Date: Fri, 13 May 2016 14:40:47 +0300 Message-Id: <1463139647-10048-1-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 1878 X-purgate-ID: 151667::1463139649-00002418-2DC3E0B2/0/0 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic: dpdk: use memset() to initialize dev_info X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Clang build fails due to a missing field in initializer error. This is a known clang bug (https://llvm.org/bugs/show_bug.cgi?id=21689). Circumvent this by using memset() instead. Signed-off-by: Matias Elo Reviewed-by: Bill Fischofer --- platform/linux-generic/pktio/dpdk.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index e6af8fb..831dc26 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -177,11 +177,13 @@ static int dpdk_netdev_is_valid(const char *s) static uint32_t dpdk_vdev_mtu_get(uint8_t port_id) { - struct rte_eth_dev_info dev_info = {0}; + struct rte_eth_dev_info dev_info; struct ifreq ifr; int sockfd; uint32_t mtu; + memset(&dev_info, 0, sizeof(struct rte_eth_dev_info)); + rte_eth_dev_info_get(port_id, &dev_info); if_indextoname(dev_info.if_index, ifr.ifr_name); @@ -219,11 +221,13 @@ static uint32_t dpdk_mtu_get(pktio_entry_t *pktio_entry) static int dpdk_vdev_promisc_mode_get(uint8_t port_id) { - struct rte_eth_dev_info dev_info = {0}; + struct rte_eth_dev_info dev_info; struct ifreq ifr; int sockfd; int mode; + memset(&dev_info, 0, sizeof(struct rte_eth_dev_info)); + rte_eth_dev_info_get(port_id, &dev_info); if_indextoname(dev_info.if_index, ifr.ifr_name); @@ -240,11 +244,13 @@ static int dpdk_vdev_promisc_mode_get(uint8_t port_id) static int dpdk_vdev_promisc_mode_set(uint8_t port_id, int enable) { - struct rte_eth_dev_info dev_info = {0}; + struct rte_eth_dev_info dev_info; struct ifreq ifr; int sockfd; int mode; + memset(&dev_info, 0, sizeof(struct rte_eth_dev_info)); + rte_eth_dev_info_get(port_id, &dev_info); if_indextoname(dev_info.if_index, ifr.ifr_name);