--- ./net/8021q/vlanproc.c.vlan 2006-09-20 07:42:06.000000000 +0400 +++ ./net/8021q/vlanproc.c 2006-11-07 22:05:30.000000000 +0300 @@ -54,7 +54,7 @@ static int vlandev_seq_show(struct seq_f * Names of the proc directory entries */ -static const char name_root[] = "vlan"; +static const char name_root[] = "net/vlan"; static const char name_conf[] = "config"; /* @@ -143,7 +143,7 @@ void vlan_proc_cleanup(void) remove_proc_entry(name_conf, proc_vlan_dir); if (proc_vlan_dir) - proc_net_remove(name_root); + remove_proc_entry(name_root, NULL); /* Dynamically added entries should be cleaned up as their vlan_device * is removed, so we should not have to take care of it here... @@ -156,9 +156,10 @@ void vlan_proc_cleanup(void) int __init vlan_proc_init(void) { - proc_vlan_dir = proc_mkdir(name_root, proc_net); + proc_vlan_dir = create_proc_glob_entry(name_root, + S_IFDIR|S_IRUGO|S_IXUGO, NULL); if (proc_vlan_dir) { - proc_vlan_conf = create_proc_entry(name_conf, + proc_vlan_conf = create_proc_glob_entry(name_conf, S_IFREG|S_IRUSR|S_IWUSR, proc_vlan_dir); if (proc_vlan_conf) { --- ./net/8021q/vlan.c.vlan 2006-09-20 07:42:06.000000000 +0400 +++ ./net/8021q/vlan.c 2006-11-09 16:50:05.000000000 +0300 @@ -41,8 +41,13 @@ /* Global VLAN variables */ /* Our listing of VLAN group(s) */ +#ifndef CONFIG_VE static struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE]; #define vlan_grp_hashfn(IDX) ((((IDX) >> VLAN_GRP_HASH_SHIFT) ^ (IDX)) & VLAN_GRP_HASH_MASK) +#else +#define vlan_group_hash (get_exec_env()->vlan_group_hash) +#define vlan_grp_hashfn(IDX) ((((IDX) >> VLAN_GRP_HASH_SHIFT_VE) ^ (IDX)) & VLAN_GRP_HASH_MASK_VE) +#endif static char vlan_fullname[] = "802.1Q VLAN Support"; static char vlan_version[] = DRV_VERSION; @@ -474,6 +479,8 @@ static struct net_device *register_vlan_ /* IFF_BROADCAST|IFF_MULTICAST; ??? */ new_dev->flags = real_dev->flags; new_dev->flags &= ~IFF_UP; + if (!ve_is_super(real_dev->owner_env)) + new_dev->features |= NETIF_F_VIRTUAL; new_dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT))) | @@ -693,7 +700,7 @@ static int vlan_ioctl_handler(void __use switch (args.cmd) { case SET_VLAN_INGRESS_PRIORITY_CMD: - if (!capable(CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) return -EPERM; err = vlan_dev_set_ingress_priority(args.device1, args.u.skb_priority, @@ -701,7 +708,7 @@ static int vlan_ioctl_handler(void __use break; case SET_VLAN_EGRESS_PRIORITY_CMD: - if (!capable(CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) return -EPERM; err = vlan_dev_set_egress_priority(args.device1, args.u.skb_priority, @@ -709,7 +716,7 @@ static int vlan_ioctl_handler(void __use break; case SET_VLAN_FLAG_CMD: - if (!capable(CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) return -EPERM; err = vlan_dev_set_vlan_flag(args.device1, args.u.flag, @@ -717,7 +724,7 @@ static int vlan_ioctl_handler(void __use break; case SET_VLAN_NAME_TYPE_CMD: - if (!capable(CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) return -EPERM; if ((args.u.name_type >= 0) && (args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) { @@ -729,7 +736,7 @@ static int vlan_ioctl_handler(void __use break; case ADD_VLAN_CMD: - if (!capable(CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) return -EPERM; /* we have been given the name of the Ethernet Device we want to * talk to: args.dev1 We also have the @@ -743,7 +750,7 @@ static int vlan_ioctl_handler(void __use break; case DEL_VLAN_CMD: - if (!capable(CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN) && !capable(CAP_VE_NET_ADMIN)) return -EPERM; /* Here, the args.dev1 is the actual VLAN we want * to get rid of. --- ./kernel/vecalls.c.vlan 2006-11-07 18:11:03.000000000 +0300 +++ ./kernel/vecalls.c 2006-11-08 18:53:14.000000000 +0300 @@ -2901,7 +2902,8 @@ static int ve_dev_add(envid_t veid, char goto out_unlock; err = -EINVAL; - if (dev->flags & (IFF_SLAVE|IFF_MASTER)) + if ((dev->flags & (IFF_SLAVE|IFF_MASTER)) || + (dev->priv_flags & (IFF_802_1Q_VLAN))) goto out_unlock; /* Check for existence of name */ --- ./include/linux/ve.h.vlan 2006-10-31 19:01:23.000000000 +0300 +++ ./include/linux/ve.h 2006-11-09 16:49:46.000000000 +0300 @@ -100,6 +100,10 @@ struct ve_ip_conntrack { #define UIDHASH_BITS_VE 6 #define UIDHASH_SZ_VE (1 << UIDHASH_BITS_VE) +#define VLAN_GRP_HASH_SHIFT_VE 5 +#define VLAN_GRP_HASH_SIZE_VE (1 << VLAN_GRP_HASH_SHIFT_VE) +#define VLAN_GRP_HASH_MASK_VE (VLAN_GRP_HASH_SIZE_VE - 1) + struct ve_cpu_stats { cycles_t idle_time; cycles_t iowait_time; @@ -209,6 +213,9 @@ struct ve_struct { #endif struct neigh_table *ve_arp_tbl; +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) + struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE_VE]; +#endif /* per VE CPU stats*/ struct timespec start_timespec; u64 start_jiffies; /* Deprecated */