Having fou.go build only for linux breaks builds for darwin:
```
$ go build main.go
src/github.com/vishvananda/netlink/fou_unspecified.go:5:15: undefined: Fou
src/github.com/vishvananda/netlink/fou_unspecified.go:9:15: undefined: Fou
src/github.com/vishvananda/netlink/fou_unspecified.go:13:26: undefined: Fou
```
Instead, build fou.go for all platforms since it doesn't have platform-specific code:
```
$ go build main.go
$ ./main
not implemented
```
Testing and functionality for the use of HFSC has been implemented.
The use of service curves is implenented closely as to how they behave
with the TC implementation.
Automated checks and testing were succesful.
chg: addtl comment and made minor logic optimization as disscussed in PR #296
chg: flipped Persist to NonPersist
chg: comments, only unpersist tuntap if flag is set
chg: tuntap persist optional, allow empty intfc name
chg: added conditional build
Signed-off-by: Ralph Schmieder <ralph.schmieder@gmail.com>
Avoid segfaults in certain environments by checking if the Stringer
interface pointer receiver function is `nil` and return "<nil>" in
those scenarios.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Closes#354
Previous attemt to fix#354 was only hiding a true issue with too small
buffer to pick up the message from kernel.
According to https://github.com/vishvananda/netlink/issues/354#issuecomment-401559441
such situation could occur not only during dump of VF list, but also
* statistics
* tc rules and tc filters
* large conn track dump
* rdma resource details dump for debugging
or any other place where kernel can return more data than default (4kB)
sized buffer could hold.
iproute2 in this case for rtnl_dump_filter_l has buffer with size of
16kB, but we don't have distinction between different receiving funcs,
so I'm proposing to stick with original issue cause finder (kudos to
Parav Pandit aka paravmellanox) who is proposing 64kB as a buffer size.
From libnl addr.c comment:
IPv6 sends the local address as IFA_ADDRESS with no
IFA_LOCAL, IPv4 sends both IFA_LOCAL and IFA_ADDRESS
with IFA_ADDRESS being the peer address if they differ
But obviously, IPv6 sends IFA_LOCAL in case of PtP.
From iproute2 manual:
If a peer address is specified, the local address
cannot have a prefix length. The network prefix is
associated with the peer rather than with the local
address.
This patch adds very basic support for getting information about RDMA
networking device; starting with device index, name, firmware version,
node GUID and system image GUID.
This is done through RDMA netlink socket.
RDMA devices are some what similar to Ethernet devices.
However there are few major differences between them.
RDMA devices usually have one or two ports, unlike Ethernet devices.
Each port has its own attributes, state and network addresses which are
different than Ethernet devices (Link and LinkAttrs). They almost don't
overlap with Link and LinkAttrs.
Therefore it doesn't derive Link and LinkAttrs structure; instead they
are represented using RdmaLink and RdmaLinkAttrs.
RdmaLink represents a RDMA device containing its attributes.
All Rdma device communication occurs through rdma subsystem's netlink
socket.
Signed-off-by: Parav Pandit parav@mellanox.com
This patch adds "Hash" attribute that represents the ID of the hash
table with which the filter is associated to U32 struct. If the hash
table is not created yet, a new hash table is created with the
specified ID.
Signed-off-by: Taku Fukushima <taku@soracom.jp>
This patch adds "Divisor" attribute that represents the divisor of the
hash table buckets to U32 struct.
With "Divisor" attribute, only a hash table without its associated
filters can be created. This new capability allows users to construct
the more flexible filter configurations with the hash table that has
the divisor greater than 1, for instance.
Although a hash table is created through the same interfaces as the
filters, it cannot be listed or deleted though the same interfaces as
the filters at this moment. Only real filters can be listed with
FilterList and deleted with FilterDel.
Signed-off-by: Taku Fukushima <taku@soracom.jp>
This patch adds ClassStatistics, a struct that represents the stats
of a class based on genric networking stats for netlink, to ClassAttrs.
The parsers for rtattrs in type of TCA_STATS and TCA_STATS2 are
introduced as well and the stats are appropriately parsed as a part
of ClassAttrs struct.
The practical tests for stats are not contained in this patch yet since
it requires the actual packet sending/receiving in the random timing,
which makes the tests complicated and flaky. Once we figure it out how
to test them in the proper way, they shall be added.
Signed-off-by: Taku Fukushima <taku@soracom.jp>
Add support for setting InfiniBand Node and Port GUID address
configuration of a VF when InfiniBand HCA are used with SR-IOV mode.
Signed-off-by: Parav Pandit <parav@mellanox.com>
The IFLA_* constants in in x/sys/unix were updated to Linux 4.15 in
golang/sys@88d2dcc510, so use these instead of locally duplicating
them.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Currently, Validity and preference information values are ignored in
addrHandle. This adds them to the netlink message when they are passed
by the caller