Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1771665imj; Sun, 10 Feb 2019 09:56:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ5m3g8fDhEOSlCfdmizjdRrzy6aGLRFOhylZ9P+TtANcLjuTEmmfiNAJmDwT1bYeZWu0bL X-Received: by 2002:a63:2507:: with SMTP id l7mr14296652pgl.22.1549821416549; Sun, 10 Feb 2019 09:56:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549821416; cv=none; d=google.com; s=arc-20160816; b=ECZzAH7RB/KixDiJeZKnMNLGmcqXkXfLZjfSQAXUnkqyi68seCfkVPPzKnAzHNLV/m xmIs1Lnl5K06L379w2XUTPqWB/Gj6ob4gHfBAupgBP+CD0JZXp9yumJMQZn7LiSKm6u/ Ld0IcvAoMSFrBOW6m1uW/ErymB4agtEsLYxV0azjSBg4nKUScH86LyELX2Um9cstUa3m fw4ILXDX+972CtedpoG5ryhZqta3IzYPrOj4iBx0hezk7b0A235shf6XyHT44Wo5YeW7 4L53hAYul+TH4ytgXxvwcz23B4g2eGFYyiFThCUPEtkvIwJ8oY9ezUcNCwvgGKYPfVZK gC5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QA40rPEhuXPofIQU7vYAyGMcSK0VqfBQ5xwZGHv+dPM=; b=DiW9dV0cvdcPH1TnmHDqT8Oo/tODP1PmNInvvxED+8C0ZBpA8DrZ8MsPwULN3mWs3h DynVoCX4114HSoPfFTOhKeseSAh9AZFoUcNFkWMs1LTI8HarWf9olzCPwR0gLjOFNV2v HJWsNs+hEwN5yIrtYLvdbRCnxtk0You71bOwC2/VLi4YKPGhv0WeylxqspuMECptJFKE u3XM6DxI8ZjPc9Vzvfo+xO6GUC74gR6WH9x/hvbKrI7nJqFUpU4iGoaovQ582O0x2yZr L5A+Mb+ZKrwDvLf4l8vPvmLbogOQp2xkOpvRTiCuPFxTWYZ7dGPQ68Tz/dQ3WImN2I8+ yMHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NBK1CTtr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si7784941plo.59.2019.02.10.09.56.40; Sun, 10 Feb 2019 09:56:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NBK1CTtr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727328AbfBJRyq (ORCPT + 99 others); Sun, 10 Feb 2019 12:54:46 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:44879 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfBJRx1 (ORCPT ); Sun, 10 Feb 2019 12:53:27 -0500 Received: by mail-ot1-f68.google.com with SMTP id e24so13831747otp.11; Sun, 10 Feb 2019 09:53:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QA40rPEhuXPofIQU7vYAyGMcSK0VqfBQ5xwZGHv+dPM=; b=NBK1CTtryHR6sFv2CVIZlk/pkEccWfogqsWQT303Jbs4aAIm5Pnu88qp2UGAPOb7C0 w0VKUdp8uCjti8rbPCs+KRTQ2AzaqvCNMVAeYThwWoIF08Vcn6pw+PFYg8FPH2wbWBrb 3IRjUhCNV6nvqKMoTMwiIxcWcodqO3ikHY0CtS26nw0v1/WscuARB6huJV2vHGWp8Ga3 Z7KHdWUHkTY93tQU6FQjZ14FfBQ6LRu4+uSrj6L36dBtgsVRHXq6if5HVh9geFtVO13b RtRH5m/ZrXGdL13DyVbekIGsYnF3pRi1EMLK5KpRFf30Ysn6BOdKEYvZ1d5AR8TLx/XM cZgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QA40rPEhuXPofIQU7vYAyGMcSK0VqfBQ5xwZGHv+dPM=; b=WYya8lxyCx8O7YMXLm6Z7d4d3AAxDZjdhy3frTLgAsMYGM2rOIV4acunJksiwaZfDR /amreOdFvmWMLjkTeSVaZPLUI7apdnDbJDT7yKAishEBu/xDx8F1wQeMZ8k+TlBMSV7/ NdfyHrqj7wFt3ebxp8IRUQSWuosVolH5dnDCPFUEnr/JC3R34bA07MtvWS3KHsrJVA7S JU/rJHHPcfjp+3TSbvhNQJlxqsanayUn2vZ5SEdsHQ/yoi8z3by0e24+CNceLeYWm136 NZ8uB1pU+7iyRYHO/oQtcQsOGqRrXEGTB0/8yUq4Xkmdkk9PKHGxmTWywNbj3wxo/aKl g9Ow== X-Gm-Message-State: AHQUAua6p89ifQNrijIZ3GO6fHoAe1PYmyiTFoGBuARZ2tSCB9Lhf2bQ DZhd8zumg+n7sYZ5vXEVnbvOVEsL X-Received: by 2002:a9d:2c46:: with SMTP id f64mr25001914otb.192.1549821205828; Sun, 10 Feb 2019 09:53:25 -0800 (PST) Received: from localhost.localdomain (ip68-228-73-187.oc.oc.cox.net. [68.228.73.187]) by smtp.gmail.com with ESMTPSA id n9sm3156425otq.14.2019.02.10.09.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 09:53:25 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , idosch@mellanox.com, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, bridge@lists.linux-foundation.org, jiri@mellanox.com, andrew@lunn.ch, vivien.didelot@gmail.com Subject: [PATCH net-next v2 06/16] net: bridge: Stop calling switchdev_port_attr_get() Date: Sun, 10 Feb 2019 09:50:55 -0800 Message-Id: <20190210175105.31629-7-f.fainelli@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190210175105.31629-1-f.fainelli@gmail.com> References: <20190210175105.31629-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that all switchdev drivers have been converted to checking the bridge port flags during the prepare phase of the switchdev_port_attr_set(), we can move straight to trying to set the desired flag through SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS. Acked-by: Jiri Pirko Signed-off-by: Florian Fainelli --- net/bridge/br_switchdev.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c index db9e8ab96d48..939f300522c5 100644 --- a/net/bridge/br_switchdev.c +++ b/net/bridge/br_switchdev.c @@ -64,29 +64,15 @@ int br_switchdev_set_port_flag(struct net_bridge_port *p, { struct switchdev_attr attr = { .orig_dev = p->dev, - .id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT, + .id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS, + .flags = SWITCHDEV_F_DEFER, + .u.brport_flags = flags, }; int err; if (mask & ~BR_PORT_FLAGS_HW_OFFLOAD) return 0; - err = switchdev_port_attr_get(p->dev, &attr); - if (err == -EOPNOTSUPP) - return 0; - if (err) - return err; - - /* Check if specific bridge flag attribute offload is supported */ - if (!(attr.u.brport_flags_support & mask)) { - br_warn(p->br, "bridge flag offload is not supported %u(%s)\n", - (unsigned int)p->port_no, p->dev->name); - return -EOPNOTSUPP; - } - - attr.id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS; - attr.flags = SWITCHDEV_F_DEFER; - attr.u.brport_flags = flags; err = switchdev_port_attr_set(p->dev, &attr); if (err) { br_warn(p->br, "error setting offload flag on port %u(%s)\n", -- 2.19.1