Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
BasedOnStyle: Google
IndentWidth: 2
ColumnLimit: 79
AlignAfterOpenBracket: DontAlign
SpacesInConditionalStatement: true
SortIncludes: false
BreakBeforeBraces: Linux
SpaceBeforeCpp11BracedList: true
SpaceBeforeParens: Never
SpaceAfterCStyleCast: true
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
SpacesInContainerLiterals: true
Cpp11BracedListStyle: false
MaxEmptyLinesToKeep: 2
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
AlignTrailingComments: true
SpacesBeforeTrailingComments: 5
SpaceAfterLogicalNot: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ Thumbs.db
/src/lib/zf/doxygen/html.zip
/src/lib/zf/doxygen/latex
/src/lib/zf/doxygen/rtf

/test_programs/mock_xnic/xnic_data
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"files.associations": {
"ip_internal.h": "c",
"*.tmpl": "c",
"functional": "c"
}
}
11 changes: 10 additions & 1 deletion mk/before.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ MMAKE_INCLUDE_DIR := $(TOPPATH)/src/include
MMAKE_INCLUDE := -I. -I$(BUILD)/include -I$(MMAKE_INCLUDE_DIR)



######################################################################
# Some useful commands.
#
Expand Down Expand Up @@ -106,3 +105,13 @@ default_all: all

nullstring:=
space=$(nullstring) #<-do not edit this line

# Definition of all of the DPDK libs. If subdirectories need to link to DPDK they can just reference
# this variable to include it. This matches the same setup that we have for REPL
DPDK_STATIC_LOCATIONS = -L$(RTE_SDK)/build/lib -L$(RTE_SDK)/build/drivers
DPDK_STATIC_LIBS = -lrte_hash -lrte_cmdline -lrte_pci -lrte_bus_pci -lrte_bus_vdev -lrte_mempool_ring -lrte_kni -lrte_ethdev -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring -lrte_kvargs -lrte_pmd_bond -lrte_pmd_virtio -lrte_pmd_enic -lrte_pmd_i40e -lrte_pmd_ixgbe -lrte_net -lrte_pmd_e1000 -lrte_pmd_ring -lrte_pmd_af_packet -lrte_pmd_mlx4 -lrte_pmd_mlx5 -lrte_pmd_ena -lrte_pmd_failsafe -lrte_pmd_netvsc -lrte_pmd_vdev_netvsc -lrte_bus_vmbus -lrte_pmd_tap -lrte_gso -lrte_timer -lrte_meter
DPDK_DYN_LIBS = -lm -ldl -lnuma -libverbs -lmlx4 -lmlx5
DPDK_STATIC = -Wl,-Bstatic -Wl,--whole-archive
DPDK_DYNAMIC = -Wl,--no-whole-archive -Wl,-Bdynamic
DEFAULT_DPDK := $(DPDK_STATIC_LOCATIONS) $(DPDK_STATIC) $(DPDK_STATIC_LIBS) $(DPDK_DYNAMIC) $(DPDK_DYN_LIBS)

6 changes: 3 additions & 3 deletions mk/linux_gcc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ cwarnings += -Wno-deprecated-declarations
endif


MMAKE_CFLAGS += $(MMAKE_CARCH) $(cwarnings)
MMAKE_CXXFLAGS += $(MMAKE_CARCH) $(cxxwarnings)
MMAKE_CFLAGS += $(MMAKE_CARCH) $(cwarnings) -msse3
MMAKE_CXXFLAGS += $(MMAKE_CARCH) $(cxxwarnings) -msse3
MMAKE_CPPFLAGS :=

MMAKE_CFLAGS_DLL := -fPIC
Expand Down Expand Up @@ -195,7 +195,7 @@ endef
define MMakeLinkCApp
set -x; \
$(CLINK) $(MMAKE_CARCH) $(CFLAGS) -Wl,-E $(MMAKE_DIR_LINKFLAGS) $(filter %.o,$^) \
$$libs -lm -lpthread -lrt -lresolv -lanl -o $@
$$libs -lm -lpthread -lrt -lresolv -lanl $(MMAKE_DPDK_LIBS) -o $@
endef


Expand Down
2 changes: 1 addition & 1 deletion mk/platform/gnu_x86_64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# X-SPDX-Copyright-Text: (c) Copyright 2004-2020 Xilinx, Inc.
GNU := 1
MMAKE_CARCH ?= -mtune=native
MMAKE_CARCH := -m64 $(MMAKE_CTUNE)
MMAKE_CARCH := -march=native -m64 $(MMAKE_CTUNE)

MMAKE_RELOCATABLE_LIB := -z combreloc

Expand Down
12 changes: 6 additions & 6 deletions scripts/onload_mkdist
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ done < <(find . -type d)
preprocess_source

verstub=$(echo "$version" | sed -e 's/-test.*//' -e 's/-rc.*//')
if [ -f ChangeLog ] && ! grep -q "$verstub" ChangeLog; then
bad "Nothing in the ChangeLog for this version"
fi
if [ -f ReleaseNotes ] && ! grep -q "$verstub" ReleaseNotes; then
bad "Nothing in the ReleaseNotes for this version"
fi
#if [ -f ChangeLog ] && ! grep -q "$verstub" ChangeLog; then
# bad "Nothing in the ChangeLog for this version"
#fi
#if [ -f ReleaseNotes ] && ! grep -q "$verstub" ReleaseNotes; then
# bad "Nothing in the ReleaseNotes for this version"
#fi

# Get rid of junk!
find . -type f -name '.#*' -exec rm "{}" \;
Expand Down
21 changes: 21 additions & 0 deletions scripts/onload_profiles/swxtch.opf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
onload_set EF_SPIN_USEC 10000000000000
onload_set EF_TCP_CONNECT_SPIN 1
onload_set EF_TCP_ACCEPT_SPIN 1
onload_set EF_TCP_RECV_SPIN 1
onload_set EF_TCP_SEND_SPIN 1
onload_set EF_UDP_RECV_SPIN 1
onload_set EF_UDP_SEND_SPIN 1
onload_set EF_MAX_ENDPOINTS 16384
onload_set EF_TXQ_SIZE 2048
onload_set EF_CLUSTER_SIZE 0
#onload_set EF_MAX_PACKETS 2097152
#onload_set EF_MAX_TX_PACKETS 1048576
#onload_set EF_PREALLOC_PACKETS 1
onload_set EF_USE_HUGE_PAGES 2
#onload_set EF_UDP_FORCE_REUSEPORT 0
#onload_set EF_UNIX_LOG 0xFFFFFFFFFFFFFFFFFFFF # this is a crappy bitmask that can be found in opts_citp_def.h and it only seems to kind of work
#onload_set EF_CTPIO 0
#onload_set EF_PIO 0
#onload_set EF_EPOLL_MT_SAFE 1
#onload_set EF_INT_DRIVEN 0
#onload_set EF_HIGH_THROUGHPUT_MODE 1
4 changes: 4 additions & 0 deletions scripts/swxtch_init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /bin/bash

sudo ~/onload/build/x86_64_linux-$(uname -r)/driver/linux/load.sh onload
echo eth1 | sudo tee /sys/module/sfc_resource/afxdp/register
21 changes: 11 additions & 10 deletions src/include/ci/efhw/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

/* NB: this enum must be aligned with enum ef_vi_arch */
enum efhw_arch {
EFHW_ARCH_EF10 = 1,
EFHW_ARCH_EF100,
EFHW_ARCH_EFCT,
EFHW_ARCH_AF_XDP,
EFHW_ARCH_EF10 = 1,
EFHW_ARCH_EF100,
EFHW_ARCH_EFCT,
EFHW_ARCH_AF_XDP,
EFHW_ARCH_SWXTCH,
};

/*----------------------------------------------------------------------------
Expand All @@ -18,15 +19,15 @@ enum efhw_arch {
*---------------------------------------------------------------------------*/

enum efhw_function {
EFHW_FUNCTION_PF,
EFHW_FUNCTION_VF,
EFHW_FUNCTION_PF,
EFHW_FUNCTION_VF,
};

struct efhw_device_type {
int arch; /* enum efhw_arch */
char variant; /* 'A', 'B', ... */
int revision; /* 0, 1, ... */
int function; /* enum efhw_function */
int arch; /* enum efhw_arch */
char variant; /* 'A', 'B', ... */
int revision; /* 0, 1, ... */
int function; /* enum efhw_function */
};

#endif
Loading