netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Chiu <larry.chiu@realtek.com>
To: Jakub Kicinski <kuba@kernel.org>, Justin Lai <justinlai0215@realtek.com>
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>
Subject: RE: [PATCH net-next v29 07/13] rtase: Implement a function to receive packets
Date: Tue, 3 Sep 2024 02:51:43 +0000	[thread overview]
Message-ID: <03177710937042bb93dfbf3237394a91@realtek.com> (raw)
In-Reply-To: <20240902190425.6eef2ee6@kernel.org>



> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Tuesday, September 3, 2024 10:04 AM
> To: Justin Lai <justinlai0215@realtek.com>
> Cc: davem@davemloft.net; edumazet@google.com; pabeni@redhat.com;
> linux-kernel@vger.kernel.org; netdev@vger.kernel.org; andrew@lunn.ch;
> jiri@resnulli.us; horms@kernel.org; rkannoth@marvell.com;
> jdamato@fastly.com; Ping-Ke Shih <pkshih@realtek.com>; Larry Chiu
> <larry.chiu@realtek.com>
> Subject: Re: [PATCH net-next v29 07/13] rtase: Implement a function to
> receive packets
> 
> 
> External mail.
> 
> 
> 
> On Thu, 29 Aug 2024 11:48:26 +0800 Justin Lai wrote:
> > +             skb->dev = dev;
> 
> no need to assign skb->dev = dev; eth_type_trans() will do it for you

Thanks, we will remove it.

> 
> > +             skb_put(skb, pkt_size);
> > +             skb_mark_for_recycle(skb);
> > +             skb->protocol = eth_type_trans(skb, dev);
> > +
> > +             if (skb->pkt_type == PACKET_MULTICAST)
> > +                     tp->stats.multicast++;
> > +
> > +             rtase_rx_vlan_skb(desc, skb);
> > +             rtase_rx_skb(ring, skb);
> > +
> > +             dev_sw_netstats_rx_add(dev, pkt_size);
> > +
> > +skip_process_pkt:
> > +             workdone++;
> > +             cur_rx++;
> > +             entry = cur_rx % RTASE_NUM_DESC;
> > +             desc = ring->desc + sizeof(union rtase_rx_desc) * entry;
> > +     } while (workdone != budget);
> 
> The check needs to be at the start of the function.
> NAPI can be called with budget of 0 to limit the processing
> to just Tx cleanup. In that case no packet should be received.

OK, we will use a for loop instead.


  reply	other threads:[~2024-09-03  2:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29  3:48 [PATCH net-next v29 00/13] Add Realtek automotive PCIe driver Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 01/13] rtase: Add support for a pci table in this module Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 02/13] rtase: Implement the .ndo_open function Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 03/13] rtase: Implement the rtase_down function Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 04/13] rtase: Implement the interrupt routine and rtase_poll Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 05/13] rtase: Implement hardware configuration function Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 06/13] rtase: Implement .ndo_start_xmit function Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 07/13] rtase: Implement a function to receive packets Justin Lai
2024-09-03  2:04   ` Jakub Kicinski
2024-09-03  2:51     ` Larry Chiu [this message]
2024-08-29  3:48 ` [PATCH net-next v29 08/13] rtase: Implement net_device_ops Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 09/13] rtase: Implement pci_driver suspend and resume function Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 10/13] rtase: Implement ethtool function Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 11/13] rtase: Add a Makefile in the rtase folder Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 12/13] realtek: Update the Makefile and Kconfig in the realtek folder Justin Lai
2024-08-29  3:48 ` [PATCH net-next v29 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=03177710937042bb93dfbf3237394a91@realtek.com \
    --to=larry.chiu@realtek.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=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;
as well as URLs for NNTP newsgroup(s).