[PATCH 1/4] ethdev: introduce encap hash calculation

Thomas Monjalon thomas at monjalon.net
Wed Feb 7 10:25:42 CET 2024


07/02/2024 07:56, Ori Kam:
> Hi Thomas,
> 
> > -----Original Message-----
> > From: Thomas Monjalon <thomas at monjalon.net>
> > Sent: Wednesday, February 7, 2024 12:40 AM
> > 
> > 28/01/2024 10:39, Ori Kam:
> > > During the encapsulation of a packet, it is expected to calculate the
> > > hash value which is based on the original packet (the outer values,
> > > which will become the inner values).
> > 
> > It is not clear what the hash is for.
> 
> Will add explanation.
> 
> > 
> > > The tunnel protocol defines which tunnel field should hold this hash,
> > > but it doesn't define the hash calculation algorithm.
> > 
> > If the hash is stored in the packet header,
> > I expect it to be reproducible when being checked.
> > How the algorithm may be undefined?
> > 
> The hash is not being checked it is used for hash the packets to different queues.
> the actual value is not important. It is critical that all packets that belongs to the same
> flow will have the same hash value.

That's the missing explanation.
Please describe you are talking about an internal hash
used for distributing packet in queues.
You should also explain how it differs from RSS.


> > > An application that uses flow offloads gets the first few packets
> > > and then decides to offload the flow. As a result, there are two
> > > different paths that a packet from a given flow may take.
> > > SW for the first few packets or HW for the rest.
> > > When the packet goes through the SW, the SW encapsulates the packet
> > > and must use the same hash calculation as the HW will do for
> > > the rest of the packets in this flow.
> > >
> > > This patch gives the SW a way to query the hash value
> > > for a given packet as if the packet was passed through the HW.
> > >
> > > Signed-off-by: Ori Kam <orika at nvidia.com>
> > > ---
> > > +Calculate encap hash
> > > +~~~~~~~~~~~~~~~~~~~~
> > > +
> > > +Calculating hash of a packet in SW as it would be calculated in HW for the
> > encap action
> > 
> > We should give the real full name of the flow action.
> > 
> > > +
> > > +When the HW execute an encapsulation action, it may calculate an hash
> > value which is based
> > > +on the original packet. This hash is stored depending on the encapsulation
> > protocol, in one
> > > +of the outer fields.
> > 
> > Give an example of such encapsulation protocol?
> 
> Sure,
> Just to be clear something like this?
> When the HW execute an encapsulation action for example for VXLAN tunnel,, it may ...

I was more thinking about saying which fields are hashed in VXLAN,
and more importantly how/when the hash is used.




More information about the dev mailing list