[Click] patchless click patches

Ricard Vilalta ricard.vilalta at cttc.es
Wed Nov 17 06:41:15 EST 2010


Sorry Roman, I send this e-mail with an updated version of the followed 
procedure.

I succeeded compiling it for a Ubuntu 10.10, but I needed to make some
hand modifications to get it running.


First of all, ./configure --enable-fixincludes doesn't understand that
we are using patchless, and gives an error about kernel not being
patched (which will mean we cannot compile click-install for example).



I enter linuxmodule folder and type make.

Several errors appear (I introduce my proposed solutions, don't know if they are good enough):




FIRST
______

/include/click/config-linuxmodule.h:174: error: redefinition of typedef
‘uintptr_t’
include/click-linuxmodule/include1/linux/types.h:45: note: previous
declaration of ‘uintptr_t’ was here

I comment line 45 at include/click-linuxmodule/include1/linux/types.h

SECOND
________

include/click-linuxmodule/include1/linux/sysfs.h:25: error: use of enum
‘kobj_ns_type’ without previous declaration

I add to include/click-linuxmodule/include1/linux/kobject.h at line 22:

enum kobj_ns_type {
         KOBJ_NS_TYPE_NONE = 0,
         KOBJ_NS_TYPE_NET,
         KOBJ_NS_TYPES
};

and remove the same text from below.

THIRD
_____

In file included from /home/rvilalta/click-patchless/linuxmodule/../elements/standard/addressinfo.cc:50:
/home/rvilalta/click-patchless/include/click-linuxmodule/include1/linux/netdevice.h: In function ‘const char* netdev_name(const net_device*)’:
/home/rvilalta/click-patchless/include/click-linuxmodule/include1/linux/netdevice.h:2232: error: ‘NETREG_REGISTERED’ was not declared in this scope

I change to net_device::NETREG_REGISTERED at line 2232 of the error file.


FOURTH
______

/home/rvilalta/click-patchless/linuxmodule/../elements/linuxmodule/todevice.cc: In member function ‘virtual bool ToDevice::run_task(Task*)’:
/home/rvilalta/click-patchless/linuxmodule/../elements/linuxmodule/todevice.cc:292: error: ‘struct net_device’ has no member named ‘xmit_lock’
/home/rvilalta/click-patchless/linuxmodule/../elements/linuxmodule/todevice.cc:294: error: ‘struct net_device’ has no member named ‘xmit_lock_owner’
/home/rvilalta/click-patchless/linuxmodule/../elements/linuxmodule/todevice.cc:403: error: ‘struct net_device’ has no member named ‘xmit_lock_owner’
/home/rvilalta/click-patchless/linuxmodule/../elements/linuxmodule/todevice.cc:404: error: ‘struct net_device’ has no member named ‘xmit_lock’


lines 271-275 use txq pointer instead of dev pointer.


line 274 is: # define click_netif_lock(dev, txq)             (txq)->_xmit_lock

lines 403-404 use txq pointer

line 404 is: spin_unlock_bh(&txq->_xmit_lock);

FIFTH
_____

/home/rvilalta/click-patchless/linuxmodule/../elements/linuxmodule/tohost.cc: In member function ‘virtual void ToHost::push(int, Packet*)’:
/home/rvilalta/click-patchless/linuxmodule/../elements/linuxmodule/tohost.cc:197: error: ‘struct sk_buff’ has no member named ‘dst’
/home/rvilalta/click-patchless/linuxmodule/../elements/linuxmodule/tohost.cc:198: error: ‘struct sk_buff’ has no member named ‘dst’
/home/rvilalta/click-patchless/linuxmodule/../elements/linuxmodule/tohost.cc:199: error: ‘struct sk_buff’ has no member named ‘dst’

I add at line 196: #define HAVE_SKB_DST_DROP 1 (I don't know if this is elegant)

SIXTH
_____

/home/rvilalta/click-patchless/linuxmodule/proclikefs.c:22: fatal error: linux/autoconf.h: No such file or directory

I remove line 22


And I finally get a working linuxmodule:

make -C /lib/modules/2.6.35-22-generic/build M=/home/rvilalta/click-patchless/linuxmodule  modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.35-22-generic'
   CC [M]  /home/rvilalta/click-patchless/linuxmodule/proclikefsmod.o
   LD [M]  /home/rvilalta/click-patchless/linuxmodule/click.o
   LD [M]  /home/rvilalta/click-patchless/linuxmodule/proclikefs.o
   Building modules, stage 2.
   MODPOST 2 modules
   CC      /home/rvilalta/click-patchless/linuxmodule/click.mod.o
   LD [M]  /home/rvilalta/click-patchless/linuxmodule/click.ko
   CC      /home/rvilalta/click-patchless/linuxmodule/proclikefs.mod.o
   LD [M]  /home/rvilalta/click-patchless/linuxmodule/proclikefs.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-22-generic'


Hope this is usefull for someone else,

Ricard






>
> I include linux/kobject.h at
> include/click-linuxmodule/include1/linux/sysfs.h
>
>
> Is it possible to use PollDevice with click patchless?
>
> Thanks,
> Ricard
>
>
>
> On 11/11/2010 06:01 PM, Roman Chertov wrote:
>> Ricard,
>>
>> Depending on what kernel you are using, you might not even need patches.  Get
>> the latest source from https://github.com/kohler/click and then try the
>> following "<click_dir>/configure --fix-includes"  If the configure process
>> finishes, then you don't need any patches.  If it fails, then you need to apply
>> the following patches
>> http://www.mail-archive.com/click@amsterdam.lcs.mit.edu/msg04236.html
>> http://www.mail-archive.com/click@amsterdam.lcs.mit.edu/msg04237.html
>> http://www.mail-archive.com/click@amsterdam.lcs.mit.edu/msg04238.html
>> http://www.mail-archive.com/click@amsterdam.lcs.mit.edu/msg04239.html
>> http://www.mail-archive.com/click@amsterdam.lcs.mit.edu/msg04244.html
>>
>> Please let the list know which kernel version you used and if you had to apply
>> the patches.
>>
>> Roman
>>
>>
>> On Thu, 11 Nov 2010 11:34:59 +0100 Ricard Vilalta<ricard.vilalta at cttc.es>   wrote
>>
>>> Hello Roman and everyone,
>>>
>>> Do I only need to apply patch1-2.txt and patch2-2.txt to be able to run
>>> click in kernel mode, without any patch to the kernel?
>>> Thanks for helping a newbie,
>>> Ricard
>>>
>>> P.S. I need to use click in kernel mode in a kernel upper than 2.6.27.
>>>
>>> On 11/03/2010 02:44 AM, Roman Chertov wrote:
>>>> Hello,
>>>>
>>>> This works on Fedora 13 running 2.6.35.8 SMP kernel.  The second patch is
>>>> based
>>>> on patches 2/12 and 3/12 that Joonwoo released.  I had to add the
>>>> NETREG_REGISTERED patch due to scoping issues when an enum declared in
>>>> net_device is used.  Otherwise, the code is same as in github master
>>>> branch.  I
>>>> am not sure if there is a more elegant way to solve that issue.
>>>>
>>>> Roman
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> click mailing list
>>>> click at amsterdam.lcs.mit.edu
>>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>> --
>>> ______________________________________________________________
>>>
>>> Ricard Vilalta
>>> Research Engineer
>>> Optical Networking Area (ONA) http://wikiona.cttc.es/
>>> CTTC - Centre Tecnològic de Telecomunicacions de Catalunya
>>> Parc Mediterrani de la Tecnologia (PMT)
>>> Av. Carl Friedrich Gauss 7,
>>> 08860 Castelldefels (Barcelona), Spain
>>> http://www.cttc.es/
>>> Phone: +34 93 396 71 70 (ext. 2232). Fax: +34 93 645 29 01
>>> E-mail: ricard.vilalta at cttc.es
>


-- 
______________________________________________________________

Ricard Vilalta
Research Engineer
Optical Networking Area (ONA) http://wikiona.cttc.es/
CTTC - Centre Tecnològic de Telecomunicacions de Catalunya
Parc Mediterrani de la Tecnologia (PMT)
Av. Carl Friedrich Gauss 7,
08860 Castelldefels (Barcelona), Spain
http://www.cttc.es/
Phone: +34 93 396 71 70 (ext. 2232). Fax: +34 93 645 29 01
E-mail: ricard.vilalta at cttc.es




More information about the click mailing list