summaryrefslogtreecommitdiff
path: root/examples/exception_path
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2014-09-11 14:15:35 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-09-17 18:53:40 +0200
commit08b563ffb19d8baf59dd84200f25bc85031d18a7 (patch)
tree3255773d53c7dc983b33936dd3970c0b95137935 /examples/exception_path
parent7869536f3f8edace05043be6f322b835702b201c (diff)
downloaddpdk-draft-windows-08b563ffb19d8baf59dd84200f25bc85031d18a7.zip
dpdk-draft-windows-08b563ffb19d8baf59dd84200f25bc85031d18a7.tar.gz
dpdk-draft-windows-08b563ffb19d8baf59dd84200f25bc85031d18a7.tar.xz
mbuf: replace data pointer by an offset
The mbuf structure already contains a pointer to the beginning of the buffer (m->buf_addr). It is not needed to use 8 bytes again to store another pointer to the beginning of the data. Using a 16 bits unsigned integer is enough as we know that a mbuf is never longer than 64KB. We gain 6 bytes in the structure thanks to this modification. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> * Updated to apply to latest on mainline. * Disabled vector PMD in config as it relies heavily on the mbuf layout This will be re-enabled in a subsequent commit once vPMD has been reworked to take account of mbuf changes. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Diffstat (limited to 'examples/exception_path')
-rw-r--r--examples/exception_path/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 5045ef8..f286bf2 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -302,7 +302,8 @@ main_loop(__attribute__((unused)) void *arg)
if (m == NULL)
continue;
- ret = read(tap_fd, m->data, MAX_PACKET_SZ);
+ ret = read(tap_fd, rte_pktmbuf_mtod(m, void *),
+ MAX_PACKET_SZ);
lcore_stats[lcore_id].rx++;
if (unlikely(ret < 0)) {
FATAL_ERROR("Reading from %s interface failed",