From patchwork Tue Aug 18 15:40:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganji Aravind X-Patchwork-Id: 262361 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=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 3FD06C433DF for ; Tue, 18 Aug 2020 15:41:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18718207D3 for ; Tue, 18 Aug 2020 15:41:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726703AbgHRPln (ORCPT ); Tue, 18 Aug 2020 11:41:43 -0400 Received: from stargate.chelsio.com ([12.32.117.8]:36597 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726639AbgHRPl0 (ORCPT ); Tue, 18 Aug 2020 11:41:26 -0400 Received: from localhost (fedora32ganji.blr.asicdesigners.com [10.193.80.135]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id 07IFfDXT024132; Tue, 18 Aug 2020 08:41:13 -0700 From: Ganji Aravind To: netdev@vger.kernel.org Cc: davem@davemloft.net, vishal@chelsio.com, rahul.lakkireddy@chelsio.com Subject: [PATCH net 1/2] cxgb4: Fix work request size calculation for loopback test Date: Tue, 18 Aug 2020 21:10:57 +0530 Message-Id: <20200818154058.1770002-2-ganji.aravind@chelsio.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818154058.1770002-1-ganji.aravind@chelsio.com> References: <20200818154058.1770002-1-ganji.aravind@chelsio.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Work request used for sending loopback packet needs to add the firmware work request only once. So, fix by using correct structure size. Fixes: 7235ffae3d2c ("cxgb4: add loopback ethtool self-test") Signed-off-by: Ganji Aravind --- drivers/net/ethernet/chelsio/cxgb4/sge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c index d2b587d1670a..7c9fe4bc235b 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c @@ -2553,8 +2553,8 @@ int cxgb4_selftest_lb_pkt(struct net_device *netdev) pkt_len = ETH_HLEN + sizeof(CXGB4_SELFTEST_LB_STR); - flits = DIV_ROUND_UP(pkt_len + sizeof(struct cpl_tx_pkt) + - sizeof(*wr), sizeof(__be64)); + flits = DIV_ROUND_UP(pkt_len + sizeof(*cpl) + sizeof(*wr), + sizeof(__be64)); ndesc = flits_to_desc(flits); lb = &pi->ethtool_lb;