mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Justin Lai <justinlai0215@realtek.com>, Jakub Kicinski <kuba@kernel.org>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"andrew@lunn.ch" <andrew@lunn.ch>,
	"jiri@resnulli.us" <jiri@resnulli.us>,
	"horms@kernel.org" <horms@kernel.org>,
	"rkannoth@marvell.com" <rkannoth@marvell.com>,
	"jdamato@fastly.com" <jdamato@fastly.com>,
	Ping-Ke Shih <pkshih@realtek.com>,
	Larry Chiu <larry.chiu@realtek.com>
Subject: Re: [PATCH net-next v25 06/13] rtase: Implement .ndo_start_xmit function
Date: Tue, 30 Jul 2024 21:34:03 +0200	[thread overview]
Message-ID: <69af4321-6c4b-42a0-b183-9f73bcf479aa@gmail.com> (raw)
In-Reply-To: <f43b61ec5e624ae78dc5d564e8735ef3@realtek.com>

On 30.07.2024 11:27, Justin Lai wrote:
>> On Mon, 29 Jul 2024 14:21:14 +0800 Justin Lai wrote:
>>> +     stop_queue = !netif_subqueue_maybe_stop(dev, ring->index,
>>> +                                             rtase_tx_avail(ring),
>>> +
>> RTASE_TX_STOP_THRS,
>>> +
>> RTASE_TX_START_THRS);
>>> +
>>> +     if (door_bell || stop_queue)
>>> +             rtase_w8(tp, RTASE_TPPOLL, BIT(ring->index));
>>> +
>>> +     return NETDEV_TX_OK;
>>> +
>>> +err_dma_1:
>>> +     ring->skbuff[entry] = NULL;
>>> +     rtase_tx_clear_range(ring, ring->cur_idx + 1, frags);
>>> +
>>> +err_dma_0:
>>> +     tp->stats.tx_dropped++;
>>> +     dev_kfree_skb_any(skb);
>>> +     return NETDEV_TX_OK;
>>> +
>>> +err_stop:
>>> +     netif_stop_queue(dev);
>>> +     tp->stats.tx_dropped++;
>>> +     return NETDEV_TX_BUSY;
>>
>> If you're dropping a packet you should somehow check that the previous xmit
>> didn't enqueue a packet to the ring and skip the doorbell because door_bell
>> was false. If that's the case you have to ring the doorbell now.
>>
I briefly checked and this may be a common issue, e.g. stmmac_xmit() behaves
the same as r8169 here.
Hitting this error path should be a rare event, so we could ring the doorbell
always, w/o any further checks?

>> Also you shouldn't increment dropped if you return TX_BUSY.
> 
I'll take care of this change for r8169.

> Thank you for your response. I will modify it.
>>
>> Please fix these issues in the driver you're copying from, too.
> 
> I will inform the person responsible for the R8169 of the issues we've
> identified and discuss what modifications need to be made.
> 
> Thanks
> Justin
> 


  parent reply	other threads:[~2024-07-30 19:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29  6:21 [PATCH net-next v25 00/13] Add Realtek automotive PCIe driver Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 01/13] rtase: Add support for a pci table in this module Justin Lai
2024-07-29  9:33   ` Markus Elfring
2024-07-29 11:31     ` Justin Lai
2024-07-29 13:00     ` Andrew Lunn
2024-07-29 16:44       ` Markus Elfring
2024-07-29  6:21 ` [PATCH net-next v25 02/13] rtase: Implement the .ndo_open function Justin Lai
2024-07-30  2:15   ` Jakub Kicinski
2024-07-30  9:24     ` Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 03/13] rtase: Implement the rtase_down function Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 04/13] rtase: Implement the interrupt routine and rtase_poll Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 05/13] rtase: Implement hardware configuration function Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 06/13] rtase: Implement .ndo_start_xmit function Justin Lai
2024-07-30  2:14   ` Jakub Kicinski
2024-07-30  9:27     ` Justin Lai
2024-07-30 14:12       ` Jakub Kicinski
2024-07-30 19:34       ` Heiner Kallweit [this message]
2024-07-29  6:21 ` [PATCH net-next v25 07/13] rtase: Implement a function to receive packets Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 08/13] rtase: Implement net_device_ops Justin Lai
2024-07-29 10:29   ` Joe Damato
2024-07-29 11:39     ` Justin Lai
2024-07-29 11:56       ` Joe Damato
2024-07-29 12:26         ` Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 09/13] rtase: Implement pci_driver suspend and resume function Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 10/13] rtase: Implement ethtool function Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 11/13] rtase: Add a Makefile in the rtase folder Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 12/13] realtek: Update the Makefile and Kconfig in the realtek folder Justin Lai
2024-07-29  6:21 ` [PATCH net-next v25 13/13] MAINTAINERS: Add the rtase ethernet driver entry Justin Lai

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=69af4321-6c4b-42a0-b183-9f73bcf479aa@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=jiri@resnulli.us \
    --cc=justinlai0215@realtek.com \
    --cc=kuba@kernel.org \
    --cc=larry.chiu@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pkshih@realtek.com \
    --cc=rkannoth@marvell.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®