Hi Nidhia,

I am developing an application in which I need to use both incoming port and 
vlan as the key for the flow table. Port field is available at 24th byte of 
mbuf and vlan(single tagged) will be at 268th byte (128 mbuf + 128 headroom + 
12 ethernet header).
How can I represent this in my config file in the src_mask field?
Is there any way to take these fields separately and keep in headroom and then 
use them to calculate hash for lookup?


[Jasvinder] - If you look at edge_router_upstream.cfg,  pass-through pipeline 
have mask and offset defined for extracting the key from the packet header and 
storing in the headroom at the offset 128. This key is used in 
flow_classification pipeline to classify the flows. You can follow similar 
approach by using pass-through pipeline doing that action at the input port. 
For that, define mask (00000000FFFFFFFF)  and offset fields for extracting the 
vlan-tag from the packet in pass-through pipeline and store at the desired 
offset in the headroom and  prepend the vlan tag  stored in the metadata with 
port id read from mbuf.  In flow-classification pipeline, you can specify the 
headroom offset and mask to read the final key (portid+vlan tag) stored in the 
packet-metadata for classification. 



Thanks for your reply and help.


Regards,
Nidhia Varghese

Reply via email to