If keyspace notifications are used at all, the respective objects and
threads must be created during startup. This requires at least some
keyspace to be configured. To support usage without any keyspaces
initially (and add them during runtime), add a special case (set
keyspace to -1).
Convert all keyspace variables to signed ints. Ignore negative keyspace
numbers where appropriate. Support Redis endpoint addresses without
database number.
Fixes#1902
Change-Id: I45a3c87bc515f9b14e64ec1ec0906dde271b5f8d
If keyspace notifications are not configured at all, bail with an error
when there is an attempt to add a new keyspace or remove one. We get a
segfault otherwise.
Closes#1902
Change-Id: Ie47cf5f7762792aabe38476739f0dcf9927787ce
Doing a simple prefix string match is not enough as there may be
keywords that are equal to a prefix of another keyword. Make sure the
keyword is followed by a space or newline or end of line. This also
removes the burden of having to skip over leading spaces in the CLI
handlers.
Change-Id: I118a08e1b33d9bf592d3d80101e4f0634401adbd
Make the macro return the appropriate pointer type, and make sure the
free function takes an argument of the same type. This also eliminates
some boilerplate type-casting code.
Change-Id: I3094271fa2c53ec93b9ff9f837d461cf422e0f12
Make it so that options only need to be managed in one place, and all
code operating on the list of them is streamlined
Change-Id: Ia53b15910ec8973635e61cad1b43eff8d536a577
Obsolete str_init(), rename STR_INIT() to just STR(), and replace all
instances of str_init() with STR().
no-op
Change-Id: I981529063ad2ea26089add467f7a84b638dbf423
Use relaxed-order atomic ops to access config variables that can be set
during run time.
Rename config_lock to keyspaces_lock as the keyspaces list remains the
only object that it protects.
All other config variables aren't settable at runtime and so don't
require locks or atomic ops.
Change-Id: I7e01a34a4818a558d5648ae27a86f9880a95d050
Keep two separate timestamps, one updated by userspace code only and the
other updated by kernel only. This way we can tell where the packet
processing happens. For code that wants to report only the last
timestamp regardless of which one of the two it is, we add a convenience
function that just returns the newer one.
Change-Id: Ib3af7aa55006d8b32e2bc3db4f8bfa5514c57e40
Allocate memory from bufferpool for per-stream stats. No functional
change, but it allows sharing these between kernel and user space.
Change-Id: I370a49e1d94bb91c7fd0a2bc7d00ba65f99c4f6a
There isn't any immediate benefit to this, but it prepares the code for
use of shared memory for statistics.
Use the opportunity to switch accesses to these to relaxed memory order.
Change-Id: I585fef7579202179fbbcbc1b843d3bbe440a723b
This has been broken for a while and nobody seems to be using it since
nobody complained. Remove it.
Change-Id: I114e7b1859ecd1982338c625f4523f372af3bbe8
In the file implementations follow the rules:
1. Firstly goes the correlated header file, then one empty row.
2. Secondly go system headers, so in angle-brackets, then one empty row.
3. Thirdly, go custom header files, so in double quotes,
then one empty row.
4. If there is "xt_RTPENGINE.h", it's mentioned next, but separately,
then one empty row.
5. If there are pre-processor definitions, they are added.
6. And eventually at least one empty row before the code.
In some situations it's allowed to step aside from the rules,
when inclusions are dependent on each other, so on the sequence,
and also possibly on some inline objects definitions, but if possible
to follow the rules, it's being done.
Change-Id: Ie512a970e230fe202398656d1942e8874bb14cd9