Genis, Bala

The API_DOC_Classification
<http://docs.opendataplane.org/master/linux-generic-doxygen-html/group__odp__classification.html#details>
details
section could probably do with this question as part of the description as
it is pretty light on how to use the API right now in the description
section - patch ?

I also realized that the example was not linked into the doc generation and
I sent a patch for that, maybe some words there describing how to achieve
this case using the example would help others ?

Mike


On 11 June 2015 at 09:46, Genís Riera Pérez <genis.riera.pe...@gmail.com>
wrote:

> Hi Bala,
>
> Thank you again for clarify the concepts. Now with odp_pmr_match_t I've
> solved the problem. You were right about the AND operation in the composite
> PMR.
>
> Sorry for my misunderstanding, and thanks again for your help.
>
> Regards,
>
> Genís Riera Pérez
>
> E-mail: genis.riera.pe...@gmail.com
>
> 2015-06-10 17:47 GMT+02:00 Bala Manoharan <bala.manoha...@linaro.org>:
>
>> Hi Genís,
>>
>> Sorry that I had not explained about the second part of your question in
>> the previous mail,
>>
>> The composite pmr (odp_pmr_match_t ) succeeds only if it matches ALL the
>> values in the odp_pmr_set_t it is an AND operation and not an OR operation.
>> The entire set either matches or does not match as a single entity.It is
>> reverse of what you have explained in your mail.
>>
>> So in your case you need to create two composite pmrs using
>> odp_pmr_match_set_create() and attach them to pktio interface using
>> odp_pktio_pmr_match_set_cos() function.
>>
>> Regards,
>> Bala
>>
>> On 10 June 2015 at 19:33, Genís Riera Pérez <genis.riera.pe...@gmail.com>
>> wrote:
>>
>>> Hi Bala,
>>>
>>> First of all, thanks a lot for your response. I think I've explained
>>> myself wrong in the previous mail, so I'll try to express myself in a
>>> better way.
>>>
>>> The scanerio I propose has two filter, eahc one composed by a set of
>>> PMR. The problem is that I want the packet classified in "Queue1" if
>>> matches exactly all PMR in Filter1, or classified in "Queue2" if matches
>>> exactky all PMR in Filter2, or classified in "DefaultQueue" if not matches
>>> any of the specified filters. As an example, imagine that you receive a
>>> packet with the following information:
>>>
>>> - IP source 10.20.30.23
>>> - IP destination 50.60.70.80
>>> - Port source 5432
>>> - Port destination 80
>>> - IP protocol TCP
>>>
>>> This packet will be enqueued on "Queue2" since its IP source does not
>>> match the IP source specified in Filter1 (neither the source port), but the
>>> whole packet matches all PMRs in Filter2, so its classified queue will be
>>> Queue2. However, if you receive the following packet:
>>>
>>> - IP source 1.2.3.23
>>> - IP destination 50.60.70.80
>>> - Port source 5432
>>> - Port destination 80
>>> - IP protocol TCP
>>>
>>> This will be enqueued on "DefaultQueue" because for the Filter1, the IP
>>> destination does not match, and for the Filter2 the IP source does not
>>> match, so at the end this packet does not match completely any of the
>>> filters and will be enqueued on "DefaultQueue".
>>>
>>> As I understand, a composite PMR (odp_pmr_set_t) applies if one of the
>>> PMR belongging to the set matches (an OR operation between PMRs of a
>>> odp_pmr_set_t), but I need to apply an AND operation between PMRs inside a
>>> filter, plus apply an OR operation between the different filters I specify
>>> to the application. Am I right?
>>>
>>> Hope I clarify the problem I try to solve with ODP.
>>>
>>> Regards,
>>>
>>> Genís Riera Pérez
>>>
>>> E-mail: genis.riera.pe...@gmail.com
>>>
>>> 2015-06-10 15:25 GMT+02:00 Bala Manoharan <bala.manoha...@linaro.org>:
>>>
>>>> Hi,
>>>>
>>>> There is a possibility in classification configuration to attach
>>>> multiple PMR rules at the pktio level.
>>>> I believe the above example you have described could be solved using
>>>> the following rules
>>>>
>>>> pmr1 = odp_pmr_create(rule1);
>>>> pmr2 = odp_pmr_create(rule2);
>>>>
>>>> odp_pktio_pmr_match_set_cos(pmr1, src_pktio, cos1);
>>>>
>>>> odp_pktio_pmr_match_set_cos(pmr2, src_pktio, cos2);
>>>>
>>>> With this above configuration the incoming packets will be matched with
>>>> PMR1 and if it does not match it will be matched with PMR2 and if both
>>>> fails the packet will be sent to the default Cos attached with the
>>>> src_pktio.
>>>>
>>>> Please note that since both the PMRs are attached at the same level the
>>>> preference among pmr1 and pmr2 will be implementation dependent.
>>>>
>>>> Hope this helps,
>>>>
>>>> Bala
>>>>
>>>> On 10 June 2015 at 17:23, Genís Riera Pérez <
>>>> genis.riera.pe...@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I've used the linux-generic implementation of ODP since few month ago,
>>>>> and I would like to implement a classification system based on multiple
>>>>> filters. My scenario is as follows (arbitrary example, not real values):
>>>>>
>>>>> Imagine that you want classify packets matching the following set of
>>>>> filters:
>>>>>
>>>>> Filter 1:
>>>>> - IP source 1.2.3.4/24
>>>>> - IP destination 5.6.7.8/24
>>>>> - Port source 2345
>>>>> - Port destination 80
>>>>> - IP protocol TCP
>>>>>
>>>>> If all the above rules from Filter1 matched, the packet will be
>>>>> assigned to the queue "Queue1". if not all the above rules from Filter1
>>>>> matched, try the next filter:
>>>>>
>>>>> Filter2:
>>>>> - IP source 10.20.30.40/24
>>>>> - IP destination 50.60.70.80/24
>>>>> - Port source 5432
>>>>> - Port destination 80
>>>>> - IP protocol TCP
>>>>>
>>>>> If all the above rules from Filter2 matched, the packet will be
>>>>> assigned to the queue "Queue2". If not all the above from FIlter2 matched,
>>>>> assign the packet to a default queue "DefaultQueue".
>>>>>
>>>>> With only one filter, it's easy to accomplish by using the CoS cascade
>>>>> method (odp_cos_pmr_cos() function) and setting a default CoS and queue to
>>>>> the pktio I use in my program. But what about when I want to define more
>>>>> than one filter? I've been working on it for a long time, and I would to
>>>>> ask if someone could help me. Maybe ODP does not support this type of
>>>>> scenarios yet, but it would be fantastic to know from other people that 
>>>>> are
>>>>> currently working on ODP too.
>>>>>
>>>>> Thank you so much, and sorry for my english level, which is not as
>>>>> good as might be expected.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Genís Riera Pérez
>>>>>
>>>>> E-mail: genis.riera.pe...@gmail.com
>>>>>
>>>>> _______________________________________________
>>>>> lng-odp mailing list
>>>>> lng-odp@lists.linaro.org
>>>>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>>>>
>>>>>
>>>>
>>>
>>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>


-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to