linux/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c

// SPDX-License-Identifier: BSD-3-Clause
/* Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries.
 * Microchip VCAP API kunit test suite
 */

#include <kunit/test.h>
#include "vcap_api.h"
#include "vcap_api_client.h"
#include "vcap_model_kunit.h"

/* First we have the test infrastructure that emulates the platform
 * implementation
 */
#define TEST_BUF_CNT
#define TEST_BUF_SZ
#define STREAMWSIZE

static u32 test_updateaddr[STREAMWSIZE] =;
static int test_updateaddridx;
static int test_cache_erase_count;
static u32 test_init_start;
static u32 test_init_count;
static u32 test_hw_counter_id;
static struct vcap_cache_data test_hw_cache;
static struct net_device test_netdev =;
static int test_move_addr;
static int test_move_offset;
static int test_move_count;

/* Callback used by the VCAP API */
static enum vcap_keyfield_set test_val_keyset(struct net_device *ndev,
					      struct vcap_admin *admin,
					      struct vcap_rule *rule,
					      struct vcap_keyset_list *kslist,
					      u16 l3_proto)
{}

/* Callback used by the VCAP API */
static void test_add_def_fields(struct net_device *ndev,
				struct vcap_admin *admin,
				struct vcap_rule *rule)
{}

/* Callback used by the VCAP API */
static void test_cache_erase(struct vcap_admin *admin)
{}

/* Callback used by the VCAP API */
static void test_cache_init(struct net_device *ndev, struct vcap_admin *admin,
			    u32 start, u32 count)
{}

/* Callback used by the VCAP API */
static void test_cache_read(struct net_device *ndev, struct vcap_admin *admin,
			    enum vcap_selection sel, u32 start, u32 count)
{}

/* Callback used by the VCAP API */
static void test_cache_write(struct net_device *ndev, struct vcap_admin *admin,
			     enum vcap_selection sel, u32 start, u32 count)
{}

/* Callback used by the VCAP API */
static void test_cache_update(struct net_device *ndev, struct vcap_admin *admin,
			      enum vcap_command cmd,
			      enum vcap_selection sel, u32 addr)
{}

static void test_cache_move(struct net_device *ndev, struct vcap_admin *admin,
			    u32 addr, int offset, int count)
{}

/* Provide port information via a callback interface */
static int vcap_test_port_info(struct net_device *ndev,
			       struct vcap_admin *admin,
			       struct vcap_output_print *out)
{}

static const struct vcap_operations test_callbacks =;

static struct vcap_control test_vctrl =;

static void vcap_test_api_init(struct vcap_admin *admin)
{}

/* Helper function to create a rule of a specific size */
static void test_vcap_xn_rule_creator(struct kunit *test, int cid,
				      enum vcap_user user, u16 priority,
				      int id, int size, int expected_addr)
{}

/* Prepare testing rule deletion */
static void test_init_rule_deletion(void)
{}

/* Define the test cases. */

static void vcap_api_set_bit_1_test(struct kunit *test)
{}

static void vcap_api_set_bit_0_test(struct kunit *test)
{}

static void vcap_api_iterator_init_test(struct kunit *test)
{}

static void vcap_api_iterator_next_test(struct kunit *test)
{}

static void vcap_api_encode_typegroups_test(struct kunit *test)
{}

static void vcap_api_encode_bit_test(struct kunit *test)
{}

static void vcap_api_encode_field_test(struct kunit *test)
{}

/* In this testcase the subword is smaller than a register */
static void vcap_api_encode_short_field_test(struct kunit *test)
{}

static void vcap_api_encode_keyfield_test(struct kunit *test)
{}

static void vcap_api_encode_max_keyfield_test(struct kunit *test)
{}

static void vcap_api_encode_actionfield_test(struct kunit *test)
{}

static void vcap_api_keyfield_typegroup_test(struct kunit *test)
{}

static void vcap_api_actionfield_typegroup_test(struct kunit *test)
{}

static void vcap_api_vcap_keyfields_test(struct kunit *test)
{}

static void vcap_api_vcap_actionfields_test(struct kunit *test)
{}

static void vcap_api_encode_rule_keyset_test(struct kunit *test)
{}

static void vcap_api_encode_rule_actionset_test(struct kunit *test)
{}

static void vcap_free_ckf(struct vcap_rule *rule)
{}

static void vcap_api_rule_add_keyvalue_test(struct kunit *test)
{}

static void vcap_free_caf(struct vcap_rule *rule)
{}

static void vcap_api_rule_add_actionvalue_test(struct kunit *test)
{}

static void vcap_api_rule_find_keyset_basic_test(struct kunit *test)
{}

static void vcap_api_rule_find_keyset_failed_test(struct kunit *test)
{}

static void vcap_api_rule_find_keyset_many_test(struct kunit *test)
{}

static void vcap_api_encode_rule_test(struct kunit *test)
{}

static void vcap_api_set_rule_counter_test(struct kunit *test)
{}

static void vcap_api_get_rule_counter_test(struct kunit *test)
{}

static void vcap_api_rule_insert_in_order_test(struct kunit *test)
{}

static void vcap_api_rule_insert_reverse_order_test(struct kunit *test)
{}

static void vcap_api_rule_remove_at_end_test(struct kunit *test)
{}

static void vcap_api_rule_remove_in_middle_test(struct kunit *test)
{}

static void vcap_api_rule_remove_in_front_test(struct kunit *test)
{}

static struct kunit_case vcap_api_rule_remove_test_cases[] =;

static void vcap_api_next_lookup_basic_test(struct kunit *test)
{}

static void vcap_api_next_lookup_advanced_test(struct kunit *test)
{}

static void vcap_api_filter_unsupported_keys_test(struct kunit *test)
{}

static void vcap_api_filter_keylist_test(struct kunit *test)
{}

static void vcap_api_rule_chain_path_test(struct kunit *test)
{}

static struct kunit_case vcap_api_rule_enable_test_cases[] =;

static struct kunit_suite vcap_api_rule_enable_test_suite =;

static struct kunit_suite vcap_api_rule_remove_test_suite =;

static struct kunit_case vcap_api_rule_insert_test_cases[] =;

static struct kunit_suite vcap_api_rule_insert_test_suite =;

static struct kunit_case vcap_api_rule_counter_test_cases[] =;

static struct kunit_suite vcap_api_rule_counter_test_suite =;

static struct kunit_case vcap_api_support_test_cases[] =;

static struct kunit_suite vcap_api_support_test_suite =;

static struct kunit_case vcap_api_full_rule_test_cases[] =;

static struct kunit_suite vcap_api_full_rule_test_suite =;

static struct kunit_case vcap_api_rule_value_test_cases[] =;

static struct kunit_suite vcap_api_rule_value_test_suite =;

static struct kunit_case vcap_api_encoding_test_cases[] =;

static struct kunit_suite vcap_api_encoding_test_suite =;

kunit_test_suite();
kunit_test_suite();
kunit_test_suite();
kunit_test_suite();
kunit_test_suite();
kunit_test_suite();
kunit_test_suite();
kunit_test_suite();