Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755500AbcK3Gga (ORCPT ); Wed, 30 Nov 2016 01:36:30 -0500 Received: from mail-lf0-f45.google.com ([209.85.215.45]:36002 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751404AbcK3GgT (ORCPT ); Wed, 30 Nov 2016 01:36:19 -0500 Subject: Re: [patch net / RFC] net: fec: increase frame size limitation to actually available buffer To: Andy Duan , "David S. Miller" , Troy Kisky , Andrew Lunn , Eric Nelson , Philippe Reynes , Johannes Berg , "netdev@vger.kernel.org" References: <1480444528-30054-1-git-send-email-nikita.yoush@cogentembedded.com> Cc: Chris Healy , Fabio Estevam , "linux-kernel@vger.kernel.org" From: Nikita Yushchenko X-Enigmail-Draft-Status: N1110 Message-ID: Date: Wed, 30 Nov 2016 09:36:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1445 Lines: 31 > But I think it is not necessary since the driver don't support jumbo frame. Hardcoded 1522 raises two separate issues. (1) When DSA is in use, frames processed by FEC chip contain DSA tag and thus can be larger than hardcoded limit of 1522. This issue is not FEC-specific, any driver that hardcodes maximum frame size to 1522 (many do) will have this issue if used with DSA. Clean solution for this must take into account that difference between MTU and max frame size is no longer known at compile time. Actually this is the case even without DSA, due to VLANs: max frame size is (MTU + 18) without VLANs, but (MTU + 22) with VLANs. However currently drivers tend to ignore this and hardcode 22. With DSA, 22 is not enough, need to add switch-specific tag size to that. Not yet sure how to handle this. DSA-specific API to find out tag size could be added, but generic solution should handle all cases of dynamic difference between MTU and max frame size, not only DSA. (2) There is some demand to use larger frames for optimization purposes. FEC register fields that limit frame size are 14-bit, thus allowing frames up to (4k-1). I'm about to prepare a larger patch: - add ndo_change_mtu handler, allowing MTU up to (4k - overhead), - set MAX_FL / TRUNC_FL based on configured MTU, - if necessary, do buffer reallocation with larger buffers. Is this suitable for upstreaming? Is there any policy related to handling larger frames?