Skip to content

Commit 9d92ae7

Browse files
author
markheger
committed
Merge branch 'master' of git@github.com:IBMStreams/streamsx.network.git
Conflicts: com.ibm.streamsx.network/com.ibm.streamsx.network.filter/IPFilter/IPFilter_cpp.cgt
2 parents ebb3cd8 + 53ca49e commit 9d92ae7

File tree

8 files changed

+40
-12
lines changed

8 files changed

+40
-12
lines changed

com.ibm.streamsx.network/com.ibm.streamsx.network.filter/IPFilter/IPFilter_cpp.cgt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,25 @@ void MY_OPERATOR::process(Tuple const & tuple, uint32_t port) {
116116

117117
SPLAPPTRC(L_TRACE, "Process() non-mutating, port 1. ipv4FilterAddr = " << ipv4Addr, IP_FILTER);
118118

119+
<<<<<<< HEAD
119120
SPL::list<SPL::uint32> addrList = getAllAddressesInNetworkInt(ipv4Addr);
120121
SPLAPPTRC(L_TRACE, "Process() non-mutating, port 1. Adding count = " << addrList.size(), IP_FILTER);
121122

123+
=======
124+
>>>>>>> branch 'master' of git@github.com:IBMStreams/streamsx.network.git
122125
AutoPortMutex amW(mutex_[ip4ListWSel_], *this);
123-
SPL::list<SPL::uint32>::const_iterator it;
124-
for(it = addrList.begin(); it != addrList.end(); ++it) {
125-
ip4List_[ip4ListWSel_]->insert(*it);
126+
SPL::uint32 addrStart, addrEnd;
127+
SPL::uint32 addrRange = getAddressRangeInNetworkInt(ipv4Addr, addrStart, addrEnd);
128+
SPLAPPTRC(L_ERROR, "Process() non-mutating, port 1. Adding count = " << addrRange << ", start = " << std::hex << addrStart << ", end = " << std::hex << addrEnd, IP_FILTER);
129+
for(SPL::uint32 b = addrStart; b < addrEnd; b++) {
130+
ip4List_[ip4ListWSel_]->insert(b);
126131
SPLAPPTRC(L_TRACE, "IPv4 filter: " << "adding: " <<
127-
convertIPV4AddressNumericToString(*it) <<
128-
"(" << *it << ")", IP_FILTER);
132+
convertIPV4AddressNumericToString(b) <<
133+
"(" << b << ")", IP_FILTER);
129134
}
135+
SPLAPPTRC(L_ERROR, "Process() non-mutating, port 1. Done Adding", IP_FILTER);
130136
return;
137+
131138
}
132139
<%}%>
133140
}

com.ibm.streamsx.network/com.ibm.streamsx.network.ipv4/native.function/function.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
<function:description sampleUri="">Returns a list of all IP addresses in the network as uint32 values. The *networkCIDR* argument must be in CIDR format (i.e. 0.0.0.0/24), otherwise an empty list will be returned.</function:description>
4545
<function:prototype>public list&lt;uint32> getAllAddressesInNetworkInt(rstring networkCIDR)</function:prototype>
4646
</function:function>
47+
<function:function>
48+
<function:description sampleUri="">Returns the range of IP addresses in the network as a start and end values. The *networkCIDR* argument must be in CIDR format (i.e. 0.0.0.0/24), otherwise an empty range will be reported.</function:description>
49+
<function:prototype>public uint32 getAddressRangeInNetworkInt(rstring networkCIDR, uint32 addressStart, uint32 addressEnd)</function:prototype>
50+
</function:function>
4751
<function:function>
4852
<function:description>Returns `true` if a valid IPv4 address was provided and the IP address is not a reserved address. Also returns `true` if the IP address is a &quot;6to4 Relay Anycast&quot; address, since these can be globally routed (RFC6890). In all other cases, will return `false`.</function:description>
4953
<function:prototype>public boolean isGlobal(rstring ip)</function:prototype>

com.ibm.streamsx.network/com.ibm.streamsx.network.source/PacketDPDKSource/PacketDPDKSource.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ To verify that 'hugepages' have been allocated, enter this command at a prompt:
183183
DPDK requires several environment variables.
184184
To set them, enter these commands at a prompt, or append them to your $HOME/.bashrc script:
185185

186-
export RTE_SDK=$HOME/dpdk-17.02.1
186+
export RTE_SDK=$HOME/dpdk-17.11.3
187187
[[ $( uname -m ) == &quot;x86_64&quot; ]] &amp;&amp; export RTE_TARGET=x86_64-native-linuxapp-gcc
188188
[[ $( uname -m ) == &quot;ppc64le&quot; ]] &amp;&amp; export RTE_TARGET=ppc_64-power8-linuxapp-gcc
189189
[[ -x /usr/sbin/lspci ]] &amp;&amp; export DPDK_DEVICE=$( /usr/sbin/lspci | grep -i mellanox | gawk '{print $1}' )
@@ -199,15 +199,15 @@ To verify that the environment variables are set, enter this command at a prompt
199199

200200
**installing the DPDK library**
201201

202-
The PacketDPDKSource operator depends upon DPDK library version 17.02.1, available from
202+
The PacketDPDKSource operator depends upon DPDK library version 17.11.3, available from
203203
[http://dpdk.org]. The library must be configured for your machine and ethernet adapter,
204204
and compiled from source code.
205205

206206
To get the DPDK source code, enter these lines at a command prompt:
207207

208208
mkdir -p $RTE_SDK
209-
wget http://fast.dpdk.org/rel/dpdk-17.02.1.tar.xz
210-
tar -x -v -f dpdk-17.02.1.tar.xz -C $RTE_SDK --strip-components=1
209+
wget http://fast.dpdk.org/rel/dpdk-17.11.3.tar.xz
210+
tar -x -v -f dpdk-17.11.3.tar.xz -C $RTE_SDK --strip-components=1
211211

212212
To configure DPDK for your machine, enter these lines at a command prompt:
213213

com.ibm.streamsx.network/impl/include/IPv4AddressFunctions.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,21 @@ namespace com { namespace ibm { namespace streamsx { namespace network { namespa
497497
return addresses;
498498
}
499499

500+
static SPL::uint32 getAddressRangeInNetworkInt(SPL::rstring const & networkCIDR, SPL::uint32 &addressStart, SPL::uint32 &addressEnd)
501+
{
502+
network_cidr resultCIDR;
503+
addressStart = 0; addressEnd = 0;
504+
if(parseNetworkCIDR_(networkCIDR, resultCIDR) == false) return 0;
505+
506+
dec_network_range range;
507+
GET_DEC_NET_RANGE(resultCIDR, range);
508+
509+
addressStart = range.network_start;
510+
addressEnd = range.network_end;
511+
512+
return (range.network_end - range.network_start);
513+
}
514+
500515
static SPL::boolean isGlobal(SPL::rstring const & ip)
501516
{
502517
return isInNetwork("192.88.99.0/24", ip) || !isReserved(ip);

com.ibm.streamsx.network/impl/src/source/dpdk/port-tool/port-tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <rte_cycles.h>
1717
#include <rte_eal.h>
1818
#include <rte_errno.h>
19+
#include <rte_bus_pci.h>
1920
#include <rte_ethdev.h>
2021
#include <rte_lcore.h>
2122
#include <rte_mbuf.h>

com.ibm.streamsx.network/impl/src/source/dpdk/streams_source/init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <rte_cycles.h>
1414
#include <rte_eal.h>
1515
#include <rte_errno.h>
16+
#include <rte_bus_pci.h>
1617
#include <rte_ethdev.h>
1718
#include <rte_lcore.h>
1819
#include <rte_mbuf.h>

com.ibm.streamsx.network/impl/src/source/dpdk/streams_source/streams_source.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ int streams_dpdk_init(const char* buffersizes) {
286286
rte_timer_subsystem_init();
287287
#endif
288288

289-
rte_set_log_level(8);
289+
rte_log_set_global_level(8);
290290

291291
uint32_t nb_ports = rte_eth_dev_count();
292292
if (nb_ports == 0) {

samples/SamplePacketDPDKSource/script/setupDPDK.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ grep -i -h hugepages /sys/devices/system/node/node*/meminfo
128128

129129
step "get DPDK source code, if necessary ..."
130130
[[ -d $RTE_SDK ]] || mkdir -p $RTE_SDK || die "sorry, could not create directory $RTE_SDK"
131-
[[ -f dpdk-17.02.1.tar.xz ]] || wget http://fast.dpdk.org/rel/dpdk-17.02.1.tar.xz || die "sorry, could not get DPDK source code from http://fast.dpdk.org/rel/dpdk-17.02.1.tar.xz"
132-
[[ -f $RTE_SDK/Makefile ]] || tar -x -v -f dpdk-17.02.1.tar.xz -C $RTE_SDK --strip-components=1 || die "sorry, could not unpack DPDK source code"
131+
[[ -f dpdk-17.11.3.tar.xz ]] || wget http://fast.dpdk.org/rel/dpdk-17.11.3.tar.xz || die "sorry, could not get DPDK source code from http://fast.dpdk.org/rel/dpdk-17.11.3.tar.xz"
132+
[[ -f $RTE_SDK/Makefile ]] || tar -x -v -f dpdk-17.11.3.tar.xz -C $RTE_SDK --strip-components=1 || die "sorry, could not unpack DPDK source code"
133133

134134
# patch old DPDK 2.2.0 source code for RHEL/CentOS 7.3
135135

0 commit comments

Comments
 (0)