[ovs-dev] [PATCH] netdev-offload-dpdk: Fix some cases all ethernet packets will be hw dropped.

Eli Britstein elibr at mellanox.com
Wed May 27 04:45:02 UTC 2020


On 4/18/2020 6:24 AM, JackerDune wrote:
> uplink-local (ip) <—> uplink <—> gw(gwip)
>
> When i use mlx5's vf and pf to offload my flow, i found my host vf ip can not get
> arp response of gw's ip, when i turn off offload, all works fine.
>
> I check ovs dpcls rules, find arp request flow is offloaded and flow counters increased
> normally. Then i open dpdk offload debug info, and find that all ethernet packets in
> uplink had been hardware dropped.
>
> The reason is when offload ethernet head, we do not care about dl_type field, because
> Intel XL710 not support this feature,then some packets that only match dl_type field will
> cause this result.

OVS is vendor agnostic. Such handling should be in a specific PMD 
(reject this case), and not in OVS. I will submit a patch to support 
offload for this case and not reject it.

https://github.com/elibritstein/OVS/commit/45f2c3f43917a0e68d86c1bbfeb8658c438bdc9f

>
> My ofctl flows are below:
> uplink is pf port, and uplink-local is vf port.
> ovs-ofctl dump-flows br0
>   cookie=0x0, duration=1495.621s, table=0, n_packets=0, n_bytes=0, priority=100,\
> ip,in_port=uplink actions=output:"uplink-local"
>   cookie=0x0, duration=1495.614s, table=0, n_packets=0, n_bytes=0, priority=100,\
> ip,in_port="uplink-local" actions=output:uplink
>   cookie=0x0, duration=1495.607s, table=0, n_packets=81, n_bytes=4828, priority=\
> 100,arp,in_port="uplink-local" actions=output:uplink cookie=0x0, duration=1495.600s,\
>   table=0, n_packets=0, n_bytes=0, priority=100,arp,in_port=uplink actions=output:"uplink-local"
>
> debug log information:
> 2020-04-17T08:29:07.159Z|00086|dpif_netdev(pmd-c10/id:45)|DBG|ovs-netdev: miss upcall:
> skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),\
> in_port(3),packet_type(ns=0,id=0),eth(src=84:d9:31:ee:44:89,dst=01:80:c2:00:00:0e),eth_type(0x88cc)
> vlan_tci=0x0000,dl_src=84:d9:31:ee:44:89,dl_dst=01:80:c2:00:00:0e,dl_type=0x88cc
> 2020-04-17T08:29:07.159Z|00014|dpif_netdev(dp_netdev_flow_46)|DBG|Mark id for ufid \
> f2de067c-d3c9-49aa-8376-5971cfa5e211 was not found
> 2020-04-17T08:29:07.160Z|00015|netdev_offload_dpdk(dp_netdev_flow_46)|DBG|uplink: \
> rte_flow 0x17fa8dc00 created:
>    Attributes: ingress=1, egress=0, prio=0, group=0, transfer=1
> rte flow eth pattern:
>    Spec = null
>    Mask = null
> rte flow count action:
>    Count: shared=0, id=0
> rte flow drop action
> 2020-04-17T08:29:07.160Z|00016|netdev_offload_dpdk(dp_netdev_flow_46)|DBG|uplink: \
> installed flow 0x17fa8dc00 by ufid f2de067c-d3c9-49aa-8376-5971cfa5e211
> 2020-04-17T08:29:07.160Z|00017|dpif_netdev(dp_netdev_flow_46)|DBG|Associated dp_netdev \
> flow 0x7f1aec009f10 with mark 1
> 2020-04-17T08:29:07.160Z|00018|dpif_netdev(dp_netdev_flow_46)|DBG|succeed to add netdev flow
>
> dpcls rules detail:
> arp request flow:
> ufid:56a8038a-b036-40d9-9d7e-22ec07c9d766, skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),\
> ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(uplink-local),packet_type(ns=0,id=0),\
> eth(src=1e:f9:44:7b:b0:84/00:00:00:00:00:00,dst=ff:ff:ff:ff:ff:ff),\
> eth_type(0x0806),arp(sip=10.97.234.2/0.0.0.0,tip=10.97.234.1/0.0.0.0,\
> op=1/0,sha=1e:f9:44:7b:b0:84/00:00:00:00:00:00,tha=00:00:00:00:00:00/00:00:00:00:00:00), \
> packets:2, bytes:120, used:0.575s, offloaded:yes, dp:dpdk, actions:uplink, \
> dp-extra-info:miniflow_bits(5,0)
>
> LLDP flow which config one match all ethernet offload flow:
> ufid:8c241a16-05b8-446b-b807-c33cfdb97d33, skb_priority(0/0),skb_mark(0/0),ct_state(0/0),\
> ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(uplink),\
> packet_type(ns=0,id=0),eth(src=84:d9:31:ee:44:89/00:00:00:00:00:00,\
> dst=01:80:c2:00:00:0e/00:00:00:00:00:00),eth_type(0x88cc), packets:647, \
> bytes:84583, used:0.575s, offloaded:yes, dp:dpdk,\
> actions:drop, dp-extra-info:miniflow_bits(4,0)
>
> Signed-off-by: JackerDune <JackerDune at gmail.com>
> Signed-off-by: dujie <dujie at didiglobal.com>
> ---
>   lib/netdev-offload-dpdk.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
> index f8c46bb..0160598 100644
> --- a/lib/netdev-offload-dpdk.c
> +++ b/lib/netdev-offload-dpdk.c
> @@ -562,6 +562,7 @@ parse_flow_match(struct flow_patterns *patterns,
>                    const struct match *match)
>   {
>       uint8_t *next_proto_mask = NULL;
> +    bool is_null_eth_head = false;
>       uint8_t proto = 0;
>   
>       /* Eth */
> @@ -589,6 +590,7 @@ parse_flow_match(struct flow_patterns *patterns,
>            * NIC (such as XL710) doesn't support that. Below is a workaround,
>            * which simply matches any L2 pkts.
>            */
> +        is_null_eth_head = true;
>           add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ETH, NULL, NULL);
>       }
>   
> @@ -727,6 +729,17 @@ parse_flow_match(struct flow_patterns *patterns,
>           }
>       }
>   
> +    /*
> +     * Some proto such as LLDP ovs will only config dl_type field
> +     * and flow's action is drop. Then a offload flow which match
> +     * all ethernet packets will be added, and all ethernet packets
> +     * in that port will be hardware dropped.
> +     */
> +    if (is_null_eth_head && proto == 0) {
> +        VLOG_DBG("Null ethernet header without any proto not support");
> +        return -1;
> +    }
> +
>       add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_END, NULL, NULL);
>   
>       return 0;


More information about the dev mailing list