Hello community,
here is the log from the commit of package rdma-core for openSUSE:Factory checked in at 2018-11-06 14:12:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rdma-core (Old)
and /work/SRC/openSUSE:Factory/.rdma-core.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rdma-core"
Tue Nov 6 14:12:55 2018 rev:25 rq:644615 version:20.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/rdma-core/rdma-core.changes 2018-08-28 09:23:14.932604180 +0200
+++ /work/SRC/openSUSE:Factory/.rdma-core.new/rdma-core.changes 2018-11-06 14:13:20.814745678 +0100
@@ -1,0 +2,11 @@
+Mon Oct 15 08:15:29 UTC 2018 - nmoreychaisemartin@suse.com
+
+- Update to rdma-core v20.1 (fate#325887, fate#325919, fate#326000)
+ * No release notes available
+- Drop patches merged upstream:
+ * suse-Add-recommends-for-rxe_cfg-requirements.patch
+ adds recommends for the relevant packages
+ * rxe-switch-to-iproute2-for-rxe_cfg.patch
+ switches to iproute2 commands
+
+-------------------------------------------------------------------
Old:
----
rdma-core-18.1.0.1f4780139d62.tar.gz
rxe-switch-to-iproute2-for-rxe_cfg.patch
suse-Add-recommends-for-rxe_cfg-requirements.patch
New:
----
rdma-core-20.1.0.222fa83a789c.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rdma-core.spec ++++++
--- /var/tmp/diff_new_pack.dmYPOn/_old 2018-11-06 14:13:33.006729516 +0100
+++ /var/tmp/diff_new_pack.dmYPOn/_new 2018-11-06 14:13:33.010729510 +0100
@@ -17,9 +17,9 @@
%bcond_without systemd
-%define git_ver .0.1f4780139d62
+%define git_ver .0.222fa83a789c
Name: rdma-core
-Version: 18.1
+Version: 20.1
Release: 0
Summary: RDMA core userspace libraries and daemons
License: GPL-2.0-only OR BSD-2-Clause
@@ -50,8 +50,6 @@
Source1: baselibs.conf
Source2: prebuild-pandoc.sh
Source3: prebuilt-pandoc.tgz
-Patch0: rxe-switch-to-iproute2-for-rxe_cfg.patch
-Patch1: suse-Add-recommends-for-rxe_cfg-requirements.patch
BuildRequires: binutils
BuildRequires: cmake >= 2.8.11
BuildRequires: gcc
@@ -169,6 +167,9 @@
Requires: %{mlx4_lname} = %{version}-%{release}
Requires: %{mlx5_lname} = %{version}-%{release}
%endif
+# Recommended packages for rxe_cfg
+Recommends: ethtool
+Recommends: iproute2
%description -n libibverbs
libibverbs is a library that allows userspace processes to use RDMA
@@ -317,8 +318,6 @@
%prep
%setup -q -n %{name}-%{version}%{git_ver}
-%patch0
-%patch1
#Extract prebuilt pandoc file in the buildlib directory
(cd buildlib && tar xf %{S:3})
@@ -531,6 +530,7 @@
%{_includedir}/infiniband/*
%{_includedir}/rdma/*
%{_libdir}/lib*.so
+%{_libdir}/pkgconfig/*.pc
%{_mandir}/man3/ibv_*
%{_mandir}/man3/rdma*
%{_mandir}/man3/umad*
++++++ _service ++++++
--- /var/tmp/diff_new_pack.dmYPOn/_old 2018-11-06 14:13:33.038729473 +0100
+++ /var/tmp/diff_new_pack.dmYPOn/_new 2018-11-06 14:13:33.042729468 +0100
@@ -8,7 +8,7 @@
<param name="versionformat">@PARENT_TAG@.@TAG_OFFSET@.%h</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="versionrewrite-replacement">\1</param>
- <param name="revision">1f4780139d626c9d5cdd8386edf76a1c0043741e</param>
+ <param name="revision">222fa83a789cd24a1e0900389587d47812fba086</param>
<param name="extract">suse/rdma-core.spec</param>
</service>
<service name="recompress" mode="disabled">
++++++ prebuild-pandoc.sh ++++++
--- /var/tmp/diff_new_pack.dmYPOn/_old 2018-11-06 14:13:33.062729441 +0100
+++ /var/tmp/diff_new_pack.dmYPOn/_new 2018-11-06 14:13:33.062729441 +0100
@@ -1,6 +1,6 @@
#!/bin/bash
TARBALL=$(rpmspec --parse rdma-core.spec | grep Source: | awk '{ print $NF}')
-OUTDIR=$(tar tf rdma-core-18.1.0.1f4780139d62.tar.gz | head -n 1)
+OUTDIR=$(tar tf $TARBALL | head -n 1)
rm -Rf $OUTDIR
tar xf $TARBALL
++++++ prebuilt-pandoc.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-prebuilt/6a82b0bc695f8fd980a86aefaf5890804a010761 new/pandoc-prebuilt/6a82b0bc695f8fd980a86aefaf5890804a010761
--- old/pandoc-prebuilt/6a82b0bc695f8fd980a86aefaf5890804a010761 1970-01-01 01:00:00.000000000 +0100
+++ new/pandoc-prebuilt/6a82b0bc695f8fd980a86aefaf5890804a010761 2018-10-15 10:13:55.835298730 +0200
@@ -0,0 +1,47 @@
+.\" Automatically generated by Pandoc 1.19.2.1
+.\"
+.TH "ibv_alloc_null_mr" "3" "2018\-6\-1" "libibverbs" "Libibverbs Programmer\[aq]s Manual"
+.hy
+.SH NAME
+.PP
+ibv_alloc_null_mr \- allocate a null memory region (MR)
+.SH SYNOPSIS
+.IP
+.nf
+\f[C]
+#include\
+
+struct\ ibv_mr\ *ibv_alloc_null_mr(struct\ ibv_pd\ *pd);
+\f[]
+.fi
+.SH DESCRIPTION
+.PP
+\f[B]ibv_alloc_null_mr()\f[] allocates a null memory region (MR) that is
+associated with the protection domain \f[I]pd\f[].
+.PP
+A null MR discards all data written to it, and always returns 0 on read.
+It has the maximum length and only the lkey is valid, the MR is not
+exposed as an rkey.
+.PP
+A device should implement the null MR in a way that bypasses PCI
+transfers, internally discarding or sourcing 0 data.
+This provides a way to avoid PCI bus transfers by using a scatter/gather
+list in commands if applications do not intend to access the data, or
+need data to be 0 filled.
+.PP
+Specifically upon \f[B]ibv_post_send()\f[] the device skips PCI read
+cycles and upon \f[B]ibv_post_recv()\f[] the device skips PCI write
+cycles which finally improves performance.
+.PP
+\f[B]ibv_dereg_mr()\f[] deregisters the MR.
+The use of ibv_rereg_mr() or ibv_bind_mw() with this MR is invalid.
+.SH RETURN VALUE
+.PP
+\f[B]ibv_alloc_null_mr()\f[] returns a pointer to the allocated MR, or
+NULL if the request fails.
+.SH SEE ALSO
+.PP
+\f[B]ibv_reg_mr\f[](3), \f[B]ibv_dereg_mr\f[](3),
+.SH AUTHOR
+.PP
+Yonatan Cohen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-prebuilt/a311edbf9d7180754e6c07a15b6fbab7c36e03e7 new/pandoc-prebuilt/a311edbf9d7180754e6c07a15b6fbab7c36e03e7
--- old/pandoc-prebuilt/a311edbf9d7180754e6c07a15b6fbab7c36e03e7 1970-01-01 01:00:00.000000000 +0100
+++ new/pandoc-prebuilt/a311edbf9d7180754e6c07a15b6fbab7c36e03e7 2018-10-15 10:13:56.459302795 +0200
@@ -0,0 +1,100 @@
+.\" Automatically generated by Pandoc 1.19.2.1
+.\"
+.TH "ibv_create_counters" "3" "2018\-04\-02" "libibverbs" "Libibverbs Programmer\[aq]s Manual"
+.hy
+.SH NAME
+.PP
+\f[B]ibv_create_counters\f[], \f[B]ibv_destroy_counters\f[] \- Create or
+destroy a counters handle
+.SH SYNOPSIS
+.IP
+.nf
+\f[C]
+#include\
+
+struct\ ibv_counters\ *
+ibv_create_counters(struct\ ibv_context\ *context,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ struct\ ibv_counters_init_attr\ *init_attr);
+
+int\ ibv_destroy_counters(struct\ ibv_counters\ *counters);
+\f[]
+.fi
+.SH DESCRIPTION
+.PP
+\f[B]ibv_create_counters\f[]() creates a new counters handle for the
+RDMA device context.
+.PP
+An ibv_counters handle can be attached to a verbs resource (e.g.: QP,
+WQ, Flow) statically when these are created.
+.PP
+For example attach an ibv_counters statically to a Flow (struct
+ibv_flow) during creation of a new Flow by calling
+\f[B]ibv_create_flow()\f[].
+.PP
+Counters are cleared upon creation and values will be monotonically
+increasing.
+.PP
+\f[B]ibv_destroy_counters\f[]() releases the counters handle, user
+should detach the counters object before destroying it.
+.SH ARGUMENTS
+.TP
+.B \f[I]context\f[]
+RDMA device context to create the counters on.
+.RS
+.RE
+.TP
+.B \f[I]init_attr\f[]
+Is an ibv_counters_init_attr struct, as defined in verbs.h.
+.RS
+.RE
+.SS \f[I]init_attr\f[] Argument
+.IP
+.nf
+\f[C]
+struct\ ibv_counters_init_attr\ {
+\ \ \ \ int\ comp_mask;
+};
+\f[]
+.fi
+.TP
+.B \f[I]comp_mask\f[]
+Bitmask specifying what fields in the structure are valid.
+.RS
+.RE
+.SH RETURN VALUE
+.PP
+\f[B]ibv_create_counters\f[]() returns a pointer to the allocated
+ibv_counters object, or NULL if the request fails (and sets errno to
+indicate the failure reason)
+.PP
+\f[B]ibv_destroy_counters\f[]() returns 0 on success, or the value of
+errno on failure (which indicates the failure reason)
+.SH ERRORS
+.TP
+.B ENOSYS
+\f[B]ibv_create_counters\f[]() is not currently supported on this device
+.RS
+.RE
+.TP
+.B ENOMEM
+\f[B]ibv_create_counters\f[]() could not create ibv_counters object, not
+enough memory
+.RS
+.RE
+.TP
+.B EINVAL
+invalid parameter supplied \f[B]ibv_destroy_counters\f[]()
+.RS
+.RE
+.SH EXAMPLE
+.PP
+An example of use of ibv_counters is shown in \f[B]ibv_read_counters\f[]
+.SH SEE ALSO
+.PP
+\f[B]ibv_attach_counters_point_flow\f[], \f[B]ibv_read_counters\f[],
+\f[B]ibv_create_flow\f[]
+.SH AUTHORS
+.PP
+Raed Salem
+.PP
+Alex Rosenbaum
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-prebuilt/bde0f0fb11d80958e182842cb166935bb5be3347 new/pandoc-prebuilt/bde0f0fb11d80958e182842cb166935bb5be3347
--- old/pandoc-prebuilt/bde0f0fb11d80958e182842cb166935bb5be3347 1970-01-01 01:00:00.000000000 +0100
+++ new/pandoc-prebuilt/bde0f0fb11d80958e182842cb166935bb5be3347 2018-10-15 10:13:56.211301179 +0200
@@ -0,0 +1,40 @@
+.\" Automatically generated by Pandoc 1.19.2.1
+.\"
+.TH "IBV_GET_PKEY_INDEX" "3" "2018\-07\-16" "libibverbs" "Libibverbs Programmer\[aq]s Manual"
+.hy
+.SH NAME
+.PP
+ibv_get_pkey_index \- obtain the index in the P_Key table of a P_Key
+.SH SYNOPSIS
+.IP
+.nf
+\f[C]
+#include\
+
+int\ ibv_get_pkey_index(struct\ ibv_context\ *context,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint8_t\ port_num,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ __be16\ pkey);
+\f[]
+.fi
+.SH DESCRIPTION
+.PP
+Every InfiniBand HCA maintains a P_Key table for each of its ports that
+is indexed by an integer and with a P_Key in each element.
+Certain InfiniBand data structures that work with P_Keys expect a P_Key
+index, e.g.
+\f[B]struct ibv_qp_attr\f[] and \f[B]struct ib_mad_addr\f[].
+Hence the function \f[B]ibv_get_pkey_index()\f[] that accepts a P_Key in
+network byte order and that returns an index in the P_Key table as
+result.
+.SH RETURN VALUE
+.PP
+\f[B]ibv_get_pkey_index()\f[] returns the P_Key index on success, and
+\-1 on error.
+.SH SEE ALSO
+.PP
+\f[B]ibv_open_device\f[](3), \f[B]ibv_query_device\f[](3),
+\f[B]ibv_query_gid\f[](3), \f[B]ibv_query_pkey\f[](3),
+\f[B]ibv_query_port\f[](3)
+.SH AUTHOR
+.PP
+Bart Van Assche
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-prebuilt/c6cf51c33703f96d23549f640ab1e80205143daf new/pandoc-prebuilt/c6cf51c33703f96d23549f640ab1e80205143daf
--- old/pandoc-prebuilt/c6cf51c33703f96d23549f640ab1e80205143daf 1970-01-01 01:00:00.000000000 +0100
+++ new/pandoc-prebuilt/c6cf51c33703f96d23549f640ab1e80205143daf 2018-10-15 10:13:55.963299562 +0200
@@ -0,0 +1,150 @@
+.\" Automatically generated by Pandoc 1.19.2.1
+.\"
+.TH "ibv_attach_counters_point_flow" "3" "2018\-04\-02" "libibverbs" "Libibverbs Programmer\[aq]s Manual"
+.hy
+.SH NAME
+.PP
+\f[B]ibv_attach_counters_point_flow\f[] \- attach individual counter
+definition to a flow object
+.SH SYNOPSIS
+.IP
+.nf
+\f[C]
+#include\
+
+int\ ibv_attach_counters_point_flow(struct\ ibv_counters\ *counters,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ struct\ ibv_counter_attach_attr\ *counter_attach_attr,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ struct\ ibv_flow\ *flow);
+\f[]
+.fi
+.SH DESCRIPTION
+.PP
+Attach counters point are a family of APIs to attach individual counter
+description definition to a verb object at a specific index location.
+.PP
+Counters object will start collecting values after it is bound to the
+verb object resource.
+.PP
+A static attach can be created when NULL is provided instead of the
+reference to the verbs object (e.g.: in case of flow providing NULL
+instead of \f[I]flow\f[]).
+In this case, this counters object will only start collecting values
+after it is bound to the verbs resource, for flow this is when
+referencing the counters handle when creating a flow with
+\f[B]ibv_create_flow\f[]().
+.PP
+Once an ibv_counters is bound statically to a verbs resource, no
+additional attach is allowed till the counter object is not bound to any
+verb object.
+.PP
+The argument counter_desc specifies which counter value should be
+collected.
+It is defined in verbs.h as one of the enum ibv_counter_description
+options.
+.PP
+Supported capabilities of specific counter_desc values per verbs object
+can be tested by checking the return value for success or ENOTSUP errno.
+.PP
+Attaching a counters handle to multiple objects of the same type will
+accumulate the values into a single index.
+e.g.: creating several ibv_flow(s) with the same ibv_counters handle
+will collect the values from all relevant flows into the relevant index
+location when reading the values from \f[B]ibv_read_counters\f[](),
+setting the index more than once with different or same counter_desc
+will aggregate the values from all relevant counters into the relevant
+index location.
+.PP
+The runtime values of counters can be read from the hardware by calling
+\f[B]ibv_read_counters\f[]().
+.SH ARGUMENTS
+.TP
+.B \f[I]counters\f[]
+Existing counters to attach new counter point on.
+.RS
+.RE
+.TP
+.B \f[I]counter_attach_attr\f[]
+An ibv_counter_attach_attr struct, as defined in verbs.h.
+.RS
+.RE
+.TP
+.B \f[I]flow\f[]
+Existing flow to attach a new counters point on (in static mode it must
+be NULL).
+.RS
+.RE
+.SS \f[I]counter_attach_attr\f[] Argument
+.IP
+.nf
+\f[C]
+struct\ ibv_counter_attach_attr\ {
+\ \ \ \ enum\ ibv_counter_description\ counter_desc;
+\ \ \ \ uint32_t\ index;
+\ \ \ \ uint32_t\ comp_mask;
+};
+\f[]
+.fi
+.SS \f[I]counter_desc\f[] Argument
+.IP
+.nf
+\f[C]
+enum\ ibv_counter_description\ {
+\ \ \ \ IBV_COUNTER_PACKETS,
+\ \ \ \ IBV_COUNTER_BYTES,
+};
+\f[]
+.fi
+.TP
+.B \f[I]index\f[]
+Desired location of the specific counter at the counters object.
+.RS
+.RE
+.TP
+.B \f[I]comp_mask\f[]
+Bitmask specifying what fields in the structure are valid.
+.RS
+.RE
+.SH RETURN VALUE
+.PP
+\f[B]ibv_attach_counters_point_flow\f[]() returns 0 on success, or the
+value of errno on failure (which indicates the failure reason)
+.SH ERRORS
+.TP
+.B EINVAL
+invalid argument(s) passed
+.RS
+.RE
+.TP
+.B ENOTSUP
+\f[I]counter_desc\f[] is not supported on the requested object
+.RS
+.RE
+.TP
+.B EBUSY
+the counter object is already bound to a flow, additional attach calls
+is not allowed (valid for static attach only)
+.RS
+.RE
+.TP
+.B ENOMEM
+not enough memory
+.RS
+.RE
+.SH NOTES
+.PP
+Counter values in each index location are cleared upon creation when
+calling \f[B]ibv_create_counters\f[]().
+Attaching counters points will only increase these values accordingly.
+.SH EXAMPLE
+.PP
+An example of use of \f[B]ibv_attach_counters_point_flow\f[]() is shown
+in \f[B]ibv_read_counters\f[]
+.SH SEE ALSO
+.PP
+\f[B]ibv_create_counters\f[], \f[B]ibv_destroy_counters\f[],
+\f[B]ibv_read_counters\f[], \f[B]ibv_create_flow\f[]
+.SH AUTHORS
+.PP
+Raed Salem
+.PP
+Alex Rosenbaum
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-prebuilt/e164230e65dc75c7e172012441bcf7a55898ca57 new/pandoc-prebuilt/e164230e65dc75c7e172012441bcf7a55898ca57
--- old/pandoc-prebuilt/e164230e65dc75c7e172012441bcf7a55898ca57 1970-01-01 01:00:00.000000000 +0100
+++ new/pandoc-prebuilt/e164230e65dc75c7e172012441bcf7a55898ca57 2018-10-15 10:13:54.959293023 +0200
@@ -0,0 +1,184 @@
+.\" Automatically generated by Pandoc 1.19.2.1
+.\"
+.TH "ibv_read_counters" "3" "2018\-04\-02" "libibverbs" "Libibverbs Programmer\[aq]s Manual"
+.hy
+.SH NAME
+.PP
+\f[B]ibv_read_counters\f[] \- Read counter values
+.SH SYNOPSIS
+.IP
+.nf
+\f[C]
+#include\
+
+int\ ibv_read_counters(struct\ ibv_counters\ *counters,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint64_t\ *counters_value,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32_t\ ncounters,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32_t\ flags);
+\f[]
+.fi
+.SH DESCRIPTION
+.PP
+\f[B]ibv_read_counters\f[]() returns the values of the chosen counters
+into \f[I]counters_value\f[] array of which can accumulate
+\f[I]ncounters\f[].
+The values are filled according to the configuration defined by the user
+in the \f[B]ibv_attach_counters_point_xxx\f[] functions.
+.SH ARGUMENTS
+.TP
+.B \f[I]counters\f[]
+Counters object to read.
+.RS
+.RE
+.TP
+.B \f[I]counters_value\f[]
+Input buffer to hold read result.
+.RS
+.RE
+.TP
+.B \f[I]ncounters\f[]
+Number of counters to fill.
+.RS
+.RE
+.TP
+.B \f[I]flags\f[]
+Use enum ibv_read_counters_flags.
+.RS
+.RE
+.SS \f[I]flags\f[] Argument
+.TP
+.B IBV_READ_COUNTERS_ATTR_PREFER_CACHED
+Will prefer reading the values from driver cache, else it will do
+volatile hardware access which is the default.
+.RS
+.RE
+.SH RETURN VALUE
+.PP
+\f[B]ibv_read_counters\f[]() returns 0 on success, or the value of errno
+on failure (which indicates the failure reason)
+.SH EXAMPLE
+.PP
+Example: Statically attach counters to a new flow
+.PP
+This example demonstrates the use of counters which are attached
+statically with the creation of a new flow.
+The counters are read from hardware periodically, and finally all
+resources are released.
+.IP
+.nf
+\f[C]
+/*\ create\ counters\ object\ and\ define\ its\ counters\ points\ \ \ \ \ \ \ \ */
+/*\ create\ simple\ L2\ flow\ with\ hardcoded\ MAC,\ and\ a\ count\ action\ */
+/*\ read\ counters\ periodically,\ every\ 1sec,\ until\ loop\ ends\ \ \ \ \ \ */
+/*\ assumes\ user\ prepared\ a\ RAW_PACKET\ QP\ as\ input\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ */
+/*\ only\ limited\ error\ checking\ in\ run\ time\ for\ code\ simplicity\ \ */
+
+#include\
+#include\
+
+/*\ the\ below\ MAC\ should\ be\ replaced\ by\ user\ */
+#define\ FLOW_SPEC_ETH_MAC_VAL\ {
+\ \ \ \ .dst_mac\ =\ {\ 0x00,\ 0x01,\ 0x02,\ 0x03,\ 0x04,0x05},
+\ \ \ \ .src_mac\ =\ {\ 0x00,\ 0x00,\ 0x00,\ 0x00,\ 0x00,\ 0x00},
+\ \ \ \ .ether_type\ =\ 0,\ .vlan_tag\ =\ 0,\ }
+#define\ FLOW_SPEC_ETH_MAC_MASK\ {
+\ \ \ \ .dst_mac\ =\ {\ 0xFF,\ 0xFF,\ 0xFF,\ 0xFF,\ 0xFF,\ 0xFF},
+\ \ \ \ .src_mac\ =\ {\ 0xFF,\ 0xFF,\ 0xFF,\ 0xFF,\ 0xFF,\ 0xFF},
+\ \ \ \ .ether_type\ =\ 0,\ .vlan_tag\ =\ 0,\ }
+
+void\ example_create_flow_with_counters_on_raw_qp(struct\ ibv_qp\ *qp)\ {
+\ \ \ \ int\ idx\ =\ 0;
+\ \ \ \ int\ loop\ =\ 10;
+\ \ \ \ struct\ ibv_flow\ *flow\ =\ NULL;
+\ \ \ \ struct\ ibv_counters\ *counters\ =\ NULL;
+\ \ \ \ struct\ ibv_counters_init_attr\ init_attr\ =\ {0};
+\ \ \ \ struct\ ibv_counter_attach_attr\ attach_attr\ =\ {0};
+
+\ \ \ \ /*\ create\ single\ coutners\ handle\ */
+\ \ \ \ counters\ =\ ibv_create_counters(qp\->context,\ &init_attr);
+
+\ \ \ \ /*\ define\ counters\ points\ */
+\ \ \ \ attach_attr.counter_desc\ =\ IBV_COUNTER_PACKETS;
+\ \ \ \ attach_attr.index\ =\ idx++;
+\ \ \ \ ret\ =\ ibv_attach_counters_point_flow(counters,\ &attach_attr,\ NULL);
+\ \ \ \ if\ (ret\ ==\ ENOTSUP)\ {
+\ \ \ \ \ \ \ \ fprintf(stderr,\ "Attaching\ IBV_COUNTER_PACKETS\ to\ flow\ is\ not\ \\
+supported");
+\ \ \ \ \ \ \ \ exit(1);
+\ \ \ \ }
+\ \ \ \ attach_attr.counter_desc\ =\ IBV_COUNTER_BYTES;
+\ \ \ \ attach_attr.index\ =\ idx++;
+\ \ \ \ ibv_attach_counters_point_flow(counters,\ &attach_attr,\ NULL);
+\ \ \ \ if\ (ret\ ==\ ENOTSUP)\ {
+\ \ \ \ \ \ \ \ fprintf(stderr,\ "Attaching\ IBV_COUNTER_BYTES\ to\ flow\ is\ not\ \\
+supported");
+\ \ \ \ \ \ \ \ exit(1);
+\ \ \ \ }
+
+\ \ \ \ /*\ define\ a\ new\ flow\ attr\ that\ includes\ the\ counters\ handle\ */
+\ \ \ \ struct\ raw_eth_flow_attr\ {
+\ \ \ \ \ \ \ \ struct\ ibv_flow_attr\ \ \ \ \ \ \ \ \ \ \ \ \ \ attr;
+\ \ \ \ \ \ \ \ struct\ ibv_flow_spec_eth\ \ \ \ \ \ \ \ \ \ spec_eth;
+\ \ \ \ \ \ \ \ struct\ ibv_flow_spec_counter_action\ spec_count;
+\ \ \ \ }\ flow_attr\ =\ {
+\ \ \ \ \ \ \ \ .attr\ =\ {
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .comp_mask\ \ =\ 0,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .type\ \ \ \ \ \ \ =\ IBV_FLOW_ATTR_NORMAL,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .size\ \ \ \ \ \ \ =\ sizeof(flow_attr),
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .priority\ \ \ =\ 0,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .num_of_specs\ =\ 2,\ /*\ ETH\ +\ COUNT\ */
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .port\ \ \ \ \ \ \ =\ 1,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .flags\ \ \ \ \ \ =\ 0,
+\ \ \ \ \ \ \ \ \ \ \ \ },
+\ \ \ \ \ \ \ \ .spec_eth\ =\ {
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .type\ =\ IBV_EXP_FLOW_SPEC_ETH,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .size\ =\ sizeof(struct\ ibv_flow_spec_eth),
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .val\ \ =\ FLOW_SPEC_ETH_MAC_VAL,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .mask\ =\ FLOW_SPEC_ETH_MAC_MASK,
+\ \ \ \ \ \ \ \ \ \ \ \ },
+\ \ \ \ \ \ \ \ .spec_count\ =\ {
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .type\ \ \ =\ IBV_FLOW_SPEC_ACTION_COUNT,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .size\ \ \ =\ sizeof(struct\ ibv_flow_spec_counter_action),
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .counters\ =\ counters,\ /*\ attached\ this\ counters\ handle
+to\ the\ newly\ created\ ibv_flow\ */\ }\ };
+
+\ \ \ \ /*\ create\ the\ flow\ */
+\ \ \ \ flow\ =\ ibv_create_flow(qp,\ &flow_attr.attr);
+
+\ \ \ \ /*\ allocate\ array\ for\ counters\ value\ reading\ */
+\ \ \ \ uint64_t\ *counters_value\ =\ malloc(sizeof(uint64_t)\ *\ idx);
+
+\ \ \ \ /*\ periodical\ read\ and\ print\ of\ flow\ counters\ */
+\ \ \ \ while\ (\-\-loop)\ {
+\ \ \ \ \ \ \ \ sleep(1);
+
+\ \ \ \ \ \ \ \ /*\ read\ hardware\ counters\ values\ */
+\ \ \ \ \ \ \ \ ibv_read_counters(counters,\ counters_value,\ idx,
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ IBV_READ_COUNTERS_ATTR_PREFER_CACHED);
+
+\ \ \ \ \ \ \ \ printf("PACKETS\ =\ %"PRIu64",\ BYTES\ =\ %"PRIu64\ \\n",
+\ \ \ \ \ \ \ \ \ \ \ \ counters_value[0],\ counters_value[1]\ );
+\ \ \ \ }
+
+\ \ \ \ /*\ all\ done,\ release\ all\ */
+\ \ \ \ free(counters_value);
+
+\ \ \ \ /*\ destroy\ flow\ and\ detach\ counters\ */
+\ \ \ \ ibv_destroy_flow(flow);
+
+\ \ \ \ /*\ destroy\ counters\ handle\ */
+\ \ \ \ ibv_destroy_counters(counters);
+
+\ \ \ \ return;
+}
+\f[]
+.fi
+.SH SEE ALSO
+.PP
+\f[B]ibv_create_counters\f[], \f[B]ibv_destroy_counters\f[],
+\f[B]ibv_attach_counters_point_flow\f[], \f[B]ibv_create_flow\f[]
+.SH AUTHORS
+.PP
+Raed Salem
+.PP
+Alex Rosenbaum
++++++ rdma-core-18.1.0.1f4780139d62.tar.gz -> rdma-core-20.1.0.222fa83a789c.tar.gz ++++++
++++ 58237 lines of diff (skipped)