1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2023 Meta Platforms, Inc. and affiliates.
*/
#pragma once
#include <limits.h>
#include <stddef.h>
#include "core/chain.h"
#include "core/counter.h"
#include "core/verdict.h"
#include "packets.h"
#define BFT_NO_PKTS SIZE_MAX
#define BFT_NO_BYTES SIZE_MAX
struct bft_counter
{
size_t index;
struct bf_counter counter;
};
#define bft_counter_p(idx, npkts, nbytes) \
(struct bft_counter []) { \
{ \
.index = (idx), \
.counter = { \
.packets = (npkts), \
.bytes = (nbytes), \
}, \
} \
}
int bft_e2e_test_with_counter(struct bf_chain *chain, enum bf_verdict expect,
const struct bft_prog_run_args *args,
const struct bft_counter *counter);
int bft_e2e_test(struct bf_chain *chain, enum bf_verdict expect,
const struct bft_prog_run_args *args);
|