[vpp-dev] Missing Network and Broadcast address in FIB for interface IP

2017-03-21 Thread Matej Klotton -X (mklotton - PANTHEON TECHNOLOGIES at Cisco)
Hi all,

I have configured on 2 VPP interfaces IP addresses:
set interface ip address GigabitEthernet0/9/0 10.0.0.2/24
set interface ip address GigabitEthernet0/a/0 192.168.0.126/26 (Network: 
192.168.0.64, Broadcast: 192.168.0.127)

When I send to GigabitEthernet0/9/0 interface packet with destination 
192.168.0.64 and 192.168.0.127, the GigabitEthernet0/a/0 interface sends an ARP 
request.
sendp(iface='eth2', x=Ether(src='02:00:00:00:00:02', 
dst='08:00:27:f3:be:f0')/IP(src='10.0.0.1', dst='192.168.0.64'))
sendp(iface='eth2', x=Ether(src='02:00:00:00:00:02', 
dst='08:00:27:f3:be:f0')/IP(src='10.0.0.1', dst='192.168.0.125'))
sendp(iface='eth2', x=Ether(src='02:00:00:00:00:02', 
dst='08:00:27:f3:be:f0')/IP(src='10.0.0.1', dst='192.168.0.126'))
sendp(iface='eth2', x=Ether(src='02:00:00:00:00:02', 
dst='08:00:27:f3:be:f0')/IP(src='10.0.0.1', dst='192.168.0.127'))
sendp(iface='eth2', x=Ether(src='02:00:00:00:00:02', 
dst='08:00:27:f3:be:f0')/IP(src='10.0.0.1', dst='192.168.0.128'))

vpp# show trace
--- Start of thread 0 vpp_main ---
Packet 1

02:34:42:407061: dpdk-input
  GigabitEthernet0/9/0 rx queue 0
  buffer 0x4ccb: current data 14, length 46, free-list 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 0x79433300
packet_type 0x0
  IP4: 02:00:00:00:00:02 -> 08:00:27:f3:be:f0
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.64
tos 0x00, ttl 64, length 20, checksum 0xb000
fragment id 0x0001
02:34:42:407085: ip4-input
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.64
tos 0x00, ttl 64, length 20, checksum 0xb000
fragment id 0x0001
02:34:42:407088: ip4-lookup
  fib 0 dpo-idx 1 flow hash: 0x
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.64
tos 0x00, ttl 64, length 20, checksum 0xb000
fragment id 0x0001
02:34:42:407090: ip4-glean
IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.64
  tos 0x00, ttl 64, length 20, checksum 0xb000
  fragment id 0x0001
02:34:42:407093: GigabitEthernet0/a/0-output
  GigabitEthernet0/a/0
  ARP: 08:00:27:66:b8:57 -> ff:ff:ff:ff:ff:ff
  request, type ethernet/IP4, address size 6/4
  08:00:27:66:b8:57/192.168.0.126 -> 00:00:00:00:00:00/192.168.0.64
02:34:42:407095: error-drop
  ip4-glean: ARP requests sent
02:34:42:407096: GigabitEthernet0/a/0-tx
  GigabitEthernet0/a/0 tx queue 0
  buffer 0x186c6: current data -14, length 42, free-list 0, trace 0x0
  ARP: 08:00:27:66:b8:57 -> ff:ff:ff:ff:ff:ff
  request, type ethernet/IP4, address size 6/4
  08:00:27:66:b8:57/192.168.0.126 -> 00:00:00:00:00:00/192.168.0.64

Packet 2

02:34:42:410263: dpdk-input
  GigabitEthernet0/9/0 rx queue 0
  buffer 0x4ca4: current data 14, length 46, free-list 0, totlen-nifb 0, trace 
0x1
  PKT MBUF: port 0, nb_segs 1, pkt_len 60
buf_len 2176, data_len 60, ol_flags 0x0, data_off 128, phys_addr 0x79432940
packet_type 0x0
  IP4: 02:00:00:00:00:02 -> 08:00:27:f3:be:f0
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.125
tos 0x00, ttl 64, length 20, checksum 0xafc3
fragment id 0x0001
02:34:42:410282: ip4-input
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.125
tos 0x00, ttl 64, length 20, checksum 0xafc3
fragment id 0x0001
02:34:42:410285: ip4-lookup
  fib 0 dpo-idx 1 flow hash: 0x
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.125
tos 0x00, ttl 64, length 20, checksum 0xafc3
fragment id 0x0001
02:34:42:410286: ip4-glean
IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.125
  tos 0x00, ttl 64, length 20, checksum 0xafc3
  fragment id 0x0001
02:34:42:410288: GigabitEthernet0/a/0-output
  GigabitEthernet0/a/0
  ARP: 08:00:27:66:b8:57 -> ff:ff:ff:ff:ff:ff
  request, type ethernet/IP4, address size 6/4
  08:00:27:66:b8:57/192.168.0.126 -> 00:00:00:00:00:00/192.168.0.125
02:34:42:410291: error-drop
  ip4-glean: ARP requests sent
02:34:42:410291: GigabitEthernet0/a/0-tx
  GigabitEthernet0/a/0 tx queue 0
  buffer 0x186ed: current data -14, length 42, free-list 0, trace 0x1
  ARP: 08:00:27:66:b8:57 -> ff:ff:ff:ff:ff:ff
  request, type ethernet/IP4, address size 6/4
  08:00:27:66:b8:57/192.168.0.126 -> 00:00:00:00:00:00/192.168.0.125

Packet 3

02:34:42:414134: dpdk-input
  GigabitEthernet0/9/0 rx queue 0
  buffer 0x4c7d: current data 14, length 46, free-list 0, totlen-nifb 0, trace 
0x2
  PKT MBUF: port 0, nb_segs 1, pkt_len 60
buf_len 2176, data_len 60, ol_flags 0x0, data_off 128, phys_addr 0x79431f80
packet_type 0x0
  IP4: 02:00:00:00:00:02 -> 08:00:27:f3:be:f0
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.126
tos 0x00, ttl 64, length 20, checksum 0xafc2
fragment id 0x0001
02:34:42:414162: ip4-input
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.126
tos 0x00, ttl 64, length 20, checksum 0xafc2
fragment id 0x0001
02:34:42:414165: ip4-lookup
  fib 0 dpo-idx 5 flow hash: 0x
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.126
tos 0x00, ttl 64, length 20, checksum 0xafc2
fragm

Re: [vpp-dev] VPP Python API for create host-interface ?

2017-03-21 Thread otroan
Hi there,

> I am running the latest vpp code from master branch.
> I am looking at the python APIs that vpp provides.
> I am specifically trying to find the API for the following cli command -
> create host-interface  []
> 
> I could not find where exactly this is defined in the json files in 
> /usr/shar/vpp/api/
> Or is this not supported through API ?

Looks like we're not quite consistent on naming.
It is this API you are looking for I think:

/** \brief Create host-interface
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
@param host_if_name - interface name
@param hw_addr - interface MAC
@param use_random_hw_addr - use random generated MAC
*/
define af_packet_create
{
  u32 client_index;
  u32 context;

  u8 host_if_name[64];
  u8 hw_addr[6];
  u8 use_random_hw_addr;
};


Best regards,
Ole


signature.asc
Description: Message signed with OpenPGP
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] vhost user and upstream dpdk

2017-03-21 Thread Kinsella, Ray

+1 to Thomas's comments, completely agree.


Ray K

On 20/03/2017 13:20, Thomas F Herbert wrote:

Damjan,

Thanks for your response. My answer is inline below.

--TFH


On 03/16/2017 02:25 PM, Damjan Marion wrote:



On 16 Mar 2017, at 14:24, Thomas F Herbert
<therb...@redhat.com> wrote:


Do we still have a plan convergence toward upstream DPDK for vhost-user?

This has come up in a discussion in this bugz,
https://bugzilla.redhat.com/show_bug.cgi?id=1422534

and this patch to vhost_user https://gerrit.fd.io/r/#/c/5700/

--TFH



No, we don't have such plans, i don't see a reason why we would invest
significant time in adopting 3rd party library if we have own working
code.

what is your particular concern?

DPDK has had a vhost user implementation for quite some time and it is
used by other projects built on DPDK. It is generally condidered better
to not duplicate similar functionality found in upstream projects. Also,
it is far easier for downstream organizations supporting both DPDK/OVS
and VPP to have a single code base for an identical functaionality.





--
*Thomas F Herbert*
SDN Group
Office of Technology
*Red Hat*


___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev


___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev


Re: [vpp-dev] Make pkg-rpm seems to be failing...

2017-03-21 Thread otroan
Burt,

> Jon's assessment is more accurate than what I wrote previously. That's 
> because I was mashing together two issues that really are separate, but are 
> closely related. In my case, I know I was trying to play a game of using 
> minimal disk space, and I played a game at the start where I determined 
> dependencies manually (as I believe install-dep brings in more than a minimal 
> set.) I must have forgotten which copy I had played this game, and then I 
> complained that install-dep is missing things. And when I realized my error, 
> I felt embarrassed for delivering misinformation. I went overboard in 
> attempting to apologize for my error. But the other issue that Jon, you 
> correctly point out, is that Ole neglected to give any heads up that his 
> change requires re-running make install-dep. So maybe someone who is 120% 
> perfect, after seeing that Ole's change does not "just work" would then read 
> the change, and say, "OH, I need to rerun make install-dep."
> 
> I think the imperfect solution is that next time, the Heads up should appear, 
> at least on this list. Exactly the way Jon suggests.

You are right, I should absolutely have given a heads up. Sorry about that.

Best regards,
Ole

> 
> On Mon, Mar 20, 2017 at 11:53 AM, Jon Loeliger  wrote:
> Burt and Ole,
> 
> On Sun, Mar 19, 2017 at 7:26 AM,  wrote:
> 
> Hmm, so https://gerrit.fd.io/r/#/c/5781/
> isn't sufficient?
> 
> Necessary, yes.  Sufficient?  No.
> 
> On the other hand...
> 
> On Sun, Mar 19, 2017 at 11:51 AM, Burt Silverman  wrote:
> Ugh, I made a terrible bone head mistake... Possibly I never ran make 
> install-dep. Even if I had, I was unaware that it is a good idea to run it 
> again, just to be sure, in a case like this. I probably thought it was like 
> make bootstrap, where running a 2nd time doesn't help. Apologies to Ed and 
> Ole for misinformation. So, Jon, were you in the same boat with me -- didn't 
> do a double check of make install-dep? I guess so, because you still had the 
> problem after Ole's fix.
> 
> Burt
> 
> This was precisely the problem here.  I'll try to say this as
> politely as I can...  Wow.  That's some blind-siding sh*t.
> 
> So, let's talk about that a bit.
> 
> First, thank you for identifying the issue!  This does indeed
> fix the build locally, and bring us back to online par. Thank you!
> 
> Second, the notion of requiring repeated running of the make
> install-dep target as part of our daily build process from our
> CI engine is just not going to happen.  NFW.  We're not running
> anything has root like that.  It's a bad idea for many reasons.
> 
> On the flip side, I can make a job that "notices" a change in the
> installed packaged requirement and run that as, say, a daily job
> and incidentally notice that updates are needed.  Sure, polling
> like that sucks; an interrupt here with a simple "Heads up!  The
> install-deps have changed" would have been awesome!
> 
> Thanks,
> jdl
> 
> 



signature.asc
Description: Message signed with OpenPGP
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] i cannot change vlib_buffer_t to rte_mbuf correctly

2017-03-21 Thread Damjan Marion

Hi Rujan,

Can you please explain what you are trying to do here.

You cannot assume inside VPP code that rte_mbuf is present and even if it is 
present, that it is filled by real data.
Locally originated packets and packets coming from non-dpdk sources simply 
don't have rte_mbuf initialized.

rte_mbuf header is constructed inside TX code based on data from vlib_buffer_t 
so typically it is enough to modify
vlib_buffer_t fields.

Hope this explains,

Damjan

> On 21 Mar 2017, at 06:45, Li, Rujun  wrote:
> 
> Hi all
>  
> I have a vlib_buffer_t packets (in GDB) looks like:
>  
> $37 = {cacheline0 = 0x7fff54716f00 "\362\377*", current_data = -14,
>   current_length = 42, flags = 0, free_list_index = 0,
>   total_length_not_including_first_buffer = 0, next_buffer = 0,
>   trace_index = 0, clone_count = 0, error = 401409, opaque = {0, 5, 3, 3, 2,
> 0, 0, 0}, cacheline1 = 0x7fff54716f40 "", opaque2 = {
> 0 }, cacheline2 = 0x7fff54716f80 "",
>   pre_data = '\000' , 
> "\377\377\377\377\377\377\000\036g\246{\356\b\006", data = 0x7fff54717000 ""}
> it is an arp-boardcast packet
>  
> and I want to change it into rte_mbuf *, so I called 
> rte_mbuf_from_vlib_buffer(b)
>  
> but the changed rte_mbuf (in GDB) looks like:
>  
> $38 = {cacheline0 = 0x7fff54716e80, buf_addr = 0x0, buf_physaddr = 0,
>   buf_len = 0, rearm_data = 0x7fff54716e92 "", data_off = 0, {refcnt_atomic = 
> {
>   cnt = 0}, refcnt = 0}, nb_segs = 0 '\000', port = 0 '\000',
>   ol_flags = 0, rx_descriptor_fields1 = 0x7fff54716ea0, {packet_type = 0, {
>   l2_type = 0, l3_type = 0, l4_type = 0, tun_type = 0, inner_l2_type = 0,
>   inner_l3_type = 0, inner_l4_type = 0}}, pkt_len = 0, data_len = 0,
>   vlan_tci = 0, hash = {rss = 0, fdir = {{{hash = 0, id = 0}, lo = 0},
>   hi = 0}, sched = {lo = 0, hi = 0}, usr = 0}, seqn = 0,
>   vlan_tci_outer = 0, cacheline1 = 0x7fff54716ec0, {userdata = 0x0,
> udata64 = 0}, pool = 0x0, next = 0x0, {tx_offload = 0, {l2_len = 0,
>   l3_len = 0, l4_len = 0, tso_segsz = 0, outer_l3_len = 0,
>   outer_l2_len = 0}}, priv_size = 0, timesync = 0}
>  
> my code is :
>   struct rte_mbuf * mb;
>   mb = (((struct rte_mbuf *)b) - 1);
> //mb = rte_mbuf_from_vlib_buffer(b); I have also tried this way
>   rte_pktmbuf_data_len(mb) = b->current_length;
>   mb->pkt_len = b->current_data;
>   mb->data_off = 128 + b->current_data;
>  
> the result may not correct, do you know why?
>  
>  
>  
> Best wishes,
> Rujun, Li
>  
> ___
> vpp-dev mailing list
> vpp-dev@lists.fd.io 
> https://lists.fd.io/mailman/listinfo/vpp-dev 
> 
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] [csit-dev] Missing Network and Broadcast address in FIB for interface IP

2017-03-21 Thread Neale Ranns (nranns)
Hi Matej,

We can add those /32 prefixes to drop packets.

/neale

From:  on behalf of "Matej Klotton -X (mklotton - 
PANTHEON TECHNOLOGIES at Cisco)" 
Date: Tuesday, 21 March 2017 at 12:24
To: "vpp-dev@lists.fd.io" 
Cc: "csit-...@lists.fd.io" 
Subject: [csit-dev] Missing Network and Broadcast address in FIB for interface 
IP

Hi all,

I have configured on 2 VPP interfaces IP addresses:
set interface ip address GigabitEthernet0/9/0 10.0.0.2/24
set interface ip address GigabitEthernet0/a/0 192.168.0.126/26 (Network: 
192.168.0.64, Broadcast: 192.168.0.127)

When I send to GigabitEthernet0/9/0 interface packet with destination 
192.168.0.64 and 192.168.0.127, the GigabitEthernet0/a/0 interface sends an ARP 
request.
sendp(iface='eth2', x=Ether(src='02:00:00:00:00:02', 
dst='08:00:27:f3:be:f0')/IP(src='10.0.0.1', dst='192.168.0.64'))
sendp(iface='eth2', x=Ether(src='02:00:00:00:00:02', 
dst='08:00:27:f3:be:f0')/IP(src='10.0.0.1', dst='192.168.0.125'))
sendp(iface='eth2', x=Ether(src='02:00:00:00:00:02', 
dst='08:00:27:f3:be:f0')/IP(src='10.0.0.1', dst='192.168.0.126'))
sendp(iface='eth2', x=Ether(src='02:00:00:00:00:02', 
dst='08:00:27:f3:be:f0')/IP(src='10.0.0.1', dst='192.168.0.127'))
sendp(iface='eth2', x=Ether(src='02:00:00:00:00:02', 
dst='08:00:27:f3:be:f0')/IP(src='10.0.0.1', dst='192.168.0.128'))

vpp# show trace
--- Start of thread 0 vpp_main ---
Packet 1

02:34:42:407061: dpdk-input
  GigabitEthernet0/9/0 rx queue 0
  buffer 0x4ccb: current data 14, length 46, free-list 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 0x79433300
packet_type 0x0
  IP4: 02:00:00:00:00:02 -> 08:00:27:f3:be:f0
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.64
tos 0x00, ttl 64, length 20, checksum 0xb000
fragment id 0x0001
02:34:42:407085: ip4-input
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.64
tos 0x00, ttl 64, length 20, checksum 0xb000
fragment id 0x0001
02:34:42:407088: ip4-lookup
  fib 0 dpo-idx 1 flow hash: 0x
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.64
tos 0x00, ttl 64, length 20, checksum 0xb000
fragment id 0x0001
02:34:42:407090: ip4-glean
IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.64
  tos 0x00, ttl 64, length 20, checksum 0xb000
  fragment id 0x0001
02:34:42:407093: GigabitEthernet0/a/0-output
  GigabitEthernet0/a/0
  ARP: 08:00:27:66:b8:57 -> ff:ff:ff:ff:ff:ff
  request, type ethernet/IP4, address size 6/4
  08:00:27:66:b8:57/192.168.0.126 -> 00:00:00:00:00:00/192.168.0.64
02:34:42:407095: error-drop
  ip4-glean: ARP requests sent
02:34:42:407096: GigabitEthernet0/a/0-tx
  GigabitEthernet0/a/0 tx queue 0
  buffer 0x186c6: current data -14, length 42, free-list 0, trace 0x0
  ARP: 08:00:27:66:b8:57 -> ff:ff:ff:ff:ff:ff
  request, type ethernet/IP4, address size 6/4
  08:00:27:66:b8:57/192.168.0.126 -> 00:00:00:00:00:00/192.168.0.64

Packet 2

02:34:42:410263: dpdk-input
  GigabitEthernet0/9/0 rx queue 0
  buffer 0x4ca4: current data 14, length 46, free-list 0, totlen-nifb 0, trace 
0x1
  PKT MBUF: port 0, nb_segs 1, pkt_len 60
buf_len 2176, data_len 60, ol_flags 0x0, data_off 128, phys_addr 0x79432940
packet_type 0x0
  IP4: 02:00:00:00:00:02 -> 08:00:27:f3:be:f0
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.125
tos 0x00, ttl 64, length 20, checksum 0xafc3
fragment id 0x0001
02:34:42:410282: ip4-input
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.125
tos 0x00, ttl 64, length 20, checksum 0xafc3
fragment id 0x0001
02:34:42:410285: ip4-lookup
  fib 0 dpo-idx 1 flow hash: 0x
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.125
tos 0x00, ttl 64, length 20, checksum 0xafc3
fragment id 0x0001
02:34:42:410286: ip4-glean
IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.125
  tos 0x00, ttl 64, length 20, checksum 0xafc3
  fragment id 0x0001
02:34:42:410288: GigabitEthernet0/a/0-output
  GigabitEthernet0/a/0
  ARP: 08:00:27:66:b8:57 -> ff:ff:ff:ff:ff:ff
  request, type ethernet/IP4, address size 6/4
  08:00:27:66:b8:57/192.168.0.126 -> 00:00:00:00:00:00/192.168.0.125
02:34:42:410291: error-drop
  ip4-glean: ARP requests sent
02:34:42:410291: GigabitEthernet0/a/0-tx
  GigabitEthernet0/a/0 tx queue 0
  buffer 0x186ed: current data -14, length 42, free-list 0, trace 0x1
  ARP: 08:00:27:66:b8:57 -> ff:ff:ff:ff:ff:ff
  request, type ethernet/IP4, address size 6/4
  08:00:27:66:b8:57/192.168.0.126 -> 00:00:00:00:00:00/192.168.0.125

Packet 3

02:34:42:414134: dpdk-input
  GigabitEthernet0/9/0 rx queue 0
  buffer 0x4c7d: current data 14, length 46, free-list 0, totlen-nifb 0, trace 
0x2
  PKT MBUF: port 0, nb_segs 1, pkt_len 60
buf_len 2176, data_len 60, ol_flags 0x0, data_off 128, phys_addr 0x79431f80
packet_type 0x0
  IP4: 02:00:00:00:00:02 -> 08:00:27:f3:be:f0
  IP6_HOP_BY_HOP_OPTIONS: 10.0.0.1 -> 192.168.0.126
tos 0x00, ttl 64, length 20, checksum 0xafc2
fragment id 0x0001

Re: [vpp-dev] VPP Python API for create host-interface ?

2017-03-21 Thread Shravan Ambati
Thanks Ole! 
I did try it before. I ran into issues when I invoke the API.

>>> r = vpp.af_packet_create(veth0-craft0)
Traceback (most recent call last):
File "", line 1, in 
NameError: name 'veth0' is not defined

>>> r = vpp.af_packet_create('veth0-craft0')
Traceback (most recent call last):
File "", line 1, in 
TypeError: () takes exactly 0 arguments (1 given)

>>> r = vpp.af_packet_create(1)
Traceback (most recent call last):
File "", line 1, in 
TypeError: () takes exactly 0 arguments (1 given)

I am a python newbie, so please excuse my naïve question. 
This is probably not a vpp issue. I must be invoking the Api wrong way. 
Do you happen to know by any chance what is the right way to invoke it? 


Thanks
Shravan 


-Original Message-
From: otr...@employees.org [mailto:otr...@employees.org] 
Sent: Tuesday, March 21, 2017 5:33 AM
To: Shravan Ambati 
Cc: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] VPP Python API for create host-interface ?

Hi there,

> I am running the latest vpp code from master branch.
> I am looking at the python APIs that vpp provides.
> I am specifically trying to find the API for the following cli command 
> - create host-interface  []
> 
> I could not find where exactly this is defined in the json files in 
> /usr/shar/vpp/api/ Or is this not supported through API ?

Looks like we're not quite consistent on naming.
It is this API you are looking for I think:

/** \brief Create host-interface
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
@param host_if_name - interface name
@param hw_addr - interface MAC
@param use_random_hw_addr - use random generated MAC */ define 
af_packet_create {
  u32 client_index;
  u32 context;

  u8 host_if_name[64];
  u8 hw_addr[6];
  u8 use_random_hw_addr;
};


Best regards,
Ole
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev


[vpp-dev] RC1 today 22nd of March

2017-03-21 Thread otroan
Just a reminder of the RC1 milestone today.
Let me know if there are urgent fixes you require to get in, otherwise I will 
notify when the release branch is pulled.

Ole


signature.asc
Description: Message signed with OpenPGP
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] VPP Python API for create host-interface ?

2017-03-21 Thread Keith Burns
Check what the name of the system interface is:

ip -o a

We don't create the veth pair for you, so once you do this with "ip link"
and ostensibly move one end into a netns, the other end is the one you add
to VPP.



On Mar 21, 2017 2:06 PM, "Shravan Ambati"  wrote:

> Thanks Ole!
> I did try it before. I ran into issues when I invoke the API.
>
> >>> r = vpp.af_packet_create(veth0-craft0)
> Traceback (most recent call last):
> File "", line 1, in 
> NameError: name 'veth0' is not defined
>
> >>> r = vpp.af_packet_create('veth0-craft0')
> Traceback (most recent call last):
> File "", line 1, in 
> TypeError: () takes exactly 0 arguments (1 given)
>
> >>> r = vpp.af_packet_create(1)
> Traceback (most recent call last):
> File "", line 1, in 
> TypeError: () takes exactly 0 arguments (1 given)
>
> I am a python newbie, so please excuse my naïve question.
> This is probably not a vpp issue. I must be invoking the Api wrong way.
> Do you happen to know by any chance what is the right way to invoke it?
>
>
> Thanks
> Shravan
>
>
> -Original Message-
> From: otr...@employees.org [mailto:otr...@employees.org]
> Sent: Tuesday, March 21, 2017 5:33 AM
> To: Shravan Ambati 
> Cc: vpp-dev@lists.fd.io
> Subject: Re: [vpp-dev] VPP Python API for create host-interface ?
>
> Hi there,
>
> > I am running the latest vpp code from master branch.
> > I am looking at the python APIs that vpp provides.
> > I am specifically trying to find the API for the following cli command
> > - create host-interface  []
> >
> > I could not find where exactly this is defined in the json files in
> > /usr/shar/vpp/api/ Or is this not supported through API ?
>
> Looks like we're not quite consistent on naming.
> It is this API you are looking for I think:
>
> /** \brief Create host-interface
> @param client_index - opaque cookie to identify the sender
> @param context - sender context, to match reply w/ request
> @param host_if_name - interface name
> @param hw_addr - interface MAC
> @param use_random_hw_addr - use random generated MAC */ define
> af_packet_create {
>   u32 client_index;
>   u32 context;
>
>   u8 host_if_name[64];
>   u8 hw_addr[6];
>   u8 use_random_hw_addr;
> };
>
>
> Best regards,
> Ole
> ___
> vpp-dev mailing list
> vpp-dev@lists.fd.io
> https://lists.fd.io/mailman/listinfo/vpp-dev
>
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] VPP Python API for create host-interface ?

2017-03-21 Thread Gabriel Ganne
Hi,

You should name the arguments you pass to the functions.
If you haven't yet, I advise you to have a look here : 
https://wiki.fd.io/view/VPP/Python_API which contains some small samples using 
the python API.

Regards,

-Original Message-
From: vpp-dev-boun...@lists.fd.io [mailto:vpp-dev-boun...@lists.fd.io] On 
Behalf Of Shravan Ambati
Sent: mardi 21 mars 2017 22:07
To: otr...@employees.org
Cc: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] VPP Python API for create host-interface ?

Thanks Ole! 
I did try it before. I ran into issues when I invoke the API.

>>> r = vpp.af_packet_create(veth0-craft0)
Traceback (most recent call last):
File "", line 1, in 
NameError: name 'veth0' is not defined

>>> r = vpp.af_packet_create('veth0-craft0')
Traceback (most recent call last):
File "", line 1, in 
TypeError: () takes exactly 0 arguments (1 given)

>>> r = vpp.af_packet_create(1)
Traceback (most recent call last):
File "", line 1, in 
TypeError: () takes exactly 0 arguments (1 given)

I am a python newbie, so please excuse my naïve question. 
This is probably not a vpp issue. I must be invoking the Api wrong way. 
Do you happen to know by any chance what is the right way to invoke it? 


Thanks
Shravan 


-Original Message-
From: otr...@employees.org [mailto:otr...@employees.org]
Sent: Tuesday, March 21, 2017 5:33 AM
To: Shravan Ambati 
Cc: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] VPP Python API for create host-interface ?

Hi there,

> I am running the latest vpp code from master branch.
> I am looking at the python APIs that vpp provides.
> I am specifically trying to find the API for the following cli command
> - create host-interface  []
> 
> I could not find where exactly this is defined in the json files in 
> /usr/shar/vpp/api/ Or is this not supported through API ?

Looks like we're not quite consistent on naming.
It is this API you are looking for I think:

/** \brief Create host-interface
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
@param host_if_name - interface name
@param hw_addr - interface MAC
@param use_random_hw_addr - use random generated MAC */ define 
af_packet_create {
  u32 client_index;
  u32 context;

  u8 host_if_name[64];
  u8 hw_addr[6];
  u8 use_random_hw_addr;
};


Best regards,
Ole
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev