Alessio, > when you say > > "You need to also start VPP with: > punt { socket <path to socket>}" > > do you mean to insert the above line in the /etc/vpp/startup.conf ?
yes, you can do that. or you can start VPP in the root build directory with: make run and set the environment variable STARTUP_CONF to point to the configuration file. my startup configuration looks like: unix { interactive startup-config vpe.conf } api-segment { uid otroan gid otroan } punt { socket /tmp/puntsocket} plugins { plugin dpdk_plugin.so { disable } } > What about the socket. Should I bind it to the NIC I am using for vpp or it > is a generic socket? The punt socket is a Unix domain socket. SOCK_DGRAM. > Thanks for the help. In case I will let it work I guess I will publish a > guide on it explaining all the trouble I passed through. Great! Best regards, Ole > > On Tue, Jun 6, 2017 at 10:19 AM, <otr...@employees.org> wrote: > Hi Alessio, > > If you want to extend what I did (with the punt socket. > > You need to also start VPP with: > punt { socket <path to socket>} > > Then you should see the print messages you added in on the VPP console / cli. > > Best regards, > Ole > > > On 5 Jun 2017, at 19:49, Alessio Silvestro <ale.silver...@gmail.com> wrote: > > > > Dear Ole, > > > > In order to avoid problems with vagrant, I installed VPP on ubuntu server > > 16.04. > > > > I start vpp with the command! $ sudo vpp unix interactive. > > > > After configuring correctly the interface I do $ set punt udp 1111 in order > > to accept UDP traffic on the port 1111. > > > > When I send 1 UDP packet I see the following trace: > > > > " > > > > vpp# show trace > > > > ------------------- Start of thread 0 vpp_main ------------------- > > > > Packet 1 > > > > 00:00:49:978247: dpdk-input > > > > GigabitEthernet0/9/0 rx queue 0 > > > > buffer 0x4db5: current data 14, length 46, free-list 0, clone-count 0, > > totlen-nifb 0, trace 0x0 > > > > PKT MBUF: port 0, nb_segs 1, pkt_len 60 > > > > buf_len 2176, data_len 60, ol_flags 0x0, data_off 128, phys_addr > > 0x8ec36d80 > > > > packet_type 0x0 > > > > IP4: 08:00:27:42:3e:65 -> 08:00:27:93:9a:be > > > > UDP: 172.28.128.6 -> 172.28.128.5 > > > > tos 0x00, ttl 64, length 35, checksum 0x49dc > > > > fragment id 0x98a9, flags DONT_FRAGMENT > > > > UDP: 47743 -> 1111 > > > > length 15, checksum 0x8a50 > > > > 00:00:49:978287: ip4-input > > > > UDP: 172.28.128.6 -> 172.28.128.5 > > > > tos 0x00, ttl 64, length 35, checksum 0x49dc > > > > fragment id 0x98a9, flags DONT_FRAGMENT > > > > UDP: 47743 -> 1111 > > > > length 15, checksum 0x8a50 > > > > 00:00:49:978292: ip4-lookup > > > > fib 0 dpo-idx 6 flow hash: 0x00000000 > > > > UDP: 172.28.128.6 -> 172.28.128.5 > > > > tos 0x00, ttl 64, length 35, checksum 0x49dc > > > > fragment id 0x98a9, flags DONT_FRAGMENT > > > > UDP: 47743 -> 1111 > > > > length 15, checksum 0x8a50 > > > > 00:00:49:978297: ip4-local > > > > UDP: 172.28.128.6 -> 172.28.128.5 > > > > tos 0x00, ttl 64, length 35, checksum 0x49dc > > > > fragment id 0x98a9, flags DONT_FRAGMENT > > > > UDP: 47743 -> 1111 > > > > length 15, checksum 0x8a50 > > > > 00:00:49:978299: ip4-udp-lookup > > > > UDP: src-port 47743 dst-port 1111 > > > > 00:00:49:978302: error-punt > > > > ip4-udp-punt: udp port punt > > > > " > > > > which to me looks like the UDP traffic has been correctly received. > > > > My goal is to modify your code, which is at $TOPDIR/vpp/src/vnet/ip/punt.c, > > in order to start and understand how to deploy new code with VPP. > > > > I inserted several clib_warning("I am here") in the code. Then I run > > $TOPDIR/vpp make build-release to compile the new code. However, even if I > > am pretty sure the your code runs because of the trace above, I cannot see > > any output in /var/log/syslog as suggested by Chris nor in the console (I > > run with unix interactive). > > > > Do you have any idea why I cannot see any message in the log and/or how I > > can modify/debug your code with some prints and look at them somewhere? > > > > Thanks for the help. > > > > Best regards, > > Alessio > > > > > > > > On Fri, Jun 2, 2017 at 4:48 PM, <otr...@employees.org> wrote: > > Alessio, > > > > Run in the foreground with unix { interactive }. > > And directly from a the build directory. > > The vagrant stuff is mostly useful for demo and first look. Sounds like you > > really want to do some development. > > > > Cheers, > > Ole > > > > > On 2 Jun 2017, at 13:31, Alessio Silvestro <ale.silver...@gmail.com> > > > wrote: > > > > > > I am running the vagrant machine provided, so I run on Ubuntu 16.04.02 > > > TLS. > > > > > > I tried clib_warning(), clib_unix_warning(), clib_error() and > > > clib_unix_error(). > > > > > > I inserted that line in both vvp/src/vnet/ip/punt.c and > > > vpp/src/vnet/ip/ip4_forward.c in order to be sure that the packet was > > > actually reaching the node. > > > > > > However, there is no sign in /var/log/syslog or anywhere else I can think > > > of about that message > > > > > > Are you sure there is no other place where they can be printed? > > > > > > Thanks for the cooperation, > > > Alessio > > > > > > On Thu, Jun 1, 2017 at 7:26 PM, John Lo (loj) <l...@cisco.com> wrote: > > > The output of clib_warning() call should be in the syslog. If running vpp > > > in Ubuntu, take a look in /var/log/syslog. -John > > > > > > > > > > > > From: vpp-dev-boun...@lists.fd.io [mailto:vpp-dev-boun...@lists.fd.io] On > > > Behalf Of Alessio Silvestro > > > Sent: Thursday, June 01, 2017 12:11 PM > > > To: Luke, Chris <chris_l...@comcast.com> > > > Cc: vpp-dev@lists.fd.io > > > Subject: Re: [vpp-dev] VPP Node Debug > > > > > > > > > > > > I knew VPP run in user space and that printk is not the best option, > > > however from the documentation it is not clear to me how to do that. > > > > > > > > > > > > For example now I inserted the command clib_warning("I am here!") in the > > > node I create -- that from vppctl show trace I can see processes the > > > packets. > > > > > > > > > > > > Where does it prints? > > > > > > > > > > > > Still I cannot figure it out. > > > > > > > > > > > > Thanks, > > > > > > Alessio > > > > > > > > > > > > On Thu, Jun 1, 2017 at 6:00 PM, Luke, Chris <chris_l...@comcast.com> > > > wrote: > > > > > > printk() is typically a kernel thing, no? This isn’t kernel code. 😊 > > > > > > > > > > > > If you just want stuff on the console when running in a debugger, or > > > interactively, clib_warning() may be what you are looking for. > > > > > > > > > > > > Chris. > > > > > > > > > > > > > > > > > > From: vpp-dev-boun...@lists.fd.io [mailto:vpp-dev-boun...@lists.fd.io] On > > > Behalf Of Alessio Silvestro > > > Sent: Thursday, June 1, 2017 10:35 > > > To: vpp-dev@lists.fd.io > > > Subject: [vpp-dev] VPP Node Debug > > > > > > > > > > > > Hi all, > > > > > > > > > > > > I am using this code "https://gerrit.fd.io/r/#/c/6721/" to in order to > > > enable an external process to receive UDP packets. > > > > > > > > > > > > I tried to use printk -- including module.h in the c file. > > > > > > > > > > > > When I compile VPP with: > > > > > > > > > > > > TOPDIR/vpp make build-release > > > > > > > > > > > > I got the following error > > > > > > > > > > > > fatal error: linux/module.h: No such file or directory > > > > > > compilation terminated. > > > > > > > > > > > > Do you have any idea why? > > > > > > > > > > > > Is there a better way to debug the code of a node in VPP? > > > > > > > > > > > > Thanks, > > > > > > Alessio > > > > > > > > > > > > > > > _______________________________________________ > > > vpp-dev mailing list > > > vpp-dev@lists.fd.io > > > https://lists.fd.io/mailman/listinfo/vpp-dev > > > > > >
signature.asc
Description: Message signed with OpenPGP
_______________________________________________ vpp-dev mailing list vpp-dev@lists.fd.io https://lists.fd.io/mailman/listinfo/vpp-dev