I have not changed any API - it's only the implementation of an API that has
changed.  What is the use of ip_neighbor_mac() if the caller wants to find
the mac-address and the implementation just returns the mac-address of the
caller's itn entry?  How useful is this?  I can just use itn->itn_mac?  Why
such C++ like object hiding in C code? Anyway, I can leave existing
implementation untouched and develop a new ip_neighbor_find().

 

My goal is simple:  I have an IP/IP6 address and sw_index for use to find an
entry in ARP/ND cache.  On finding the entry, the mac-address of the entry
is returned.  This way if I know IP and egress interface for next-hop, I get
the mac-address for next-hop to forward a packet.

 

I expect the lookup to happen in a worker thread.  I am careful to not
search system-wide ARP/ND cache but only check if an entry exists on an
interface.  In new implementation I will deny the find if a wildcard of
0xffffffff is input for sw_if_index.

 

Thanks,

 

Hemant

 

From: Neale Ranns <ne...@graphiant.com> 
Sent: Friday, April 16, 2021 2:54 PM
To: hem...@mnkcg.com; vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] dst mac-address look up?

 

 

Please don't change the semantics of existing APIs. Add a ip_neighbor_find
API if you need one. 

But what is it you are trying to do? Why are you searching the neighbour
table and in what context; main or worker thread?

 

/neale

 

From: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>  <vpp-dev@lists.fd.io
<mailto:vpp-dev@lists.fd.io> > on behalf of hemant via lists.fd.io
<hemant=mnkcg....@lists.fd.io <mailto:hemant=mnkcg....@lists.fd.io> >
Date: Friday, 16 April 2021 at 19:18
To: hem...@mnkcg.com <mailto:hem...@mnkcg.com>  <hem...@mnkcg.com
<mailto:hem...@mnkcg.com> >, vpp-dev@lists.fd.io
<mailto:vpp-dev@lists.fd.io>  <vpp-dev@lists.fd.io
<mailto:vpp-dev@lists.fd.io> >
Subject: Re: [vpp-dev] dst mac-address look up?

In vpp/src/vnet/ip-neighbor/ip_neighbor.api, I don't see any API to find the
ip-neighbor entry to serve the purpose below.  So, first the doc at the link
below should change because the API does not exist.

Second, I changed, ip_neighbor_get_mac() as follows and now I have an API to
help me get the next-hop mac-address if I have the next-hop IP address and
link-type.  

 

Unless, I missed something, should we consider the code changes below?

 

https://gerrit.fd.io/r/c/vpp/+/32014

 

Thanks,

 

Hemant

 

From: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>  <vpp-dev@lists.fd.io
<mailto:vpp-dev@lists.fd.io> > On Behalf Of hemant via lists.fd.io
Sent: Thursday, April 15, 2021 4:33 PM
To: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io> 
Subject: [vpp-dev] dst mac-address look up?

 

I read this link:
https://fdio-vpp.readthedocs.io/en/latest/gettingstarted/developers/fib20/ar
pentries.html

 

At the end of the page, I see text that says "key for which is {interface,
next-hop, link-type}."

 

I have the data for the above key, but what API do I use to find destination
mac-address?

 

Hemant

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19233): https://lists.fd.io/g/vpp-dev/message/19233
Mute This Topic: https://lists.fd.io/mt/82127329/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to