From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D9EEC433FE for ; Mon, 4 Apr 2022 22:49:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232672AbiDDWvx (ORCPT ); Mon, 4 Apr 2022 18:51:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235900AbiDDWvr (ORCPT ); Mon, 4 Apr 2022 18:51:47 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57D0D61A0A for ; Mon, 4 Apr 2022 15:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=kpKeRnJLlKYqZBD6VcfJyKUGK1O/DKpsspH64ose7t0=; b=ULsk1qKnN4MuUjjHu6D9lJeq3c TRG3XGim3XwbTObOAqXHMZF3+dmULFKfGWWPIf/v63qurM/HzFyExUs9MWoTUHVNpXvyQUPf+h+PM h3o8JD/1sceEWRpjde84nUdTfPkczqxTYQ/voOa4q0DKoF3U7reYv99w/G7bm8j8Og8k=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nbUoI-00E9GV-7u; Tue, 05 Apr 2022 00:04:30 +0200 Date: Tue, 5 Apr 2022 00:04:30 +0200 From: Andrew Lunn To: Matej Zachar Cc: netdev@vger.kernel.org Subject: Re: [DSA] fallback PTP to master port when switch does not support it Message-ID: References: <25688175-1039-44C7-A57E-EB93527B1615@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25688175-1039-44C7-A57E-EB93527B1615@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Apr 04, 2022 at 09:28:08PM +0200, Matej Zachar wrote: > Hi, > > in my embedded setup I have CPU (master) port with full PTP support > connected to the onboard switch (without PTP support) through > DSA. As the ioctl and ts_info is passed to the switch driver I made > small change to fallback to the master net_device. Did you try just running PTP on the master device? I'm wondering if the DSA headers get in the way? What i don't like about your proposed fallback is that it gives the impression the slave ports actually support PTP, when they do not. And maybe you want to run different ports in different modes, one upstream towards a grand master and one downstream? I suspect the errors you get are not obvious. Where as if you just run PTP on the master, the errors would be more obvious. > This however requires that the switch which does not support PTP > must not implement .get_ts_info and .port_hwtstamp_get/set from > dsa_switch_ops struct. And this is another advantage of just using master directly. You can even use master when the switch ports do support PTP. Andrew