From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilias Apalodimas Subject: Re: [PATCH 4/4] cpsw: add switchdev support Date: Thu, 24 May 2018 16:32:34 +0300 Message-ID: <20180524133234.GA15703@apalos> References: <1527144984-31236-1-git-send-email-ilias.apalodimas@linaro.org> <1527144984-31236-5-git-send-email-ilias.apalodimas@linaro.org> <20180524131229.GC24557@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, grygorii.strashko@ti.com, ivan.khoronzhuk@linaro.org, nsekhar@ti.com, jiri@resnulli.us, ivecera@redhat.com, francois.ozog@linaro.org, yogeshs@ti.com, spatton@ti.com To: Andrew Lunn Return-path: Received: from mail-wr0-f193.google.com ([209.85.128.193]:44216 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965390AbeEXNcj (ORCPT ); Thu, 24 May 2018 09:32:39 -0400 Received: by mail-wr0-f193.google.com with SMTP id y15-v6so3151034wrg.11 for ; Thu, 24 May 2018 06:32:39 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180524131229.GC24557@lunn.ch> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, May 24, 2018 at 03:12:29PM +0200, Andrew Lunn wrote: > Device tree is supposed to describe the hardware. Using that hardware > in different ways is not something you should describe in DT. > The new switchdev mode is applied with a .config option in the kernel. What you see is pre-existing code, so i am not sure if i should change it in this patchset. Your point is valid though and we are on the same page. > There are also a lot of IS_ENABLED() here, which i don't like. It is a > lot better than #ifdef, but we should try to do better. I don't like it either i just tried to clean up code in "hot path" with ifdefs. In theory this should replace "switch mode" in the near future so the ifdefs will go away > It would be > good to split this cleanly into three parts. A generic library, which > does not care about DUAL_MAC or SWITCHDEV. A driver which implements > legacy DUAL MAC etc. And a driver which implements SWITCHDEV. We can > then give this new switchdev driver a different compatible. It i still > encoding in device tree how to use the hardware, but it is more > implicit, rather than explicit. Good idea, i'll sent the next version like that Thanks, Ilias