Bump version to 9.0.2
Signed-off-by: Igor Ivanov <igor.ivanov.va@gmail.com>
This commit is contained in:
		
							parent
							
								
									d55334dfa6
								
							
						
					
					
						commit
						2387c1c73b
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1 +1,2 @@ | ||||
| /libvma-8.0.1.tar.gz | ||||
| /libvma-9.0.2.tar.gz | ||||
|  | ||||
							
								
								
									
										316
									
								
								0001-issue-928161-Add-man-pages.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										316
									
								
								0001-issue-928161-Add-man-pages.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,316 @@ | ||||
| From 5d23e646056ffb0c77826f7e9413edab2f3d7235 Mon Sep 17 00:00:00 2001 | ||||
| From: Igor Ivanov <igor.ivanov.va@gmail.com> | ||||
| Date: Thu, 8 Jun 2017 17:50:01 +0300 | ||||
| Subject: [PATCH] issue: 928161 Add man pages | ||||
| 
 | ||||
| Changes introduce new folder as doc to store any documentation | ||||
| related VMA library. | ||||
| As a part of this commit man folder is added with man pages for | ||||
| vma, vma daemon and vma_stats. | ||||
| 
 | ||||
| Signed-off-by: Igor Ivanov <igor.ivanov.va@gmail.com> | ||||
| ---
 | ||||
|  Makefile.am                 |  4 +-- | ||||
|  build/libvma.spec.in        |  3 ++ | ||||
|  configure.ac                |  5 +-- | ||||
|  debian/libvma-utils.install |  1 + | ||||
|  debian/libvma.install       |  2 ++ | ||||
|  doc/man/Makefile.am         | 24 +++++++++++++ | ||||
|  doc/man/vma.7.in            | 42 ++++++++++++++++++++++ | ||||
|  doc/man/vma_stats.8.in      | 70 +++++++++++++++++++++++++++++++++++++ | ||||
|  doc/man/vmad.8.in           | 41 ++++++++++++++++++++++ | ||||
|  9 files changed, 188 insertions(+), 4 deletions(-) | ||||
|  create mode 100644 doc/man/Makefile.am | ||||
|  create mode 100644 doc/man/vma.7.in | ||||
|  create mode 100644 doc/man/vma_stats.8.in | ||||
|  create mode 100644 doc/man/vmad.8.in | ||||
| 
 | ||||
| diff --git a/Makefile.am b/Makefile.am
 | ||||
| index 3872264d..6eecd5af 100644
 | ||||
| --- a/Makefile.am
 | ||||
| +++ b/Makefile.am
 | ||||
| @@ -1,7 +1,7 @@
 | ||||
| -SUBDIRS := src tools
 | ||||
| +SUBDIRS := src tools doc/man
 | ||||
|   | ||||
|   | ||||
| -DIST_SUBDIRS := src tests tools
 | ||||
| +DIST_SUBDIRS := src tests tools doc/man
 | ||||
|   | ||||
|  noinst_SCRIPTS = \ | ||||
|  	$(wildcard contrib/scripts/*) | ||||
| diff --git a/build/libvma.spec.in b/build/libvma.spec.in
 | ||||
| index f11e48d4..695348aa 100644
 | ||||
| --- a/build/libvma.spec.in
 | ||||
| +++ b/build/libvma.spec.in
 | ||||
| @@ -169,6 +169,8 @@ fi
 | ||||
|  %else | ||||
|  %{_sysconfdir}/init.d/vma | ||||
|  %endif | ||||
| +%{_mandir}/man7/vma.*
 | ||||
| +%{_mandir}/man8/vmad.*
 | ||||
|   | ||||
|  %files devel | ||||
|  %defattr(-,root,root,-) | ||||
| @@ -178,6 +180,7 @@ fi
 | ||||
|  %defattr(-,root,root) | ||||
|  %{_bindir}/vma_stats | ||||
|  %{vma_datadir}/scripts/vma_perf_envelope.sh | ||||
| +%{_mandir}/man8/vma_stats.*
 | ||||
|   | ||||
|  %changelog | ||||
|  * Mon Nov 28 2016 Igor Ivanov <igor.ivanov.va@gmail.com> | ||||
| diff --git a/configure.ac b/configure.ac
 | ||||
| index 1df73e28..8d19935f 100644
 | ||||
| --- a/configure.ac
 | ||||
| +++ b/configure.ac
 | ||||
| @@ -53,7 +53,7 @@ dateopt=""
 | ||||
|      if test -n "$SOURCE_DATE_EPOCH" ; then | ||||
|      dateopt="-u -d @$SOURCE_DATE_EPOCH" | ||||
|  fi | ||||
| -AC_SUBST([BUILD_DATE], [$(date $dateopt +'%b/%d/%Y')])
 | ||||
| +AC_SUBST([BUILD_DATE], [$(date $dateopt +'%d %b %Y')])
 | ||||
|  AC_SUBST([BUILD_TIME], [$(date $dateopt +'%H:%M:%S')]) | ||||
|  AC_SUBST([BUILD_DATE_CHANGELOG], [$(date $dateopt +'%a, %d %b %Y %T %z')]) | ||||
|   | ||||
| @@ -102,9 +102,9 @@ show_section_title "Configure build tools"
 | ||||
|   | ||||
|  # Find compiler, libtools, etc | ||||
|  # | ||||
| +LT_INIT([disable-static])
 | ||||
|  AC_PROG_CC | ||||
|  AC_PROG_CXX | ||||
| -AC_PROG_LIBTOOL
 | ||||
|  AC_PROG_YACC | ||||
|  AM_PROG_LEX | ||||
|   | ||||
| @@ -489,6 +489,7 @@ AC_CONFIG_FILES([
 | ||||
|  		tests/throughput_test/Makefile | ||||
|  		tools/Makefile | ||||
|  		tools/daemon/Makefile | ||||
| +		doc/man/Makefile
 | ||||
|  		contrib/scripts/vma.init | ||||
|  		contrib/scripts/vma.service | ||||
|  		build/libvma.spec | ||||
| diff --git a/debian/libvma-utils.install b/debian/libvma-utils.install
 | ||||
| index 86a9e9c7..a2452f72 100644
 | ||||
| --- a/debian/libvma-utils.install
 | ||||
| +++ b/debian/libvma-utils.install
 | ||||
| @@ -1 +1,2 @@
 | ||||
|  usr/bin/vma_stats | ||||
| +usr/share/man/man8/vma_stats.*
 | ||||
| diff --git a/debian/libvma.install b/debian/libvma.install
 | ||||
| index c2dc65bc..65612191 100644
 | ||||
| --- a/debian/libvma.install
 | ||||
| +++ b/debian/libvma.install
 | ||||
| @@ -7,4 +7,6 @@ usr/sbin/
 | ||||
|  etc/libvma.conf | ||||
|  etc/ | ||||
|  contrib/scripts/vma.service lib/systemd/system | ||||
| +usr/share/man/man7/vma.*
 | ||||
| +usr/share/man/man8/vmad.*
 | ||||
|  libvma-debug.so usr/lib | ||||
| diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
 | ||||
| new file mode 100644 | ||||
| index 00000000..e1c54e58
 | ||||
| --- /dev/null
 | ||||
| +++ b/doc/man/Makefile.am
 | ||||
| @@ -0,0 +1,24 @@
 | ||||
| +vma_man_pages = \
 | ||||
| +	vma.7 \
 | ||||
| +	vmad.8 \
 | ||||
| +	vma_stats.8
 | ||||
| +
 | ||||
| +man_MANS = $(vma_man_pages)
 | ||||
| +CLEANFILES = $(vma_man_pages)
 | ||||
| +EXTRA_DIST = \
 | ||||
| +	$(vma_man_pages:.7=.7.in) \
 | ||||
| +	$(vma_man_pages:.8=.8.in)
 | ||||
| +
 | ||||
| +%.7: %.7.in
 | ||||
| +	@cp $< $@
 | ||||
| +	@sed -i 's/#BUILD_DATE#/@BUILD_DATE@/g' $@
 | ||||
| +	@sed -i 's/#VMA_LIBRARY_MAJOR#/@VMA_LIBRARY_MAJOR@/g' $@
 | ||||
| +	@sed -i 's/#VMA_LIBRARY_MINOR#/@VMA_LIBRARY_MINOR@/g' $@
 | ||||
| +	@sed -i 's/#VMA_LIBRARY_REVISION#/@VMA_LIBRARY_REVISION@/g' $@
 | ||||
| +
 | ||||
| +%.8: %.8.in
 | ||||
| +	@cp $< $@
 | ||||
| +	@sed -i 's/#BUILD_DATE#/@BUILD_DATE@/g' $@
 | ||||
| +	@sed -i 's/#VMA_LIBRARY_MAJOR#/@VMA_LIBRARY_MAJOR@/g' $@
 | ||||
| +	@sed -i 's/#VMA_LIBRARY_MINOR#/@VMA_LIBRARY_MINOR@/g' $@
 | ||||
| +	@sed -i 's/#VMA_LIBRARY_REVISION#/@VMA_LIBRARY_REVISION@/g' $@
 | ||||
| diff --git a/doc/man/vma.7.in b/doc/man/vma.7.in
 | ||||
| new file mode 100644 | ||||
| index 00000000..d029d5d9
 | ||||
| --- /dev/null
 | ||||
| +++ b/doc/man/vma.7.in
 | ||||
| @@ -0,0 +1,42 @@
 | ||||
| +.\" -*- groff -*-
 | ||||
| +.\"
 | ||||
| +.TH VMA 7 "#BUILD_DATE#" libvma "VMA(#VMA_LIBRARY_MAJOR#.#VMA_LIBRARY_MINOR#.#VMA_LIBRARY_REVISION#) User's Manual"
 | ||||
| +.SH NAME
 | ||||
| +VMA \- Mellanox's Messaging Accelerator (VMA) library.
 | ||||
| +
 | ||||
| +.SH SYNOPSIS
 | ||||
| +.B libvma.so
 | ||||
| +
 | ||||
| +.SH DESCRIPTION
 | ||||
| +.B VMA
 | ||||
| +Mellanox's Messaging Accelerator (VMA) boosts performance for message-based
 | ||||
| +and streaming applications such as those found in financial services market
 | ||||
| +data environments and Web2.0 clusters. It allows application written over
 | ||||
| +standard socket API to run over Ethernet and/or Infiniband from user-space
 | ||||
| +with full network stack bypass. The result is a reduction in latency by as
 | ||||
| +much as 300%, an increase in application throughput by as much as 200%, higher
 | ||||
| +packets rates and better CPU utilization as compared to applications running
 | ||||
| +on standard Ethernet or InfiniBand interconnect networks.
 | ||||
| +
 | ||||
| +.SH FILES
 | ||||
| +.I /etc/libvma.conf
 | ||||
| +.RS
 | ||||
| +The system wide configuration file. Look inside libvma.conf for instructions
 | ||||
| +and examples.
 | ||||
| +.RE
 | ||||
| +.I /usr/share/doc/libvma/README.txt
 | ||||
| +.RS
 | ||||
| +General VMA Library description.
 | ||||
| +.RE
 | ||||
| +.I /usr/share/doc/libvma/VMA_VERSION
 | ||||
| +.RS
 | ||||
| +VMA Library version information.
 | ||||
| +.RE
 | ||||
| +
 | ||||
| +.SH SEE ALSO
 | ||||
| +.BR vmad (8),
 | ||||
| +.BR vma_stats (8)
 | ||||
| +
 | ||||
| +.SH "AUTHORS"
 | ||||
| +.TP
 | ||||
| +Igor Ivanov <igori@mellanox.com>
 | ||||
| diff --git a/doc/man/vma_stats.8.in b/doc/man/vma_stats.8.in
 | ||||
| new file mode 100644 | ||||
| index 00000000..9609a464
 | ||||
| --- /dev/null
 | ||||
| +++ b/doc/man/vma_stats.8.in
 | ||||
| @@ -0,0 +1,70 @@
 | ||||
| +.\" -*- groff -*-
 | ||||
| +.\"
 | ||||
| +.TH VMA 8 "#BUILD_DATE#" libvma "VMA(#VMA_LIBRARY_MAJOR#.#VMA_LIBRARY_MINOR#.#VMA_LIBRARY_REVISION#) User's Manual"
 | ||||
| +.SH NAME
 | ||||
| +vma_stats \- Mellanox's Messaging Accelerator (VMA) statistic utility.
 | ||||
| +
 | ||||
| +.SH SYNOPSIS
 | ||||
| +.B vma_stats
 | ||||
| +[\-p \fIpid\fP] [\-k \fIdirectory\fP] [\-v \fIview\fP] [\-d \fIdetails\fP] [\-i \fIinterval\fP]
 | ||||
| +[\-n \fIapplication\fP] [\-f] [\-F] [\-c \fIcycles\fP] [\-l \fIlevel\fP] [\-z]
 | ||||
| +
 | ||||
| +.SH DESCRIPTION
 | ||||
| +vma_stats is program that reports information about sockets and internal related objects for vma (7).
 | ||||
| +vma_stats can be configured using command-line options
 | ||||
| +
 | ||||
| +The options are as follows:
 | ||||
| +.sp
 | ||||
| +\fB\-p,\-\-pid\fP \fIid\fP
 | ||||
| +Show VMA statistics for process with pid.
 | ||||
| +.TP
 | ||||
| +\fB\-k,\-\-directory\fP=\fIdirectory\fP
 | ||||
| +Set shared memory directory path.
 | ||||
| +.TP
 | ||||
| +\fB\-n,\-\-name\fP=\fIapplication\fP
 | ||||
| +Show VMA statistics for application.
 | ||||
| +.TP
 | ||||
| +\fB\-f,\-\-find_pid\fP
 | ||||
| +Find and show statistics for VMA instance running.
 | ||||
| +.TP
 | ||||
| +\fB\-F,\-\-forbid_clean\fP
 | ||||
| +By setting this flag inactive shared objects would not be removed.
 | ||||
| +.TP
 | ||||
| +\fB\-i,\-\-interval\fP=\fIinterval\fP
 | ||||
| +Print report every interval seconds.
 | ||||
| +.TP
 | ||||
| +\fB\-c,\-\-cycles\fP=\fIcycles\fP
 | ||||
| +Do report print cycles and exit, use 0 value for infinite.
 | ||||
| +.TP
 | ||||
| +\fB\-v,\-\-view\fP=\fI[1|2|3|4|5]\fP
 | ||||
| +Set view type: 1\- basic info, 2\- extra info, 3\- full info, 4\- mc groups, 5\- similar to 'netstat \-tunaep'.
 | ||||
| +.TP
 | ||||
| +\fB\-d,\-\-details\fP=\fI[1|2]\fP
 | ||||
| +Set details mode:1\- to see totals, 2\- to see deltas.
 | ||||
| +.TP
 | ||||
| +\fB\-z,\-\-zero\fP
 | ||||
| +Zero counters.
 | ||||
| +.TP
 | ||||
| +\fB\-l,\-\-log_level\fP=\fIlevel\fP
 | ||||
| +Set VMA log level (one of: none, panic, error, warn, info, details, debug, fine, finer, all).
 | ||||
| +.TP
 | ||||
| +\fB\-S,\-\-fd_dump\fP=\fIfd [level]\fP
 | ||||
| +Dump statistics for fd number using log level. Use 0 value for all open fds.
 | ||||
| +.TP
 | ||||
| +\fB\-D,\-\-details_level\fP=\fIlevel\fP
 | ||||
| +Set VMA log details level.
 | ||||
| +.TP
 | ||||
| +\fB\-s,\-\-sockets\fP=\fI[list|range]\fP
 | ||||
| +Log only sockets that match list or range, format: 4-16 or 1,9 (or combination).
 | ||||
| +.TP
 | ||||
| +\fB\-V,\-\-version\fP
 | ||||
| +Print version.
 | ||||
| +.TP
 | ||||
| +
 | ||||
| +.SH SEE ALSO
 | ||||
| +.BR vma (7),
 | ||||
| +.BR vmad (8)
 | ||||
| +
 | ||||
| +.SH "AUTHORS"
 | ||||
| +.TP
 | ||||
| +Igor Ivanov <igori@mellanox.com>
 | ||||
| diff --git a/doc/man/vmad.8.in b/doc/man/vmad.8.in
 | ||||
| new file mode 100644 | ||||
| index 00000000..cac0c75b
 | ||||
| --- /dev/null
 | ||||
| +++ b/doc/man/vmad.8.in
 | ||||
| @@ -0,0 +1,41 @@
 | ||||
| +.\" -*- groff -*-
 | ||||
| +.\"
 | ||||
| +.TH VMA 8 "#BUILD_DATE#" libvma "VMA(#VMA_LIBRARY_MAJOR#.#VMA_LIBRARY_MINOR#.#VMA_LIBRARY_REVISION#) User's Manual"
 | ||||
| +.SH NAME
 | ||||
| +vmad \- Mellanox's Messaging Accelerator (VMA) daemon.
 | ||||
| +
 | ||||
| +.SH SYNOPSIS
 | ||||
| +.B vmad
 | ||||
| +[\-\-console] [\-\-pid,-p \fInum\fP] [\-\-fid,-f \fInum\fP]
 | ||||
| +[\-\-force-rst] [\-\-verbose,\-v \fIlevel\fP]
 | ||||
| +
 | ||||
| +.SH DESCRIPTION
 | ||||
| +vmad is the daemon program for vma (7).
 | ||||
| +
 | ||||
| +vmad can be configured using command-line options
 | ||||
| +
 | ||||
| +The options are as follows:
 | ||||
| +.sp
 | ||||
| +\fB\-\-console\fP
 | ||||
| +Enable foreground mode.
 | ||||
| +.TP
 | ||||
| +\fB\-\-pid,\-p \fP\fInum\fP
 | ||||
| +Set prime number as maximum of processes per node.
 | ||||
| +.TP
 | ||||
| +\fB\-\-fid,\-f \fP\fInum\fP
 | ||||
| +Set prime number as maximum of sockets per process.
 | ||||
| +.TP
 | ||||
| +\fB\-\-force\-rst\fP
 | ||||
| +Force internal RST.
 | ||||
| +.TP
 | ||||
| +\fB\-\-verbose,\-v \fP\fIlevel\fP
 | ||||
| +Output verbose level
 | ||||
| +.TP
 | ||||
| +
 | ||||
| +.SH SEE ALSO
 | ||||
| +.BR vma (7),
 | ||||
| +.BR vma_stats (8)
 | ||||
| +
 | ||||
| +.SH "AUTHORS"
 | ||||
| +.TP
 | ||||
| +Igor Ivanov <igori@mellanox.com>
 | ||||
| -- 
 | ||||
| 2.18.1 | ||||
| 
 | ||||
							
								
								
									
										34
									
								
								0002-Update-systemctl-files.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								0002-Update-systemctl-files.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| From 96a275dbffcc967cdbd4c29c9a3196a9518bae00 Mon Sep 17 00:00:00 2001 | ||||
| From: Igor Ivanov <igor.ivanov.va@gmail.com> | ||||
| Date: Fri, 19 Jun 2020 16:29:25 +0300 | ||||
| Subject: [PATCH] Update systemctl files | ||||
| 
 | ||||
| Signed-off-by: Igor Ivanov <igor.ivanov.va@gmail.com> | ||||
| ---
 | ||||
|  contrib/scripts/vma.service.in | 6 ++---- | ||||
|  1 file changed, 2 insertions(+), 4 deletions(-) | ||||
| 
 | ||||
| diff --git a/contrib/scripts/vma.service.in b/contrib/scripts/vma.service.in
 | ||||
| index e268173f..13457b2f 100644
 | ||||
| --- a/contrib/scripts/vma.service.in
 | ||||
| +++ b/contrib/scripts/vma.service.in
 | ||||
| @@ -1,14 +1,12 @@
 | ||||
|  [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
 | ||||
|  RestartForceExitStatus=1 SIGTERM | ||||
|   | ||||
|  [Install] | ||||
| -- 
 | ||||
| 2.18.1 | ||||
| 
 | ||||
							
								
								
									
										54
									
								
								0003-Remove-30-libvma-limits.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								0003-Remove-30-libvma-limits.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,54 @@ | ||||
| From 402a7f565d6171d195a5b65b9d54f42d802211c1 Mon Sep 17 00:00:00 2001 | ||||
| From: Igor Ivanov <igor.ivanov.va@gmail.com> | ||||
| Date: Tue, 14 Jul 2020 19:34:02 +0300 | ||||
| Subject: [PATCH] Remove 30-libvma-limits.conf | ||||
| 
 | ||||
| RDMA communications require that physical memory in the computer | ||||
| be pinned. Pinning memory is normally a very privileged operation. | ||||
| In order to allow users other than root to run large RDMA applications, | ||||
| it will likely be necessary to increase the amount of memory | ||||
| that non-root users are allowed to pin in the system. | ||||
| This is done by adding a file in the /etc/security/limits.d/ directory. | ||||
| It can be done by an administrator of system for user/group that | ||||
| use libvma. | ||||
| 
 | ||||
| Signed-off-by: Igor Ivanov <igor.ivanov.va@gmail.com> | ||||
| ---
 | ||||
|  src/vma/Makefile.am                | 5 +---- | ||||
|  src/vma/util/30-libvma-limits.conf | 6 ------ | ||||
|  2 files changed, 1 insertion(+), 10 deletions(-) | ||||
|  delete mode 100644 src/vma/util/30-libvma-limits.conf | ||||
| 
 | ||||
| diff --git a/src/vma/Makefile.am b/src/vma/Makefile.am
 | ||||
| index 6a710a72..8f73fe93 100644
 | ||||
| --- a/src/vma/Makefile.am
 | ||||
| +++ b/src/vma/Makefile.am
 | ||||
| @@ -28,12 +28,9 @@ EXTRA_DIST = \
 | ||||
|  	util/hash_map.inl \ | ||||
|  	dev/cq_mgr.inl \ | ||||
|  	dev/cq_mgr_mlx5.inl \ | ||||
| -	util/libvma.conf \
 | ||||
| -	util/30-libvma-limits.conf
 | ||||
| +	util/libvma.conf
 | ||||
|   | ||||
|  sysconf_DATA = util/libvma.conf | ||||
| -othersysconfdir=$(sysconfdir)/security/limits.d
 | ||||
| -othersysconf_DATA=util/30-libvma-limits.conf
 | ||||
|  otherincludedir = $(includedir)/mellanox | ||||
|  otherinclude_HEADERS = vma_extra.h | ||||
|   | ||||
| diff --git a/src/vma/util/30-libvma-limits.conf b/src/vma/util/30-libvma-limits.conf
 | ||||
| deleted file mode 100644 | ||||
| index 9c0d8bc0..00000000
 | ||||
| --- a/src/vma/util/30-libvma-limits.conf
 | ||||
| +++ /dev/null
 | ||||
| @@ -1,6 +0,0 @@
 | ||||
| -# Default limits that are needed for proper work of libvma
 | ||||
| -# Read more about this topic in the VMA's User Manual
 | ||||
| -
 | ||||
| -*             -   memlock        unlimited
 | ||||
| -*          soft   memlock        unlimited
 | ||||
| -*          hard   memlock        unlimited
 | ||||
| -- 
 | ||||
| 2.18.1 | ||||
| 
 | ||||
							
								
								
									
										73
									
								
								0004-Use-vmad-for-systemd.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								0004-Use-vmad-for-systemd.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,73 @@ | ||||
| From dd5cfb9017c0c6ac233faf4fb17ebfa8a2101cf8 Mon Sep 17 00:00:00 2001 | ||||
| From: Igor Ivanov <igor.ivanov.va@gmail.com> | ||||
| Date: Tue, 14 Jul 2020 21:33:31 +0300 | ||||
| Subject: [PATCH] Use vmad for systemd | ||||
| 
 | ||||
| Signed-off-by: Igor Ivanov <igor.ivanov.va@gmail.com> | ||||
| ---
 | ||||
|  Makefile.am                    | 9 --------- | ||||
|  contrib/scripts/vma.service.in | 3 +-- | ||||
|  tools/daemon/daemon.c          | 5 ----- | ||||
|  3 files changed, 1 insertion(+), 16 deletions(-) | ||||
| 
 | ||||
| diff --git a/Makefile.am b/Makefile.am
 | ||||
| index 6eecd5af..dc01e13e 100644
 | ||||
| --- a/Makefile.am
 | ||||
| +++ b/Makefile.am
 | ||||
| @@ -23,23 +23,14 @@ 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; \ | ||||
| -	else \
 | ||||
| -		mkdir -p $(DESTDIR)/$(sysconfdir)/init.d; \
 | ||||
| -		cp $(top_builddir)/contrib/scripts/vma.init $(DESTDIR)$(sysconfdir)/init.d/vma; \
 | ||||
| -		chmod 755 $(DESTDIR)$(sysconfdir)/init.d/vma; \
 | ||||
|  	fi | ||||
|   | ||||
|  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; \
 | ||||
|  	fi | ||||
|   | ||||
|  install-all: install | ||||
| diff --git a/contrib/scripts/vma.service.in b/contrib/scripts/vma.service.in
 | ||||
| index 13457b2f..e6f5a25b 100644
 | ||||
| --- a/contrib/scripts/vma.service.in
 | ||||
| +++ b/contrib/scripts/vma.service.in
 | ||||
| @@ -5,8 +5,7 @@ After=network.target
 | ||||
|  [Service] | ||||
|  Type=forking | ||||
|  Restart=on-failure | ||||
| -ExecStart=@prefix@/sbin/vma start
 | ||||
| -ExecStop=@prefix@/sbin/vma stop
 | ||||
| +ExecStart=@prefix@/sbin/vmad
 | ||||
|  RestartForceExitStatus=1 SIGTERM | ||||
|   | ||||
|  [Install] | ||||
| diff --git a/tools/daemon/daemon.c b/tools/daemon/daemon.c
 | ||||
| index 4444258d..9d23395a 100644
 | ||||
| --- a/tools/daemon/daemon.c
 | ||||
| +++ b/tools/daemon/daemon.c
 | ||||
| @@ -66,11 +66,6 @@ int main(int argc, char *argv[])
 | ||||
|  	/* Setup syslog logging */ | ||||
|  	openlog(MODULE_NAME, LOG_PID, LOG_LOCAL5); | ||||
|   | ||||
| -	/* already a daemon */
 | ||||
| -	if (getppid() == 1) {
 | ||||
| -		return 0;
 | ||||
| -	}
 | ||||
| -
 | ||||
|  	/* command line parsing... */ | ||||
|  	config_def(); | ||||
|  	log_info("Starting\n"); | ||||
| -- 
 | ||||
| 2.18.1 | ||||
| 
 | ||||
| @ -1,636 +0,0 @@ | ||||
| diff -up libvma-8.0.1/src/vlogger/vlogger.cpp.me libvma-8.0.1/src/vlogger/vlogger.cpp
 | ||||
| diff -up libvma-8.0.1/src/vlogger/vlogger.h.me libvma-8.0.1/src/vlogger/vlogger.h
 | ||||
| --- libvma-8.0.1/src/vlogger/vlogger.h.me	2018-02-05 16:37:02.817681804 +0100
 | ||||
| +++ libvma-8.0.1/src/vlogger/vlogger.h	2018-02-05 16:41:24.109434120 +0100
 | ||||
| @@ -223,11 +223,11 @@ static inline void vlog_printf(vlog_leve
 | ||||
|   | ||||
|  	switch (g_vlogger_details) { | ||||
|  	case 3: // Time | ||||
| -		len += snprintf(buf+len, VLOGGER_STR_SIZE-len-1, " Time: %9.3f", ((float)vlog_get_usec_since_start())/1000);
 | ||||
| +		len += snprintf(buf+len, VLOGGER_STR_SIZE-len-1, " Time: %9.3f", ((float)vlog_get_usec_since_start())/1000); // fallthrough
 | ||||
|  	case 2: // Pid | ||||
| -		len += snprintf(buf+len, VLOGGER_STR_SIZE-len-1, " Pid: %5u", getpid());
 | ||||
| +		len += snprintf(buf+len, VLOGGER_STR_SIZE-len-1, " Pid: %5u", getpid()); // fallthrough
 | ||||
|  	case 1: // Tid | ||||
| -		len += snprintf(buf+len, VLOGGER_STR_SIZE-len-1, " Tid: %5u", gettid());
 | ||||
| +		len += snprintf(buf+len, VLOGGER_STR_SIZE-len-1, " Tid: %5u", gettid()); // fallthrough
 | ||||
|  	case 0: // Func | ||||
|  	default: | ||||
|  		len += snprintf(buf+len, VLOGGER_STR_SIZE-len-1, " %s %s: ", g_vlogger_module_name, log_level::to_str(log_level)); | ||||
| diff -up libvma-8.0.1.me libvma-8.0.1
 | ||||
| Nur in libvma-8.0.1.me: aclocal.m4. | ||||
| Nur in libvma-8.0.1.me: autom4te.cache. | ||||
| Gemeinsame Unterverzeichnisse: libvma-8.0.1.me/build und libvma-8.0.1/build. | ||||
| Gemeinsame Unterverzeichnisse: libvma-8.0.1.me/config und libvma-8.0.1/config. | ||||
| Nur in libvma-8.0.1.me: config.h. | ||||
| Nur in libvma-8.0.1.me: config.h.in. | ||||
| Nur in libvma-8.0.1.me: config.log. | ||||
| Nur in libvma-8.0.1.me: config.status. | ||||
| Nur in libvma-8.0.1.me: configure. | ||||
| Gemeinsame Unterverzeichnisse: libvma-8.0.1.me/debian und libvma-8.0.1/debian. | ||||
| Nur in libvma-8.0.1.me: libtool. | ||||
| Nur in libvma-8.0.1.me: Makefile. | ||||
| Nur in libvma-8.0.1.me: Makefile.in. | ||||
| Gemeinsame Unterverzeichnisse: libvma-8.0.1.me/src und libvma-8.0.1/src. | ||||
| Nur in libvma-8.0.1.me: stamp-h1. | ||||
| Gemeinsame Unterverzeichnisse: libvma-8.0.1.me/tests und libvma-8.0.1/tests. | ||||
| Nur in libvma-8.0.1.me: VMA_VERSION. | ||||
| diff -up libvma-8.0.1.me/src/vma/dev/buffer_pool.cpp.me libvma-8.0.1.me/src/vma/dev/buffer_pool.cpp
 | ||||
| --- libvma-8.0.1.me/src/vma/dev/buffer_pool.cpp.me	2018-02-05 16:50:45.046086354 +0100
 | ||||
| +++ libvma-8.0.1.me/src/vma/dev/buffer_pool.cpp	2018-02-05 16:55:01.233840952 +0100
 | ||||
| @@ -116,7 +116,7 @@ buffer_pool::buffer_pool(size_t buffer_c
 | ||||
|  				throw_vma_exception_no_msg(); | ||||
|  			} | ||||
|  			break; | ||||
| -		}
 | ||||
| +		} // fallthrough
 | ||||
|  	case ALLOC_TYPE_CONTIG: | ||||
|  #ifndef VMA_IBV_ACCESS_ALLOCATE_MR | ||||
|  		m_is_contig_alloc = false; | ||||
| @@ -132,6 +132,7 @@ buffer_pool::buffer_pool(size_t buffer_c
 | ||||
|  			break; | ||||
|  		} | ||||
|  #endif | ||||
| +	// fallthrough
 | ||||
|  	case ALLOC_TYPE_ANON: | ||||
|  	default: | ||||
|  		__log_info_dbg("allocating memory using malloc()"); | ||||
| diff -up libvma-8.0.1.me/src/vma/dev/net_device_val.cpp.me libvma-8.0.1.me/src/vma/dev/net_device_val.cpp
 | ||||
| diff -up libvma-8.0.1.me/src/vma/dev/qp_mgr.h.me libvma-8.0.1.me/src/vma/dev/qp_mgr.h
 | ||||
| --- libvma-8.0.1.me/src/vma/dev/qp_mgr.h.me	2018-02-05 16:46:49.759393319 +0100
 | ||||
| +++ libvma-8.0.1.me/src/vma/dev/qp_mgr.h	2018-02-05 16:50:25.235028000 +0100
 | ||||
| @@ -179,7 +179,7 @@ class qp_mgr_eth : public qp_mgr
 | ||||
|  { | ||||
|  public: | ||||
|  	qp_mgr_eth(const ring_simple* p_ring, const ib_ctx_handler* p_context, const uint8_t port_num, | ||||
| -			struct ibv_comp_channel* p_rx_comp_event_channel, const uint32_t tx_num_wr, const uint16_t vlan) throw (vma_error) :
 | ||||
| +			struct ibv_comp_channel* p_rx_comp_event_channel, const uint32_t tx_num_wr, const uint16_t vlan) :
 | ||||
|  		qp_mgr(p_ring, p_context, port_num, tx_num_wr), m_vlan(vlan) { if(configure(p_rx_comp_event_channel)) throw_vma_exception("failed creating qp"); }; | ||||
|   | ||||
|  	virtual void 		modify_qp_to_ready_state(); | ||||
| @@ -196,7 +196,7 @@ class qp_mgr_ib : public qp_mgr
 | ||||
|  { | ||||
|  public: | ||||
|  	qp_mgr_ib(const ring_simple* p_ring, const ib_ctx_handler* p_context, const uint8_t port_num, | ||||
| -			struct ibv_comp_channel* p_rx_comp_event_channel, const uint32_t tx_num_wr, const uint16_t pkey) throw (vma_error) :
 | ||||
| +			struct ibv_comp_channel* p_rx_comp_event_channel, const uint32_t tx_num_wr, const uint16_t pkey) :
 | ||||
|  		qp_mgr(p_ring, p_context, port_num, tx_num_wr), m_pkey(pkey) { update_pkey_index(); if(configure(p_rx_comp_event_channel)) throw_vma_exception("failed creating qp"); }; | ||||
|   | ||||
|  	virtual void 		modify_qp_to_ready_state(); | ||||
| diff -up libvma-8.0.1.me/src/vma/dev/ring_bond.h.me libvma-8.0.1.me/src/vma/dev/ring_bond.h
 | ||||
| --- libvma-8.0.1.me/src/vma/dev/ring_bond.h.me	2018-02-05 16:59:22.388610183 +0100
 | ||||
| +++ libvma-8.0.1.me/src/vma/dev/ring_bond.h	2018-02-05 16:59:45.409677991 +0100
 | ||||
| @@ -88,23 +88,23 @@ private:
 | ||||
|  class ring_bond_eth : public ring_bond | ||||
|  { | ||||
|  public: | ||||
| -	ring_bond_eth(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, int count, bool active_slaves[], uint16_t vlan, net_device_val::bond_type type, net_device_val::bond_xmit_hash_policy bond_xmit_hash_policy, uint32_t mtu) throw (vma_error):
 | ||||
| +	ring_bond_eth(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, int count, bool active_slaves[], uint16_t vlan, net_device_val::bond_type type, net_device_val::bond_xmit_hash_policy bond_xmit_hash_policy, uint32_t mtu):
 | ||||
|  		ring_bond(count, type, bond_xmit_hash_policy, mtu){ | ||||
|  		create_slave_list(local_if, p_ring_info, active_slaves, vlan); | ||||
|  		update_rx_channel_fds(); | ||||
|  	}; | ||||
|  protected: | ||||
| -	virtual void create_slave_list(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, bool active_slaves[], uint16_t partition) throw (vma_error);
 | ||||
| +	virtual void create_slave_list(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, bool active_slaves[], uint16_t partition);
 | ||||
|  }; | ||||
|   | ||||
|  class ring_bond_ib : public ring_bond | ||||
|  { | ||||
|  public: | ||||
| -	ring_bond_ib(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, int count, bool active_slaves[], uint16_t pkey, net_device_val::bond_type type, net_device_val::bond_xmit_hash_policy bond_xmit_hash_policy, uint32_t mtu) throw (vma_error):
 | ||||
| +	ring_bond_ib(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, int count, bool active_slaves[], uint16_t pkey, net_device_val::bond_type type, net_device_val::bond_xmit_hash_policy bond_xmit_hash_policy, uint32_t mtu):
 | ||||
|  		ring_bond(count, type, bond_xmit_hash_policy, mtu){ | ||||
|  		create_slave_list(local_if, p_ring_info, active_slaves, pkey); | ||||
|  		update_rx_channel_fds(); | ||||
|  	}; | ||||
|  protected: | ||||
| -	virtual void create_slave_list(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, bool active_slaves[], uint16_t partition) throw (vma_error);
 | ||||
| +	virtual void create_slave_list(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, bool active_slaves[], uint16_t partition);
 | ||||
|  }; | ||||
| diff -up libvma-8.0.1.me/src/vma/dev/ring_simple.h.me libvma-8.0.1.me/src/vma/dev/ring_simple.h
 | ||||
| --- libvma-8.0.1.me/src/vma/dev/ring_simple.h.me	2018-02-05 16:56:07.957037486 +0100
 | ||||
| +++ libvma-8.0.1.me/src/vma/dev/ring_simple.h	2018-02-05 16:56:36.450121414 +0100
 | ||||
| @@ -40,7 +40,7 @@
 | ||||
|  class ring_simple : public ring | ||||
|  { | ||||
|  public: | ||||
| -	ring_simple(in_addr_t local_if, uint16_t partition_sn, int count, transport_type_t transport_type, uint32_t mtu, ring* parent = NULL) throw (vma_error);
 | ||||
| +	ring_simple(in_addr_t local_if, uint16_t partition_sn, int count, transport_type_t transport_type, uint32_t mtu, ring* parent = NULL) ;
 | ||||
|  	virtual ~ring_simple(); | ||||
|   | ||||
|  	virtual int		request_notification(cq_type_t cq_type, uint64_t poll_sn); | ||||
| @@ -86,7 +86,7 @@ public:
 | ||||
|   | ||||
|  protected: | ||||
|  	virtual qp_mgr*		create_qp_mgr(const ib_ctx_handler* ib_ctx, uint8_t port_num, struct ibv_comp_channel* p_rx_comp_event_channel) = 0; | ||||
| -	void			create_resources(ring_resource_creation_info_t* p_ring_info, bool active) throw (vma_error);
 | ||||
| +	void			create_resources(ring_resource_creation_info_t* p_ring_info, bool active) ;
 | ||||
|  	// Internal functions. No need for locks mechanism. | ||||
|  	bool			rx_process_buffer(mem_buf_desc_t* p_rx_wc_buf_desc, transport_type_t m_transport_type, void* pv_fd_ready_array); | ||||
|  	void			print_flow_to_rfs_udp_uc_map(flow_spec_udp_uc_map_t *p_flow_map); | ||||
| @@ -149,21 +149,21 @@ private:
 | ||||
|  class ring_eth : public ring_simple | ||||
|  { | ||||
|  public: | ||||
| -	ring_eth(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, int count, bool active, uint16_t vlan, uint32_t mtu, ring* parent = NULL) throw (vma_error):
 | ||||
| +	ring_eth(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, int count, bool active, uint16_t vlan, uint32_t mtu, ring* parent = NULL) :
 | ||||
|  		ring_simple(local_if, vlan, count, VMA_TRANSPORT_ETH, mtu, parent) { create_resources(p_ring_info, active); }; | ||||
|   | ||||
|  protected: | ||||
| -	virtual qp_mgr* create_qp_mgr(const ib_ctx_handler* ib_ctx, uint8_t port_num, struct ibv_comp_channel* p_rx_comp_event_channel) throw (vma_error);
 | ||||
| +	virtual qp_mgr* create_qp_mgr(const ib_ctx_handler* ib_ctx, uint8_t port_num, struct ibv_comp_channel* p_rx_comp_event_channel) ;
 | ||||
|  }; | ||||
|   | ||||
|  class ring_ib : public ring_simple | ||||
|  { | ||||
|  public: | ||||
| -	ring_ib(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, int count, bool active, uint16_t pkey, uint32_t mtu, ring* parent = NULL) throw (vma_error):
 | ||||
| +	ring_ib(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, int count, bool active, uint16_t pkey, uint32_t mtu, ring* parent = NULL) :
 | ||||
|  		ring_simple(local_if, pkey, count, VMA_TRANSPORT_IB, mtu, parent) { create_resources(p_ring_info, active); }; | ||||
|   | ||||
|  protected: | ||||
| -	virtual qp_mgr* create_qp_mgr(const ib_ctx_handler* ib_ctx, uint8_t port_num, struct ibv_comp_channel* p_rx_comp_event_channel) throw (vma_error);
 | ||||
| +	virtual qp_mgr* create_qp_mgr(const ib_ctx_handler* ib_ctx, uint8_t port_num, struct ibv_comp_channel* p_rx_comp_event_channel) ;
 | ||||
|  }; | ||||
|   | ||||
|  #endif //RING_SIMPLE_H | ||||
| diff -up libvma-8.0.1.me/src/vma/sock/socket_fd_api.h.me libvma-8.0.1.me/src/vma/sock/socket_fd_api.h
 | ||||
| --- libvma-8.0.1.me/src/vma/sock/socket_fd_api.h.me	2018-02-05 16:56:50.925164049 +0100
 | ||||
| +++ libvma-8.0.1.me/src/vma/sock/socket_fd_api.h	2018-02-05 16:57:28.586274977 +0100
 | ||||
| @@ -119,13 +119,13 @@ public:
 | ||||
|  	virtual int getpeername(sockaddr *__name, socklen_t *__namelen); | ||||
|   | ||||
|  	virtual int setsockopt(int __level, int __optname, | ||||
| -			       __const void *__optval, socklen_t __optlen) throw (vma_error);
 | ||||
| +			       __const void *__optval, socklen_t __optlen) ;
 | ||||
|   | ||||
|  	virtual int getsockopt(int __level, int __optname, void *__optval, | ||||
| -			       socklen_t *__optlen) throw (vma_error);
 | ||||
| -	virtual int fcntl(int __cmd, unsigned long int __arg) throw (vma_error) = 0;
 | ||||
| +			       socklen_t *__optlen) ;
 | ||||
| +	virtual int fcntl(int __cmd, unsigned long int __arg) ;
 | ||||
|   | ||||
| -	virtual int ioctl(unsigned long int __request, unsigned long int __arg) throw (vma_error) = 0;
 | ||||
| +	virtual int ioctl(unsigned long int __request, unsigned long int __arg) ;
 | ||||
|   | ||||
|  	virtual ssize_t rx(const rx_call_t call_type, iovec* iov, | ||||
|  			   const ssize_t iovlen, int* p_flags = 0, | ||||
| diff -up libvma-8.0.1.me/src/vma/sock/sockinfo.h.me libvma-8.0.1.me/src/vma/sock/sockinfo.h
 | ||||
| --- libvma-8.0.1.me/src/vma/sock/sockinfo.h.me	2018-02-05 16:57:44.453321715 +0100
 | ||||
| +++ libvma-8.0.1.me/src/vma/sock/sockinfo.h	2018-02-05 16:58:08.290391925 +0100
 | ||||
| @@ -102,7 +102,7 @@ typedef std::tr1::unordered_map<ring*, r
 | ||||
|  class sockinfo : public socket_fd_api, public pkt_rcvr_sink, public pkt_sndr_source, public wakeup_pipe | ||||
|  { | ||||
|  public: | ||||
| -	sockinfo(int fd) throw (vma_exception);
 | ||||
| +	sockinfo(int fd);
 | ||||
|  	virtual ~sockinfo(); | ||||
|   | ||||
|  #if _BullseyeCoverage | ||||
| @@ -169,8 +169,8 @@ protected:
 | ||||
|  	void*			m_rx_callback_context; // user context | ||||
|   | ||||
|  	virtual void 		set_blocking(bool is_blocked); | ||||
| -	virtual int 		fcntl(int __cmd, unsigned long int __arg) throw (vma_error);
 | ||||
| -	virtual int 		ioctl(unsigned long int __request, unsigned long int __arg) throw (vma_error);
 | ||||
| +	virtual int 		fcntl(int __cmd, unsigned long int __arg);
 | ||||
| +	virtual int 		ioctl(unsigned long int __request, unsigned long int __arg);
 | ||||
|   | ||||
|  	virtual	mem_buf_desc_t* get_front_m_rx_pkt_ready_list() = 0; | ||||
|  	virtual	size_t get_size_m_rx_pkt_ready_list() = 0; | ||||
| diff -up libvma-8.0.1.me/src/vma/sock/sock-redirect.h.me libvma-8.0.1.me/src/vma/sock/sock-redirect.h
 | ||||
| --- libvma-8.0.1.me/src/vma/sock/sock-redirect.h.me	2018-02-05 16:55:23.796907411 +0100
 | ||||
| +++ libvma-8.0.1.me/src/vma/sock/sock-redirect.h	2018-02-05 16:55:50.402985778 +0100
 | ||||
| @@ -114,10 +114,10 @@ struct os_api {
 | ||||
|  	int (*connect) (int __fd, const struct sockaddr *__to, socklen_t __tolen); | ||||
|  	int (*listen) (int __fd, int __backlog); | ||||
|   | ||||
| -	int (*setsockopt) (int __fd, int __level, int __optname, __const void *__optval, socklen_t __optlen) throw (vma_error);
 | ||||
| -	int (*getsockopt) (int __fd, int __level, int __optname, void *__optval, socklen_t *__optlen) throw (vma_error);
 | ||||
| -	int (*fcntl) (int __fd, int __cmd, ...) throw (vma_error);
 | ||||
| -	int (*ioctl) (int __fd, unsigned long int __request, ...) throw (vma_error);
 | ||||
| +	int (*setsockopt) (int __fd, int __level, int __optname, __const void *__optval, socklen_t __optlen) ;
 | ||||
| +	int (*getsockopt) (int __fd, int __level, int __optname, void *__optval, socklen_t *__optlen) ;
 | ||||
| +	int (*fcntl) (int __fd, int __cmd, ...) ;
 | ||||
| +	int (*ioctl) (int __fd, unsigned long int __request, ...) ;
 | ||||
|  	int (*getsockname) (int __fd, struct sockaddr *__name,socklen_t *__namelen); | ||||
|  	int (*getpeername) (int __fd, struct sockaddr *__name,socklen_t *__namelen); | ||||
|   | ||||
| diff -up libvma-8.0.1/src/stats/stats_publisher.cpp.me libvma-8.0.1/src/stats/stats_publisher.cpp
 | ||||
| --- libvma-8.0.1/src/stats/stats_publisher.cpp.me	2018-02-05 20:51:58.289661916 +0100
 | ||||
| +++ libvma-8.0.1/src/stats/stats_publisher.cpp	2018-02-05 20:54:40.342177526 +0100
 | ||||
| @@ -189,7 +189,11 @@ void vma_shmem_stats_open(vlog_levels_t*
 | ||||
|   | ||||
|  	g_sh_mem_info.filename_sh_stats[0] = '\0'; | ||||
|  	g_sh_mem_info.p_sh_stats = MAP_FAILED; | ||||
| -	sprintf(g_sh_mem_info.filename_sh_stats, "%s/vmastat.%d", mce_sys.stats_shmem_dirname, getpid());
 | ||||
| +	ret = snprintf(g_sh_mem_info.filename_sh_stats, sizeof(g_sh_mem_info.filename_sh_stats), "%s/vmastat.%d", mce_sys.stats_shmem_dirname, getpid());
 | ||||
| +	if (!((0 < ret) && (ret < (int)sizeof(g_sh_mem_info.filename_sh_stats)))) {
 | ||||
| +		vlog_printf(VLOG_ERROR, "%s: Could not create file under %s %m\n", __func__, mce_sys.stats_shmem_dirname, errno);
 | ||||
| +		goto no_shmem;
 | ||||
| +	}
 | ||||
|  	saved_mode = umask(0); | ||||
|  	g_sh_mem_info.fd_sh_stats = open(g_sh_mem_info.filename_sh_stats, O_CREAT|O_RDWR, S_IRWXU | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); | ||||
|  	umask(saved_mode); | ||||
| diff -up libvma-8.0.1/src/vma/config_parser.c.me libvma-8.0.1/src/vma/config_parser.c
 | ||||
| --- libvma-8.0.1/src/vma/config_parser.c.me	2018-02-05 20:55:30.352336647 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/config_parser.c	2018-02-05 20:55:58.015424668 +0100
 | ||||
| @@ -117,7 +117,7 @@ static void __vma_set_ipv4_addr(short a0
 | ||||
|     | ||||
|  	p_ipv4 = &(__vma_address_port_rule->ipv4); | ||||
|     | ||||
| -	sprintf(buf,"%d.%d.%d.%d", a0, a1, a2, a3);
 | ||||
| +	snprintf(buf, sizeof(buf), "%hd.%hd.%hd.%hd", a0, a1, a2, a3);
 | ||||
|  	if (!inet_aton(buf, p_ipv4)) | ||||
|  	{ | ||||
|  		parse_err = 1; | ||||
| diff -up libvma-8.0.1/src/vma/dev/net_device_val.cpp.me libvma-8.0.1/src/vma/dev/net_device_val.cpp
 | ||||
| --- libvma-8.0.1/src/vma/dev/net_device_val.cpp.me	2018-02-05 20:34:51.781395825 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/dev/net_device_val.cpp	2018-02-05 20:39:30.698283260 +0100
 | ||||
| @@ -230,9 +230,12 @@ void net_device_val::configure(struct if
 | ||||
|  		// find the ibv context and port num | ||||
|  		for (int j=0; j<num_devices; j++) { | ||||
|  			char ib_res[1024] = {0}; | ||||
| -			char ib_path[256] = {0};
 | ||||
| -			sprintf(ib_path, "%s/device/resource", pp_ibv_context_list[j]->device->ibdev_path);
 | ||||
| -			priv_read_file(ib_path, ib_res, 1024);
 | ||||
| +			const char ib_path_format[] = "%s/device/resource";
 | ||||
| +			char ib_path[IBV_SYSFS_PATH_MAX + sizeof(ib_path_format)] = {0};
 | ||||
| +			snprintf(ib_path, sizeof(ib_path), ib_path_format, pp_ibv_context_list[j]->device->ibdev_path);
 | ||||
| +			if (priv_read_file(ib_path, ib_res, sizeof(ib_res)) <= 0) {
 | ||||
| +				continue;
 | ||||
| +			}
 | ||||
|  			if (strcmp(sys_res, ib_res) == 0) { | ||||
|  				m_slaves[i]->p_ib_ctx = g_p_ib_ctx_handler_collection->get_ib_ctx(pp_ibv_context_list[j]); | ||||
|  				int dev_id = -1; | ||||
| diff -up libvma-8.0.1/src/vma/dev/ring_bond.cpp.me libvma-8.0.1/src/vma/dev/ring_bond.cpp
 | ||||
| --- libvma-8.0.1/src/vma/dev/ring_bond.cpp.me	2018-02-05 20:42:02.186765259 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/dev/ring_bond.cpp	2018-02-05 20:42:10.008790148 +0100
 | ||||
| @@ -465,7 +465,7 @@ void ring_bond::mem_buf_desc_return_to_o
 | ||||
|  	ring_logpanic("programming error, how did we got here?"); | ||||
|  } | ||||
|   | ||||
| -void ring_bond_eth::create_slave_list(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, bool active_slaves[], uint16_t vlan) throw (vma_error)
 | ||||
| +void ring_bond_eth::create_slave_list(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, bool active_slaves[], uint16_t vlan)
 | ||||
|  { | ||||
|  	for (uint32_t i = 0; i < m_n_num_resources; i++) { | ||||
|  		m_bond_rings[i] = new ring_eth(local_if, &p_ring_info[i], 1, active_slaves[i], vlan, get_mtu(), this); | ||||
| @@ -482,7 +482,7 @@ void ring_bond_eth::create_slave_list(in
 | ||||
|  	close_gaps_active_rings(); | ||||
|  } | ||||
|   | ||||
| -void ring_bond_ib::create_slave_list(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, bool active_slaves[], uint16_t pkey) throw (vma_error)
 | ||||
| +void ring_bond_ib::create_slave_list(in_addr_t local_if, ring_resource_creation_info_t* p_ring_info, bool active_slaves[], uint16_t pkey)
 | ||||
|  { | ||||
|  	for (uint32_t i = 0; i < m_n_num_resources; i++) { | ||||
|  		m_bond_rings[i] = new ring_ib(local_if, &p_ring_info[i], 1, active_slaves[i], pkey, get_mtu(), this); // get_mtu() reads the MTU from ifconfig when created. Now passing it to its slaves. could have sent 0 here, as the MTU of the bond is already on the bond | ||||
| diff -up libvma-8.0.1/src/vma/dev/ring_simple.cpp.me libvma-8.0.1/src/vma/dev/ring_simple.cpp
 | ||||
| --- libvma-8.0.1/src/vma/dev/ring_simple.cpp.me	2018-02-05 20:40:52.005541960 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/dev/ring_simple.cpp	2018-02-05 20:41:42.553702792 +0100
 | ||||
| @@ -80,18 +80,18 @@ inline void ring_simple::send_status_han
 | ||||
|  	BULLSEYE_EXCLUDE_BLOCK_END | ||||
|  } | ||||
|   | ||||
| -qp_mgr* ring_eth::create_qp_mgr(const ib_ctx_handler* ib_ctx, uint8_t port_num, struct ibv_comp_channel* p_rx_comp_event_channel) throw (vma_error)
 | ||||
| +qp_mgr* ring_eth::create_qp_mgr(const ib_ctx_handler* ib_ctx, uint8_t port_num, struct ibv_comp_channel* p_rx_comp_event_channel)
 | ||||
|  { | ||||
|  	return new qp_mgr_eth(this, ib_ctx, port_num, p_rx_comp_event_channel, get_tx_num_wr(), get_partition()); | ||||
|  } | ||||
|   | ||||
| -qp_mgr* ring_ib::create_qp_mgr(const ib_ctx_handler* ib_ctx, uint8_t port_num, struct ibv_comp_channel* p_rx_comp_event_channel) throw (vma_error)
 | ||||
| +qp_mgr* ring_ib::create_qp_mgr(const ib_ctx_handler* ib_ctx, uint8_t port_num, struct ibv_comp_channel* p_rx_comp_event_channel)
 | ||||
|  { | ||||
|  	return new qp_mgr_ib(this, ib_ctx, port_num, p_rx_comp_event_channel, get_tx_num_wr(), get_partition()); | ||||
|  } | ||||
|   | ||||
|   | ||||
| -ring_simple::ring_simple(in_addr_t local_if, uint16_t partition_sn, int count, transport_type_t transport_type, uint32_t mtu, ring* parent /*=NULL*/) throw (vma_error):
 | ||||
| +ring_simple::ring_simple(in_addr_t local_if, uint16_t partition_sn, int count, transport_type_t transport_type, uint32_t mtu, ring* parent /*=NULL*/):
 | ||||
|  	ring(count, mtu), m_lock_ring_rx("ring_simple:lock_rx"), m_lock_ring_tx("ring_simple:lock_tx"), | ||||
|  	m_p_qp_mgr(NULL), m_p_cq_mgr_rx(NULL), m_p_cq_mgr_tx(NULL), | ||||
|  	m_lock_ring_tx_buf_wait("ring:lock_tx_buf_wait"), m_tx_num_bufs(0), m_tx_num_wr(0), m_tx_num_wr_free(0), | ||||
| @@ -182,7 +182,7 @@ ring_simple::~ring_simple()
 | ||||
|  	ring_logdbg("delete ring() completed"); | ||||
|  } | ||||
|   | ||||
| -void ring_simple::create_resources(ring_resource_creation_info_t* p_ring_info, bool active) throw (vma_error)
 | ||||
| +void ring_simple::create_resources(ring_resource_creation_info_t* p_ring_info, bool active)
 | ||||
|  { | ||||
|  	ring_logdbg("new ring()"); | ||||
|   | ||||
| @@ -201,8 +201,7 @@ void ring_simple::create_resources(ring_
 | ||||
|  		VLOG_PRINTF_INFO_ONCE_THEN_ALWAYS(VLOG_ERROR, VLOG_DEBUG, "ibv_create_comp_channel for tx failed. m_p_tx_comp_event_channel = %p (errno=%d %m)", m_p_tx_comp_event_channel, errno); | ||||
|  		if (errno == EMFILE) { | ||||
|  			VLOG_PRINTF_INFO_ONCE_THEN_ALWAYS(VLOG_ERROR, VLOG_DEBUG, "did we run out of file descriptors? traffic may not be offloaded, increase ulimit -n"); | ||||
| -		}
 | ||||
| -		throw_vma_exception("create event channel failed");
 | ||||
| +		};
 | ||||
|  	} | ||||
|  	BULLSEYE_EXCLUDE_BLOCK_END | ||||
|   | ||||
| @@ -226,8 +225,7 @@ void ring_simple::create_resources(ring_
 | ||||
|  		VLOG_PRINTF_INFO_ONCE_THEN_ALWAYS(VLOG_ERROR, VLOG_DEBUG, "ibv_create_comp_channel for rx failed. p_rx_comp_event_channel = %p (errno=%d %m)", m_p_rx_comp_event_channel, errno); | ||||
|  		if (errno == EMFILE) { | ||||
|  			VLOG_PRINTF_INFO_ONCE_THEN_ALWAYS(VLOG_ERROR, VLOG_DEBUG, "did we run out of file descriptors? traffic may not be offloaded, increase ulimit -n"); | ||||
| -		}
 | ||||
| -		throw_vma_exception("create event channel failed");
 | ||||
| +		};
 | ||||
|  	} | ||||
|  	BULLSEYE_EXCLUDE_BLOCK_END | ||||
|   | ||||
| diff -up libvma-8.0.1/src/vma/proto/flow_tuple.cpp.me libvma-8.0.1/src/vma/proto/flow_tuple.cpp
 | ||||
| --- libvma-8.0.1/src/vma/proto/flow_tuple.cpp.me	2018-02-05 20:43:41.835082317 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/proto/flow_tuple.cpp	2018-02-05 20:44:57.456322925 +0100
 | ||||
| @@ -160,7 +160,7 @@ bool flow_tuple::is_3_tuple()
 | ||||
|   | ||||
|  void flow_tuple::set_str() | ||||
|  { | ||||
| -	snprintf(m_str, STR_MAX_LENGTH, "dst:%d.%d.%d.%d:%d, src:%d.%d.%d.%d:%d, protocol:%s",
 | ||||
| +	snprintf(m_str, sizeof(m_str), "dst:%hhu.%hhu.%hhu.%hhu:%hu, src:%hhu.%hhu.%hhu.%hhu:%hu, proto:%s",
 | ||||
|  			NIPQUAD(m_dst_ip), ntohs(m_dst_port), | ||||
|  			NIPQUAD(m_src_ip), ntohs(m_src_port), | ||||
|  			__vma_get_protocol_str(m_protocol)); | ||||
| @@ -172,7 +172,7 @@ void flow_tuple::set_str()
 | ||||
|   | ||||
|  void flow_tuple_with_local_if::set_str() | ||||
|  { | ||||
| -	snprintf(m_str, STR_MAX_LENGTH, "dst:%d.%d.%d.%d:%d, src:%d.%d.%d.%d:%d, protocol:%s, local if:%d.%d.%d.%d",
 | ||||
| +	snprintf(m_str, sizeof(m_str), "dst:%hhu.%hhu.%hhu.%hhu:%hu, src:%hhu.%hhu.%hhu.%hhu:%hu, proto:%s, if:%hhu.%hhu.%hhu.%hhu",
 | ||||
|  			NIPQUAD(m_dst_ip), ntohs(m_dst_port), | ||||
|  			NIPQUAD(m_src_ip), ntohs(m_src_port), | ||||
|  			__vma_get_protocol_str(m_protocol), NIPQUAD(m_local_if)); | ||||
| diff -up libvma-8.0.1/src/vma/sock/pipeinfo.cpp.me libvma-8.0.1/src/vma/sock/pipeinfo.cpp
 | ||||
| --- libvma-8.0.1/src/vma/sock/pipeinfo.cpp.me	2018-02-05 20:49:49.731252877 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/pipeinfo.cpp	2018-02-05 20:50:05.167301990 +0100
 | ||||
| @@ -43,7 +43,7 @@
 | ||||
|  #define VLOG_PRINTF(log_level, log_fmt, log_args...) 		vlog_printf(log_level, "fd[%#x]:%s() " log_fmt "\n", m_fd, __FUNCTION__, ##log_args) | ||||
|  #define VLOG_PRINTF_DETAILS(log_level, log_fmt, log_args...) 	vlog_printf(log_level, MODULE_NAME ":%d:fd[%#x]:%s() " log_fmt "\n", __LINE__, m_fd, __FUNCTION__, ##log_args) | ||||
|   | ||||
| -#define pi_logpanic(log_fmt, log_args...) 							VLOG_PRINTF(VLOG_PANIC, log_fmt, ##log_args);	throw;
 | ||||
| +#define pi_logpanic(log_fmt, log_args...) 							VLOG_PRINTF(VLOG_PANIC, log_fmt, ##log_args);
 | ||||
|  #define pi_logerr(log_fmt, log_args...) 							VLOG_PRINTF(VLOG_ERROR, log_fmt, ##log_args) | ||||
|  #define pi_logwarn(log_fmt, log_args...) 							VLOG_PRINTF(VLOG_WARNING, log_fmt, ##log_args) | ||||
|  #define pi_loginfo(log_fmt, log_args...) 							VLOG_PRINTF(VLOG_INFO, log_fmt, ##log_args) | ||||
| @@ -125,7 +125,7 @@ void pipeinfo::clean_obj()
 | ||||
|  	g_p_event_handler_manager->unregister_timers_event_and_delete(this); | ||||
|  } | ||||
|   | ||||
| -int pipeinfo::fcntl(int __cmd, unsigned long int __arg) throw (vma_error)
 | ||||
| +int pipeinfo::fcntl(int __cmd, unsigned long int __arg)
 | ||||
|  { | ||||
|  	switch (__cmd) { | ||||
|  	case F_SETFL: | ||||
| @@ -163,7 +163,7 @@ int pipeinfo::fcntl(int __cmd, unsigned
 | ||||
|  	return orig_os_api.fcntl(m_fd, __cmd, __arg); | ||||
|  } | ||||
|   | ||||
| -int pipeinfo::ioctl(unsigned long int __request, unsigned long int __arg) throw (vma_error)
 | ||||
| +int pipeinfo::ioctl(unsigned long int __request, unsigned long int __arg)
 | ||||
|  { | ||||
|  	int *p_arg = (int *)__arg; | ||||
|   | ||||
| diff -up libvma-8.0.1/src/vma/sock/pipeinfo.h.me libvma-8.0.1/src/vma/sock/pipeinfo.h
 | ||||
| --- libvma-8.0.1/src/vma/sock/pipeinfo.h.me	2018-02-05 20:49:12.706135069 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/pipeinfo.h	2018-02-05 20:49:29.239187672 +0100
 | ||||
| @@ -47,8 +47,8 @@ public:
 | ||||
|   | ||||
|  	virtual void clean_obj(); | ||||
|   | ||||
| -	int	fcntl(int __cmd, unsigned long int __arg) throw (vma_error);
 | ||||
| -	int 	ioctl(unsigned long int __request, unsigned long int __arg) throw (vma_error);
 | ||||
| +	int	fcntl(int __cmd, unsigned long int __arg);
 | ||||
| +	int 	ioctl(unsigned long int __request, unsigned long int __arg);
 | ||||
|   | ||||
|  	// Process a Rx request, we might have a ready packet, or we might block until | ||||
|  	// we have one (if sockinfo::m_b_blocking == true) | ||||
| diff -up libvma-8.0.1/src/vma/sock/socket_fd_api.cpp.me libvma-8.0.1/src/vma/sock/socket_fd_api.cpp
 | ||||
| --- libvma-8.0.1/src/vma/sock/socket_fd_api.cpp.me	2018-02-05 20:50:20.506350795 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/socket_fd_api.cpp	2018-02-05 20:50:28.599376542 +0100
 | ||||
| @@ -155,7 +155,7 @@ int socket_fd_api::getpeername(sockaddr
 | ||||
|  } | ||||
|   | ||||
|  int socket_fd_api::setsockopt(int __level, int __optname, | ||||
| -			      __const void *__optval, socklen_t __optlen) throw (vma_error)
 | ||||
| +			      __const void *__optval, socklen_t __optlen)
 | ||||
|  { | ||||
|  	__log_info_func(""); | ||||
|  	int ret = orig_os_api.setsockopt(m_fd, __level, __optname, __optval, __optlen); | ||||
| @@ -166,7 +166,7 @@ int socket_fd_api::setsockopt(int __leve
 | ||||
|  } | ||||
|   | ||||
|  int socket_fd_api::getsockopt(int __level, int __optname, void *__optval, | ||||
| -			      socklen_t *__optlen) throw (vma_error)
 | ||||
| +			      socklen_t *__optlen)
 | ||||
|  { | ||||
|  	__log_info_func(""); | ||||
|  	int ret = orig_os_api.getsockopt(m_fd, __level, __optname, __optval, __optlen); | ||||
| diff -up libvma-8.0.1/src/vma/sock/sockinfo.cpp.me libvma-8.0.1/src/vma/sock/sockinfo.cpp
 | ||||
| --- libvma-8.0.1/src/vma/sock/sockinfo.cpp.me	2018-02-05 20:45:56.355510329 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/sockinfo.cpp	2018-02-05 20:46:38.833645483 +0100
 | ||||
| @@ -60,7 +60,7 @@
 | ||||
|   | ||||
|  #define si_logdbg_no_funcname(log_fmt, log_args...)	do { if (g_vlogger_level >= VLOG_DEBUG) vlog_printf(VLOG_DEBUG, MODULE_NAME "[fd=%d]:%d: " log_fmt "\n", m_fd, __LINE__, ##log_args); } while (0) | ||||
|   | ||||
| -sockinfo::sockinfo(int fd) throw (vma_exception):
 | ||||
| +sockinfo::sockinfo(int fd):
 | ||||
|  		socket_fd_api(fd), | ||||
|  		m_b_closed(false), m_b_blocking(true), m_protocol(PROTO_UNDEFINED), | ||||
|  		m_lock_rcv(MODULE_NAME "::m_lock_rcv"), | ||||
| @@ -117,7 +117,7 @@ void sockinfo::set_blocking(bool is_bloc
 | ||||
|  	m_p_socket_stats->b_blocking = m_b_blocking; | ||||
|  } | ||||
|   | ||||
| -int sockinfo::fcntl(int __cmd, unsigned long int __arg) throw (vma_error)
 | ||||
| +int sockinfo::fcntl(int __cmd, unsigned long int __arg)
 | ||||
|  { | ||||
|  	switch (__cmd) { | ||||
|  	case F_SETFL: | ||||
| @@ -160,7 +160,7 @@ int sockinfo::fcntl(int __cmd, unsigned
 | ||||
|  	return orig_os_api.fcntl(m_fd, __cmd, __arg); | ||||
|  } | ||||
|   | ||||
| -int sockinfo::ioctl(unsigned long int __request, unsigned long int __arg) throw (vma_error)
 | ||||
| +int sockinfo::ioctl(unsigned long int __request, unsigned long int __arg)
 | ||||
|  { | ||||
|   | ||||
|  	int *p_arg = (int *)__arg; | ||||
| diff -up libvma-8.0.1/src/vma/sock/sockinfo_tcp.cpp.me libvma-8.0.1/src/vma/sock/sockinfo_tcp.cpp
 | ||||
| --- libvma-8.0.1/src/vma/sock/sockinfo_tcp.cpp.me	2018-02-05 20:48:22.058973921 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/sockinfo_tcp.cpp	2018-02-05 20:48:52.602071103 +0100
 | ||||
| @@ -170,7 +170,7 @@ inline void sockinfo_tcp::reuse_buffer(m
 | ||||
|  	} | ||||
|  } | ||||
|   | ||||
| -sockinfo_tcp::sockinfo_tcp(int fd) throw (vma_exception) :
 | ||||
| +sockinfo_tcp::sockinfo_tcp(int fd) :
 | ||||
|          sockinfo(fd), | ||||
|          m_timer_handle(NULL), | ||||
|          m_timer_pending(false) | ||||
| @@ -2923,7 +2923,7 @@ bad_state:
 | ||||
|  #define TCP_INFO         11     /* Information about this connection. */ | ||||
|  #define TCP_QUICKACK     12     /* Bock/reenable quick ACKs.  */ | ||||
|   | ||||
| -int sockinfo_tcp::fcntl(int __cmd, unsigned long int __arg) throw (vma_error)
 | ||||
| +int sockinfo_tcp::fcntl(int __cmd, unsigned long int __arg)
 | ||||
|  { | ||||
|  	if (!mce_sys.avoid_sys_calls_on_tcp_fd || !is_connected()) | ||||
|  		return sockinfo::fcntl(__cmd, __arg); | ||||
| @@ -2954,7 +2954,7 @@ int sockinfo_tcp::fcntl(int __cmd, unsig
 | ||||
|  	return sockinfo::fcntl(__cmd, __arg); | ||||
|  } | ||||
|   | ||||
| -int sockinfo_tcp::ioctl(unsigned long int __request, unsigned long int __arg)  throw (vma_error)
 | ||||
| +int sockinfo_tcp::ioctl(unsigned long int __request, unsigned long int __arg)
 | ||||
|  { | ||||
|  	if (!mce_sys.avoid_sys_calls_on_tcp_fd || !is_connected()) | ||||
|  		return sockinfo::ioctl(__request, __arg); | ||||
| @@ -3040,7 +3040,7 @@ bool sockinfo_tcp::try_un_offloading() /
 | ||||
|  //////////////////////////////////////////////////////////////////////////////// | ||||
|  #define SOCKOPT_HANDLE_BY_OS -2 | ||||
|  int sockinfo_tcp::setsockopt(int __level, int __optname, | ||||
| -                              __const void *__optval, socklen_t __optlen) throw (vma_error)
 | ||||
| +                              __const void *__optval, socklen_t __optlen)
 | ||||
|  { | ||||
|  	//todo check optlen and set proper errno on failure | ||||
|   | ||||
| @@ -3297,7 +3297,7 @@ int sockinfo_tcp::getsockopt_offload(int
 | ||||
|  } | ||||
|   | ||||
|  int sockinfo_tcp::getsockopt(int __level, int __optname, void *__optval, | ||||
| -		socklen_t *__optlen) throw (vma_error)
 | ||||
| +		socklen_t *__optlen)
 | ||||
|  { | ||||
|  	int ret = getsockopt_offload(__level, __optname, __optval, __optlen); | ||||
|  	if (ret != SOCKOPT_HANDLE_BY_OS) | ||||
| diff -up libvma-8.0.1/src/vma/sock/sockinfo_tcp.h.me libvma-8.0.1/src/vma/sock/sockinfo_tcp.h
 | ||||
| --- libvma-8.0.1/src/vma/sock/sockinfo_tcp.h.me	2018-02-05 18:30:44.283370969 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/sockinfo_tcp.h	2018-02-05 18:31:16.207484436 +0100
 | ||||
| @@ -95,7 +95,7 @@ typedef std::map<peer_key, vma_desc_list
 | ||||
|  class sockinfo_tcp : public sockinfo, public timer_handler | ||||
|  { | ||||
|  public: | ||||
| -	sockinfo_tcp(int fd) throw (vma_exception);
 | ||||
| +	sockinfo_tcp(int fd);
 | ||||
|  	virtual ~sockinfo_tcp(); | ||||
|   | ||||
|  	virtual void clean_obj(); | ||||
| @@ -118,10 +118,10 @@ public:
 | ||||
|  	void create_dst_entry(); | ||||
|  	bool prepare_dst_to_send(bool is_accepted_socket = false); | ||||
|   | ||||
| -	virtual int fcntl(int __cmd, unsigned long int __arg) throw (vma_error);
 | ||||
| -	virtual int ioctl(unsigned long int __request, unsigned long int __arg)  throw (vma_error);
 | ||||
| -	virtual int setsockopt(int __level, int __optname, const void *__optval, socklen_t __optlen) throw (vma_error);
 | ||||
| -	virtual int getsockopt(int __level, int __optname, void *__optval, socklen_t *__optlen) throw (vma_error);
 | ||||
| +	virtual int fcntl(int __cmd, unsigned long int __arg);
 | ||||
| +	virtual int ioctl(unsigned long int __request, unsigned long int __arg);
 | ||||
| +	virtual int setsockopt(int __level, int __optname, const void *__optval, socklen_t __optlen);
 | ||||
| +	virtual int getsockopt(int __level, int __optname, void *__optval, socklen_t *__optlen);
 | ||||
|  	int getsockopt_offload(int __level, int __optname, void *__optval, socklen_t *__optlen); | ||||
|  	virtual int connect(const sockaddr*, socklen_t); | ||||
|  	virtual int bind(const sockaddr *__addr, socklen_t __addrlen); | ||||
| diff -up libvma-8.0.1/src/vma/sock/sockinfo_udp.cpp.me libvma-8.0.1/src/vma/sock/sockinfo_udp.cpp
 | ||||
| --- libvma-8.0.1/src/vma/sock/sockinfo_udp.cpp.me	2018-02-05 20:47:41.730845607 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/sockinfo_udp.cpp	2018-02-05 20:48:02.920913029 +0100
 | ||||
| @@ -363,7 +363,7 @@ const char * setsockopt_ip_opt_to_str(in
 | ||||
|  // Throttle the amount of ring polling we do (remember last time we check for receive packets) | ||||
|  tscval_t g_si_tscv_last_poll = 0; | ||||
|   | ||||
| -sockinfo_udp::sockinfo_udp(int fd) throw (vma_exception) :
 | ||||
| +sockinfo_udp::sockinfo_udp(int fd) :
 | ||||
|  	sockinfo(fd) | ||||
|  	,m_mc_tx_if(INADDR_ANY) | ||||
|  	,m_b_mc_tx_loop(mce_sys.tx_mc_loopback_default) // default value is 'true'. User can change this with config parameter SYS_VAR_TX_MC_LOOPBACK | ||||
| @@ -694,7 +694,7 @@ int sockinfo_udp::on_sockname_change(str
 | ||||
|  } | ||||
|   | ||||
|  //////////////////////////////////////////////////////////////////////////////// | ||||
| -int sockinfo_udp::setsockopt(int __level, int __optname, __const void *__optval, socklen_t __optlen) throw (vma_error)
 | ||||
| +int sockinfo_udp::setsockopt(int __level, int __optname, __const void *__optval, socklen_t __optlen)
 | ||||
|  { | ||||
|  	si_udp_logfunc("level=%d, optname=%d", __level, __optname); | ||||
|   | ||||
| @@ -1090,7 +1090,7 @@ int sockinfo_udp::setsockopt(int __level
 | ||||
|  	return orig_os_api.setsockopt(m_fd, __level, __optname, __optval, __optlen); | ||||
|  } | ||||
|   | ||||
| -int sockinfo_udp::getsockopt(int __level, int __optname, void *__optval, socklen_t *__optlen) throw (vma_error)
 | ||||
| +int sockinfo_udp::getsockopt(int __level, int __optname, void *__optval, socklen_t *__optlen)
 | ||||
|  { | ||||
|  	si_udp_logfunc("level=%d, optname=%d", __level, __optname); | ||||
|   | ||||
| diff -up libvma-8.0.1/src/vma/sock/sockinfo_udp.h.me libvma-8.0.1/src/vma/sock/sockinfo_udp.h
 | ||||
| --- libvma-8.0.1/src/vma/sock/sockinfo_udp.h.me	2018-02-05 20:47:05.955731778 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/sockinfo_udp.h	2018-02-05 20:47:22.191783438 +0100
 | ||||
| @@ -92,7 +92,7 @@ struct cmsg_state
 | ||||
|  class sockinfo_udp : public sockinfo | ||||
|  { | ||||
|  public: | ||||
| -	sockinfo_udp(int fd) throw (vma_exception);
 | ||||
| +	sockinfo_udp(int fd);
 | ||||
|  	virtual ~sockinfo_udp(); | ||||
|   | ||||
|  	void 	setPassthrough() { m_p_socket_stats->b_is_offloaded = m_sock_offload = false;} | ||||
| @@ -103,8 +103,8 @@ public:
 | ||||
|  	int	bind(const struct sockaddr *__addr, socklen_t __addrlen); | ||||
|  	int	connect(const struct sockaddr *__to, socklen_t __tolen); | ||||
|  	int	getsockname(struct sockaddr *__name, socklen_t *__namelen); | ||||
| -	int	setsockopt(int __level, int __optname, const void *__optval, socklen_t __optlen) throw (vma_error);
 | ||||
| -	int	getsockopt(int __level, int __optname, void *__optval, socklen_t *__optlen) throw (vma_error);
 | ||||
| +	int	setsockopt(int __level, int __optname, const void *__optval, socklen_t __optlen);
 | ||||
| +	int	getsockopt(int __level, int __optname, void *__optval, socklen_t *__optlen);
 | ||||
|   | ||||
|  	/** | ||||
|  	* Sampling the OS immediately by matching the rx_skip_os counter (m_rx_udp_poll_os_ratio_counter) to the limit (mce_sys.rx_udp_poll_os_ratio) | ||||
| diff -up libvma-8.0.1/src/vma/sock/sock-redirect.cpp.me libvma-8.0.1/src/vma/sock/sock-redirect.cpp
 | ||||
| --- libvma-8.0.1/src/vma/sock/sock-redirect.cpp.me	2018-02-05 20:50:44.442426951 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/sock-redirect.cpp	2018-02-05 20:51:04.640491219 +0100
 | ||||
| @@ -623,7 +623,7 @@ int connect(int __fd, const struct socka
 | ||||
|     Returns 0 on success, -1 for errors.  */ | ||||
|  extern "C" | ||||
|  int setsockopt(int __fd, int __level, int __optname, | ||||
| -	       __const void *__optval, socklen_t __optlen) throw (vma_error)
 | ||||
| +	       __const void *__optval, socklen_t __optlen)
 | ||||
|  { | ||||
|  	BULLSEYE_EXCLUDE_BLOCK_START | ||||
|  	if (!orig_os_api.setsockopt) get_orig_funcs(); | ||||
| @@ -659,7 +659,7 @@ int setsockopt(int __fd, int __level, in
 | ||||
|     Returns 0 on success, -1 for errors.  */ | ||||
|  extern "C" | ||||
|  int getsockopt(int __fd, int __level, int __optname, | ||||
| -	       void *__optval, socklen_t *__optlen) throw (vma_error)
 | ||||
| +	       void *__optval, socklen_t *__optlen)
 | ||||
|  { | ||||
|  	BULLSEYE_EXCLUDE_BLOCK_START | ||||
|  	if (!orig_os_api.getsockopt) get_orig_funcs(); | ||||
| @@ -706,7 +706,7 @@ int getsockopt(int __fd, int __level, in
 | ||||
|     accordingly (see README.txt) | ||||
|     */ | ||||
|  extern "C" | ||||
| -int fcntl(int __fd, int __cmd, ...) throw (vma_error)
 | ||||
| +int fcntl(int __fd, int __cmd, ...)
 | ||||
|  { | ||||
|  	BULLSEYE_EXCLUDE_BLOCK_START | ||||
|  	if (!orig_os_api.fcntl) get_orig_funcs(); | ||||
| @@ -743,7 +743,7 @@ int fcntl(int __fd, int __cmd, ...) thro
 | ||||
|     One argument may follow; its presence and type depend on REQUEST. | ||||
|     Return value depends on REQUEST.  Usually -1 indicates error. */ | ||||
|  extern "C" | ||||
| -int ioctl (int __fd, unsigned long int __request, ...) throw (vma_error)
 | ||||
| +int ioctl (int __fd, unsigned long int __request, ...)
 | ||||
|  { | ||||
|  	BULLSEYE_EXCLUDE_BLOCK_START | ||||
|  	if (!orig_os_api.fcntl) get_orig_funcs(); | ||||
| diff -up libvma-8.0.1/src/stats/stats_reader.cpp.me libvma-8.0.1/src/stats/stats_reader.cpp
 | ||||
| --- libvma-8.0.1/src/stats/stats_reader.cpp.me	2018-02-05 21:25:40.793097034 +0100
 | ||||
| +++ libvma-8.0.1/src/stats/stats_reader.cpp	2018-02-05 21:28:30.415637551 +0100
 | ||||
| @@ -1525,7 +1525,7 @@ int  init_print_process_stats(sh_mem_inf
 | ||||
|  	sh_mem_t* sh_mem; | ||||
|  	int pid = sh_mem_info.pid; | ||||
|   | ||||
| -	sprintf(sh_mem_info.filename_sh_stats, "%s/vmastat.%d", g_vma_shmem_dir, pid);
 | ||||
| +	snprintf(sh_mem_info.filename_sh_stats, sizeof(sh_mem_info.filename_sh_stats), "%s/vmastat.%d", g_vma_shmem_dir, pid);
 | ||||
|  	 | ||||
|  	if (user_params.write_auth) | ||||
|  		sh_mem_info.fd_sh_stats = open(sh_mem_info.filename_sh_stats,O_RDWR, S_IRWXU|S_IROTH); | ||||
| @ -1,189 +0,0 @@ | ||||
| diff -up libvma-8.0.1/src/stats/stats_publisher.cpp.me libvma-8.0.1/src/stats/stats_publisher.cpp
 | ||||
| --- libvma-8.0.1/src/stats/stats_publisher.cpp.me	2018-02-06 17:39:15.618093186 +0100
 | ||||
| +++ libvma-8.0.1/src/stats/stats_publisher.cpp	2018-02-06 17:39:54.488171577 +0100
 | ||||
| @@ -268,7 +268,7 @@ shmem_error:
 | ||||
|  	g_sh_mem_info.fd_sh_stats = -1; | ||||
|  	g_sh_mem_info.p_sh_stats = MAP_FAILED; | ||||
|  	g_sh_mem = &g_local_sh_mem; | ||||
| -	memset(g_sh_mem, 0, sizeof(*g_sh_mem));
 | ||||
| +	memset(static_cast<void*>(g_sh_mem), 0, sizeof(*g_sh_mem));
 | ||||
|  	*p_p_vma_log_level = &g_sh_mem->log_level; | ||||
|  	*p_p_vma_log_details = &g_sh_mem->log_details_level; | ||||
|  	BULLSEYE_EXCLUDE_BLOCK_END | ||||
| @@ -332,7 +332,7 @@ void vma_stats_instance_create_socket_bl
 | ||||
|   | ||||
|  out: | ||||
|  	if (p_skt_stats) { | ||||
| -		memset(p_skt_stats, 0, sizeof(*p_skt_stats));
 | ||||
| +		memset(static_cast<void*>(p_skt_stats), 0, sizeof(*p_skt_stats));
 | ||||
|  		p_skt_stats->mc_grp_map.reset(); | ||||
|                  g_p_stats_data_reader->add_data_reader(local_stats_addr, p_skt_stats, sizeof(socket_stats_t)); | ||||
|  	} | ||||
| diff -up libvma-8.0.1/src/stats/stats_reader.cpp.me libvma-8.0.1/src/stats/stats_reader.cpp
 | ||||
| --- libvma-8.0.1/src/stats/stats_reader.cpp.me	2018-02-06 15:59:12.754199479 +0100
 | ||||
| +++ libvma-8.0.1/src/stats/stats_reader.cpp	2018-02-06 16:39:38.406905488 +0100
 | ||||
| @@ -1525,8 +1525,10 @@ int  init_print_process_stats(sh_mem_inf
 | ||||
|  	sh_mem_t* sh_mem; | ||||
|  	int pid = sh_mem_info.pid; | ||||
|   | ||||
| -	snprintf(sh_mem_info.filename_sh_stats, sizeof(sh_mem_info.filename_sh_stats), "%s/vmastat.%d", g_vma_shmem_dir, pid);
 | ||||
| -	
 | ||||
| +	//snprintf(sh_mem_info.filename_sh_stats, sizeof(sh_mem_info.filename_sh_stats), "%s/vmastat.%d", g_vma_shmem_dir, pid);
 | ||||
| +	const char ib_path_format[] = "%s/vmastat.%d";
 | ||||
| +	snprintf(sh_mem_info.filename_sh_stats, sizeof(sh_mem_info.filename_sh_stats), ib_path_format, g_vma_shmem_dir, pid);
 | ||||
| +
 | ||||
|  	if (user_params.write_auth) | ||||
|  		sh_mem_info.fd_sh_stats = open(sh_mem_info.filename_sh_stats,O_RDWR, S_IRWXU|S_IROTH); | ||||
|  	else | ||||
| diff -up libvma-8.0.1/src/vma/dev/buffer_pool.cpp.me libvma-8.0.1/src/vma/dev/buffer_pool.cpp
 | ||||
| --- libvma-8.0.1/src/vma/dev/buffer_pool.cpp.me	2018-02-06 17:18:48.792336254 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/dev/buffer_pool.cpp	2018-02-06 17:18:25.927276800 +0100
 | ||||
| @@ -166,7 +166,7 @@ buffer_pool::buffer_pool(size_t buffer_c
 | ||||
|  	for (size_t i = 0; i < buffer_count; ++i) { | ||||
|   | ||||
|  		mem_buf_desc_t* ptr_desc_mbdt = (mem_buf_desc_t*)ptr_desc; | ||||
| -		memset(ptr_desc_mbdt, 0, sizeof (*ptr_desc_mbdt));
 | ||||
| +		memset(static_cast<void*>(ptr_desc_mbdt), 0, sizeof (*ptr_desc_mbdt));
 | ||||
|  		mem_buf_desc_t *desc = new (ptr_desc) mem_buf_desc_t(ptr_buff, buf_size); | ||||
|  		desc->serial_num = i; | ||||
|  		desc->p_desc_owner = owner; | ||||
| diff -up libvma-8.0.1/src/vma/infra/subject_observer.cpp.me libvma-8.0.1/src/vma/infra/subject_observer.cpp
 | ||||
| --- libvma-8.0.1/src/vma/infra/subject_observer.cpp.me	2018-02-06 17:38:01.739951162 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/infra/subject_observer.cpp	2018-02-06 17:38:43.712031849 +0100
 | ||||
| @@ -52,11 +52,11 @@ bool subject::register_observer(IN const
 | ||||
|  	} | ||||
|   | ||||
|  	auto_unlocker lock(m_lock); | ||||
| -	if (m_observers.count((observer * const)new_observer) > 0) {
 | ||||
| +	if (m_observers.count((observer *)new_observer) > 0) {
 | ||||
|  //		sub_obs_logdbg("[%s] Observer is already registered (%p)", to_str(), new_observer); | ||||
|  		return false; | ||||
|  	} | ||||
| -	m_observers.insert((observer * const)new_observer);
 | ||||
| +	m_observers.insert((observer *)new_observer);
 | ||||
|  //	sub_obs_logdbg("[%s] Successfully registered new_observer %s", to_str(), new_observer->to_str()); | ||||
|  	return true; | ||||
|  } | ||||
| @@ -69,7 +69,7 @@ bool subject::unregister_observer(IN con
 | ||||
|  	} | ||||
|   | ||||
|  	auto_unlocker lock(m_lock); | ||||
| -	m_observers.erase((observer * const)old_observer);
 | ||||
| +	m_observers.erase((observer *)old_observer);
 | ||||
|  //	sub_obs_logdbg("[%s] Successfully unregistered old_observer %s",to_str(), old_observer->to_str()); | ||||
|  	return true; | ||||
|  } | ||||
| diff -up libvma-8.0.1/src/vma/proto/L2_address.h.me libvma-8.0.1/src/vma/proto/L2_address.h
 | ||||
| --- libvma-8.0.1/src/vma/proto/L2_address.h.me	2018-02-06 16:40:59.152129368 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/proto/L2_address.h	2018-02-06 16:49:34.787559057 +0100
 | ||||
| @@ -59,7 +59,7 @@ public:
 | ||||
|  	void		set(address_t const address, addrlen_t const len); | ||||
|   | ||||
|  	addrlen_t	get_addrlen() const { return m_len; }; | ||||
| -	address_t	get_address() const { return (const address_t)m_p_raw_address; };
 | ||||
| +	address_t	get_address() const { return (address_t) m_p_raw_address; };
 | ||||
|   | ||||
|  	virtual bool 	compare(L2_address const& other) const; | ||||
|   | ||||
| diff -up libvma-8.0.1/src/vma/proto/mem_buf_desc.h.me libvma-8.0.1/src/vma/proto/mem_buf_desc.h
 | ||||
| diff -up libvma-8.0.1/src/vma/proto/route_rule_table_key.h.me libvma-8.0.1/src/vma/proto/route_rule_table_key.h
 | ||||
| --- libvma-8.0.1/src/vma/proto/route_rule_table_key.h.me	2018-02-06 17:17:44.241168404 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/proto/route_rule_table_key.h	2018-02-06 17:34:50.072582707 +0100
 | ||||
| @@ -36,6 +36,7 @@
 | ||||
|   | ||||
|  #include <stdio.h> | ||||
|  #include <string> | ||||
| +#include <cstring>
 | ||||
|   | ||||
|  #include "vma/util/to_str.h" | ||||
|  #include "vma/util/vtypes.h" | ||||
| @@ -53,13 +54,18 @@ public:
 | ||||
|  	 | ||||
|  	const std::string to_str() const | ||||
|  	{ | ||||
| -		char s[100];
 | ||||
| +		char s[100] = {0};
 | ||||
|  		sprintf(s, "Destination IP:%d.%d.%d.%d", NIPQUAD(m_dst_ip)); | ||||
| -		if (m_src_ip)
 | ||||
| -			sprintf(s, "%s Source IP:%d.%d.%d.%d", s, NIPQUAD(m_src_ip));	
 | ||||
| -		if (m_tos)
 | ||||
| -			sprintf(s, "%s TOS:%u", s, m_tos);
 | ||||
| -			
 | ||||
| +		if (m_src_ip) {
 | ||||
| +			char sx[40] = {0};
 | ||||
| +			sprintf(sx, " Source IP:%d.%d.%d.%d", NIPQUAD(m_src_ip));	
 | ||||
| +			strcat(s, sx);
 | ||||
| +		}
 | ||||
| +		if (m_tos) {
 | ||||
| +			char sx[20] = {0};
 | ||||
| +			sprintf(sx, " TOS:%u", m_tos);
 | ||||
| +			strcat(s, sx);
 | ||||
| +		}	
 | ||||
|  		return(std::string(s)); | ||||
|  	} | ||||
|  	 | ||||
| @@ -85,16 +91,22 @@ public:
 | ||||
|  	size_t operator()(const route_rule_table_key &key) const | ||||
|  	{ | ||||
|  		hash<string>_hash; | ||||
| -		char s[40];
 | ||||
| +		char s[40] = {0};
 | ||||
|  		/* | ||||
|  		Build string from exist parameter (destination IP, source IP, TOS) | ||||
|  		which is unique for different route-rule entries. | ||||
|  		*/ | ||||
|  		sprintf(s, "%d.%d.%d.%d", NIPQUAD(key.get_dst_ip())); | ||||
| -		if (key.get_src_ip())
 | ||||
| -			sprintf(s, "%s %d.%d.%d.%d", s, NIPQUAD(key.get_src_ip()));	
 | ||||
| -		if (key.get_tos())
 | ||||
| -			sprintf(s, "%s %u", s, key.get_tos());		
 | ||||
| +		if (key.get_src_ip()) {
 | ||||
| +			char sx[20] = {0};
 | ||||
| +			sprintf(sx, " %d.%d.%d.%d", NIPQUAD(key.get_src_ip()));
 | ||||
| +			strcat(s, sx);
 | ||||
| +		}
 | ||||
| +		if (key.get_tos()) {
 | ||||
| +			char sx[20] = {0};
 | ||||
| +			sprintf(sx, " %u", key.get_tos());
 | ||||
| +			strcat(s, sx);
 | ||||
| +		}
 | ||||
|  		return _hash(std::string(s));// Use built in hash function for string input. | ||||
|  	} | ||||
|  }; | ||||
| diff -up libvma-8.0.1/src/vma/sock/pipeinfo.cpp.me libvma-8.0.1/src/vma/sock/pipeinfo.cpp
 | ||||
| --- libvma-8.0.1/src/vma/sock/pipeinfo.cpp.me	2018-02-06 17:36:50.905814995 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/pipeinfo.cpp	2018-02-06 17:37:33.543896959 +0100
 | ||||
| @@ -72,7 +72,7 @@ pipeinfo::pipeinfo(int fd) : socket_fd_a
 | ||||
|  		// pi_logdbg("Got NULL from mce_stats_instance_create_socket_block, using local member"); | ||||
|  		m_p_socket_stats = &m_socket_stats; | ||||
|  	} | ||||
| -	memset(m_p_socket_stats, 0, sizeof(*m_p_socket_stats));
 | ||||
| +	memset(static_cast<void*>(m_p_socket_stats), 0, sizeof(*m_p_socket_stats));
 | ||||
|  	m_p_socket_stats->fd = m_fd; | ||||
|  	m_p_socket_stats->b_blocking = m_b_blocking; | ||||
|  	m_p_socket_stats->n_rx_ready_pkt_count = 0; | ||||
| diff -up libvma-8.0.1/src/vma/sock/sockinfo.cpp.me libvma-8.0.1/src/vma/sock/sockinfo.cpp
 | ||||
| --- libvma-8.0.1/src/vma/sock/sockinfo.cpp.me	2018-02-06 17:35:47.210692547 +0100
 | ||||
| +++ libvma-8.0.1/src/vma/sock/sockinfo.cpp	2018-02-06 17:36:07.360731283 +0100
 | ||||
| @@ -85,7 +85,7 @@ sockinfo::sockinfo(int fd):
 | ||||
|   | ||||
|  	m_p_socket_stats = &m_socket_stats; // Save stats as local copy and allow state publisher to copy from this location | ||||
|  	vma_stats_instance_create_socket_block(m_p_socket_stats); | ||||
| -	memset(m_p_socket_stats, 0, sizeof(*m_p_socket_stats));
 | ||||
| +	memset(static_cast<void*>(m_p_socket_stats), 0, sizeof(*m_p_socket_stats));
 | ||||
|  	m_p_socket_stats->fd = m_fd; | ||||
|  	m_p_socket_stats->inode = fd2inode(m_fd); | ||||
|  	m_p_socket_stats->b_blocking = m_b_blocking; | ||||
| diff -up libvma-8.0.1/src/vma/util/sys_vars.h.me libvma-8.0.1/src/vma/util/sys_vars.h
 | ||||
| diff -up libvma-8.0.1/src/vma/util/sock_addr.h.me libvma-8.0.1/src/vma/util/sock_addr.h
 | ||||
| --- libvma-8.0.1/src/vma/util/sock_addr.h.me	2018-02-07 04:14:27.942612450 -0500
 | ||||
| +++ libvma-8.0.1/src/vma/util/sock_addr.h	2018-02-07 04:25:37.714699564 -0500
 | ||||
| @@ -157,7 +157,7 @@ private:
 | ||||
|  	struct sockaddr_in* 	m_p_sa_in; | ||||
|   | ||||
|  	char			m_str_in_addr[16]; | ||||
| -	char			m_str_in_port[6];
 | ||||
| +	char			m_str_in_port[11];
 | ||||
|  	char			m_str[22]; | ||||
|   | ||||
|  	void 		set_str_in_addr() { sprintf(m_str_in_addr, "%d.%d.%d.%d", NIPQUAD(get_in_addr())); set_str(); } | ||||
							
								
								
									
										158
									
								
								libvma.spec
									
									
									
									
									
								
							
							
						
						
									
										158
									
								
								libvma.spec
									
									
									
									
									
								
							| @ -1,128 +1,122 @@ | ||||
| %{!?configure_options: %global configure_options %{nil}} | ||||
| 
 | ||||
| Name: libvma | ||||
| Version: 8.0.1 | ||||
| Release: 8%{?dist} | ||||
| Version: 9.0.2 | ||||
| Release: 1%{?dist} | ||||
| Summary: A library for boosting TCP and UDP traffic (over RDMA hardware) | ||||
| 
 | ||||
| License: GPLv2 or BSD | ||||
| Url: https://github.com/Mellanox/libvma | ||||
| Source: http://www.mellanox.com/downloads/Accelerator/%{name}-%{version}.tar.gz | ||||
| #arm is excluded since libvma fails to compile on arm.  | ||||
| #Reason: libvma uses assembly commands that are not supported by arm. | ||||
| Patch0: libvma-8.0.1-gcc7.patch | ||||
| Patch1: libvma-8.0.1-gcc8.patch | ||||
| ExcludeArch: %{arm}  | ||||
| Requires: pam | ||||
| # rdma-core doesn't not exist on s390x. need to check later | ||||
| # disable it temporary | ||||
| ExcludeArch: s390x | ||||
| Source0: https://github.com/Mellanox/libvma/archive/%{version}/%{name}-%{version}.tar.gz | ||||
| Patch0: 0001-issue-928161-Add-man-pages.patch | ||||
| Patch1: 0002-Update-systemctl-files.patch | ||||
| Patch2: 0003-Remove-30-libvma-limits.patch | ||||
| Patch3: 0004-Use-vmad-for-systemd.patch | ||||
| 
 | ||||
| # libvma currently supports only the following architectures | ||||
| ExclusiveArch: x86_64 ppc64le ppc64 aarch64 | ||||
| 
 | ||||
| BuildRequires: pkgconfig | ||||
| BuildRequires: automake | ||||
| BuildRequires: autoconf | ||||
| BuildRequires: libtool | ||||
| BuildRequires: gcc-c++ | ||||
| BuildRequires: rdma-core-devel libnl3-devel | ||||
| BuildRequires: automake autoconf libtool | ||||
| BuildRequires: rdma-core-devel | ||||
| BuildRequires: systemd-rpm-macros | ||||
| BuildRequires: pkgconfig(libnl-3.0) | ||||
| BuildRequires: pkgconfig(libnl-route-3.0) | ||||
| 
 | ||||
| %description | ||||
| libvma is a LD_PRELOAD-able library that boosts performance | ||||
| of TCP and UDP traffic. | ||||
| It allows application written over standard socket API to handle  | ||||
| fast path data traffic from user space over Ethernet and/or  | ||||
| libvma is a LD_PRELOAD-able library that boosts performance of TCP and | ||||
| UDP traffic. It allows application written over standard socket API to | ||||
| handle fast path data traffic from user space over Ethernet and/or | ||||
| Infiniband with full network stack bypass and get better throughput, | ||||
| latency and packets/sec rate. | ||||
| 
 | ||||
| No application binary change is required for that. | ||||
| libvma is supported by RDMA capable devices that support | ||||
| "verbs" IBV_QPT_RAW_PACKET QP for Ethernet and/or IBV_QPT_UD QP for IPoIB. | ||||
| libvma is supported by RDMA capable devices that support "verbs" | ||||
| IBV_QPT_RAW_PACKET QP for Ethernet and/or IBV_QPT_UD QP for IPoIB. | ||||
| 
 | ||||
| %package devel | ||||
| Summary: Header files required to develop with libvma | ||||
| Requires: %{name}%{?_isa} = %{version}-%{release} | ||||
| 
 | ||||
| %description devel | ||||
| Headers files required to develop with the libvma library. | ||||
| This package includes headers for building programs with libvma's | ||||
| interfaces. | ||||
| 
 | ||||
| %package utils | ||||
| Summary: Libvma utilities | ||||
| Summary: Utilities used with libvma | ||||
| Requires: %{name}%{?_isa} = %{version}-%{release} | ||||
| 
 | ||||
| %description utils | ||||
| Tools for collecting and analyzing libvma statistic. | ||||
| This package contains the tool for collecting and analyzing libvma statistic. | ||||
| 
 | ||||
| %prep | ||||
| %setup -q | ||||
| %patch0 -p1 -b .gcc7 | ||||
| %patch1 -p1 -b .gcc8 | ||||
| %autosetup -p1 | ||||
| 
 | ||||
| %build | ||||
| ./autogen.sh | ||||
| %configure  | ||||
| make %{?_smp_mflags} V=1 | ||||
| export revision=1 | ||||
| if [ ! -e configure ] && [ -e autogen.sh ]; then | ||||
|     VMA_RELEASE=1 ./autogen.sh | ||||
| fi | ||||
| 
 | ||||
| %configure %{?configure_options} | ||||
| %{make_build} | ||||
| 
 | ||||
| %install | ||||
| %make_install | ||||
| rm -f $RPM_BUILD_ROOT%{_libdir}/*.la | ||||
| %{make_install} | ||||
| 
 | ||||
| %ldconfig_scriptlets | ||||
| find $RPM_BUILD_ROOT%{_libdir} -name '*.la' -delete | ||||
| install -D -m 644 contrib/scripts/vma.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/vma.service | ||||
| 
 | ||||
| %post | ||||
| %systemd_post vma.service | ||||
| 
 | ||||
| %preun | ||||
| %systemd_preun vma.service | ||||
| 
 | ||||
| %postun | ||||
| %systemd_postun_with_restart vma.service | ||||
| 
 | ||||
| %files | ||||
| %{_libdir}/%{name}*.so.* | ||||
| #libvma.so in needed in the main package so that  | ||||
| #'LD_PRELOAD=libvma.so <command>' works. | ||||
| %{_libdir}/%{name}.so | ||||
| %license COPYING LICENSE | ||||
| %doc README.txt journal.txt VMA_VERSION | ||||
| %{_libdir}/%{name}.so* | ||||
| %dir %{_pkgdocdir} | ||||
| %doc %{_pkgdocdir}/README.txt | ||||
| %doc %{_pkgdocdir}/journal.txt | ||||
| %doc %{_pkgdocdir}/VMA_VERSION | ||||
| %config(noreplace) %{_sysconfdir}/libvma.conf | ||||
| %config(noreplace) %{_sysconfdir}/security/limits.d/30-libvma-limits.conf | ||||
| %{_sbindir}/vmad | ||||
| %{_prefix}/lib/systemd/system/vma.service | ||||
| %license COPYING LICENSE | ||||
| %{_mandir}/man7/vma.* | ||||
| %{_mandir}/man8/vmad.* | ||||
| 
 | ||||
| %files devel | ||||
| %{_includedir}/* | ||||
| %dir %{_includedir}/mellanox | ||||
| %{_includedir}/mellanox/vma_extra.h | ||||
| 
 | ||||
| %files utils | ||||
| %{_bindir}/vma_stats | ||||
| %{_mandir}/man8/vma_stats.* | ||||
| 
 | ||||
| %changelog | ||||
| * Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.1-8 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild | ||||
| * Fri Apr 17 2020 Igor Ivanov <igor.ivanov.va@gmail.com> 9.0.2-1 | ||||
| - Align with Fedora guidelines | ||||
| - Bump version to 9.0.2 | ||||
| 
 | ||||
| * Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.1-7 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild | ||||
| * Thu Feb 7 2019 Igor Ivanov <igor.ivanov.va@gmail.com> 8.8.2-1 | ||||
| - Improve package update processing | ||||
| 
 | ||||
| * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.1-6 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild | ||||
| * Tue Dec 19 2017 Igor Ivanov <igor.ivanov.va@gmail.com> 8.5.1-1 | ||||
| - Add systemd support | ||||
| 
 | ||||
| * Mon Feb 05 2018 Than Ngo <than@redhat.com> - 8.0.1-5 | ||||
| - fixed FTBS with gcc7/gcc8 | ||||
| * Tue May 9 2017 Ophir Munk <ophirmu@mellanox.com> 8.3.4-1 | ||||
| - Add libvma-debug.so installation | ||||
| 
 | ||||
| * Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.1-4 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild | ||||
| * Mon Nov 28 2016 Igor Ivanov <igor.ivanov.va@gmail.com> 8.2.2-1 | ||||
| - Add daemon | ||||
| 
 | ||||
| * Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.1-3 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild | ||||
| 
 | ||||
| * Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.1-2 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild | ||||
| 
 | ||||
| * Sun Mar 13 2016 Alex Vainman <alexv@mellanox.com> - 8.0.1-1 | ||||
| - New upstream release | ||||
| - Move to dual license: GPLv2 or BSD | ||||
| - ExcludeArch update | ||||
| - Removal of extra space in: | ||||
|   config(noreplace) {_sysconfdir}/security/limits.d/30-libvma-limits.conf | ||||
| - Add V=1 to make | ||||
| 
 | ||||
| * Wed Mar  2 2016 Alex Vainman <alexv@mellanox.com> - 7.0.14-2 | ||||
| - Added reasoning for archs exclusion | ||||
| - Package description improvement | ||||
| - Removal of the pre scriplet | ||||
| - Added COPYING and LICENSE files to the package | ||||
| 
 | ||||
| * Sun Feb 21 2016 Alex Vainman <alexv@mellanox.com> - 7.0.14-1 | ||||
| - New upstream release | ||||
| - Removal of redundant macros and obsolete/unneeded tags | ||||
| - Added ExcludeArch, BuildRequires and Require sections | ||||
| - Fixes and cleanups in the build and installation sections | ||||
| - Install 30-libvma-limits.conf file under  | ||||
|   /etc/security/limits.d/ | ||||
| - Fixes related to files/directories ownerships | ||||
| - Removal of vma_perf_envelope.sh from the utility package | ||||
| - Update Source tag URL | ||||
| - Fix most of the rpmlint warnings | ||||
| 
 | ||||
| * Mon Jan  4 2016 Avner BenHanoch <avnerb@mellanox.com> - 7.0.12-1 | ||||
| * Mon Jan  4 2016 Avner BenHanoch <avnerb@mellanox.com> 7.0.12-1 | ||||
| - Initial Packaging | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user