Hi Burt,

Thanks, but then I think you mean the vectors as in src/vppinfra/vec.h
but the discussion here was about how the name "n_vectors" is used in
for example src/vlib/node.h and such places. It's a different thing.

If we have a situation like this, now first described using a picture
without using the word "vector" for anything:

A : [ a1 a2 a3 ]
B : [ b1 b2 b3 b4 ]

Then the above can be described in different ways.

Alternative 1: we can say that A and B are vectors. A is a vector with
3 elements, B is a vector with 4 elements. The number of vectors is 2
(A and B). According to this view, if there was something called
n_vectors then we would say that n_vectors=2.

Alternative 2 (the VPP way): A consists o3 3 vectors, and B consists of
4 vectors. The number of vectors for A is 3, and the number of vectors
for B is 4. A and B each have their own n_vectors values, A has
n_vectors=3 and B has n_vectors=4. At least this is how I think it is
in the VPP source code.

The VPP source code can be confusing if you assume the word "vector" is
used as in alternative 1.

I think the main scenario of interest in VPP is that there is a bunch
of packets that are processed together. You might think that this would
be described as a vector of packets, but the VPP source code instead
describes the individual packets as vectors, so that "number of
vectors" in effect means "number of packets". At least that is how I
think it is.

There is at least one comment in src/vlib/node.h that seems to say
this, it looks like this:

  /* Number of vector elements currently in frame. */
  u16 n_vectors;

So that variable is called n_vectors but according to the comment its
meaning is the number of vector elements rather than the number of
vectors.

Best regards,
Elias

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16016): https://lists.fd.io/g/vpp-dev/message/16016
Mute This Topic: https://lists.fd.io/mt/72667316/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