On 6/2/25 12:15 PM, Rukomoinikova Aleksandra wrote:
> Ilya, h! I've been implementing your idea, and it seems to me that the 
> implementation does not justify the functionality: it seems that grep 
> will still be more convenient if we want to filter the output of a 
> single table (for example: --filter=interface(geneve|vxlan - I mean it).

Grep is not more convenient, because if you want to check other fields of
the interface, then you need to add -A/-B to the grep, and then if you
also want to add something else in the match of the same grep command, the
output becomes messy.

> It seems unjustified to take into account all the options for writing 
> tables in ovn/ovs (case, dash, and so on) for this option.

You don't need to manually check for case and dashes.  Just call the
get_table() and it will give you the matching table pointer taking into
account the case, the dashes and the partial matches.  Then you may put
the actual table->name as a key into hash map.  This way it should be
possible to easily lookup filters for the show->table->name.

> I would prefer to make this functionality a separate option.  and in my 
> implementation, I will correct your comments in the original version and 
> implement the output of one row, As in my original idea, what do you think ?

I'd still prefer it to be the same option.

> 
> 
> On 30.05.2025 00:18, Ilya Maximets wrote:
>> On 5/29/25 10:56 PM, Rukomoinikova Aleksandra wrote:
>>> On 29.05.2025 23:48, Ilya Maximets wrote:
>>>> A counteroffer: We have just one option, but if the table is not 
>>>> specified, then
>>>> the filtering happens only at the top level as in your current 
>>>> implementation.
>>>> But if the table is specified, then the filtering happens at the level of 
>>>> that
>>>> particular table.  i.e.  --filter='ch0' in ovn-sbctl will be the same as
>>>> --filter='chassis(ch0)', but I would still be able to use ovs-vsctl with
>>>> --filter='interface(geneve)' to filter out only the geneve interfaces or 
>>>> use
>>>> --filter='port(Port),int(key=123)' to print all the port names, but only 
>>>> print
>>>> tunnel interfaces with the key=123 in them.
>> I suppose in this schema the 'interface(key=123)' and 
>> 'port(Port),int(key=123)'
>> will actually give the same result.  Because we'll be filtering interfaces 
>> out,
>> but not the ports that hold them.  In order to filter out ports that do not 
>> have
>> matching interfaces one will need to use 'port(Interface),int(key=123)'.
>> But that's still makes logical sense, so should be fine.  We may need to add 
>> some
>> examples to the docs.
>>
>>> Yeah, okay, that sounds reasonable, thanks. I will send a new version.
>> Thanks!
>>
>> Best regards, Ilya Maximets.
> 
> 

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

Reply via email to