Add APIs to add and delete a devlink port of specified flavour for a
given devlink device.
Extended test to accept devlink device and sf number parameters from the
test command line.
Signed-off-by: Parav Pandit <parav@nvidia.com>
ipvtap is a similar link type as ipvlan with tap interface.
This patch enables it just like macvtap.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Add optional field in XfrmPolicyTmpl to template code so users can
configure template optional values.
Tested via:
$ go test -exec sudo . -run XfrmPolicyWithOptional
ok github.com/vishvananda/netlink 0.009s
Co-authored-by: Joe Stringer <joe@cilium.io>
Signed-off-by: Joe Stringer <joe@cilium.io>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Commit ec93726159 ("Adds strings translation methods") broke non-Linux
builds by relying on unix constants that are only declared on the linux
platform in the upstream x/sys/unix package.
Other platforms report undefined variables, such as the following:
$ GOOS=darwin go build .
# github.com/vishvananda/netlink
./route.go:17:7: undefined: SCOPE_UNIVERSE
./route.go:19:7: undefined: SCOPE_SITE
./route.go:21:7: undefined: SCOPE_LINK
./route.go:23:7: undefined: SCOPE_HOST
./route.go:25:7: undefined: SCOPE_NOWHERE
./route.go:55:7: undefined: unix.RTPROT_BABEL
./route.go:57:7: undefined: unix.RTPROT_BGP
./route.go:59:7: undefined: unix.RTPROT_BIRD
./route.go:61:7: undefined: unix.RTPROT_BOOT
./route.go:63:7: undefined: unix.RTPROT_DHCP
./route.go:63:7: too many errors
Move the platform-specific implementations to platform-specific files
and add stubs to satisfy other platforms.
Fixes: ec93726159 ("Adds strings translation methods")
Signed-off-by: Joe Stringer <joe@cilium.io>
XfrmState currently doesn't allow setting the mask for the output mark.
As a result, setting an output mark always clears all bits. This commit
adds support for the mask value.
Signed-off-by: Paul Chaignon <paul@cilium.io>
Add a command to get information about a specific devlink port
referenced by device name and port index(bus, device, port index).
Signed-off-by: Parav Pandit <parav@mellanox.com>
There are lots of route metrics to be added, such as rto_min,
quick_ack and so on, and these metrics are useful for users to
tune network performance, so we add all these metrics.
Signed-off-by: bianze <bianze1993@gmail.com>
- Prio and Quantum should be set equal to the input params
- Fix buffer and cbuffer due to incorrect hz
- Fix Xmittime which is also not equal the behavior of c library.
C library converts time to uint32 to drop precision before multiply
tick_in_usec. ref https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/tc/tc_core.c#n62
Creating a veth pair across namespaces now is a multistep process.
Doing it in one shot with this change is clearer as current
namespace never sees peer IF. Also, moving peer into a namespace
may be rather slow, so better avoided.
Strings in GO is not null-terminated while linux is written by
C and strings in C is null-terminated. Request will fail if we
perform rule request with not null-terminated iifname or ofiname,
with error message "no such file or directory".
Signed-off-by: Wu Zongyong <wuzongyong@linux.alibaba.com>
When deserializing a link related netlink message, if no network namespace id
attribute is specified, we need to set it to -1 otherwise it defaults to 0
which is a valid id. Using NewLinkAttrs sets the default values and allows
the user to distinguish an empty value from a missing value
Add a new method to the ConntrackFilter to be able to
filter conntrack entries by Layer 4 protocol and source
and destination port.
Signed-off-by: Antonio Ojea <aojea@redhat.com>