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

issue: 2336523 Return RX pbufs to cq_mgr instead of global pool #917

Open
wants to merge 16 commits into
base: vNext
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2020 Mellanox Technologies, Ltd. All rights reserved.
* Copyright (c) 2001-2021 Mellanox Technologies, Ltd. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
Expand Down
3 changes: 0 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ mydoc_DATA = README.txt journal.txt VMA_VERSION

install-exec-hook:
if type systemctl >/dev/null 2>&1; then \
cp $(top_builddir)/contrib/scripts/vma.init $(DESTDIR)$(sbindir)/vma; \
chmod 755 $(DESTDIR)$(sbindir)/vma; \
mkdir -p $(DESTDIR)$(prefix)/lib/systemd/system/; \
cp $(top_builddir)/contrib/scripts/vma.service $(DESTDIR)$(prefix)/lib/systemd/system/vma.service; \
chmod 644 $(DESTDIR)$(prefix)/lib/systemd/system/vma.service; \
Expand All @@ -35,7 +33,6 @@ install-exec-hook:

uninstall-hook:
if type systemctl >/dev/null 2>&1; then \
rm -rf $(DESTDIR)$(sbindir)/vma; \
rm -rf $(DESTDIR)$(prefix)/lib/systemd/system/vma.service; \
else \
rm -rf $(DESTDIR)$(sysconfdir)/init.d/vma; \
Expand Down
2 changes: 1 addition & 1 deletion config/m4/dpcp.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dpcp.m4 - Library to operate with DevX
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2020. ALL RIGHTS RESERVED.
# Copyright (C) Mellanox Technologies Ltd. 2001-2021. ALL RIGHTS RESERVED.
# See file LICENSE for terms.
#

Expand Down
2 changes: 1 addition & 1 deletion config/m4/func.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# func.m4 - Collection of functions
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2020. ALL RIGHTS RESERVED.
# Copyright (C) Mellanox Technologies Ltd. 2001-2021. ALL RIGHTS RESERVED.
# See file LICENSE for terms.
#

Expand Down
2 changes: 1 addition & 1 deletion config/m4/nl.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nl.m4 - Detect nl package
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2020. ALL RIGHTS RESERVED.
# Copyright (C) Mellanox Technologies Ltd. 2001-2021. ALL RIGHTS RESERVED.
# See file LICENSE for terms.
#

Expand Down
2 changes: 1 addition & 1 deletion config/m4/opt.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# opt.m4 - Macros to control optimization
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2020. ALL RIGHTS RESERVED.
# Copyright (C) Mellanox Technologies Ltd. 2001-2021. ALL RIGHTS RESERVED.
# See file LICENSE for terms.
#

Expand Down
2 changes: 1 addition & 1 deletion config/m4/prof.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# prof.m4 - Profiling, instrumentation
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2020. ALL RIGHTS RESERVED.
# Copyright (C) Mellanox Technologies Ltd. 2001-2021. ALL RIGHTS RESERVED.
# See file LICENSE for terms.
#

Expand Down
2 changes: 1 addition & 1 deletion config/m4/verbs.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# verbs.m4 - Parsing verbs capabilities
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2020. ALL RIGHTS RESERVED.
# Copyright (C) Mellanox Technologies Ltd. 2001-2021. ALL RIGHTS RESERVED.
# See file LICENSE for terms.
#

Expand Down
8 changes: 6 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ AC_MSG_CHECKING([for compiler])
case $CC in
gcc*|g++*)
AC_MSG_RESULT([gcc])
CFLAGS="$CFLAGS -Wall -Wextra -Werror -Wundef -ffunction-sections -fdata-sections -Wsequence-point -pipe -Winit-self -Wmissing-include-dirs"
CXXFLAGS="$CXXFLAGS -Wshadow -Wall -Wextra -Werror -Wundef -ffunction-sections -fdata-sections -Wsequence-point -pipe -Winit-self -Wmissing-include-dirs"
CFLAGS="$CFLAGS -Wall -Wextra -Werror -Wundef \
-ffunction-sections -fdata-sections -Wsequence-point -pipe -Winit-self -Wmissing-include-dirs \
-Wno-free-nonheap-object "
CXXFLAGS="$CXXFLAGS -Wshadow -Wall -Wextra -Werror -Wundef \
-ffunction-sections -fdata-sections -Wsequence-point -pipe -Winit-self -Wmissing-include-dirs \
-Wno-free-nonheap-object "
;;
icc*|icpc*)
AC_MSG_RESULT([icc])
Expand Down
58 changes: 39 additions & 19 deletions contrib/jenkins_tests/tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,49 @@ function check_daemon()
rm -rf ${out_log}
sudo pkill -9 vmad

echo "daemon check output: ${service}" > ${out_log}

if type systemctl >/dev/null 2>&1; then
service=${install_dir}/sbin/vma
service=${install_dir}/sbin/vmad
service_arg=${install_dir}/lib/systemd/system/vma.service

if [ $(sudo systemd-analyze verify ${service_arg} >>${out_log} 2>&1 || echo $?) ]; then
ret=1
fi
sleep 3
if [ $(sudo ${service} >>${out_log} 2>&1 || echo $?) ]; then
ret=1
fi
sleep 3
if [ "0" == "$ret" -a "" == "$(pgrep vmad)" ]; then
ret=1
fi
sudo pkill -9 vmad >>${out_log} 2>&1
sleep 3
if [ "0" == "$ret" -a "" != "$(pgrep vmad)" ]; then
ret=1
fi
else
service=${install_dir}/etc/init.d/vma
fi
service_arg=""

echo "daemon check output: ${service}" > ${out_log}
if [ $(sudo ${service} start >>${out_log} 2>&1 || echo $?) ]; then
ret=1
fi
sleep 3
if [ "0" == "$ret" -a "" == "$(pgrep vmad)" ]; then
ret=1
fi
if [ $(sudo ${service} status >>${out_log} 2>&1 || echo $?) ]; then
ret=1
fi
if [ $(sudo ${service} stop >>${out_log} 2>&1 || echo $?) ]; then
ret=1
fi
sleep 3
if [ "0" == "$ret" -a "" != "$(pgrep vmad)" ]; then
ret=1
if [ $(sudo ${service} start ${service_arg} >>${out_log} 2>&1 || echo $?) ]; then
ret=1
fi
sleep 3
if [ "0" == "$ret" -a "" == "$(pgrep vmad)" ]; then
ret=1
fi
if [ $(sudo ${service} status ${service_arg} >>${out_log} 2>&1 || echo $?) ]; then
ret=1
fi
if [ $(sudo ${service} stop ${service_arg} >>${out_log} 2>&1 || echo $?) ]; then
ret=1
fi
sleep 3
if [ "0" == "$ret" -a "" != "$(pgrep vmad)" ]; then
ret=1
fi
fi

sudo pkill -9 vmad
Expand Down
66 changes: 37 additions & 29 deletions contrib/scripts/libvma.spec.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
%{!?configure_options: %global configure_options %{nil}}
%{!?use_extralib: %global use_extralib @VMA_LIBRARY_RELEASE@}
%{!?use_rel: %global use_rel @VMA_LIBRARY_RELEASE@}

%{!?make_build: %global make_build %{__make} %{?_smp_mflags} %{?mflags} V=1}
Expand All @@ -19,10 +18,6 @@ License: GPLv2 or BSD
Url: https://github.com/Mellanox/%{name}
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz

%if 0%{?rhl}%{?fedora} == 0
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%endif

# libvma currently supports only the following architectures
ExclusiveArch: x86_64 ppc64le ppc64 aarch64

Expand All @@ -31,11 +26,13 @@ BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: gcc-c++
BuildRequires: libibverbs-devel
BuildRequires: rdma-core-devel
BuildRequires: systemd-rpm-macros
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 24 || 0%{?suse_version} >= 1500
BuildRequires: libnl3-devel
BuildRequires: pkgconfig(libnl-3.0)
BuildRequires: pkgconfig(libnl-route-3.0)
%endif
BuildRequires: make

%description
libvma is a LD_PRELOAD-able library that boosts performance of TCP and
Expand Down Expand Up @@ -77,7 +74,7 @@ if [ ! -e configure ] && [ -e autogen.sh ]; then
VMA_RELEASE=%{use_rel} ./autogen.sh
fi

%if %{use_extralib} > 0
%if %{use_rel} > 0
%configure --enable-opt-log=none \
%{?configure_options}
%{make_build}
Expand All @@ -86,28 +83,34 @@ cp -f src/vma/.libs/%{name}.so %{name}-debug.so
%endif

%configure --docdir=%{_pkgdocdir} \
%{?configure_options}
%{?configure_options}
%{make_build}

%install
%if 0%{?rhl}%{?fedora} == 0
[ "${RPM_BUILD_ROOT}" != "/" -a -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT}
%endif

%{make_build} DESTDIR=${RPM_BUILD_ROOT} install

find $RPM_BUILD_ROOT%{_libdir} -name '*.la' -delete
%if "%{use_systemd}" == "1"
install -D -m 644 contrib/scripts/vma.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/vma.service
%endif

%if %{use_extralib} > 0
%if %{use_rel} > 0
install -m 755 ./%{name}-debug.so $RPM_BUILD_ROOT/%{_libdir}/%{name}-debug.so
%endif

%post
%if 0%{?fedora} || 0%{?rhel} > 7
# https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets
%else
%{run_ldconfig}

%endif
if [ $1 = 1 ]; then
if type systemctl >/dev/null 2>&1; then
systemctl --no-reload enable vma.service >/dev/null 2>&1 || true
%if 0%{?suse_version}
%service_add_post vma.service
%else
%systemd_post vma.service
%endif
elif [ -e /sbin/chkconfig ]; then
/sbin/chkconfig --add vma
elif [ -e /usr/sbin/update-rc.d ]; then
Expand All @@ -120,8 +123,11 @@ fi
%preun
if [ $1 = 0 ]; then
if type systemctl >/dev/null 2>&1; then
systemctl --no-reload disable vma.service >/dev/null 2>&1 || true
systemctl stop vma.service || true
%if 0%{?suse_version}
%service_del_preun vma.service
%else
%systemd_preun vma.service
%endif
elif [ -e /sbin/chkconfig ]; then
%{_sysconfdir}/init.d/vma stop
/sbin/chkconfig --del vma
Expand All @@ -134,15 +140,18 @@ if [ $1 = 0 ]; then
fi
fi

%clean
%if 0%{?rhl}%{?fedora} == 0
[ "${RPM_BUILD_ROOT}" != "/" -a -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT}
%endif

%postun
%if 0%{?fedora} || 0%{?rhel} > 7
# https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets
%else
%{run_ldconfig}
%endif
if type systemctl >/dev/null 2>&1; then
systemctl --system daemon-reload >/dev/null 2>&1 || true
%if 0%{?suse_version}
%service_del_postun vma.service
%else
%systemd_postun_with_restart vma.service
%endif
fi

%files
Expand All @@ -152,13 +161,9 @@ fi
%doc %{_pkgdocdir}/journal.txt
%doc %{_pkgdocdir}/VMA_VERSION
%config(noreplace) %{_sysconfdir}/libvma.conf
%dir %{_sysconfdir}/security
%dir %{_sysconfdir}/security/limits.d
%config(noreplace) %{_sysconfdir}/security/limits.d/30-libvma-limits.conf
%{_sbindir}/vmad
%if "%{use_systemd}" == "1"
%{_prefix}/lib/systemd/system/vma.service
%{_sbindir}/vma
%else
%{_sysconfdir}/init.d/vma
%endif
Expand All @@ -171,7 +176,7 @@ fi
%files devel
%dir %{_includedir}/mellanox
%{_includedir}/mellanox/vma_extra.h
%if %{use_extralib} > 0
%if %{use_rel} > 0
%{_libdir}/%{name}-debug.so
%endif

Expand All @@ -180,6 +185,9 @@ fi
%{_mandir}/man8/vma_stats.*

%changelog
* Mon Nov 23 2020 Igor Ivanov <[email protected]> 9.2.1-1
- Improve systemd support

* Fri Apr 17 2020 Igor Ivanov <[email protected]> 9.0.2-1
- Align with Fedora guidelines

Expand Down
2 changes: 1 addition & 1 deletion contrib/scripts/vma.init.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2020. ALL RIGHTS RESERVED.
# Copyright (C) Mellanox Technologies Ltd. 2001-2021. ALL RIGHTS RESERVED.
# See file LICENSE for terms.
#
# vma: Start the VMA Daemon
Expand Down
9 changes: 3 additions & 6 deletions contrib/scripts/vma.service.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
[Unit]
Description=VMA Daemon. Version: @VERSION@-@VMA_LIBRARY_RELEASE@
After=network.target syslog.target
Requires=network.target
Description=VMA Daemon
After=network.target

[Service]
Type=forking
Restart=on-failure
ExecStart=@prefix@/sbin/vma start
ExecStop=@prefix@/sbin/vma stop
ExecReload=@prefix@/sbin/vma restart
ExecStart=@prefix@/sbin/vmad
RestartForceExitStatus=1 SIGTERM

[Install]
Expand Down
2 changes: 1 addition & 1 deletion contrib/test_jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Testing script for VMA, to run from Jenkins CI
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2020. ALL RIGHTS RESERVED.
# Copyright (C) Mellanox Technologies Ltd. 2001-2021. ALL RIGHTS RESERVED.
#
# See file LICENSE for terms.
#
Expand Down
2 changes: 1 addition & 1 deletion debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Upstream-Name: libvma
Source: https://github.com/Mellanox/libvma

Files: *
Copyright: 2001-2020 Mellanox Technologies, Ltd.
Copyright: 2001-2021 Mellanox Technologies, Ltd.
License: GPLv2-and-2BSD

Files:
Expand Down
2 changes: 1 addition & 1 deletion src/state_machine/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2020 Mellanox Technologies, Ltd. All rights reserved.
* Copyright (c) 2001-2021 Mellanox Technologies, Ltd. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
Expand Down
2 changes: 1 addition & 1 deletion src/state_machine/sm.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2020 Mellanox Technologies, Ltd. All rights reserved.
* Copyright (c) 2001-2021 Mellanox Technologies, Ltd. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
Expand Down
2 changes: 1 addition & 1 deletion src/state_machine/sm.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2020 Mellanox Technologies, Ltd. All rights reserved.
* Copyright (c) 2001-2021 Mellanox Technologies, Ltd. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
Expand Down
2 changes: 1 addition & 1 deletion src/state_machine/sm_fifo.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2020 Mellanox Technologies, Ltd. All rights reserved.
* Copyright (c) 2001-2021 Mellanox Technologies, Ltd. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
Expand Down
2 changes: 1 addition & 1 deletion src/state_machine/sm_fifo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2020 Mellanox Technologies, Ltd. All rights reserved.
* Copyright (c) 2001-2021 Mellanox Technologies, Ltd. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
Expand Down
2 changes: 1 addition & 1 deletion src/stats/stats_data_reader.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2020 Mellanox Technologies, Ltd. All rights reserved.
* Copyright (c) 2001-2021 Mellanox Technologies, Ltd. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
Expand Down
Loading