• A
    IB/mlx5: Use IP version matching to classify IP traffic · 19cc7524
    Ariel Levkovich 提交于
    This change adds the ability for flow steering to classify IPv4/6
    packets with MPLS tag (Ethertype 0x8847 and 0x8848) as standard IP
    packets and hit IPv4/6 classifed steering rules.
    
    When user added a flow rule with IP classification, driver was
    implicitly adding ethertype matching to the created rule in order
    to distinguish between IPv4 and IPv6 protocols.
    Since IP packets with MPLS tag header have MPLS ethertype, they missed
    the rule and ended up hitting the default filters.
    Such behavior prevented from MPLS packets to undergo inbound traffic
    load balancing flows (if such were defined by configuring RSS) to
    achieve higher throughput - the way that non-MPLS IP packets performed.
    
    Since our device is able to look past the MPLS tag and identify the
    next protocol we introduce this solution which replaces Ethertype
    matching by the device's capability to perform IP version parsing
    and matching in order to distinguish between IPv4 and IPv6.
    Therefore, whenever a flow with IP spec is added and device support IP
    version matching, driver will implicitly add IP version matching to the
    rule (Based on the IP spec type) without Ethertype matching which will
    cause relevant MPLS tagged packets to hit this rule as well.
    Otherwise (device doesn't support IP version matching), we fall back to
    setting Ethertype matching.
    
    If the user's filters specify an L2 ethertype and an IP spec
    the rule will then match both the ethertype and the IP version.
    
    The device's support for IP version matching is reported by the
    device via dedicated capability bit in query_device_cap and named
    outer/inner_ip_version.
    Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
    Signed-off-by: NLeon Romanovsky <leon@kernel.org>
    Signed-off-by: NDoug Ledford <dledford@redhat.com>
    19cc7524
main.c 99.0 KB