[Click] click-devirtualize and kernel 2.6

Beyers Cronje bcronje at gmail.com
Thu Feb 7 13:27:57 EST 2008


Hi Eddie,

Just did a test on one of my own elements and I've run into some errors
again. Are there any recommendations or "gotchas" to know of when coding a
custom element in order for click-devirtualize to support it?

Here is the error I get:

[root at slacker click]# click-devirtualize -f conf/le1000.click | click
While loading package 'clickdv_t_2COpEyFhZH8rwZZl3u6c':
  /usr/local/bin/click-buildtool makepackage -q -C /tmp/clicktmp30201/ -t
userlevel  -w -fno-access-control  clickdv_t_2COpEyFhZH8rwZZl3u6c
clickdv_t_2COpEyFhZH8rwZZl3u6c.u.cc 1>&2
  CXX clickdv_t_2COpEyFhZH8rwZZl3u6c.u.cc
clickdv_t_2COpEyFhZH8rwZZl3u6c.u.cc: In member function 'Packet*
UDevE1000_a_afd::input_pull(int) const':
clickdv_t_2COpEyFhZH8rwZZl3u6c.u.cc:111: error: 'i' was not declared in this
scope
make[1]: *** [clickdv_t_2COpEyFhZH8rwZZl3u6c.u.uo] Error 1


Here is the section in the output file that click-devirtualize generates
that obviously causes the error:

inline Packet *
UDevE1000_a_afd::input_pull(int) const
{
  return input(i).pull();
}


If I just manually change to UDevE1000_a_afd::input_pull(int i) I get
further, but then it spews out a whole list of other errors, so I'm not sure
what the ramifications are by manually changing the output file of
click-devirtualize.

The UDevE1000 element has no elements connected to its input port in the
tested config, its port_count method is defined as:
const char *port_count() const        { return "0-1/0-1"; }
During initialization I check for input port:
      if (ninputs() == 1)
        _tx = true;  // TX path enabled
and then in run_task() something similar to:
      if (_tx)
          p = input(0).pull();


It seems Specializer::create_class(SpecializedClass &spc) line correctly
calls
"  new_cxxc->defun
    (CxxFunction("input_pull", false, "inline Packet *",
         (_ninputs[eindex] ? "(int i) const" : "(int) const"),
         "", ""));
"
but the logic to determine if input_pull is alive might be suspect.

Beyers

On Feb 7, 2008 6:53 PM, Beyers Cronje <bcronje at gmail.com> wrote:

> Thanks Eddie, the simple script now runs 100% !
>
> I'll let you know if more complex scripts give any problems.
>
>
>
> On Feb 7, 2008 9:56 AM, Eddie Kohler <kohler at cs.ucla.edu> wrote:
>
> > There were some parser errors where FromDevice confused Click.  I've
> > fixed a
> > handful of them; maybe that helps?
> >
> > Eddie
> >
> >
> >
> > Beyers Cronje wrote:
> > > I'm getting similar errors when using without the -u tag.
> > >
> > > [root at probe01 click]# cat conf/idle.click
> > > FromDevice(eth0) -> Discard;
> > >
> > > [root at probe01 click]# click-devirtualize -f conf/idle.click >
> > test.click
> > > [root at probe01 click]# click test.click
> > > While loading package 'clickdv_6xFcmX7L8NcDX9nub1PwCb':
> > >   /usr/local/bin/click-buildtool makepackage -q -C /tmp/clicktmp3563/
> > -t
> > > userlevel  -w -fno-access-control  clickdv_6xFcmX7L8NcDX9nub1PwCb
> > > clickdv_6xFcmX7L8NcDX9nub1PwCb.u.cc 1>&2
> > >   CXX clickdv_6xFcmX7L8NcDX9nub1PwCb.u.cc
> > > In file included from clickdv_6xFcmX7L8NcDX9nub1PwCb.u.cc:9:
> > > clickdv_6xFcmX7L8NcDX9nub1PwCb.u.hh:30:2: error: #endif without #if
> > > clickdv_6xFcmX7L8NcDX9nub1PwCb.u.cc:116:23: error: fakepcap.hh: No
> > such file
> > > or directory
> > > clickdv_6xFcmX7L8NcDX9nub1PwCb.u.cc:136:2: error: #endif without #if
> > > clickdv_6xFcmX7L8NcDX9nub1PwCb.u.cc: In member function âvirtual void
> > > FromDevice_a_aFromDevice_a1::selected(int)â:
> > > clickdv_6xFcmX7L8NcDX9nub1PwCb.u.cc:172: error: âfake_pcap_force_ipâ
> > was not
> > > declared in this scope
> > > make[1]: *** [clickdv_6xFcmX7L8NcDX9nub1PwCb.u.uo] Error 1
> > > make: *** [clickdv_6xFcmX7L8NcDX9nub1PwCb.uo] Error 2
> > >   package /tmp/clicktmp3563/clickdv_6xFcmX7L8NcDX9nub1PwCb.uo: cannot
> > open
> > > shared object file: No such file or directory
> > > requirement 'clickdv_6xFcmX7L8NcDX9nub1PwCb' not available
> > > conf/idle.click:1: unknown element class 'FromDevice@@FromDevice at 1'
> > > conf/idle.click:1: unknown element class 'Discard@@Discard at 2'
> > >
> > >
> > >
> > > On Feb 2, 2008 1:23 AM, Giovanni Di Stasi <gdistasi at gmail.com> wrote:
> > >
> > >> Il Tuesday 29 January 2008 20:41:25 hai scritto:
> > >>> Current git should work in both cases; I just verified user level
> > (with
> > >> a
> > >>> simple config).
> > >>>
> > >>> Eddie
> > >>
> > >> I don't know why, but in my case it doesn't work. I get compile
> > errors
> > >> like
> > >> these:
> > >>
> > >> + make clickdv_mODuB8fcPyH3Psd1lP2E4b.uo
> > >> make CLICK_PACKAGE_MAKING=userlevel clickdv_mODuB8fcPyH3Psd1lP2E4b.uo
> > >> make[1]: Entering directory `/tmp/clicktmp4366'
> > >>  CXX clickdv_mODuB8fcPyH3Psd1lP2E4b.u_.cc
> > >> clickdv_mODuB8fcPyH3Psd1lP2E4b.u_.cc:9:45: error:
> > >> clickdv_mODuB8fcPyH3Psd1lP2E4b.hh: Nessun file o directory
> > >> clickdv_mODuB8fcPyH3Psd1lP2E4b.u_.cc:110:20: error: utils.hh: no file
> > or
> > >> directory
> > >> clickdv_mODuB8fcPyH3Psd1lP2E4b.u_.cc:289:25: error: fccapacket.hh: no
> > file
> > >> or
> > >> directory
> > >> clickdv_mODuB8fcPyH3Psd1lP2E4b.u_.cc:605:18: error: def.hh: no file
> > or
> > >> directory
> > >> clickdv_mODuB8fcPyH3Psd1lP2E4b.u_.cc:1153:23: error: fakepcap.hh: no
> > file
> > >> or
> > >> directory
> > >>
> > >> fccapacket.hh, def.hh are header file I include in some of my
> > elements.
> > >> I launched click-devirtualize in this way:
> > >>
> > >> click-devirtualize -u -f click.conf
> > >>
> > >> Everything goes well when I launch click with that configuration.
> > >> Without devirtualization it's very difficult to achieve good
> > performance.
> > >>
> > >>
> > >> I also tried this simple configuration: FromDevice(eth0) -> Discard
> > ->
> > >> Idle
> > >> and tried:
> > >> click-devirtualize -u -f file_conf | click,
> > >> I got compile errors in this case too.
> > >> Is this the right way to use click-devirtualize?
> > >>
> > >> Thanks.
> > >> _______________________________________________
> > >> click mailing list
> > >> click at amsterdam.lcs.mit.edu
> > >> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> > >>
> > > _______________________________________________
> > > click mailing list
> > > click at amsterdam.lcs.mit.edu
> > > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> >
>
>


More information about the click mailing list