netmap.4 (44e86fbdcf5a3e625095652a3d0ab99532e54eea) netmap.4 (c97d2c8ae89acfbebcc61e3f00024cf3bb7b5abd)
1.\" Copyright (c) 2011-2014 Matteo Landi, Luigi Rizzo, Universita` di Pisa
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 13 unchanged lines hidden (view full) ---

22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" This document is derived in part from the enet man page (enet.4)
26.\" distributed with 4.3BSD Unix.
27.\"
28.\" $FreeBSD$
29.\"
1.\" Copyright (c) 2011-2014 Matteo Landi, Luigi Rizzo, Universita` di Pisa
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 13 unchanged lines hidden (view full) ---

22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" This document is derived in part from the enet man page (enet.4)
26.\" distributed with 4.3BSD Unix.
27.\"
28.\" $FreeBSD$
29.\"
30.Dd February 6, 2020
30.Dd October 3, 2020
31.Dt NETMAP 4
32.Os
33.Sh NAME
34.Nm netmap
35.Nd a framework for fast packet I/O
36.Sh SYNOPSIS
37.Cd device netmap
38.Sh DESCRIPTION

--- 1008 unchanged lines hidden (view full) ---

1047 struct nm_pkthdr h;
1048 ...
1049 d = nm_open("netmap:ix0", NULL, 0, 0);
1050 fds.fd = NETMAP_FD(d);
1051 fds.events = POLLIN;
1052 for (;;) {
1053 poll(&fds, 1, -1);
1054 while ( (buf = nm_nextpkt(d, &h)) )
31.Dt NETMAP 4
32.Os
33.Sh NAME
34.Nm netmap
35.Nd a framework for fast packet I/O
36.Sh SYNOPSIS
37.Cd device netmap
38.Sh DESCRIPTION

--- 1008 unchanged lines hidden (view full) ---

1047 struct nm_pkthdr h;
1048 ...
1049 d = nm_open("netmap:ix0", NULL, 0, 0);
1050 fds.fd = NETMAP_FD(d);
1051 fds.events = POLLIN;
1052 for (;;) {
1053 poll(&fds, 1, -1);
1054 while ( (buf = nm_nextpkt(d, &h)) )
1055 consume_pkt(buf, h->len);
1055 consume_pkt(buf, h.len);
1056 }
1057 nm_close(d);
1058}
1059.Ed
1060.Ss ZERO-COPY FORWARDING
1061Since physical interfaces share the same memory region,
1062it is possible to do packet forwarding between ports
1063swapping buffers.

--- 124 unchanged lines hidden ---
1056 }
1057 nm_close(d);
1058}
1059.Ed
1060.Ss ZERO-COPY FORWARDING
1061Since physical interfaces share the same memory region,
1062it is possible to do packet forwarding between ports
1063swapping buffers.

--- 124 unchanged lines hidden ---