Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4154964ybv; Mon, 10 Feb 2020 13:29:07 -0800 (PST) X-Google-Smtp-Source: APXvYqyhCB0ki6yxamUtKanNGM9eiNMwGcXp/6FU5Kb6IkHS6j9+JHI2yAlPndF9m59fGW0anmsB X-Received: by 2002:a9d:65c1:: with SMTP id z1mr2771679oth.180.1581370147827; Mon, 10 Feb 2020 13:29:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581370147; cv=none; d=google.com; s=arc-20160816; b=H65/8jv10On8DaGQw6g+oeYb2a5Iy/Wj/j0xicZxLy7QaaOjZzCwuyXjmNLJm6xSN8 VIqn8uYgVcUKV0v5j6A6x2eF9kOSW+nQx1P3+JJS1QXUxn2jHJRynoub8Mb61IBAarj2 pwuScvSR3zdnc9RlCt3Sf01cMzOCXGmNzu3CetFg5IYRLFxfo5ajERswwzc+C8t8XjYf zHcf+JIAmpEmTdKQs9fOfeTHrzlczuVk+8R2ZjFpZnnV6vMnFECP5pJ05xZ1hi2KRrJX B6oZtBXUHtvfkdTqJ+RfgXb3RnHXORU8m9tTxY3nTJ7lQ5WSJ+WT6Eo/RmjklW7ybPH3 Jb2Q== 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=TM+s4GBZCtC608lSxbsyLO448dw5KQ7OPGd2jdqnWSh7twQugH3sk3PnKvskYhz18+ pQLdJ5lx00RRdO1KdctODW1VOqpG4gPKLr3ll8Nx/Ejxim24225XvI1uCvoaq8UrVZs+ ryIa8VWope/FQnG6VYnvbBGHsRk6v9TETFjJKE2zo9hy+AYJslqibtQvUD8/beIc9c6o BMkiMtm0ETs8HTqqXAXtWRAH4Q2yUcKjC5si+KZgGpGEGlyhn0mN0xMJAP+FvxWLovTt 7AK7ofsviWvVydmKVkFkHJ5Aa9ymClfiAw6kpHLq0bMKgyTXQNcI67EtEmBwpSPqgLuX ilRQ== 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 l84si696722oig.5.2020.02.10.13.28.54; Mon, 10 Feb 2020 13:29:07 -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 S1727710AbgBJV1M (ORCPT + 99 others); Mon, 10 Feb 2020 16:27:12 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:59760 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbgBJV0u (ORCPT ); Mon, 10 Feb 2020 16:26:50 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 419A229B52; Mon, 10 Feb 2020 16:26:48 -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: Tue, 11 Feb 2020 08:18:50 +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