Commit 67d63751 authored by Steen Hegelund's avatar Steen Hegelund Committed by David S. Miller
Browse files

net: microchip: sparx5: Adding KUNIT test for the VCAP API



This provides a KUNIT test suite for the VCAP APIs encoding functionality.

The test can be run by adding these settings in a .kunitconfig file

CONFIG_KUNIT=y
CONFIG_NET=y
CONFIG_VCAP_KUNIT_TEST=y

Signed-off-by: default avatarSteen Hegelund <steen.hegelund@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5d7e5b04
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -36,4 +36,17 @@ config VCAP
	  characteristics. Look in the datasheet for the VCAP specifications for the
	  specific switchcore.

config VCAP_KUNIT_TEST
	bool "KUnit test for VCAP library" if !KUNIT_ALL_TESTS
	depends on KUNIT
	depends on KUNIT=y && VCAP=y && y
	default KUNIT_ALL_TESTS
	help
	  This builds unit tests for the VCAP library.

	  For more information on KUnit and unit tests in general, please refer
	  to the KUnit documentation in Documentation/dev-tools/kunit/.

	  If unsure, say N.

endif # NET_VENDOR_MICROCHIP
+643 −0

File added.

Preview size limit exceeded, changes collapsed.

+4 −0
Original line number Diff line number Diff line
@@ -1178,3 +1178,7 @@ void vcap_set_tc_exterr(struct flow_cls_offload *fco, struct vcap_rule *vrule)
	}
}
EXPORT_SYMBOL_GPL(vcap_set_tc_exterr);

#ifdef CONFIG_VCAP_KUNIT_TEST
#include "vcap_api_kunit.c"
#endif
+3 −0
Original line number Diff line number Diff line
@@ -11,6 +11,9 @@
#include <linux/netdevice.h>

/* Use the generated API model */
#ifdef CONFIG_VCAP_KUNIT_TEST
#include "vcap_ag_api_kunit.h"
#endif
#include "vcap_ag_api.h"

#define VCAP_CID_LOOKUP_SIZE          100000 /* Chains in a lookup */
+933 −0

File added.

Preview size limit exceeded, changes collapsed.