[PATCH v2 04/36] net/ionic: fix up the Rx filter save API

Andrew Boyer andrew.boyer at amd.com
Tue Oct 18 21:40:59 CEST 2022


Check the match variable after copying cmd info, or else there can
be unexpected results.

Fixes: a27e0e96ab77 ("net/ionic: observe endianness in Rx filter")
Cc: andrew.boyer at amd.com
Cc: stable at dpdk.org

Signed-off-by: Andrew Boyer <andrew.boyer at amd.com>
---
 drivers/net/ionic/ionic_rx_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ionic/ionic_rx_filter.c b/drivers/net/ionic/ionic_rx_filter.c
index bf57a9fa52..4b2e907f9f 100644
--- a/drivers/net/ionic/ionic_rx_filter.c
+++ b/drivers/net/ionic/ionic_rx_filter.c
@@ -63,8 +63,8 @@ ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id,
 	f->flow_id = flow_id;
 	f->filter_id = rte_le_to_cpu_32(ctx->comp.rx_filter_add.filter_id);
 	f->rxq_index = rxq_index;
-	f->match = rte_le_to_cpu_16(f->cmd.match);
 	memcpy(&f->cmd, &ctx->cmd, sizeof(f->cmd));
+	f->match = rte_le_to_cpu_16(f->cmd.match);
 
 	switch (f->match) {
 	case IONIC_RX_FILTER_MATCH_VLAN:
-- 
2.17.1



More information about the stable mailing list