Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: use DPDK_MACHINE=haswell when testing dpdk build on github-hosted runner #2243

Merged
merged 3 commits into from
May 16, 2024
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- compiler: clang++-18
standard: 23
mode: release
cooks: --cook dpdk
options: --cook dpdk --dpdk-machine haswell
enables: --enable-dpdk
- compiler: clang++-18
standard: 23
Expand All @@ -69,7 +69,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: "${{ contains(matrix.cooks, 'dpdk') }}"
submodules: "${{ contains(matrix.enables, 'dpdk') }}"

- name: Install build dependencies
run: |
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
--compiler $CXX
--c-compiler $CC
--mode ${{ matrix.mode }}
${{ matrix.cooks }}
${{ matrix.options }}
${{ matrix.enables }} ;

- name: Build
Expand Down
29 changes: 2 additions & 27 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def standard_supported(standard, compiler='g++'):
arg_parser.add_argument('--compile-commands-json', dest='cc_json', action='store_true',
help='Generate a compile_commands.json file for integration with clangd and other tools.')
arg_parser.add_argument('--heap-profiling', dest='heap_profiling', action='store_true', default=False, help='Enable heap profiling')
arg_parser.add_argument('--dpdk-machine', default='native', help='Specify the target architecture')
add_tristate(arg_parser, name='deferred-action-require-noexcept', dest='deferred_action_require_noexcept', help='noexcept requirement for deferred actions', default=True)
arg_parser.add_argument('--prefix', dest='install_prefix', default='/usr/local', help='Root installation path of Seastar files')
args = arg_parser.parse_args()
Expand All @@ -163,32 +164,6 @@ def identify_best_standard(cpp_standards, compiler):
args.cpp_standard = identify_best_standard(cpp_standards, compiler=args.cxx)


def infer_dpdk_machine(user_cflags):
"""Infer the DPDK machine identifier (e.g., 'ivb') from the space-separated
string of user cflags by scraping the value of `-march` if it is present.

The default if no architecture is indicated is 'native'.
"""
arch = 'native'

# `-march` may be repeated, and we want the last one.
# strip features, leave only the arch: armv8-a+crc+crypto -> armv8-a
for flag in user_cflags.split():
if flag.startswith('-march'):
arch = flag[7:].split('+')[0]

MAPPING = {
'native': 'native',
'nehalem': 'nhm',
'westmere': 'wsm',
'sandybridge': 'snb',
'ivybridge': 'ivb',
'armv8-a': 'armv8a',
}

return MAPPING.get(arch, 'native')


MODES = seastar_cmake.SUPPORTED_MODES if args.mode == 'all' else [args.mode]

# For convenience.
Expand Down Expand Up @@ -223,7 +198,7 @@ def configure_mode(mode):
tr(LDFLAGS, 'LD_FLAGS'),
tr(args.cxx_modules, 'MODULE'),
tr(args.dpdk, 'DPDK'),
tr(infer_dpdk_machine(args.user_cflags), 'DPDK_MACHINE'),
tr(args.dpdk_machine, 'DPDK_MACHINE'),
tr(args.hwloc, 'HWLOC', value_when_none='yes'),
tr(args.io_uring, 'IO_URING', value_when_none=None),
tr(args.alloc_failure_injection, 'ALLOC_FAILURE_INJECTION', value_when_none='DEFAULT'),
Expand Down
Loading