Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751728AbdHRFEJ convert rfc822-to-8bit (ORCPT ); Fri, 18 Aug 2017 01:04:09 -0400 Received: from mga03.intel.com ([134.134.136.65]:23619 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751613AbdHRFEG (ORCPT ); Fri, 18 Aug 2017 01:04:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,391,1498546800"; d="scan'208";a="301678539" From: "Tantilov, Emil S" To: Ding Tianhong , "davem@davemloft.net" , "Kirsher, Jeffrey T" , "keescook@chromium.org" , "linux-kernel@vger.kernel.org" , "sparclinux@vger.kernel.org" , "intel-wired-lan@lists.osuosl.org" , "alexander.duyck@gmail.com" , "netdev@vger.kernel.org" , "linuxarm@huawei.com" Subject: RE: [PATCH net v2 2/2] net: ixgbe: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag Thread-Topic: [PATCH net v2 2/2] net: ixgbe: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag Thread-Index: AQHTFwjSqSxj//5GgUGie5IyMp+DLaKIlhGggAEmFYD//5J+kA== Date: Fri, 18 Aug 2017 05:04:03 +0000 Message-ID: <87618083B2453E4A8714035B62D67992B4095363@FMSMSX105.amr.corp.intel.com> References: <1502940316-13384-1-git-send-email-dingtianhong@huawei.com> <1502940316-13384-3-git-send-email-dingtianhong@huawei.com> <87618083B2453E4A8714035B62D67992B4094F7A@FMSMSX105.amr.corp.intel.com> <2a7fc27b-c2f4-a7a1-9318-3a93531e7670@huawei.com> In-Reply-To: <2a7fc27b-c2f4-a7a1-9318-3a93531e7670@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTUwMGVhYmItNjM1Zi00NWE0LWE3MmUtZTg0M2I2NzkzMTNmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InhwSzNhTjkzblB1MG40U09XOGtLck9BMlwvaWFhZEhPZnlDNVwvYWczYWVPcz0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.106] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2092 Lines: 54 >-----Original Message----- >From: Ding Tianhong [mailto:dingtianhong@huawei.com] >Sent: Thursday, August 17, 2017 5:39 PM >To: Tantilov, Emil S ; davem@davemloft.net; >Kirsher, Jeffrey T ; keescook@chromium.org; >linux-kernel@vger.kernel.org; sparclinux@vger.kernel.org; intel-wired- >lan@lists.osuosl.org; alexander.duyck@gmail.com; netdev@vger.kernel.org; >linuxarm@huawei.com >Subject: Re: [PATCH net v2 2/2] net: ixgbe: Use new >PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag > > > >On 2017/8/17 22:17, Tantilov, Emil S wrote: > >>> ret_val = ixgbe_start_hw_generic(hw); >>> >>> -#ifndef CONFIG_SPARC >>> - /* Disable relaxed ordering */ >>> - for (i = 0; ((i < hw->mac.max_tx_queues) && >>> - (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) { >>> - regval = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); >>> - regval &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; >>> - IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), regval); >>> - } >>> + if (!pcie_relaxed_ordering_enabled(adapter->pdev)) { >> >> As Alex mentioned there is no need for this check in any form. >> >> The HW defaults to Relaxed Ordering enabled unless it is disabled in >> the PCIe Device Control Register. So the above logic is already done by >HW. >> >> All you have to do is strip the code disabling relaxed ordering. >> > >Hi Tantilov: > >I misunderstood Alex's suggestion, But I still couldn't find the logic >where >the HW disable the Relaxed Ordering when the PCIe Device Control Register >disable it, can you point it out? If you look at the datasheet (82599) - the description of CTRL_EXT.RO_DIS (bit 17, 0b): Relaxed Ordering Disable. When set to 1b, the device does not request any relaxed ordering transactions. When this bit is cleared and the Enable Relaxed Ordering bit in the Device Control register is set, the device requests relaxed ordering transactions per queues as configured in the DCA_RXCTRL[n] and DCA_TXCTRL[n] registers. So if you remove the code that clears the bits in DCA_T/RXCTRL relaxed ordering should be enabled by HW when the bus allows it. Thanks, Emil