Skip to content

Commit

Permalink
Fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette committed Jul 28, 2023
1 parent d053be6 commit c774734
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 20 deletions.
4 changes: 4 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -16327,6 +16327,10 @@ pcap.h and/or -lpcap not found; user-level driver can't steal packets.
HAVE_USERLEVEL_DRIVER=1
fi

if test "x$enable_dpdk_packet" = "xyes" -a "x$HAVE_NETMAP" = "xyes"; then
as_fn_error $? "--with-netmap is not compatible with --enable-dpdk-packet " "$LINENO" 5
fi

if test "x$enable_netmap_pool" = "xyes"; then
if test "x$HAVE_NETMAP" != "xyes"; then
as_fn_error $? "
Expand Down
4 changes: 4 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,10 @@ pcap.h and/or -lpcap not found; user-level driver can't steal packets.
HAVE_USERLEVEL_DRIVER=1
fi

if test "x$enable_dpdk_packet" = "xyes" -a "x$HAVE_NETMAP" = "xyes"; then
AC_MSG_ERROR([--with-netmap is not compatible with --enable-dpdk-packet ])
fi

if test "x$enable_netmap_pool" = "xyes"; then
if test "x$HAVE_NETMAP" != "xyes"; then
AC_MSG_ERROR([
Expand Down
9 changes: 9 additions & 0 deletions deps.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh
# This installs dependencies for both DPDK and FastClick, support for apt-get(Debian, Ubuntu, ...) and apk (Alpine) for now. PRs are welcome.

opt=0
if [ $1 = "--optional" ] ; then
opt=1
fi

echo "Installing dependencies..." ;
if ( command -v apt-get &> /dev/null ) ; then
echo "Using apt-get"
Expand All @@ -10,6 +15,10 @@ if ( command -v apt-get &> /dev/null ) ; then
if apt-cache search --names-only $header &> /dev/null ; then
apt-get install -yqq $header
fi
if [ $opt -eq 1 ] ; then
echo "Installing optional dependencies"
apt-get install -yqq libmicrohttpd-dev libhyperscan-dev libpci-dev libbpf-dev libpapi-dev libre2-dev llvm-dev
fi
elif ( command -v apk &> /dev/null ) ; then
echo "Using apk"
echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
Expand Down
2 changes: 1 addition & 1 deletion elements/analysis/checknumberpacket.hh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CLICK_DECLS
CheckNumberPacket() Check increasing number inside packet
=s analysis
=s timestamps
=d
Expand Down
2 changes: 1 addition & 1 deletion elements/analysis/numberpacket.hh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CLICK_DECLS
NumberPacket() Set an increasing number inside packet
=s analysis
=s timestamps
=d
Expand Down
2 changes: 1 addition & 1 deletion elements/analysis/replay.hh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ replay an input of packets at a given speed, pull to push
Technically equivalent to Replay->Unqueue-> it is more efficient.
Keyword arguments are the same than @Replay, with the addition of:
Keyword arguments are the same than Replay, with the addition of:
=over 8
Expand Down
4 changes: 3 additions & 1 deletion elements/ctx/midstat.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ MidStat([CLOSECONNECTION])
Count the number of bytes and packets in sessions.
This element is not context aware. So it would count dups etc. FlowCounter is.
=d
This element is not context aware. So it would count dups etc.
=a FlowCounter
*/
Expand Down
10 changes: 8 additions & 2 deletions elements/flow/flowcounter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

CLICK_DECLS

FlowCounter::FlowCounter()
FlowCounter::FlowCounter() : StatVector(Vector<int>(32768,0))
{

}
Expand All @@ -32,7 +32,7 @@ void FlowCounter::push_flow(int, int* fcb, PacketBatch* flow)
}


enum { h_count };
enum { h_count, h_open };

String
FlowCounter::read_handler(Element *e, void *thunk)
Expand All @@ -43,6 +43,10 @@ FlowCounter::read_handler(Element *e, void *thunk)
PER_THREAD_MEMBER_SUM(uint64_t,count, fd->_state, count);
return String(count);
}
case h_open: {
PER_THREAD_MEMBER_SUM(uint64_t,open, fd->_state, open);
return String(open);
}
default:
return "<error>";
}
Expand All @@ -57,6 +61,8 @@ FlowCounter::write_handler(const String &s_in, Element *e, void *thunk, ErrorHan
void
FlowCounter::add_handlers() {
add_read_handler("count", read_handler, h_count);
add_read_handler("open", read_handler, h_open);
add_stat_handler(this);
}

CLICK_ENDDECLS
Expand Down
46 changes: 37 additions & 9 deletions elements/flow/flowcounter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <click/element.hh>
#include <click/vector.hh>
#include <click/multithread.hh>
#include <click/statvector.hh>
#include <click/flow/flowelement.hh>

CLICK_DECLS
Expand All @@ -15,13 +16,42 @@ FlowCounter([CLOSECONNECTION])
=s flow
Counts all flows passing by, the number of active flows, and the number of
packets per flow.
Counts the number of flows and packets per flow
=d
This element uses the flow subsystem to count the number of flows passing by,
the one considered still active (using the upstream FlowManager's definition of
active flow) and the number of packets per flow.
=h count
Returns the number of flows seen
=h open
Returns the number of flows currently active
=h average
Returns the average length of a flow
=h median
Returns the median length of flows
=h dump
Print the histogram of flow sizes
=a MidStat
*/


class FlowCounter : public FlowStateElement<FlowCounter,int>
class FlowCounter : public FlowStateElement<FlowCounter,int>, StatVector<int>
{
public:
/** @brief Construct an FlowCounter element
Expand All @@ -36,10 +66,10 @@ public:

void release_flow(int* fcb) {
_state->open--;
if (_state->lengths.size() < *fcb) {
_state->lengths.resize(*fcb, 0);
}
_state->lengths[*fcb - 1]++;
unsigned n = *fcb - 1;
if (n > 32767)
n = 32767;
(*stats)[n]++;
}

const static int timeout = 15000;
Expand All @@ -55,11 +85,9 @@ public:
void add_handlers() override CLICK_COLD;
protected:


struct fcstate {
long count;
long open;
Vector<int> lengths;
};
per_thread<fcstate> _state;

Expand Down
6 changes: 4 additions & 2 deletions elements/flow/tcpreorder.hh
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ is reused after a RST, the other side will see packets out of order.
Proper implementation needs a "dual" state, something only accessible after
TCPIn
=d
This element reorders TCP packets before sending them on its first output. It can be used outside
of the stack of the middlebox. The second output is optional and is used to push retransmitted
packets. If the second output is not used, retransmitted packets are dropped.
=over 8
=item FLOWDIRECTION
ID of the path for the connection (0 or 1). The return path must have the other ID.
Expand All @@ -95,6 +95,8 @@ Where k is the number of packets in the batch and n is the number of packets in
Default value: true.
=back
=a TCPIn, TCPOut, TCPRetransmitter */

class TCPReorder : public FlowSpaceElement<fcb_tcpreorder>, public TCPHelper
Expand Down
31 changes: 31 additions & 0 deletions elements/standard/averagecounter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ CLICK_DECLS
*
* =h reset write-only
* Resets the count and rate to zero.
*
* =a
* AverageCounterMP, AverageCounterIMP
*/

template <typename Stats>
Expand Down Expand Up @@ -125,6 +128,20 @@ class AverageCounter : public AverageCounterBase<AverageCounterStats<uint64_t> >
const char *class_name() const override { return "AverageCounter"; }
};

/*
* =c
* AverageCounterMP
*
* =s counters
* measures historical packet count and rate, atomic version
*
* =d
*
* Check AverageCounter for documentation*
* *
* =a
* AverageCounter, AverageCounterIMP
*/
class AverageCounterMP : public AverageCounterBase<AverageCounterStats<atomic_uint64_t> > { public:
AverageCounterMP() CLICK_COLD;

Expand Down Expand Up @@ -181,6 +198,20 @@ struct AverageCounterStatsIMP {
inline void set_last(uint64_t last){ _counts->last = last; }
};

/*
* =c
* AverageCounterIMP
*
* =s counters
* measures historical packet count and rate, per-thread version
*
* =d
*
* Check AverageCounter for documentation*
* *
* =a
* AverageCounter, AverageCounterMP
*/
class AverageCounterIMP : public AverageCounterBase<AverageCounterStatsIMP> { public:
AverageCounterIMP() CLICK_COLD;

Expand Down
2 changes: 1 addition & 1 deletion elements/userlevel/fromdump.hh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ if TIMING is not true. Defaults to 100, the original time.
String. A function that can be used to change the ACCELERATION according to
the current time. The parsing uses TinyFNT and therefore follows the format.
The variable containing the time is x. E.g. "10 + min(90,10*x)" will have an
acceleration from 10 to 100% in 9 seconds. See @ReplayUnqueue for more details.
acceleration from 10 to 100% in 9 seconds. See ReplayUnqueue for more details.
Ineffective if TIMING is not true. Defaults to an empty string (inactive).
=item BURST
Expand Down
5 changes: 4 additions & 1 deletion elements/userlevel/xdploader.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ CLICK_DECLS


/*
=title XDPLoader
=c
XDPLoader
XDPLoader(PATH, DEV, [CLEAN])
=s
Expand Down
1 change: 1 addition & 0 deletions etc/build_wiki.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
sudo ./deps.sh --optional
./configure CXXFLAGS="-std=gnu++11" --enable-user-multithread --disable-verbose-batch --enable-simtime --disable-clone --enable-dpdk --enable-all-elements --enable-flow --enable-batch --enable-ctx --enable-cpu-load --enable-rsspp --enable-flow-api --with-netmap=../netmap/sys/ --enable-user-timestamp
make -C doc install-man-markdown O=$(pwd)/../fastclick.wiki/elements
2 changes: 1 addition & 1 deletion include/click/statvector.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class StatVector {



enum{H_MEDIAN,H_AVERAGE,H_DUMP,H_MAX_OBS,H_N_OBS,H_NZ,H_MAX,H_MAX_OBS_VAL};
enum{H_MEDIAN=736,H_AVERAGE,H_DUMP,H_MAX_OBS,H_N_OBS,H_NZ,H_MAX,H_MAX_OBS_VAL};

static String read_handler(Element *e, void *thunk)
{
Expand Down

0 comments on commit c774734

Please sign in to comment.