From patchwork Tue Jul 21 08:58:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 74537 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B7CF9A0526; Tue, 21 Jul 2020 10:58:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6A5F31BFEB; Tue, 21 Jul 2020 10:58:54 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 9F1321BFD4 for ; Tue, 21 Jul 2020 10:58:52 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.61]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 2B7AB6006E for ; Tue, 21 Jul 2020 08:58:52 +0000 (UTC) Received: from us4-mdac16-20.ut7.mdlocal (unknown [10.7.65.244]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 2991C8009E for ; Tue, 21 Jul 2020 08:58:52 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.66.41]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id B925380051 for ; Tue, 21 Jul 2020 08:58:51 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 716A54C0064 for ; Tue, 21 Jul 2020 08:58:51 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 21 Jul 2020 09:58:47 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 21 Jul 2020 09:58:47 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 06L8wmAq032256 for ; Tue, 21 Jul 2020 09:58:48 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id F2ED91617DC for ; Tue, 21 Jul 2020 09:58:47 +0100 (BST) From: Andrew Rybchenko To: Date: Tue, 21 Jul 2020 09:58:45 +0100 Message-ID: <1595321925-26226-1-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25554.003 X-TM-AS-Result: No-0.597400-8.000000-10 X-TMASE-MatchedRID: DE/IChlcRtJYwMQSR3qB3XTzPL3sqyAmOYqKF7UrYh5jLp8Cm8vwFz6P hj6DfZCErdoLblq9S5puPjTI2GOFjdLucdA1OHpBKrDHzH6zmUWL/MoUdwG/+1IxScKXZnK0DZc OfsBqOI7i8zVgXoAltmHJPdY2OmlS0C1sQRfQzEHEQdG7H66TyHEqm8QYBtMOO6W8NPks1DKk5Q Rt8pESH/zw/0t6tzrHsCC9vhcm8vCog8kh8LWj5hQ2AZiJTp6aYzbdeQiJ+qjW+23R7XKyUFOu3 h9OLulgHJKgEJ6iVAOry48kL3hIWBHTqXooh3g36iZzCSskvuc= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.597400-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25554.003 X-MDID: 1595321932-ThabaJIfpPml Subject: [dpdk-dev] [PATCH] net/sfc: avoid unnecessary actions on dummy default MAC set X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Just an optimization to avoid extra reconfiguration when it is not not actually required. Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 6b3c49a284..acee3e48e4 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -1030,6 +1030,9 @@ sfc_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) sfc_adapter_lock(sa); + if (rte_is_same_ether_addr(mac_addr, &port->default_mac_addr)) + goto unlock; + /* * Copy the address to the device private data so that * it could be recalled in the case of adapter restart.