From d2b65bb7c8f0e6689682daadd47770c5c40cd85d Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Fri, 27 Jun 2014 23:24:28 +0400 Subject: ipoe: improved vlan monitor Previous version used linear list of vlan monitor enabled interfaces, this caused huge overhead in packet receive path because for each received packet it performed search on linear list to check if vlan monitor is enabled on input device. Current version binds internal structure to net_device->ml_priv so search is not performed more. --- accel-pppd/ctrl/ipoe/ipoe.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'accel-pppd/ctrl/ipoe') diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 9a21c8c3..039a66a9 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -1967,17 +1967,21 @@ void ipoe_vlan_notify(int ifindex, int vid) log_error("ipoe: vlan-mon: %s.%i: interface name is too long\n", ifr.ifr_name, vid); return; } + + log_info2("ipoe: create vlan %s parent %s\n", ifname, ifr.ifr_name); strcpy(ifr.ifr_name, ifname); len = strlen(ifr.ifr_name); - log_info2("ipoe: create vlan %s parent %s\n", ifr.ifr_name, ifname); - if (iplink_vlan_add(ifr.ifr_name, ifindex, vid)) { log_warn("ipoe: vlan-mon: %s: failed to add vlan\n", ifr.ifr_name); return; } + ioctl(sock_fd, SIOCGIFFLAGS, &ifr, sizeof(ifr)); + ifr.ifr_flags |= IFF_UP; + ioctl(sock_fd, SIOCSIFFLAGS, &ifr, sizeof(ifr)); + if (ioctl(sock_fd, SIOCGIFINDEX, &ifr, sizeof(ifr))) { log_error("ipoe: vlan-mon: %s: failed to get interface index\n", ifr.ifr_name); return; -- cgit v1.2.3