On 22 Mar 2023, at 7:21, Chris Mi wrote:

> On 3/16/2023 5:13 PM, Eelco Chaudron wrote:
>> On 1 Mar 2023, at 8:22, Chris Mi wrote:
>>
>>> Initialize psample socket. Add sFlow recv API to receive sampled
>>> packets from psample socket. Add sFow recv wait API to add psample
>>> socket fd to poll list.
>> See some comments inline below. and one question for Ilya ;)
>>
>> //Eelco
>>
>>> Signed-off-by: Chris Mi<c...@nvidia.com>
>>> Reviewed-by: Roi Dayan<r...@nvidia.com>
>>> ---

<SNIP>

>>> +static void
>>> +psample_init(void)
>>> +{
>>> +    unsigned int psample_mcgroup;
>>> +    int err;
>>> +
>>> +    if (!netdev_is_flow_api_enabled()) {
>>> +        VLOG_DBG("Flow API is not enabled.");
>> I think for logs we do not need dots at the end. Ilya what is the general 
>> rule? In this file, most logs do not have a . at the end.
> I'll keep the dot now. If there is a general guide, I'll follow it. šŸ˜‰

I think Ilya replied in a separate email to keep whatever is used in the file.
And it looks like a dot is only used once, so I would suggest removing it.

<SNIP>

>>>
>>> +struct offload_psample {
>>> +    struct nlattr *packet; /* Packet data. */
>>> +    int group_id;          /* Mapping id for sFlow offload. */
>>> +    int iifindex;          /* Input ifindex. */
>> group_id is uint32 should we use that specific type here?
> OK, changed to uint32.
>> Maybe uint16 for iifindex?
> I found most of ovs code uses int. And Linux also uses int. So I think we 
> should keep it.

Well, the kernel used u16 from the TC below, but Iā€™m fine keeping it int.

<SNIP>

>>>
>>> +    upcall->key = NULL;
>>> +    upcall->key_len = 0;
>>> +    upcall->ufid = sflow->ufid;
>>> +    upcall->userdata = sflow->userdata;
>>> +    upcall->actions = sflow->actions;
>> You do not need these here, or you will be passing the wrong actions in 
>> patch 7.
>> The actions you pass are the remaining actions after sflow(), which should 
>> not be executed in user space again for sflow'ed packets.
> It is used to show output tunnel info.

Will follow up as part of patch 3

<SNIP>

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to