Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1739533img; Wed, 27 Feb 2019 04:42:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IaJoFS7lQLvD5gw+yY3SNcQGldZiLTXl2Agdnl28BiNt+HKMR3TyS3xZdRzof4YLlV2CmDK X-Received: by 2002:a17:902:368:: with SMTP id 95mr1962506pld.139.1551271336637; Wed, 27 Feb 2019 04:42:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551271336; cv=none; d=google.com; s=arc-20160816; b=StP/OPUATE9lc5+zLH6h5rdfEwx3flgIdwv+zIB0pyv1OPoULn1gQjsqWsDmOwPJp9 u3/63n6TJEmxyq5403KmA30HjSGwZD7wLjPUO+OrYn1slzqTUhFOtSqjX0rjPV9urg6N FadAm1ftd5z6hziq4iPlZpgJ4EHlLdZtMikRwTdOQ+4mxH/aYdWhnMlAj3CKnuJZq/Yp EVxXjeUVxk52YCPedlsXLaVkDYzPu1ReRAE/ElU4a9Ouvt8PTo53NnbiyVjz74lhBJof PiwO7s0M9YZUm29sreV/VWmmJpSI8oJokqFqO7/gfTbt/wyST34GqtRc65IbAYIdNNVd eXew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=swq/S8DcM57qPexRzKGchyQ5CBiRTzg6l93s6myU0D4=; b=J0/A3flU46TDsCRXxgFEQeVTCXNO68TSCMh0/ynOQojalG4/kuhaNX/js732p+6pfy S56ykhRKThdSIRhBIcemm9A8J+ienhB9LCsAirbodZ7yO1fKSUcf/vbC7EViThFolyeP edpu6atd7lr1MHLS4fKhTm1ZXbhv4Uqtlea6Vu/zSs+cO+JISdW9/BiTA1XJPzwJQ99/ PiQQnOekmVGci4dPw49/XrM8UUb7w70WhxSNbSw1gEu914J3BonCISptizJDJFDrzhT5 ghGBnz5TEeEMjt4rCP0btG6mzUzHnWeS77L8SCeB4ahrL1mbuMjCrtc/QcLQC7+dUNy+ JAug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=WYYwd0xh; 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=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si14896164pls.101.2019.02.27.04.42.01; Wed, 27 Feb 2019 04:42:16 -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=@Mellanox.com header.s=selector1 header.b=WYYwd0xh; 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=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730172AbfB0MdT (ORCPT + 99 others); Wed, 27 Feb 2019 07:33:19 -0500 Received: from mail-eopbgr60079.outbound.protection.outlook.com ([40.107.6.79]:28587 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726092AbfB0MdS (ORCPT ); Wed, 27 Feb 2019 07:33:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=swq/S8DcM57qPexRzKGchyQ5CBiRTzg6l93s6myU0D4=; b=WYYwd0xhJwpVKVqa58Mit2X0z981tpVGRDibJxXh1SVUGkfG0i32IUcK2BHIvXfKqF6WpPe8ZdogrA+7Qwh946XqHJ00cNxf+ywVzcCFKmsVo2RSrCRrlURU/y8QOQB7mk7cMvzAed/M7GJK37ajlkl93/6NwmLJuBpWWXO2gBU= Received: from DB7PR05MB5243.eurprd05.prod.outlook.com (20.178.42.15) by DB7PR05MB5512.eurprd05.prod.outlook.com (20.177.192.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.15; Wed, 27 Feb 2019 12:32:35 +0000 Received: from DB7PR05MB5243.eurprd05.prod.outlook.com ([fe80::2df1:2e11:a3f7:ef23]) by DB7PR05MB5243.eurprd05.prod.outlook.com ([fe80::2df1:2e11:a3f7:ef23%6]) with mapi id 15.20.1643.019; Wed, 27 Feb 2019 12:32:35 +0000 From: Ido Schimmel To: Florian Fainelli CC: "netdev@vger.kernel.org" , "David S. Miller" , open list , "open list:STAGING SUBSYSTEM" , "moderated list:ETHERNET BRIDGE" , Jiri Pirko , "andrew@lunn.ch" , "vivien.didelot@gmail.com" Subject: Re: [PATCH net-next 7/8] net: switchdev: Replace port attr set SDO with a notification Thread-Topic: [PATCH net-next 7/8] net: switchdev: Replace port attr set SDO with a notification Thread-Index: AQHUywrdkdsT/LOBwUG+oBo6MXUQTqXtL/eAgAH7MoCAAR2bAIAApvMAgAKrOAA= Date: Wed, 27 Feb 2019 12:32:34 +0000 Message-ID: <20190227123232.GE13567@splinter> References: <20190222235927.10295-1-f.fainelli@gmail.com> <20190222235927.10295-8-f.fainelli@gmail.com> <20190223103207.GA13070@splinter> <20190225094940.GA15128@splinter> <2e91b708-a092-3839-4979-2712145a9951@gmail.com> In-Reply-To: <2e91b708-a092-3839-4979-2712145a9951@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR0502CA0024.eurprd05.prod.outlook.com (2603:10a6:209:1::37) To DB7PR05MB5243.eurprd05.prod.outlook.com (2603:10a6:10:68::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 569c2647-7260-47c8-590b-08d69cafa683 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB7PR05MB5512; x-ms-traffictypediagnostic: DB7PR05MB5512: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1;DB7PR05MB5512;23:B7Yh07MQFYD7kYmA58/kd+kcGYEowD3C8P6yGyI?= =?iso-8859-1?Q?c3uLAbK6L/EfZLolGsnXPGYllExXFIWVXfdYkoeSzPpr8yrZz9964/iq+T?= =?iso-8859-1?Q?S3OExAOK7+vjG96PtSaPdznhAjLTfyhvbqCbpzkLRKCjknJTaX6Gq1HTVP?= =?iso-8859-1?Q?/a0h/Yj3evh4dbAlxSQ0qCQVjY1bWczgaCEVwgxLe8j619DPc6B64pX1lZ?= =?iso-8859-1?Q?dKsEKkgaTxf+5zeam+5lUD7w+Wy+JIXPl0Z43XqU74fyd5ImsSI5YRLRwp?= =?iso-8859-1?Q?KoGpCUSd/4lgaLCgQePGnXMj8GzOtHUGkUuQOw/m2OGL04idXiTvyyQem5?= =?iso-8859-1?Q?ocxZsXUN+zxioZdulfYRIE5OvFgDuL9yDdt865ZBx5hx0VSwD9Qcy0xsvJ?= =?iso-8859-1?Q?jnjBrMLo+4824kWia5BYrg/Qjz+VZZbjV38U/Qcq+yg+vbpFsZY6DkxcRR?= =?iso-8859-1?Q?NHFa2CjEk1u4JqTiDMYPcpvJICv2oMYiZcxn5HxQPTufGm3kiMt8L9tad0?= =?iso-8859-1?Q?BKJdp0s3HpIWamqB5DV4fwRmENRP+Gj8AwM11aukC/q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4gM=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 0961DF5286 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(7916004)(346002)(39860400002)(366004)(136003)(376002)(396003)(199004)(189003)(86362001)(93886005)(14444005)(6916009)(256004)(8676002)(446003)(7736002)(99286004)(52116002)(11346002)(6116002)(3846002)(81166006)(14454004)(6486002)(81156014)(6436002)(15650500001)(33656002)(229853002)(2906002)(5660300002)(26005)(54906003)(186003)(316002)(305945005)(486006)(106356001)(105586002)(66574012)(1076003)(68736007)(66066001)(25786009)(71190400001)(8936002)(4326008)(476003)(97736004)(102836004)(53936002)(76176011)(53546011)(6512007)(478600001)(6506007)(386003)(9686003)(6246003)(33716001)(71200400001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR05MB5512;H:DB7PR05MB5243.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: uUQnh+zXovLeBERgqxyJrxpzjzcbxjC96wg4JhES4iyrccATPfoRqhluUKW8w/T9gUUXRJKEjlWvXHc5CMCNyv+/doYpSSypdPycWE3mbHgZS2mj+nWay+W9z1T2VU/b8vOasNHqFi754y4sWDnX4abSNLHpCsFiGX3WmwBRIQVFCWjdKB1ZA2G+VlUtFHs4uiS7QZCYxn9QhiK4YlydDLzm0UTvUdBKerPymewLgvq7UN7U2AcYLYStb+vc/AhdbncsrI3e6ZCz8J1JLlbDwWkf4YLiyV/nNBn2Sgg09o8cW7sJSMKPgVaKLJsDb5zQpMo4MlBqsSdoaNLjf6t4FD2gztVRQXVKs4igweumEk8DezevqhzQ9vRDJSw95g8GKbHGNWBleJUAa1E7mSxc+X9GyQsxxUZ7eUSg406pM84= Content-Type: text/plain; charset="iso-8859-1" Content-ID: <915DA04E3989804892AF568544A38635@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 569c2647-7260-47c8-590b-08d69cafa683 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2019 12:32:34.4067 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5512 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 25, 2019 at 11:47:12AM -0800, Florian Fainelli wrote: > On 2/25/19 1:49 AM, Ido Schimmel wrote: > > On Sun, Feb 24, 2019 at 08:47:27AM -0800, Florian Fainelli wrote: > >> Le 2/23/19 =E0 2:32 AM, Ido Schimmel a =E9crit=A0: > >>> On Fri, Feb 22, 2019 at 03:59:25PM -0800, Florian Fainelli wrote: > >>>> - if (attr->flags & SWITCHDEV_F_NO_RECURSE) > >>>> + if (attr & SWITCHDEV_F_DEFER) > >>>> + rc =3D call_switchdev_blocking_notifiers(nt, dev, > >>>> + &attr_info.info, NULL); > >>>> + else > >>>> + rc =3D call_switchdev_notifiers(nt, dev, &attr_info.info, NULL); > >>> > >>> I don't believe this is needed. You're calling this function from > >>> switchdev_port_attr_set_now() which is always called from process > >>> context. switchdev_port_attr_set() takes care of that. Similar to > >>> switchdev_port_obj_add(). > >> > >> Except for net/bridge/br_switchdev.c when we check the bridge port's > >> flags support with PRE_BRIDGE_FLAGS. In that case we are executing fro= m > >> the caller (atomic) context and we can't defer otherwise that trumps t= he > >> whole idea of being able to do a quick check and return that to the > >> caller that we cannot support specific flags. How would you recommend > >> approaching that? > >=20 > > In this case you can invoke call_switchdev_notifiers() directly from > > br_switchdev_set_port_flag(). Eventually switchdev_port_attr_set() will > > be gone and bridge code will invoke the notifiers directly. >=20 > That can be done, but it still requires the target driver (mlxsw, > ocelot, dsa, etc.) to support attribute notification from blocking and > non-blocking context. Are you fine with that? Yes. Sorry for the latency. I was away yesterday. Reviewed your v2 and only found one problem. Will run some tests now. Thanks!