Hi Maintainer,<br /> <br />> A general question: does the implementation somehow enforce any specific order<br />> of actions? Say, check that ENCAP does not follow DROP? And does it need to<br />> enforce, for example, a check that action DECAP is only used when the pattern<br />> has matched on the very presence of an encap. header in the packet?<br /> <br /> 1、The DROP action is only supported in ingress direction, And check that DECAP  <br /> does not follow DROP.<br /> 2、It is based on matching the five-tuple of the packet to perform decap and encap<br /> <br /> <br /> <br />>> +void zxdh_flow_global_init(void)<br />>> +{<br />>> +    int i;<br />>> +    for (i = 0; i < MAX_FLOW_COUNT_NUM; i++) {<br />>> +        rte_spinlock_init(&flow_count_ref[i].count_lock);<br />>> +        flow_count_ref[i].count_ref = 0;<br /> <br />> Just a question: does this absolutely need to be PMD-global and not per-device?<br /> <br /> Yes, currently, one card only supports 2048 fd rules,  <br /> and there is no limit on the maximum usage of single pf/vf.<br /> <br /> <br /> <br />>> +    print_ether_addr("\nL2\t  dst=", &key->mac_dst, print_buf, buf_size, cur_len);<br />>> +    print_ether_addr(" - src=", &key->mac_src, print_buf, buf_size, cur_len);<br />>> +    MKDUMPSTR(print_buf, buf_size, *cur_len, " -eth type=0x%04x", key->ether_type);<br /> <br />> Just to make sure: is this in big-endian or little-endian? The original value of<br />> EtherType supposedly comes from RTE flow item spec as a big-endian value.<br /> <br /> little-endian, HW supports little-endian.<br /> We parsed from the RTE flow item spec, performed byte-order conversion,<br /> and assigned it to the key.<br /> <br /> <br /> <br />>> +    count->bytes = (uint64_t)(rte_le_to_cpu_32(fstats.hit_bytes_hi)) << 32 |<br />>> +                    rte_le_to_cpu_32(fstats.hit_bytes_lo);<br />>> +    count->hits = (uint64_t)(rte_le_to_cpu_32(fstats.hit_pkts_hi)) << 32 |<br />>> +                    rte_le_to_cpu_32(fstats.hit_pkts_lo);<br /> <br />> Shouldn't this also check for 'count->reset' (input field)? If the HW does not<br />> support resetting the counter upon query, perhaps reject the query then?<br /> <br />> Also, this sets 'bytes' and 'hits', but not indicate the values are valid by<br />> setting 'bytes_set' and 'hits_set'. Why? Please take a look at other PMDs.<br /> <br /> HW supports query by default, but we currently do not support determining  <br /> whether to enable query based on count->reset.<br /> <br /> Currently, it is not supported to indicate that 'bytes' and 'hits' are valid<br /> by setting 'bytes_set' and 'hits_set'.<br /> <br /> <br /> <br /> <br />>> +        case RTE_FLOW_ITEM_TYPE_ETH:<br />>> +            eth_spec = item->spec;<br />>> +            eth_mask = item->mask;<br />>> +            if (eth_spec && eth_mask) {<br />>> +                key->mac_dst = eth_spec->dst;<br />>> +                key->mac_src  = eth_spec->src;<br />>> +                key_mask->mac_dst  = eth_mask->dst;<br />>> +                key_mask->mac_src  = eth_mask->src;<br />>> +<br />>> +                if (eth_mask->type == 0xffff) {<br />>> +                    key->ether_type = eth_spec->type;<br />>> +                    key_mask->ether_type = eth_mask->type;<br />>> +                }<br />>> +            }<br /> <br />> 1) If both 'spec' and 'mask' are 'NULL', shouldn't the code set some broader<br />> match on the sole presence of a Ethernet header?<br />> 2) If 'mask' is 'NULL' and 'spec' is not (or vice versa), isn't this an error?<br /> <br />>> +            break;<br />>> +        case RTE_FLOW_ITEM_TYPE_VLAN:<br />>> +            vlan_spec = item->spec;<br />>> +            vlan_mask = item->mask;<br />>> +            if (vlan_spec && vlan_mask) {<br />>> +                key->vlan_tci  = vlan_spec->tci;<br />>> +                key_mask->vlan_tci = vlan_mask->tci;<br />>> +            }<br /> <br />> Similar questions here. For example, the user having provided the item VLAN<br />> but having omitted both 'spec' and 'mask' can be translated into setting the<br />> VLAN EtherType in 'key->ether_type', with an appropriate check of whether this<br />> key has already been set to an overlapping value by the previous (ETH) item.<br /> <br /> In my opinion, The values of 'spec' and 'mask' will not be null.<br /> If the user does not set 'spec' and 'mask', the passed-in values will be set to 00 and ff by default,<br /> which is ensured by the upper-layer interface of dpdk.<br /> <br /> <br /> Other issues will de modified, and will be resubbmitted.<br />