Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6402305rwi; Mon, 24 Oct 2022 00:22:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7t/Vi1W3BOcXeIZow1OMuZT0jeQepuSNe0y4WxVfU7Kg31walx9o04EU39k/FlCCv+VOjh X-Received: by 2002:a63:693:0:b0:46e:e210:effb with SMTP id 141-20020a630693000000b0046ee210effbmr8243828pgg.10.1666596176251; Mon, 24 Oct 2022 00:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666596176; cv=none; d=google.com; s=arc-20160816; b=ZLmbY17G2ULLIyr06bVmbseLQLjXhKHQrJGyAPv8QKvUAjdJP9FpYwD17fjHpcsQgN PG4H6UkQKardXYeVN3fHn9m4aiT0FVKTCGT7/wT9vzsRMDjOi0z9bz8I03hwZ9j01FfL Z6gASvx928DEe/opHbjL1QmS/UhTOV825nQCmLU7+OkO3hcq5CW6lFZzfnBGmzHHGkpf 126KbJLMFBvzKWsuKl6MHTQOS23mwicxbHCPHCnCgpRBri3Isx9jL7nCYqDqzIo+HbCb JUL7AUalMhiHCW3OCzDblwK5LlBXxSwwkA47anutCWdBiLhkBFDFIwpwk8gd5Fx1w/+O vvEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Jz256VNBfjVqJK9+NrAMss0trM3tbgbVUPo6E11Yxx8=; b=LfplfsS38SCNSbDFPxKT2Fsf9FdNLIBYc81LCqTnnAWtWaK3yCbWF9sahX3PVRFXWu gPnSGL9WMLzh80fKDgYSMAyrNf3tviSg7VPQaPo0e5J3cJas52v4aBDczJoVpmryx6o6 vvk5pBgK+MDruvacVOOh33uYlppmt1lOrhmT7+t+LAyiE4mtaWQW6S2EQnYlBE3sNlBV 0c1d/SdrhKMd+KAYRCDfF0F6Vc+3l0ItILIQVH8GgI9dq+czmLElpRXewI13BKrD0zRS BUofO3Tf5lP4//vDoTOdI061V0JRuEQHe8L5q8uHnyV0r0iFFHM6BDGD/ZlRWcJbTucA dmcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=OIXAoXXV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x26-20020a63b21a000000b0043c9fcccbd9si38581998pge.685.2022.10.24.00.22.45; Mon, 24 Oct 2022 00:22:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=OIXAoXXV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230306AbiJXHRK (ORCPT + 99 others); Mon, 24 Oct 2022 03:17:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbiJXHRH (ORCPT ); Mon, 24 Oct 2022 03:17:07 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CCC64C004; Mon, 24 Oct 2022 00:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1666595822; x=1698131822; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ahXYXj9DE/pVF8jQHrJ2tqdijJC/al1D0XongLdLCUI=; b=OIXAoXXVqquo5+d6v3qiyU9W/30D6qvpc1qnxDMHJw/tW+J1JC4NWPDx XsHe0v6C2ywXd715BvuipSkR9ubagy4+AfNQF5exiglQtwZQ3WAVYd178 SVwfZEUkICFkEe5FeT4wbOPXr1fKMQyhDxpx9uodeG1kA9VNVgEO4z7o7 kwb00J4J1Nepo6BJvSW2D6uC+4ORAM6jzFu5+FTyugy/2DHUmYfGMAX/k 1JhETkYfi/ljRUrEUD3v1OMh+8O/D+ESeZ27nXQjKn2ZU5c4aGch+D50r /tZiklx3bSfmptmYg33ll/mmeAoG7TqeoxmPoTssCHQN2GZP8WwhxAHry g==; X-IronPort-AV: E=Sophos;i="5.95,207,1661842800"; d="scan'208";a="186088262" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 Oct 2022 00:17:01 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Mon, 24 Oct 2022 00:17:01 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Mon, 24 Oct 2022 00:16:57 -0700 Date: Mon, 24 Oct 2022 12:46:56 +0530 From: Raju Lakkaraju To: Andrew Lunn CC: , , , , , , , , , , Subject: Re: [PATCH net-next 1/2] net: lan743x: Add support for get_pauseparam and set_pauseparam Message-ID: <20221024071656.GA653394@raju-project-pc> References: <20221021055642.255413-1-Raju.Lakkaraju@microchip.com> <20221021055642.255413-2-Raju.Lakkaraju@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, Thank you for review comments. The 10/21/2022 15:46, Andrew Lunn wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > > +static int lan743x_set_pauseparam(struct net_device *dev, > > + struct ethtool_pauseparam *pause) > > +{ > > + struct lan743x_adapter *adapter = netdev_priv(dev); > > + struct phy_device *phydev = dev->phydev; > > + struct lan743x_phy *phy = &adapter->phy; > > + > > + if (!phydev) > > + return -ENODEV; > > + > > + if (!phy_validate_pause(phydev, pause)) > > + return -EINVAL; > > + > > + phy->fc_request_control = 0; > > + if (pause->rx_pause) > > + phy->fc_request_control |= FLOW_CTRL_RX; > > + > > + if (pause->tx_pause) > > + phy->fc_request_control |= FLOW_CTRL_TX; > > + > > + phy->fc_autoneg = pause->autoneg; > > + > > + phy_set_asym_pause(phydev, pause->rx_pause, pause->tx_pause); > > + > > + if (pause->autoneg == AUTONEG_DISABLE) > > + lan743x_mac_flow_ctrl_set_enables(adapter, pause->tx_pause, > > + pause->rx_pause); > > pause is not too well defined. But i think phy_set_asym_pause() should > be in an else clause. If pause autoneg is off, you directly set it in > the MAC and ignore what is negotiated. If it is enabled, you > negotiate. As far as i understand, you don't modify your negotiation > when pause autoneg is off. O.K. I will change. > > Andrew -------- Thanks, Raju