Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3182021ybv; Sat, 15 Feb 2020 13:18:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxk0ULRRWE91z7aYj1VQWmsG2RKwBQLedwij4smZCxZwHj4pr+EOPPonujPljzKMPfw9Ml/ X-Received: by 2002:a9d:7851:: with SMTP id c17mr7278680otm.58.1581801509712; Sat, 15 Feb 2020 13:18:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581801509; cv=none; d=google.com; s=arc-20160816; b=v9ClhZ6ipVYziFCPhRX1KA8sPS9rN+hP1+jIdDvVYqS3vvvjX5QY8b2aOtEThGaIhA FartngbjxHk7UBpAUPlUZPvfUHwSpzV428EpM+aTdxqaaLA41N/4L+kKU15syZOb60UI yYC7MSb0Ds5qdGt0sw9mfcpmV75M9XdejAxX0cvll7aX5MGnuN8MUUuaP/cbBmcTBmxW EjYPvJkEemhZ45U67WE2tV/evMFpBUW787slGleS0m9YPV3hrZsHzG50jiKzOtCy3Mpw xXZd4rEv3cC1+4XkK4ag1+onIuHoLu+L2C5rNcSktwUjSlhjx0AA/2yYhPysKOU5CjHl EfZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:from:references:in-reply-to :message-id:cc:to; bh=EOvnwT/a8NDlGr/QoHsGPVSwRzh8l9tmMkgTGTv7MxQ=; b=AfD18Qq7kazweNPdYOq5F+9ASBRkcFox1IVTQ8qDbuOVspVg+blHNtvmIHHFgUk3IT GJuaVogvDnvQw3z34frgE0Kg4iUYtR+IAKcNlMj0eTDdKhmFVc9gRWUNEB1n6FbHELQw 6yI2H+412khfdo+3oov5xdBUqi3qVYvqQ5Qg4frUpq05i5zXFjYXIGuOVzmVcC5nzOz1 7qMM3Q2hP8pHMjy347s8g+sWAbZOTxjE9XoYYMo8FQeanN/f8yAENCFzk+3OA2O1uBqI q4OiqYpUejca5megf90qW+mc0zZHFMw32/wrzcrFMsQGnzmoyuIiWiAlxp8fQJ/GnKaV MkZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si4859842oti.22.2020.02.15.13.18.17; Sat, 15 Feb 2020 13:18:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727934AbgBOVSF (ORCPT + 99 others); Sat, 15 Feb 2020 16:18:05 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:34950 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727668AbgBOVSD (ORCPT ); Sat, 15 Feb 2020 16:18:03 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id EE9C429B31; Sat, 15 Feb 2020 16:18:01 -0500 (EST) To: "David S. Miller" Cc: Thomas Bogendoerfer , Chris Zankel , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: In-Reply-To: References: From: Finn Thain Subject: [PATCH net-next 6/7] net/sonic: Start packet transmission immediately Date: Sun, 16 Feb 2020 08:03:32 +1100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Give the transmit command as soon as the transmit descriptor is ready. Tested-by: Stan Johnson Signed-off-by: Finn Thain --- drivers/net/ethernet/natsemi/sonic.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/natsemi/sonic.c b/drivers/net/ethernet/natsemi/sonic.c index 508c6a80fc6e..dd3605aa5f23 100644 --- a/drivers/net/ethernet/natsemi/sonic.c +++ b/drivers/net/ethernet/natsemi/sonic.c @@ -311,12 +311,17 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) sonic_tda_put(dev, entry, SONIC_TD_LINK, sonic_tda_get(dev, entry, SONIC_TD_LINK) | SONIC_EOL); + sonic_tda_put(dev, lp->eol_tx, SONIC_TD_LINK, ~SONIC_EOL & + sonic_tda_get(dev, lp->eol_tx, SONIC_TD_LINK)); + + netif_dbg(lp, tx_queued, dev, "%s: issuing Tx command\n", __func__); + + SONIC_WRITE(SONIC_CMD, SONIC_CR_TXP); + lp->tx_len[entry] = length; lp->tx_laddr[entry] = laddr; lp->tx_skb[entry] = skb; - sonic_tda_put(dev, lp->eol_tx, SONIC_TD_LINK, - sonic_tda_get(dev, lp->eol_tx, SONIC_TD_LINK) & ~SONIC_EOL); lp->eol_tx = entry; entry = (entry + 1) & SONIC_TDS_MASK; @@ -327,10 +332,6 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) /* after this packet, wait for ISR to free up some TDAs */ } - netif_dbg(lp, tx_queued, dev, "%s: issuing Tx command\n", __func__); - - SONIC_WRITE(SONIC_CMD, SONIC_CR_TXP); - spin_unlock_irqrestore(&lp->lock, flags); return NETDEV_TX_OK; -- 2.24.1