From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bk0-x22d.google.com (mail-bk0-x22d.google.com [IPv6:2a00:1450:4008:c01::22d]) by dpdk.org (Postfix) with ESMTP id 24F9B532D for ; Wed, 12 Jun 2013 11:17:04 +0200 (CEST) Received: by mail-bk0-f45.google.com with SMTP id je9so2886134bkc.4 for ; Wed, 12 Jun 2013 02:17:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=iuxWMBVpGY6KfkJkCJLU9OpitmGY3hiBvSzmOBB0Kh8=; b=BZKchBpSA/1+EAFLxzyxHcRFG0lhqHmBoL44QLckzR51DU61hN21DWodbouZWcwO8w cagbJKgRR+QR3j1eEVOmWW3a+nq3j7S3DdAX0TGXs9bID5dk8IXa20uDk5bCk2ZyYK0X g9SdPGiHXB8CR3zayF9PXT+qCIGwWZkiippGFLFi38RfeP2CKjb8fHgFjKrRDYLkLMAM gHIW4kEh8hjaygmlySZVYuo8EftiaTNSHBohg3g3BFsM7puRxO0Od7H7a+9A7Or2cfMo Ung/81HZ7C/EXJsLIur3mxPqGMJqdAwZob6aFW0NgzEN1C4FEMdVwbwKlwPsbP42QnjF Rnag== X-Received: by 10.204.239.199 with SMTP id kx7mr2991955bkb.153.1371028633614; Wed, 12 Jun 2013 02:17:13 -0700 (PDT) Received: from [10.16.0.195] (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id i15sm7127140bkz.12.2013.06.12.02.17.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Jun 2013 02:17:12 -0700 (PDT) Message-ID: <51B83C9B.4060807@6wind.com> Date: Wed, 12 Jun 2013 11:17:15 +0200 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.6esrpre) Gecko/20120817 Icedove/10.0.6 MIME-Version: 1.0 To: dev@dpdk.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkuDuxxZCXVfPtp5gsQUohjhB7D6bGzE5fpqGIRaiuViQzPbsd4MV0WxYRp3YoP+H0n70zX Subject: Re: [dpdk-dev] Can the empty struct rte_eth_txmode be enhanced? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jun 2013 09:17:04 -0000 Hello, > Can we change the struct rte_eth_txmode ? > > Such as : > > struct rte_eth_txmode { int reserve[]; }; /* sizeof(struct rte_eth_txmode) == 0 in gcc and g++ */ I agree with your solution. Do you approve the following patch ? From: lxu Date: Wed, 12 Jun 2013 09:32:30 +0200 Subject: [PATCH] ethdev: force the size of struct rte_eth_txmode to be 0 The size of an empty structure is 0 when compiling with gcc, and 1 when compiling with g++. Adding an empty table forces the size fo be 0, in C or C++. Acked-by: Olivier Matz Signed-off-by: lxu --- lib/librte_ether/rte_ethdev.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 5985496..e0a1ccf 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -320,6 +320,7 @@ struct rte_eth_vmdq_dcb_conf { * For future extensions. */ struct rte_eth_txmode { + int reserved[]; /* force the size of struct to be 0 */ }; /** -- 1.7.10.4