Re: [Netnice-kernels] Linux NNFS API nearing completion
Status: Alpha
Brought to you by:
taost6
From: Scott B. <sco...@ve...> - 2004-10-28 18:44:26
|
Hi Takashi, I previously replied to your message on the mailing-list and since then have done more in-depth looking at these issues. Some of them I have fixed now and the rest I would offer to fix in the future. I think the problem with the 'type' control file is a bug in nnfs_netnice.c that does not take into account that a string can end in '\n'. In summary, I added the rmdir and follow_link opperations. On Thu, 28 Oct 2004, Takashi Okumura wrote: > hi scott, > > - Directory: /nnfs/procs/[pid] This I would offer to change in the future. > - Directory: /nnfs/procs/[pid]/* > > this issue is not serious, but, you will add other control files, right? > since priority of this part is low, we may skip this part, for now, also. > Also, this I did not change as I _think_ all the required control files are under Linux /proc. > - Directory: /nnfs/procs/[pid]/*/sockets/ > > cann't we cd to the link? > > $ cd lo > lo: Not a directory > $ > I fixed this. I have added the follow_link operation to the per-process and per-socket vif symlinks so now you can do this: [root@tamarack root]# mkdir /nnfs/network/lo/vif1 [root@tamarack root]# cd /nnfs/procs/1911/sockets/3/lo/vif1/ [root@tamarack vif1]# ls bandwidth drops filter port recv send type weight [root@tamarack vif1]# pwd /nnfs/procs/1911/sockets/3/lo/vif1 [root@tamarack vif1]# > - Directory: /nnfs/network/lo > > i tried parameter setting under lo directory. is this expected behavior? > i felt it is not, though i also felt it is easy to fix. > > $ cat type > Non Work Conserving > > $ echo 1 > type; cat type > Block > I believe this happens due to how 'echo' works on Linux. This will also happen on FreeBSD if the value 1 is passed to the os as '1\n' Here, echo is adding a '\n' character to the string. By using 'echo -n' the correct value is parsed: [root@tamarack root]# cd /nnfs/network/lo/vif1/ [root@tamarack vif1]# cat type Non Work-Conserving [root@tamarack vif1]# echo 1 > type; cat type Block [root@tamarack vif1]# echo -n 1 > type; cat type Weighted Fair Queuing [root@tamarack vif1]# > - Directory: /nnfs/network/lo > > mkdir of VIF dir: OK > rmdir of VIF dir: NG? > directory not empty error. > I have fixed this. I have added a stubbed out rmdir operation that allows you to do rm -r on a created vif. However, remember that the vif is not removed internally, the directory is just removed from the filesystem: [root@tamarack lo]# pwd /nnfs/network/lo [root@tamarack lo]# mkdir vif1 [root@tamarack lo]# ls vif1/ bandwidth drops filter port recv send type weight [root@tamarack lo]# rmdir vif1/ rmdir: `vif1/': Directory not empty [root@tamarack lo]# rm -ri vif1/ rm: descend into directory `vif1/'? y rm: remove regular empty file `vif1//filter'? y rm: remove regular empty file `vif1//port'? y rm: remove regular empty file `vif1//drops'? y rm: remove regular empty file `vif1//send'? y rm: remove regular empty file `vif1//recv'? y rm: remove regular empty file `vif1//weight'? y rm: remove regular empty file `vif1//bandwidth'? y rm: remove regular empty file `vif1//type'? y rm: remove directory `vif1/'? y [root@tamarack lo]# > - Kernel build > > can we merge CONFIG_NNFS and CONFIG_NETNICE? > or, do you think we may leave them, for now? > on FreeBSD, we merged the options. > what do you recommend? > This I can do in the future. > - net/core/vif_subr.c > > we completely rewritten vif_rm(). we'll need to fix this, > based on net/vif_suvr.c of FreeBSD5.3. > This I can do in the future. Thanks, Scott Brumbaugh |