From: Justin Lai <justinlai0215@realtek.com>
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: "kuba@kernel.org" <kuba@kernel.org>,
"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>,
Ping-Ke Shih <pkshih@realtek.com>,
Larry Chiu <larry.chiu@realtek.com>
Subject: RE: [PATCH net-next v20 06/13] rtase: Implement .ndo_start_xmit function
Date: Wed, 12 Jun 2024 04:20:29 +0000 [thread overview]
Message-ID: <4a894465ea0747d08c96282602bcdf6b@realtek.com> (raw)
In-Reply-To: <20240607155420.GA3743392@maili.marvell.com>
> On 2024-06-07 at 14:13:14, Justin Lai (justinlai0215@realtek.com) wrote:
> > Implement .ndo_start_xmit function to fill the information of the
> > packet to be transmitted into the tx descriptor, and then the hardware
> > will transmit the packet using the information in the tx descriptor.
> > In addition, we also implemented the tx_handler function to enable the
> > tx descriptor to be reused.
> >
> > Signed-off-by: Justin Lai <justinlai0215@realtek.com>
> > ---
> > .../net/ethernet/realtek/rtase/rtase_main.c | 285 ++++++++++++++++++
> > 1 file changed, 285 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > b/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > index 23406c195cff..6bdb4edbfbc1 100644
> > --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > @@ -256,6 +256,68 @@ static void rtase_mark_to_asic(union rtase_rx_desc
> *desc, u32 rx_buf_sz)
> > cpu_to_le32(RTASE_DESC_OWN | eor | rx_buf_sz)); }
> >
> > +static u32 rtase_tx_avail(struct rtase_ring *ring) {
> > + return READ_ONCE(ring->dirty_idx) + RTASE_NUM_DESC -
> > + READ_ONCE(ring->cur_idx); }
> dirty_idx and cur_idx wont wrap ? its 32bit in size.
>
> >
cur_idx and dirty_idx may wrap, but all we want is the difference between
them, so this won't have any effect. In addition, the difference between
the two will not exceed RTASE_NUM_DESC, and dirty_idx will not exceed
cur_idx, so the calculation won't go wrong.
next prev parent reply other threads:[~2024-06-12 4:21 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 8:43 [PATCH net-next v20 00/13] Add Realtek automotive PCIe driver Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 01/13] rtase: Add pci table supported in this module Justin Lai
2024-06-13 9:01 ` Markus Elfring
2024-06-17 8:14 ` Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 02/13] rtase: Implement the .ndo_open function Justin Lai
2024-06-13 7:50 ` Markus Elfring
2024-06-17 9:25 ` Justin Lai
2024-06-17 10:07 ` [v20 " Markus Elfring
2024-06-17 13:28 ` Justin Lai
2024-06-17 18:59 ` Simon Horman
2024-06-17 20:22 ` Markus Elfring
2024-06-18 7:51 ` Justin Lai
[not found] ` <202406181007.45IA7eWxA3305754@rtits1.realtek.com.tw>
2024-06-18 11:01 ` Justin Lai
2024-06-18 11:30 ` Markus Elfring
2024-06-07 8:43 ` [PATCH net-next v20 03/13] rtase: Implement the rtase_down function Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 04/13] rtase: Implement the interrupt routine and rtase_poll Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 05/13] rtase: Implement hardware configuration function Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 06/13] rtase: Implement .ndo_start_xmit function Justin Lai
2024-06-07 9:03 ` Hariprasad Kelam
2024-06-12 4:35 ` Justin Lai
2024-06-12 10:36 ` Hariprasad Kelam
2024-06-13 3:38 ` Justin Lai
2024-06-13 7:24 ` Hariprasad Kelam
2024-06-07 15:54 ` Ratheesh Kannoth
2024-06-12 4:20 ` Justin Lai [this message]
2024-06-07 8:43 ` [PATCH net-next v20 07/13] rtase: Implement a function to receive packets Justin Lai
2024-06-13 0:43 ` Jakub Kicinski
2024-06-17 6:44 ` Justin Lai
2024-06-17 15:02 ` Jakub Kicinski
2024-06-18 3:40 ` Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 08/13] rtase: Implement net_device_ops Justin Lai
2024-06-13 0:39 ` Jakub Kicinski
2024-06-13 3:16 ` Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 09/13] rtase: Implement pci_driver suspend and resume function Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 10/13] rtase: Implement ethtool function Justin Lai
2024-06-13 0:35 ` Jakub Kicinski
2024-06-17 6:54 ` Justin Lai
2024-06-17 14:07 ` Andrew Lunn
2024-06-18 9:56 ` Justin Lai
2024-06-17 15:10 ` Jakub Kicinski
2024-06-18 7:28 ` Justin Lai
2024-06-18 14:24 ` Jakub Kicinski
2024-06-19 3:40 ` Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 11/13] rtase: Add a Makefile in the rtase folder Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 12/13] realtek: Update the Makefile and Kconfig in the realtek folder Justin Lai
2024-06-07 8:43 ` [PATCH net-next v20 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=4a894465ea0747d08c96282602bcdf6b@realtek.com \
--to=justinlai0215@realtek.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--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