Bug 215675
Summary: | Dummy interface is not working properly under VRF, is droping the income data | ||
---|---|---|---|
Product: | Networking | Reporter: | Easynet (devel) |
Component: | IPV4 | Assignee: | Stephen Hemminger (stephen) |
Status: | NEW --- | ||
Severity: | enhancement | CC: | dsahern, hvisage |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://github.com/EasyNetDev/linux-multi-loopback | ||
Kernel Version: | 5.16.X 5.15.x 5.10.x | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Easynet
2022-03-11 19:53:36 UTC
Hi, After some modification to my driver I was able to make it working. If this feature looks promising as a patch or as a new driver to Linux kernel, please take a look to my driver here: https://github.com/EasyNetDev/linux-multi-loopback I'm not a good programmer in for Linux Kernel, but I tried as much as possible to understand the logics behind of the VRF, loopback and dummy driver to be able to implement this additional loopback driver. I did an detailed explanation in README.md the strange behavior of dummy driver under VRF with a more complete scenario using FRRouting. I think there are more pleople trying to find a way to add more loopback interfaces in their Linux router and they will face this issue. Does `ip -s li sh` show tx drops for the dummy interface? Guessing so. dummy interfaces just drop packets; they do not have a xmit function. Hi David, Indeed the dummy interface has xmit to drop the packets. But is very interesting that is working well in default VRF. I checked the drops of the interfaces and are 0: # ip -s li sh lo0 32: lo0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/ether 92:be:12:4b:4d:f6 brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped missed mcast 0 0 0 0 0 0 TX: bytes packets errors dropped carrier collsns 0 0 0 0 0 0 # ip -s li sh lo1 33: lo1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master internet state UNKNOWN mode DEFAULT group default qlen 1000 link/ether 46:f7:a2:61:2d:02 brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped missed mcast 0 0 0 0 0 0 TX: bytes packets errors dropped carrier collsns 14406 147 0 0 0 0 lo0 is i default VRF and lo1 is in internet VRF. For this reason I had to create this additional driver to be able to increase the number of loopbacks in the system and to be able to use them normaly inside of VRFs. Actually there is where dummy interface is supose to drop the packats: static netdev_tx_t dummy_xmit(struct sk_buff *skb, struct net_device *dev) { dev_lstats_add(dev, skb->len); skb_tx_timestamp(skb); dev_kfree_skb(skb); return NETDEV_TX_OK; } static const struct net_device_ops dummy_netdev_ops = { .ndo_init = dummy_dev_init, .ndo_uninit = dummy_dev_uninit, .ndo_start_xmit = dummy_xmit, .ndo_validate_addr = eth_validate_addr, .ndo_set_rx_mode = set_multicast_list, .ndo_set_mac_address = eth_mac_addr, .ndo_get_stats64 = dummy_get_stats64, .ndo_change_carrier = dummy_change_carrier, }; |