[rtems-libbsd commit] Fix zero-copy mbuf support
Sebastian Huber
sebh at rtems.org
Mon May 13 07:44:50 UTC 2019
Module: rtems-libbsd
Branch: 5-freebsd-12
Commit: 6e5c6322483813b2bea41872c922f39f9e2a786a
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=6e5c6322483813b2bea41872c922f39f9e2a786a
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Mon May 13 09:31:17 2019 +0200
Fix zero-copy mbuf support
In 2017 there was a change in the mbuf API.
---
rtemsbsd/include/rtems/bsd/zerocopy.h | 3 +--
rtemsbsd/rtems/rtems-kernel-mbuf.c | 3 +--
testsuite/zerocopy01/test_main.c | 6 +++---
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/rtemsbsd/include/rtems/bsd/zerocopy.h b/rtemsbsd/include/rtems/bsd/zerocopy.h
index b15333c..339e7a4 100644
--- a/rtemsbsd/include/rtems/bsd/zerocopy.h
+++ b/rtemsbsd/include/rtems/bsd/zerocopy.h
@@ -53,8 +53,7 @@ struct mbuf *rtems_bsd_m_get(int how, short type);
struct mbuf *rtems_bsd_m_gethdr(int how, short type);
void rtems_bsd_m_extaddref(struct mbuf *m, void *buf, size_t size,
- u_int *ref_cnt, void (*freef)(void *, void *), void *arg1,
- void *arg2);
+ u_int *ref_cnt, m_ext_free_t *freef, void *arg1, void *arg2);
void rtems_bsd_m_free(struct mbuf *m);
diff --git a/rtemsbsd/rtems/rtems-kernel-mbuf.c b/rtemsbsd/rtems/rtems-kernel-mbuf.c
index a1429d8..1d10b51 100644
--- a/rtemsbsd/rtems/rtems-kernel-mbuf.c
+++ b/rtemsbsd/rtems/rtems-kernel-mbuf.c
@@ -55,8 +55,7 @@ rtems_bsd_m_gethdr(int how, short type)
void
rtems_bsd_m_extaddref(struct mbuf *m, void *buf, size_t size,
- u_int *ref_cnt, void (*freef)(void *, void *), void *arg1,
- void *arg2)
+ u_int *ref_cnt, m_ext_free_t *freef, void *arg1, void *arg2)
{
m_extaddref(m, buf, size, ref_cnt, freef, arg1, arg2);
}
diff --git a/testsuite/zerocopy01/test_main.c b/testsuite/zerocopy01/test_main.c
index d23c746..e528257 100644
--- a/testsuite/zerocopy01/test_main.c
+++ b/testsuite/zerocopy01/test_main.c
@@ -82,10 +82,10 @@ struct buffer_control {
static struct buffer_control buffer_control;
static void
-buffer_free(void *arg1, void *arg2)
+buffer_free(struct mbuf *m)
{
- struct buffer_control *bc = arg1;
- struct buffer *buf = arg2;
+ struct buffer_control *bc = m->m_ext.ext_arg1;
+ struct buffer *buf = m->m_ext.ext_arg2;
rtems_status_code sc;
rtems_interrupt_lock_context lock_context;
rtems_id waiting_task;
More information about the vc
mailing list