Skip to content

Commit b97d281

Browse files
author
Stefan Raspl
committed
Release: Prepare v1.0.1
Signed-off-by: Stefan Raspl <raspl@linux.ibm.com>
1 parent 29f3194 commit b97d281

11 files changed

Lines changed: 225 additions & 158 deletions

File tree

Makefile

Lines changed: 72 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,125 @@
11
#
22
# SMC Tools - Shared Memory Communication Tools
33
#
4-
# Copyright IBM Corp. 2017
4+
# Copyright IBM Corp. 2016, 2017
55
#
66
# All rights reserved. This program and the accompanying materials
77
# are made available under the terms of the Eclipse Public License v1.0
88
# which accompanies this distribution, and is available at
99
# http://www.eclipse.org/legal/epl-v10.html
1010
#
1111

12-
VERSION = 1
13-
RELEASE = 0
14-
PATCHLEVEL = 0
15-
SMC_TOOLS_RELASE = $(VERSION).$(RELEASE).$(PATCHLEVEL)
12+
SMC_TOOLS_RELEASE = 1.0.1
13+
VER_MAJOR = $(shell echo $(SMC_TOOLS_RELEASE) | cut -d '.' -f 1)
1614

17-
ARCH = $(shell uname -m)
18-
ifeq ($(ARCH),i686)
19-
ARCH64=0
20-
else ifeq ($(ARCH),s390)
21-
ARCH64=0
15+
ARCHTYPE = $(shell uname -m)
16+
ARCH := $(shell getconf LONG_BIT)
17+
18+
ifneq ("${V}","1")
19+
MAKEFLAGS += --quiet
20+
cmd = echo $1$2;
2221
else
23-
ARCH64=1
22+
cmd =
2423
endif
25-
26-
DESTDIR ?=
27-
INSTALLDIR = /usr
28-
BINDIR = ${INSTALLDIR}/bin
29-
MANDIR = ${INSTALLDIR}/share/man
30-
OWNER = $(shell id -un)
31-
GROUP = $(shell id -gn)
32-
INSTALL_FLAGS_BIN = -g $(GROUP) -o $(OWNER) -m755
33-
INSTALL_FLAGS_MAN = -g $(GROUP) -o $(OWNER) -m644
34-
35-
STUFF_32BIT = 0
24+
CCC = $(call cmd," CC ",$@)${CC}
25+
LINK = $(call cmd," LINK ",$@)${CC}
26+
GEN = $(call cmd," GEN ",$@)sed
27+
DESTDIR ?=
28+
PREFIX = /usr
29+
BINDIR = ${PREFIX}/bin
30+
MANDIR = ${PREFIX}/share/man
31+
OWNER = $(shell id -un)
32+
GROUP = $(shell id -gn)
33+
INSTALL_FLAGS_BIN = -g $(GROUP) -o $(OWNER) -m755
34+
INSTALL_FLAGS_MAN = -g $(GROUP) -o $(OWNER) -m644
35+
36+
STUFF_32BIT = 0
3637
#
3738
# Check that 31/32-bit build tools are available.
3839
#
39-
ifeq ($(ARCH64),1)
40-
LIBDIR = ${INSTALLDIR}/lib64
41-
ifneq ("$(wildcard ${INSTALLDIR}/include/gnu/stubs-32.h)","")
40+
ifeq ($(ARCH),64)
41+
LIBDIR = ${PREFIX}/lib64
42+
ifneq ("$(wildcard ${PREFIX}/include/gnu/stubs-32.h)","")
4243
STUFF_32BIT = 1
43-
LIBDIR32 = ${INSTALLDIR}/lib
44+
LIBDIR32 = ${PREFIX}/lib
4445
endif
4546
else
46-
LIBDIR = ${INSTALLDIR}/lib
47+
LIBDIR = ${PREFIX}/lib
4748
endif
4849

49-
all: smc_run ld_pre_smc.so ld_pre_smc32.so smcss smcrpnet
50+
all: ld_pre_smc.so ld_pre_smc32.so smcss smc_pnet smc_run
5051

51-
CFLAGS := -Wall -I include -O3 -g
52+
CFLAGS ?= -Wall -O3 -g
53+
ALL_CFLAGS = -DSMC_TOOLS_RELEASE=$(SMC_TOOLS_RELEASE) $(CFLAGS)
5254

53-
ifeq ($(ARCH),s390x)
55+
ifeq ($(ARCHTYPE),s390x)
5456
MACHINE_OPT32="-m31"
5557
else
5658
MACHINE_OPT32="-m32"
5759
endif
5860

5961
smc_run: smc_run.in
60-
my_installdir=${INSTALLDIR}; \
61-
sed -e "s#@install_dir@#$$my_installdir#g" < $< > $@
62+
my_installdir=${PREFIX} $(GEN) -e "s#@install_dir@#$$my_installdir#g" < $< > $@
63+
chmod a+x $@
64+
65+
ld_pre_smc.o: ld_pre_smc.c
66+
${CCC} ${CFLAGS} -fPIC -c ld_pre_smc.c
6267

63-
ld_pre_smc.so: ld_pre_smc.c
64-
${CC} ${CFLAGS} -fPIC -c ld_pre_smc.c
65-
${CC} -shared ld_pre_smc.o -ldl -Wl,-z,defs -o ld_pre_smc.so
68+
ld_pre_smc.so: ld_pre_smc.o
69+
${LINK} ${LDFLAGS} -shared ld_pre_smc.o -ldl -Wl,-z,defs,-soname,$@.$(VER_MAJOR) -o $@
6670

6771
ld_pre_smc32.so: ld_pre_smc.c
68-
ifeq ($(ARCH64),1)
72+
ifeq ($(ARCH),64)
6973
ifeq ($(STUFF_32BIT),1)
70-
${CC} ${CFLAGS} -fPIC -c ${MACHINE_OPT32} ld_pre_smc.c -o ld_pre_smc32.o
71-
${CC} -shared ld_pre_smc32.o ${MACHINE_OPT32} -ldl -o ld_pre_smc32.so
74+
${CCC} ${CFLAGS} -fPIC -c ${MACHINE_OPT32} $< -o ld_pre_smc32.o
75+
${LINK} ${LDFLAGS} -shared ld_pre_smc32.o ${MACHINE_OPT32} -ldl -Wl,-soname,$@.$(VER_MAJOR) -o $@
7276
else
73-
$(warning "Warning: Skipping 31/32-bit library build because 31/32-bit \
74-
build tools are unavailable. SMC-R will not support 31 and 32 bit TCP \
75-
applications unless the glibc-devel for appropriate addressing mode is \
76-
installed and the preload libraries are rebuilt.")
77+
$(warning "Warning: Skipping 31/32-bit library build because 31/32-bit build tools")
78+
$(warning " are unavailable. SMC will not support 31/32 bit applications")
79+
$(warning " unless the glibc devel package for the appropriate addressing")
80+
$(warning " mode is installed and the preload libraries are rebuilt.")
7781
endif
7882
endif
7983

80-
smcss.o: smcss.c smc_diag.h smctools_common.h
81-
${CC} ${CFLAGS} -c smcss.c
82-
83-
smcss: smcss.o
84-
85-
#
8684
ifneq ($(shell sh -c 'command -v pkg-config'),)
87-
SMCRPNET_FLAGS = $(shell pkg-config --silence-errors --cflags --libs libnl-genl-3.0)
85+
SMC_PNET_CFLAGS = $(shell pkg-config --silence-errors --cflags libnl-genl-3.0)
86+
SMC_PNET_LFLAGS = $(shell pkg-config --silence-errors --libs libnl-genl-3.0)
8887
else
89-
SMCRPNET_FLAGS = -I/usr/include/libnl3 -lnl-genl-3 -lnl-3
88+
SMC_PNET_CFLAGS = -I /usr/include/libnl3
89+
SMC_PNET_LFLAGS = -lnl-genl-3 -lnl-3
9090
endif
9191

92-
smcrpnet: smcrpnet.c smc.h
93-
@if [ -e /usr/include/libnl3/netlink/netlink.h ]; then \
94-
echo ${CC} ${CFLAGS} ${SMCRPNET_FLAGS} -o $@ $< ; \
95-
${CC} ${CFLAGS} ${SMCRPNET_FLAGS} -o $@ $< ; \
96-
else \
97-
printf "*********************************************\n" >&2; \
92+
smc_pnet: smc_pnet.c smc.h smctools_common.h
93+
@if [ ! -e /usr/include/libnl3/netlink/netlink.h ]; then \
94+
printf "**************************************************************\n" >&2; \
9895
printf "* Missing build requirement for: %-45s\n" $@ >&2; \
99-
printf "* Install package..............: %-45s\n" libnl3-devel >&2; \
100-
printf "*********************************************\n" >&2; \
101-
exit 0; \
96+
printf "* Install package..............: %-45s\n" "devel package for libnl3" >&2; \
97+
printf "* Install package..............: %-45s\n" "devel package for libnl3-genl" >&2; \
98+
printf "* NOTE: Package names might differ by platform\n" >&2; \
99+
printf "**************************************************************\n" >&2; \
100+
exit 1; \
102101
fi
102+
${CCC} ${ALL_CFLAGS} ${SMC_PNET_CFLAGS} ${LDFLAGS} -o $@ $< ${SMC_PNET_LFLAGS}
103+
104+
smcss: smcss.c smc_diag.h smctools_common.h
105+
${CCC} ${ALL_CFLAGS} ${LDFLAGS} $< -o $@
103106

104-
install:
107+
install: all
108+
echo " INSTALL"
105109
install -d -m755 $(DESTDIR)$(LIBDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man7 $(DESTDIR)$(MANDIR)/man8
106-
install -s $(INSTALL_FLAGS_BIN) ld_pre_smc.so $(DESTDIR)$(LIBDIR)
110+
install $(INSTALL_FLAGS_BIN) ld_pre_smc.so $(DESTDIR)$(LIBDIR)
107111
ifeq ($(STUFF_32BIT),1)
108112
install -d -m755 $(DESTDIR)$(LIBDIR32)
109-
install -s $(INSTALL_FLAGS_BIN) ld_pre_smc32.so $(DESTDIR)$(LIBDIR32)/ld_pre_smc.so
113+
install $(INSTALL_FLAGS_BIN) ld_pre_smc32.so $(DESTDIR)$(LIBDIR32)/ld_pre_smc.so
110114
endif
111115
install $(INSTALL_FLAGS_BIN) smc_run $(DESTDIR)$(BINDIR)
112-
install -s $(INSTALL_FLAGS_BIN) smcss $(DESTDIR)$(BINDIR)
113-
install -s $(INSTALL_FLAGS_BIN) smcrpnet $(DESTDIR)$(BINDIR)
114-
install $(INSTALL_FLAGS_MAN) af_smc.7 $(DESTDIR)$(MANDIR)/man7
116+
install $(INSTALL_FLAGS_BIN) smcss $(DESTDIR)$(BINDIR)
117+
install $(INSTALL_FLAGS_BIN) smc_pnet $(DESTDIR)$(BINDIR)
118+
install $(INSTALL_FLAGS_MAN) $(DESTDIR)$(MANDIR)/man7
115119
install $(INSTALL_FLAGS_MAN) smc_run.8 $(DESTDIR)$(MANDIR)/man8
116-
install $(INSTALL_FLAGS_MAN) smcrpnet.8 $(DESTDIR)$(MANDIR)/man8
120+
install $(INSTALL_FLAGS_MAN) smc_pnet.8 $(DESTDIR)$(MANDIR)/man8
117121
install $(INSTALL_FLAGS_MAN) smcss.8 $(DESTDIR)$(MANDIR)/man8
118122

119123
clean:
120-
rm -f *.o *.so smc_run smcss smcrpnet
124+
echo " CLEAN"
125+
rm -f *.o *.so smc_run smcss smc_pnet

README.smctools

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
SMC Tools (1.0.0)
1+
SMC Tools (1.0.1)
22
===================
33

44
The SMC Tools provided in this package allow execution of existing TCP
55
applications over RoCE network without need to make changes in them.
6-
In addition tools are provided to display SMC socket information and
7-
SMC socket statistics (in future).
6+
In addition tools are provided to display SMC socket information.
87

98
This package consists of the tools:
109

1110
- ld_preload_smc.so : preload library.
1211
- smc_run : preload library environment setup script.
13-
- smcrpnet : C program for PNET Table handling
12+
- smc_pnet : C program for PNET Table handling
1413
- smcss : C program for displaying the information about active
1514
SMC sockets.
1615

@@ -20,16 +19,49 @@ The environment setup script smc_run sets up the preload environment
2019
for the ld_pre_smc.so shared library before starting application.
2120
The smcss program is used to gather and display information about the
2221
SMC sockets.
23-
The smcrpnet program is used to create, destroy, and change the SMC-R PNET
22+
The smc_pnet program is used to create, destroy, and change the SMC-R PNET
2423
table.
2524

2625
In addition the package contains the AF_SMC manpage ("man af_smc").
2726

27+
28+
Bug Reports
29+
===========
30+
See section 'Code Contributions'.
31+
32+
33+
Code Contributions
34+
==================
35+
Code contributions will not be accepted for smctools.
36+
Therefore, please do not send DIFFs or code-snippets. Thank you!
37+
If you want to report bugs or suggest enhancements, please contact:
38+
linux390@de.ibm.com
39+
and put "[smctools]" as the first word in the subject line of your mail.
40+
For bug reports, at a minimum describe the scenario with instructions on how
41+
to reproduce.
42+
For enhancements, please describe the proposed change and its benefits.
43+
44+
2845
Release History:
2946
================
3047

31-
1.0.0
32-
The initial version.
48+
1.0.1 (2018-01-12)
49+
Changes:
50+
- Makefile: Improve distro compatibility
51+
- Makefile: Add SONAME to shared libraries
52+
- Makefile: Do not strip binaries on install
53+
- Makefile: Use LDFLAGS to allow addition of externally set link flags
54+
- ld_pre..: Remove hardcoded reference to libc
55+
- Manpages: Formatting changes
56+
57+
Bug fixes:
58+
- Makefile: Fix target 'install' dependencies
59+
- smcss: Fix "--version" output
60+
- smc_pnet: Fix "--version" output
61+
62+
1.0.0 (2017-02-13)
63+
The initial version
64+
3365

3466
Parts:
3567
======
@@ -39,26 +71,27 @@ The SMC Tools package includes the following files:
3971
Makefile smctools Makefile
4072
ld_pre_smc.c ld_pre_smc.so, SMC preload library source code
4173
smc_run SMC preload library environment setup script
42-
smcrpnet.c PNET Table handling source code
74+
smc_pnet.c PNET Table handling source code
4375
smcss.c SMC socket display source code
4476
smctools_common.h common definitions for smctools
4577
smc.h include file from kernel include/uapi/linux/smc.h
4678
smc_diag.h include file from kernel include/uapi/linux/smc_diag.h
4779
af_smc.7 manpage for AF_SMC sockets
48-
smcrpnet.8 manpage for smcrpnet
80+
smc_pnet.8 manpage for smc_pnet
4981
smcss.8 manpage for smcss
5082
smc_run.8 manpage for preload library usage
5183

84+
5285
Requirements:
5386
=============
5487

5588
- To compile and run applications over a RoCE network, PCI support,
5689
Mellanox Connect-X device support, Infiniband, and SMC support, must be
57-
enabled in kernel.
90+
enabled in the kernel.
5891
- To run the applications over a RoCE network, the RoCE network must be
5992
properly configured.
6093

61-
Copyright IBM Corp. 2017
94+
Copyright IBM Corp. 2016, 2017
6295

6396
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THE ENCLOSED ECLIPSE
6497
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE

af_smc.7

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.\" af_smc.7
22
.\"
33
.\"
4-
.\" Copyright IBM Corp. 2017
4+
.\" Copyright IBM Corp. 2016, 2017
55
.\" Author(s): Ursula Braun <ubraun@linux.vnet.ibm.com>
66
.\" Thomas Richter <tmricht@linux.vnet.ibm.com>
77
.\" ----------------------------------------------------------------------
@@ -71,9 +71,9 @@ Any available Ethernet interface can be combined with available
7171
if they belong to the same Converged Ethernet fabric.
7272
To configure RoCE Adapter mapping, you must create a pnet table.
7373
Modify the table with the smc-tools command
74-
.I smcrpnet.
74+
.I smc_pnet.
7575
.PP
76-
For details call "man smcrpnet".
76+
For details call "man smc_pnet".
7777
.SS Important sysctl settings
7878
SMC-R supports IPv4 only. Use this sysctl setting:
7979
.IR net.ipv6.bindv6only=1
@@ -102,10 +102,10 @@ the minimum MTU size of both peers.
102102

103103
.SH "AUTHOR"
104104
.nf
105-
Copyright IBM Corp. 2017
105+
Copyright IBM Corp. 2016, 2017
106106

107107
Published under the terms and conditions of the EPL
108-
(eclipse public license).
108+
(Eclipse Public License).
109109
.fi
110110

111111
.SH "SEE ALSO"
@@ -115,10 +115,10 @@ Published under the terms and conditions of the EPL
115115
.BR socket (7)
116116
.BR smc_run (8)
117117
.BR smcss (8)
118-
.BR smcrpnet (8)
118+
.BR smc_pnet (8)
119119
.SH "HISTORY"
120120
.TP
121-
.B AF_SMC, version 1.0.0
121+
.B AF_SMC, version 1.0.1
122122
.RS 4
123123
.IP "\bu" 2
124124
Initial version.

ld_pre_smc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SMC Tools - Shared Memory Communication Tools
33
*
4-
* Copyright (c) IBM Corp. 2017
4+
* Copyright (c) IBM Corp. 2016, 2017
55
*
66
* All rights reserved. This program and the accompanying materials
77
* are made available under the terms of the Eclipse Public License v1.0
@@ -16,12 +16,12 @@
1616
#include <sys/types.h>
1717
#include <netinet/in.h>
1818
#include <sys/socket.h>
19+
#include <gnu/lib-names.h>
1920
#include <netdb.h>
2021
#include <dlfcn.h>
2122
#include <errno.h>
2223
#include <search.h>
2324

24-
#define LIBC_PATH "libc.so.6"
2525
#define DLOPEN_FLAG RTLD_LAZY
2626

2727
#ifndef AF_SMC
@@ -97,7 +97,7 @@ static void initialize(void)
9797
{
9898
set_debug_mode("SMC_DEBUG");
9999

100-
dl_handle = dlopen(LIBC_PATH,DLOPEN_FLAG);
100+
dl_handle = dlopen(LIBC_SO, DLOPEN_FLAG);
101101
if (!dl_handle)
102102
dbg_msg(stderr, "dlopen failed: %s\n", dlerror());
103103
GET_FUNC(socket);

0 commit comments

Comments
 (0)