aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/netlink.c
AgeCommit message (Collapse)AuthorFilesLines
2022-01-11linux-cp: Add VPP->Linux synchronizationPim van Pelt1-1/+44
Part 1 -- notes in https://ipng.ch/s/articles/2021/08/13/vpp-2.html Add the ability for VPP to copy out (sync) its state from the dataplane to Linux Interface Pairs, when they exist. Gated by a configuration flag (linux-cp { lcp-sync }), and by a CLI option to toggle on/off, synchronize the following events: - Interface state changes - Interface MTU changes - Interface IPv4/IPv6 address add/deletion In VPP, subints can have any link state and MTU, orthogonal to their phy. In Linux, setting admin-down on a phy forces its children to be down as well. Also, in Linux, MTU of children must not exceed that of the phy. Add a state synchronizer which walks over phy+subints to ensure Linux and VPP end up in the same consistent state. Part 2 -- notes in https://ipng.ch/s/articles/2021/08/15/vpp-3.html Add the ability for VPP to autocreate sub-interfaces of existing Linux Interface pairs. Gated by a configuration flag (linux-cp { lcp-auto-subint }), and by a CLI option to toggle on/off, synchronize the following event: - Sub-interface creation (dot1q, dot1ad, QinQ and QinAD) A few other changes: - Add two functions into netlink.[ch] to delete ip4 and ip6 addresses. - Remove a spurious logline (printing MTU) in netlink.c. - Resolve a TODO around vnet_sw_interface_supports_addressing() Type: improvement Signed-off-by: Pim van Pelt <pim@ipng.nl> Change-Id: I34fc070e80af4013be58d7a8cbf64296cc760e4e Signed-off-by: Pim van Pelt <pim@ipng.nl>
2021-04-08devices: af_packet - use netlink to get/set mtuAloys Augustin1-11/+93
The /sys filesystem is not always accurate when switching network namespaces. Using netlink should work in more situations. Type: improvement Change-Id: I71611f14319820469ea7794eec5b7c6c70e2be6d Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-04-27devices: allow link state down with netlinkMatthew Smith1-1/+1
Type: fix Use the up parameter in vnet_netlink_set_link_state(). It was ignoring the parameter and always setting IFF_UP on an interface. Change-Id: I0d44406d982afbdc43bc6b26d0f22c0bdd47abdc Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-03-13devices: netlink create the object if missingDave Barach1-4/+4
Type: fix Fixes: b49bc1a Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I3dd81a2484c8b4925fd07556576c29d1cde337e1
2020-03-05tap: add support for persistanceMohsin Kazmi1-4/+4
Type: feature Change-Id: I775f53531972447ebae0d69b9e2dfeee84d115e5 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-02-18devices: netlink: add more error loggingMohsin Kazmi1-10/+50
Type: improvement Change-Id: I4d8ca04840845e1ba631e4260e155df2486155e6 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-10-23c11 safe string handling supportDave Barach1-1/+1
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-03-03netlink: Use nl_pid 0 to play nice with others.Jon Loeliger1-1/+1
While the netlink field is named nl_pid, and typically contains a process id, setting it to a pid value directly prevents other modules from also using a netlink socket. On the other hand, setting it to 0 allows multiple modules to use a netlink socket by letting the kernel assign the nl_pid a value. This allows the verito tap code to interact nicely with the router plugin's librtnl after, say, tap-inject has been enabled. Change-Id: I9771929f34d15497a5f7b8c5fd78dac28e31383b Signed-off-by: Jon Loeliger <jdl@netgate.com>
2018-01-18tapv2: add option to set host-side default gwDamjan Marion1-0/+42
Change-Id: I76fd655ecd9445299b94b3b5af10e7b1588584e4 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-12-08tapv2: multiple improvementsDamjan Marion1-51/+86
- change interface naming scheme - rework netlink code - add option to set link address, namespace Change-Id: Icf667babb3077a07617b0b87c45c957e345cb4d1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-12-02tap_v2: multiple improvementsDamjan Marion1-41/+145
- add support for assigning tap interface to the bridge - add support for assigning tap interface host side ip4 and ip6 address - host namespace can be specified as PID (pid:12345) or full path to file - automatically bring linux interface up Change-Id: I1cf7c3cad9a740e430cc1b9c2bb0aad0ba4cc8d8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-12-01virtio: fix coverity warningsSteven1-5/+6
Fix 3 coverity warnings 1. api_format.c: init net_ns = 0 and remove its corresponding vec_add and vec_free 2. netlink.c (reported in tap.c before the code was removed): resource leaked due to fd is not close 3. tap.c: subtract 1 for size when calling strncpy to accommodate the terminated NULL character Change-Id: Iff4e66604862f0c06dac227b8cfd48d3979e41a5 Signed-off-by: Steven <sluong@cisco.com>
2017-11-30tap_v2: move netlink code to separate fileDamjan Marion1-0/+114
Change-Id: Ib091875f77ea99421aec0947fd17833c4e6d2ec2 Signed-off-by: Damjan Marion <damarion@cisco.com>