diff mbox series

[net-next,3/6] ionic: fill mac addr earlier in add_addr

Message ID 20210827185512.50206-4-snelson@pensando.io (mailing list archive)
State Accepted
Commit 92c90dff687f86ca02bcc1bf7d43626fcf06f4c9
Delegated to: Netdev Maintainers
Headers show
Series ionic: queue mgmt updates | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 2 maintainers not CCed: saeedm@nvidia.com allenbh@pensando.io
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Shannon Nelson Aug. 27, 2021, 6:55 p.m. UTC
Make sure the ctx struct has the new mac address before
any save operations happen.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 drivers/net/ethernet/pensando/ionic/ionic_lif.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index df0137044c03..d69c80c3eaa2 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -1268,6 +1268,8 @@  int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr)
 	struct ionic_rx_filter *f;
 	int err = 0;
 
+	memcpy(ctx.cmd.rx_filter_add.mac.addr, addr, ETH_ALEN);
+
 	spin_lock_bh(&lif->rx_filters.lock);
 	f = ionic_rx_filter_by_addr(lif, addr);
 	if (f) {
@@ -1281,7 +1283,6 @@  int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr)
 		f->state = IONIC_FILTER_STATE_SYNCED;
 	} else {
 		/* save as SYNCED to catch any DEL requests while processing */
-		memcpy(ctx.cmd.rx_filter_add.mac.addr, addr, ETH_ALEN);
 		err = ionic_rx_filter_save(lif, 0, IONIC_RXQ_INDEX_ANY, 0, &ctx,
 					   IONIC_FILTER_STATE_SYNCED);
 	}