Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ganji Aravind <ganji.aravind@chelsio.com>
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	[thread overview]
Message-ID: <20200818154058.1770002-2-ganji.aravind@chelsio.com> (raw)
In-Reply-To: <20200818154058.1770002-1-ganji.aravind@chelsio.com>

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 <ganji.aravind@chelsio.com>
---
 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;
-- 
2.26.2


  reply	other threads:[~2020-08-18 15:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 15:40 [PATCH net 0/2]cxgb4: Fix ethtool selftest flits calculation Ganji Aravind
2020-08-18 15:40 ` Ganji Aravind [this message]
2020-08-18 19:33   ` [PATCH net 1/2] cxgb4: Fix work request size calculation for loopback test Jesse Brandeburg
2020-08-18 15:40 ` [PATCH net 2/2] cxgb4: Fix race between loopback and normal Tx path Ganji Aravind
2020-08-18 19:35   ` Jesse Brandeburg
2020-08-18 20:03 ` [PATCH net 0/2]cxgb4: Fix ethtool selftest flits calculation David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200818154058.1770002-2-ganji.aravind@chelsio.com \
    --to=ganji.aravind@chelsio.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=rahul.lakkireddy@chelsio.com \
    --cc=vishal@chelsio.com \
    --subject='Re: [PATCH net 1/2] cxgb4: Fix work request size calculation for loopback test' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).