21 Commits

Author SHA1 Message Date
ohci1 4b8f3098a5 update configure info for 2.14
Co-authored-by: Pavel Begunkov<asml.silence@gmail.com>
Co-authored-by: Guillem Jover<guillem@hadrons.org>
Co-authored-by: Jens Axboe<axboe@kernel.dk>
Co-authored-by: Khem Raj<raj.khem@gmail.com>
Co-authored-by: Michael de Lang<kingoipo@gmail.com>
Co-authored-by: David Disseldorp<ddiss@suse.de>
Co-authored-by: Ming Lei<ming.lei@redhat.com>
2026-04-24 09:24:13 +08:00
fangzhiyi18 0ae77b95ef 升级2.7
Signed-off-by: fangzhiyi18 <fangzhiyi1@huawei.com>
2024-10-21 02:53:20 +00:00
Dylan Yudaken 12d7e7cf8f add an example for a UDP server
Add an example showing off multishot recvmsg and provided buffer rings.
The application is a UDP echo server that responds to all packets with the
same packet.

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220726121502.1958288-6-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-07-26 10:22:45 -06:00
Pavel Begunkov 7d554b8352 examples: add a zerocopy send example
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/60f2a1a167b12fe60bf04d4c67da75a4a6983855.1658748624.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-07-25 09:46:23 -06:00
Pavel Begunkov b71741dc80 examples: add a simple single-shot poll benchmark
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/20a5afbb4f8aeb586b6ce04a623264f18c4fe467.1658484803.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-07-22 09:20:47 -06:00
Alviro Iskandar Setiawan 0acab8f6ff examples/Makefile: Add liburing.a as a dependency
The example binaries statically link liburing using liburing.a file.
When liburing.a is recompiled, make sure the example binaries are also
recompiled to ensure changes are applied to the binaries. It makes
"make clean" command optional when making changes.

Signed-off-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
Link: https://lore.kernel.org/r/20220310111231.1713588-5-alviro.iskandar@gnuweeb.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-03-10 05:13:49 -07:00
Ammar Faizi a8fbb6cf1d examples/Makefile: Fix missing clean up
Several things go wrong with this Makefile:
  1) Using `test_srcs` to generate `test_objs`.
  2) `test_objs` is an unused variable. So (1) is pointless.
  3) `make clean` does not remove `ucontext-cp` binary.

I assume (1) and (2) were blindly copied from the test Makefile.

For 3, the `make clean` removes $(all_targets) and $(test_objs). But
`ucontext-cp` only exists in $(all_targets) if we have
`CONFIG_HAVE_UCONTEXT`. When the target goal is `clean`, we will not
have any of `CONFIG_*` variables. Thus, `ucontext-cp` is not removed.

Clean them up!

Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id>
Link: https://lore.kernel.org/r/20211030114858.320116-2-ammar.faizi@intel.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-10-31 16:30:00 -06:00
Guillem Jover 130e82b9f2 build: Fix build flags support
The usual convention is that the various *FLAGS are user controllable,
and can be overridden, so anything that is essential for the build
should be passed respecting that. The other usual convention is that
CPPFLAGS only contain pre-processor options, CFLAGS and CXXFLAGS only
contain compilation options and LDFLAGS only contain linker flags,
where all of these are honored in all build rules.

Switch to set optional flags conditionally into the *FLAGS variables if
they are not set, and then unconditionally append any required flags.
And pass the various *FLAGS to the rules as expected.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-13 13:19:25 +02:00
Uman Shahzad 5ebfd161d7 build: add -D_GNU_SOURCE to all CPPFLAGS/CFLAGS.
Needed for e.g. musl libc which only includes entities like
cpu_set_t if this is defined.

Signed-off-by: Uman Shahzad <uman@mslm.io>
2021-09-02 02:13:24 +05:00
Simon Zeni 14540a9618 examples: disable ucontext-cp if ucontext.h is not available
The header file `ucontext.h` is not available on musl based distros. The
example `ucontext-cp` is not built if `configure` fails to locate the
header.

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-10-28 16:32:16 -06:00
Guillem Jover a91f313e6a Fix build flag settings
Split preprocessor flags into CPPFLAGS to be passed to rules involving
code compilation, instead of link-only rules. This also guarantees we
always use the user set CPPFLAGS which are expected to be honored by
most build systems. Move build system required C++ flags into an
override for CXXFLAGS to follow the same pattern as the other flags.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2020-09-20 03:10:52 +02:00
Jens Axboe 4332433754 configure: allow to set host CC
Use ./configure --cc=whatever to set the compiler.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-12-23 21:34:03 -07:00
Jens Axboe 32fcace197 Makefile: quiet down rm
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-12-23 21:33:47 -07:00
Jens Axboe 1cff0db7bc Makefile: handle quiet AR/RANLIB
Also unify across subdirs.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-09-22 10:10:33 -06:00
Jens Axboe ad551e6470 Makefile: add pretty/quiet CC/LN output
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-09-21 20:46:00 -06:00
James Rouzier e88b74ae6d Generalize Makefiles for examples and test.
Signed-off-by: James Rouzier <rouzier@gmail.com>
2019-09-21 17:16:50 -04:00
李通洲 20b3ce6c52 examples/ucontext-cp: use ucontext with liburing
Coroutines are often used to simplify async programming,
and work great with liburing.
`ucontext` doesn't perform very good, but it's enough for an example.
2019-09-20 17:37:55 +08:00
Stefan Hajnoczi c31c7ec4bc src/Makefile: keep private headers in <liburing/*.h>
It is not possible to install barrier.h and compat.h into the top-level
/usr/include directly since they are likely to conflict with other
software.  io_uring.h could be confused with the system's kernel header
file.

Put liburing headers into <liburing/*.h> so there is no chance of
conflicts or confusion.

Existing applications continue to build successfully since the location
of <liburing.h> is unchanged.  In-tree examples and tests require
modification because src/liburing.h is moved to src/include/liburing.h.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-07-24 09:11:44 -06:00
Bart Van Assche 64f89fa146 Makefiles: Support specifying CFLAGS on the command line
This patch makes the liburing build work as expected for e.g. the following
command:

make CFLAGS=-m32

and avoids that the build fails as follows for the above command:

make[1]: Entering directory 'liburing/test'
cc -m32 -o poll poll.c -luring
/usr/bin/ld: cannot find -luring
collect2: error: ld returned 1 exit status
Makefile:18: recipe for target 'poll' failed
make[1]: *** [poll] Error 1
make[1]: Leaving directory 'software/liburing/test'
Makefile:12: recipe for target 'all' failed
make: *** [all] Error 2

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-07-08 15:25:57 -06:00
Jens Axboe 0ba9503f79 Add link SQE support
Just a basic test case that does various forms of linked nops, and
a sample bare bones copy program using linked reads and writes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-13 16:16:07 -06:00
Jens Axboe 4916320ec3 Separate test cases from examples
Also adds a runtests makefile target.
2019-04-17 11:39:39 -06:00