From patchwork Wed Nov 18 16:51:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 11915419 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9978C5519F for ; Wed, 18 Nov 2020 16:52:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54C6D24858 for ; Wed, 18 Nov 2020 16:52:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="BF2ZGNov" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728010AbgKRQvy (ORCPT ); Wed, 18 Nov 2020 11:51:54 -0500 Received: from mout.gmx.net ([212.227.15.15]:56325 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727522AbgKRQvx (ORCPT ); Wed, 18 Nov 2020 11:51:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1605718303; bh=gWwwCwfISDjmpy8OSIHFij5Di1bQqJTgV20bl7nQn58=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=BF2ZGNovrL5ODt20K7zGFp8JXPFL36xCmuabld4IfTUx8KvXls7pmOO3QMNiK0gBs TRjjxBIIbyKsKNIY5IB57boFaVWARpk6nkWO4ueRtgWV29KAPB45eHDPXxkGlFy05H RBKrty5EmFTjd3IkNcIRO1ksSVMgWD4hj3n/UX8g= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from MX-Linux-Intel.fritz.box ([79.242.191.181]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N2mFi-1kGFQg3jQ4-01358A; Wed, 18 Nov 2020 17:51:43 +0100 From: Armin Wolf To: kuba@kernel.org Cc: netdev@vger.kernel.org, davem@davemloft.net, f.fainelli@gmail.com, joe@perches.com Subject: [PATCH net-next v2 0/2] lib8390: Remove custom padding solution Date: Wed, 18 Nov 2020 17:51:05 +0100 Message-Id: <20201118165107.12419-1-W_Armin@gmx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:uwI0J+/nhAAMEUXl5VdMZL+3JZb2Zbg8u51scFzEcuO8afOTv37 +sHsqkaRGPDFS16xu6YsI/LXnC0TBKSuzPYItuSPcL3/3wnGolSdVniYoQWkk86eIhhF812 hVCXJIMzyhmqTTTGSc1Z+aeS5fSOjtqViSOdE/LJq+xaTeNcZa/iR7HZcQBtYosbYJPhwVL iTPhNwjqiKUGvsK3mezwQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:7n4KS9aTaXY=:cxeMQJKP7DmYTkM7at0S/j a6N4HwYXvx/UwN6VCGDFCffaiRJtX+0KGsQDxfz7AYrIgfw6TlqADp3BaabQr7EExwq9O6HFj 39UIQbBvIOBEludBEXYnMthlwuuG0Jg6dnn/vFjz7sByupm2z5eGLLnu+u5oaw6W1zTyJM7M4 iH+g1GfLA2tMV3NLGCUvMwwE3tHbaoSG1vIBFCZYYHptxHNRrAqrKmgwtnPQzRHR8pb6YDdIM YOfIzEUq9XbaQkx3cQob/S4t+5Mu3vYGF604NK4ir5WwuzFizPlcMkkZTt+o2Cc4lcjg/f5Nj TC4MzEX2YYSkKAJ9m7OdbIP1h0rLv8imX0/V1d/44XvJSAQIAGOFMzEjqnZVcFZ4l0ciEENCo nKBWfWooptOjPQt3CuV0CAn9tYcSEHUKwsxgyT/GqVe4zdHxOEn0ddyLd+pgJNcjkd3aud4gv WJrJuqyeUxVJ4CKjEIlUmNTf3lAAGvEL5ahh3q6a9hGM5fNfJlcwR03aRMPSo6Dc87btmhPvu ZSiE+9eaeimv044np0KWI9VmK7t72FH5TGZqF56vg2e1qv4dCvDQwp0xY+FO1hcFpYfpD+ZVD zW1vwi2zHCIHNRR481PPhO4iW6zqjYD+65In31YDN8nn2yybeUi0FfFYs4UzSnTvUcGGX58Uy oyedBDg+wyuin2isZM/PP4gaHOhPyRe7E6LAWqDT0uKRDVVwFyEcn+7INR5hdzpWNIB0JjLh/ J0JYB1P5HRxcalAW9RWhUYlR8x1TceRCViTy8UOt/dcKlG4op9wkERWhg2T+eWKBDlu5sTDY/ MVW/r/aiZoHBxDzIbaw60g2dP5tX13vlcgonlxBfp6eysNuWd81gv4A2dhi1u06Tp7Uij24pk HFzVvd1w3YHsKvhpxWAw== Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org When padding undersized frames, lib8390.c utilizes a stack scratch area plus memset/memcpy. In doing so, it is overwriting content already zeroed with memset, which seems not optimal even when commented as being more efficient. Using eth_skb_pad() allows us to remove memset/memcpy and the stack scratch area altogether. v2 changes: - split cleanup of variables in seperate patch - revise commit description Armin Wolf (2): lib8390: Use eth_skb_pad() lib8390: Cleanup variables drivers/net/ethernet/8390/lib8390.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) --- 2.20.1