From patchwork Fri Oct 27 12:16:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinas Rasheed X-Patchwork-Id: 158917 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp557264vqb; Fri, 27 Oct 2023 05:17:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGX10lI9gFuUVt+gnU2aPCo/+J34ZuzxGCLLJM+Enx438ThPr4SktKspDeNa916s5YZ14zC X-Received: by 2002:a81:b623:0:b0:59c:678:7a32 with SMTP id u35-20020a81b623000000b0059c06787a32mr2638859ywh.29.1698409038999; Fri, 27 Oct 2023 05:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698409038; cv=none; d=google.com; s=arc-20160816; b=V+jVPb7hoX3xXrjXQ8owLMroy3/NjJnA2M61hQacQbE3DnZ85EZxmIIn14llh1zjqf T8tV7sFEP83uxsegPOr7ccucgyXXL+FOzbVlR6msDg61EIdM+V1Og+jj3YE8zduLnpuB rf9/GCreYV5xhYN+keEEynTZaqGEN6QBaW537nu31RRmHXya4hZuyQLOnIp0cDzEd2b6 oPXkM5Ode0HC4stwkpSvuXA+jCZ/IULZv7e0PBbCZDtUo953EA3shRdSflBnaOJTUY18 K8mHweVLV93b+tbDJPyamB6HtM0rBOJJuQbqm6J1zCqIgltrVc6q7JOP9gjMKuaDzVMm vfIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NgILK9wtLyMUAwzUUpKcc8XDHZhA7pOaSTnLVOywbdQ=; fh=PUbSZjf2dtyqulLdd5rISVghnntgSGxvYpWMBobeHB0=; b=i5oaCyj28ZtcJA1ErUqS7IXxbYTs5SKx3pDufCs0EfFMZnHXUSVkM/W/ACn9kyjTqu YDZCts2nyYXViGbWNjpksptwbXE0IhSMZbwu35LH+sE4r80nMqGRejYjvbyFydI9bxVw COqDXqtK41/xR/oBukws9AoqHW2QR6engdWLo81eqfSSqBd7udwC7HVX52iBodevGQyD AsiQ//zUaX09q9obugAbmdcMLCcoqERokHF7paWknXb3tBPfuE1Xvx5WI1e4ccl4bOIi qRx1vgeCyQuPUY0RhGdXuIvhv2QKZkezHWCqa07PZihDE+JNXQFUbTVBDNTeQOtxoOG8 /gxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=j+y6QEij; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id p206-20020a815bd7000000b0059f7c51f9easi2325380ywb.377.2023.10.27.05.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 05:17:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=j+y6QEij; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9594F8055569; Fri, 27 Oct 2023 05:17:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345585AbjJ0MRG (ORCPT + 25 others); Fri, 27 Oct 2023 08:17:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345804AbjJ0MRF (ORCPT ); Fri, 27 Oct 2023 08:17:05 -0400 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9A3E129; Fri, 27 Oct 2023 05:17:02 -0700 (PDT) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39R5TnCT012403; Fri, 27 Oct 2023 05:16:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=NgILK9wtLyMUAwzUUpKcc8XDHZhA7pOaSTnLVOywbdQ=; b=j+y6QEijy0fZMfGbAOS4xBaehRxdN8Ze6q+Ts8jT+fxvSFTezgdCg7gHqlRV/FSnxZXl 4aL3cZpb+LiTKnb9PdvSwPXTubnmaSatKKhRka+UT+YME7g18qES6qW/B8i8KTVZUXaX sFz5JUqS8sYKerEjQEMh2WsMU7YiGh6a3gbjDFpMcDdRavHX1EpFnzmrZeIdpRqckneM odY5GzbsJNc/hu3T56igKotHe3OWFTSQnurScM7UdOYT6lYUX/HNJXpBMoe9lOfdSWK+ df4jNVajIyjxFteVuOAToI1uB3usBaVweG4xt2piqnBz7msLuU0zB0I45zCM8Qi6dE5o BQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3tywr83b2x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 27 Oct 2023 05:16:55 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 27 Oct 2023 05:16:54 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Fri, 27 Oct 2023 05:16:54 -0700 Received: from ubuntu-PowerEdge-T110-II.sclab.marvell.com (unknown [10.106.27.86]) by maili.marvell.com (Postfix) with ESMTP id D8F7D3F7050; Fri, 27 Oct 2023 05:16:53 -0700 (PDT) From: Shinas Rasheed To: , CC: , , , , , , , , , , Shinas Rasheed , "Veerasenareddy Burru" , Sathesh Edara , Eric Dumazet Subject: [PATCH net-next v3 1/4] octeon_ep: add padding for small packets Date: Fri, 27 Oct 2023 05:16:36 -0700 Message-ID: <20231027121639.2382565-2-srasheed@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027121639.2382565-1-srasheed@marvell.com> References: <20231027121639.2382565-1-srasheed@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: 3qNwm5EDD6Rh59n-SfkWgtZXvZghafBr X-Proofpoint-ORIG-GUID: 3qNwm5EDD6Rh59n-SfkWgtZXvZghafBr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-27_10,2023-10-27_01,2023-05-22_02 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 27 Oct 2023 05:17:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780910956586569118 X-GMAIL-MSGID: 1780910956586569118 Pad small packets to ETH_ZLEN before transmit, as hardware cannot pad and requires software padding to ensure minimum ethernet frame length. Signed-off-by: Shinas Rasheed --- V3: - Updated changelog to provide more info. V2: https://lore.kernel.org/all/20231024145119.2366588-2-srasheed@marvell.com/ - Introduced the patch drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c index 552970c7dec0..2c86b911a380 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c @@ -820,6 +820,9 @@ static netdev_tx_t octep_start_xmit(struct sk_buff *skb, u16 nr_frags, si; u16 q_no, wi; + if (skb_put_padto(skb, ETH_ZLEN)) + return NETDEV_TX_OK; + q_no = skb_get_queue_mapping(skb); if (q_no >= oct->num_iqs) { netdev_err(netdev, "Invalid Tx skb->queue_mapping=%d\n", q_no);