| 234 | } |
| 235 | |
| 236 | int |
| 237 | cpfl_rule_process(struct cpfl_itf *itf, |
| 238 | struct idpf_ctlq_info *tx_cq, |
| 239 | struct idpf_ctlq_info *rx_cq, |
| 240 | struct cpfl_rule_info *rinfo, |
| 241 | int rule_num, |
| 242 | bool add) |
| 243 | { |
| 244 | struct idpf_hw *hw = &itf->adapter->base.hw; |
| 245 | int i; |
| 246 | int ret = 0; |
| 247 | |
| 248 | if (rule_num == 0) |
| 249 | return 0; |
| 250 | |
| 251 | for (i = 0; i < rule_num; i++) { |
| 252 | ret = cpfl_rule_pack(&rinfo[i], &itf->dma[i], &itf->msg[i], add); |
| 253 | if (ret) { |
| 254 | PMD_INIT_LOG(ERR, "Could not pack rule"); |
| 255 | return ret; |
| 256 | } |
| 257 | } |
| 258 | ret = cpfl_send_ctlq_msg(hw, tx_cq, rule_num, itf->msg); |
| 259 | if (ret) { |
| 260 | PMD_INIT_LOG(ERR, "Failed to send control message"); |
| 261 | return ret; |
| 262 | } |
| 263 | ret = cpfl_receive_ctlq_msg(hw, rx_cq, rule_num, itf->msg); |
| 264 | if (ret) { |
| 265 | PMD_INIT_LOG(ERR, "Failed to update rule"); |
| 266 | return ret; |
| 267 | } |
| 268 | |
| 269 | return 0; |
| 270 | } |
no test coverage detected