* Check that the given set of match flags missing in the original filter spec * could be covered by adding spec copies which specify the corresponding * flags and packet field values to match. * * @param miss_flags[in] * Flags that are missing until the supported filter. * @param spec[in] * Specification to be supplemented. * @param filter[in] * SFC filter. * * @return * Number
| 2147 | * Number of specifications after copy or 0, if the flags can not be added. |
| 2148 | */ |
| 2149 | static unsigned int |
| 2150 | sfc_flow_check_missing_flags(efx_filter_match_flags_t miss_flags, |
| 2151 | efx_filter_spec_t *spec, |
| 2152 | struct sfc_filter *filter) |
| 2153 | { |
| 2154 | unsigned int i; |
| 2155 | efx_filter_match_flags_t copy_flags = 0; |
| 2156 | efx_filter_match_flags_t flag; |
| 2157 | efx_filter_match_flags_t match = spec->efs_match_flags | miss_flags; |
| 2158 | sfc_flow_spec_check *check; |
| 2159 | unsigned int multiplier = 1; |
| 2160 | |
| 2161 | for (i = 0; i < RTE_DIM(sfc_flow_copy_flags); i++) { |
| 2162 | flag = sfc_flow_copy_flags[i].flag; |
| 2163 | check = sfc_flow_copy_flags[i].spec_check; |
| 2164 | if ((flag & miss_flags) == flag) { |
| 2165 | if (check != NULL && (!check(match, spec, filter))) |
| 2166 | continue; |
| 2167 | |
| 2168 | copy_flags |= flag; |
| 2169 | multiplier *= sfc_flow_copy_flags[i].vals_count; |
| 2170 | } |
| 2171 | } |
| 2172 | |
| 2173 | if (copy_flags == miss_flags) |
| 2174 | return multiplier; |
| 2175 | |
| 2176 | return 0; |
| 2177 | } |
| 2178 | |
| 2179 | /** |
| 2180 | * Attempt to supplement the specification template to the minimally |
no test coverage detected