DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chao Zhu <chaozhu@linux.vnet.ibm.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] Fix KNI compiling issue on IBM Power
Date: Thu,  4 Dec 2014 18:14:08 +0800	[thread overview]
Message-ID: <1417688048-23076-2-git-send-email-chaozhu@linux.vnet.ibm.com> (raw)
In-Reply-To: <1417688048-23076-1-git-send-email-chaozhu@linux.vnet.ibm.com>

Because of different cache line size, the alignment of struct
rte_kni_mbuf in rte_kni_common.h doesn't work on IBM Power. This patch
changed from 64 to RTE_CACHE_LINE_SIZE micro to do the alignment.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
---
 .../linuxapp/eal/include/exec-env/rte_kni_common.h |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
index e548161..6fc6442 100644
--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
@@ -67,6 +67,9 @@
  * KNI name is part of memzone name.
  */
 #define RTE_KNI_NAMESIZE 32
+#ifndef RTE_CACHE_LINE_SIZE
+#define RTE_CACHE_LINE_SIZE 64                  /**< Cache line size. */
+#endif
 
 /*
  * Request id.
@@ -108,7 +111,7 @@ struct rte_kni_fifo {
  * Padding is necessary to assure the offsets of these fields
  */
 struct rte_kni_mbuf {
-	void *buf_addr __attribute__((__aligned__(64)));
+	void *buf_addr __attribute__((__aligned__(RTE_CACHE_LINE_SIZE)));
 	char pad0[10];
 	uint16_t data_off;      /**< Start address of data in segment buffer. */
 	char pad1[4];
@@ -118,7 +121,7 @@ struct rte_kni_mbuf {
 	uint32_t pkt_len;       /**< Total pkt len: sum of all segment data_len. */
 
 	/* fields on second cache line */
-	char pad3[8] __attribute__((__aligned__(64)));
+	char pad3[8] __attribute__((__aligned__(RTE_CACHE_LINE_SIZE)));
 	void *pool;
 	void *next;
 };
-- 
1.7.1

  reply	other threads:[~2014-12-04 10:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 10:14 [dpdk-dev] [PATCH] Fix KNI compiling " Chao Zhu
2014-12-04 10:14 ` Chao Zhu [this message]
2014-12-04 11:59   ` [dpdk-dev] [PATCH] Fix KNI compiling issue " Thomas Monjalon
2014-12-04 13:29     ` Neil Horman
2014-12-04 13:47       ` Thomas Monjalon
2014-12-04 15:32         ` Neil Horman
2014-12-04 15:59           ` Thomas Monjalon
2014-12-04 20:05             ` Neil Horman
2014-12-05  9:11               ` Chao Zhu
2014-12-05 13:10               ` Thomas Monjalon
2014-12-05 14:42                 ` Neil Horman
2014-12-05 14:52                   ` Thomas Monjalon

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=1417688048-23076-2-git-send-email-chaozhu@linux.vnet.ibm.com \
    --to=chaozhu@linux.vnet.ibm.com \
    --cc=dev@dpdk.org \
    /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).