[ovs-dev] [PATCH] dp-packet: Introduce dp_packet_batch_add_unsafe().

Ilya Maximets i.maximets at samsung.com
Fri Aug 11 14:41:17 UTC 2017


On 09.08.2017 17:19, Andy Zhou wrote:
>> Maybe I don't fully understand what you're trying to say, but I want to use
>> unsafe function in dpif-netdev for per-flow packet batching (see the patch)
>> and it should not be internal for that case.
>> (It's safe to use unsafe function there because per-flow batches are
>> guaranteed to be less than original rx batch.)
> 
> Let me try again.  As you ave pointed out, it is not really unsafe to
> use the function
> at those calling sites, I think dp_packet_batch_add__() is a suitable
> name. In case
> you prefer a different function name, that's fine too, I just don't
> think unsafe is accurate.

Oh. What I'm trying to achieve:

	1. Eliminate direct usages of batch internal structure.
	2. Don't check the boundaries in
	   lib/dpif-netdev.c:packet_batch_per_flow_update().

The second goal requires existence of the exposed to the end users
function, which will not check the boundaries while adding packet to batch.
dp_packet_batch_add__() is not suitable in this case, because it has
"__" as a suffix and should not be exposed to the end users because of this.

Could you suggest another dp_packet_batch_XXX() name (which can be exposed
to the end user) for the function that doesn't check the boundaries instead
of 'add_unsafe', if you think it is not accurate?


Best regards, Ilya Maximets.


More information about the dev mailing list