Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938834AbcKWPMk convert rfc822-to-8bit (ORCPT ); Wed, 23 Nov 2016 10:12:40 -0500 Received: from rtits2.realtek.com ([211.75.126.72]:56560 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938683AbcKWPMh (ORCPT ); Wed, 23 Nov 2016 10:12:37 -0500 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.56 with qID uANFCM2s010991, This message is accepted by code: ctloc85258 From: Hayes Wang To: Mark Lord , "netdev@vger.kernel.org" CC: nic_swsd , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" Subject: RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable Thread-Topic: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable Thread-Index: AQHSO+t3nHKkZLLsBUqa3CUPsCXz6KDci+AwgAAm4ICAAaIjoP//1LUAgAfJkeCAAC16gIAAmNB+ Date: Wed, 23 Nov 2016 15:12:21 +0000 Message-ID: <0835B3720019904CB8F7AA43166CEEB201051D51@RTITMBSV03.realtek.com.tw> References: <1394712342-15778-226-Taiwan-albertk@realtek.com> <1394712342-15778-227-Taiwan-albertk@realtek.com> <0835B3720019904CB8F7AA43166CEEB20105013E@RTITMBSV03.realtek.com.tw> <0835B3720019904CB8F7AA43166CEEB201050B7E@RTITMBSV03.realtek.com.tw> <0835B3720019904CB8F7AA43166CEEB2010517CE@RTITMBSV03.realtek.com.tw>, In-Reply-To: Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [123.195.27.219] 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: 820 Lines: 25 Mark Lord [mlord@pobox.com] [...] > What does this code do: > >static void r8153_set_rx_early_size(struct r8152 *tp) > >{ > > u32 mtu = tp->netdev->mtu; > > u32 ocp_data = (agg_buf_sz - mtu - VLAN_ETH_HLEN - VLAN_HLEN) / 4; > > > > ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EARLY_SIZE, ocp_data); > >} This only works for RTL8153. However, what you use is RTL8152. It is like delay completion. It is used to reduce the loading of CPU by letting a transfer contain more data to reduce the number of transfers. > How is ocp_data used by the hardware? > Shouldn't the calculation also include sizeof(rx_desc) in there somewhere? The algorithm is from our hw engineers, and it should be (agg_buf_sz - packet size) / 8 You could refer to commit a59e6d815226 ("r8152: correct the rx early size").