From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C79730E0FB for ; Tue, 14 Apr 2026 11:00:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776164427; cv=none; b=mHMAVOFd97Yv9OU+hhb6BnboersM/58gF/3zRjXMxjd0I1cxdA9XPLfKz6v+su6eQOsW7e7Z3zsp+1spJZ8GTpK+DDgKovlZ4Kd78A9mSzMDPRno6Wg9LWgZwZ+bBxe5aCmKiJoMVdsoTfkl7dcRamvSw0VyLbjkxBdM7qI7x/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776164427; c=relaxed/simple; bh=2UtLUUZv+pISnEkUkDnIM2R/Np33aRkGdmjJlFiPChE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c6uUKPtEkAYffcyB31tQpQGfsoOweD8AxRSD7djFCgrKPK4tHc5lS7DVbiGtDdrMse8Ur4I9JNibW6b0Jl7SL3000xiSiMj06glbsZqdrbDCYPgeeR52dYs1tdE3D9bB1m6Wlwv0Pf1yOfkfb2FHHKVvcEjfWt9tldrQ41K3hcA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=P4IdK0m1; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="P4IdK0m1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776164425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tLstqt8MpK55vIwUxGrwtfUC/VKq5oqZIuXPjU9AllQ=; b=P4IdK0m1bc6fn5zKEY+qEM3Vb0PP3j4vwF/eZT5mG4mnIewn3vF9aXu5Lk4QV6ac7+uw+0 XujLY3cPKNiL8mgbtvRQYD3LRUd4IXmn71xBBlc8AL0RVvPrSAy2L/hA9H7wYufBQ7+NeB GmIqWAUj3uHsVW55gFCLwC26TLAhTnc= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-eTCdVHMOM0OBeQR3AtsDZA-1; Tue, 14 Apr 2026 07:00:22 -0400 X-MC-Unique: eTCdVHMOM0OBeQR3AtsDZA-1 X-Mimecast-MFC-AGG-ID: eTCdVHMOM0OBeQR3AtsDZA_1776164421 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1FAC1180034E; Tue, 14 Apr 2026 11:00:21 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.44.48.43]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 814A03000C21; Tue, 14 Apr 2026 11:00:17 +0000 (UTC) From: Jose Ignacio Tornos Martinez To: netdev@vger.kernel.org Cc: intel-wired-lan@lists.osuosl.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, Jose Ignacio Tornos Martinez Subject: [PATCH net v3 1/5] iavf: return EBUSY if reset in progress or not ready during MAC change Date: Tue, 14 Apr 2026 13:00:02 +0200 Message-ID: <20260414110006.124286-2-jtornosm@redhat.com> In-Reply-To: <20260414110006.124286-1-jtornosm@redhat.com> References: <20260414110006.124286-1-jtornosm@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 When a MAC address change is requested while the VF is resetting or still initializing, return -EBUSY immediately instead of attempting the operation. Additionally, during early initialization states (before __IAVF_DOWN), the PF may be slow to respond to MAC change requests, causing long delays. Only allow MAC changes once the VF reaches __IAVF_DOWN state or later, when the watchdog is running and the VF is ready for operations. After commit ad7c7b2172c3 ("net: hold netdev instance lock during sysfs operations"), MAC changes are called with the netdev lock held, so we should not wait with the lock held during reset or initialization. This allows the caller to retry or handle the busy state appropriately without blocking other operations. Signed-off-by: Jose Ignacio Tornos Martinez drivers/net/ethernet/intel/iavf/iavf_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index dad001abc908..67aa14350b1b 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -1060,6 +1060,9 @@ static int iavf_set_mac(struct net_device *netdev, void *p) struct sockaddr *addr = p; int ret; + if (iavf_is_reset_in_progress(adapter) || adapter->state < __IAVF_DOWN) + return -EBUSY; + if (!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL; -- 2.53.0