[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ac6161b-373a-47ce-801d-9e4ff1ef258c@wanadoo.fr>
Date: Thu, 23 Jan 2025 08:16:09 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Basharath Hussain Khaja <basharath@...thit.com>, danishanwar@...com,
rogerq@...nel.org, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com, robh@...nel.org,
krzk+dt@...nel.org, conor+dt@...nel.org, nm@...com, ssantosh@...nel.org,
tony@...mide.com, richardcochran@...il.com, parvathi@...thit.com,
schnelle@...ux.ibm.com, rdunlap@...radead.org, diogo.ivo@...mens.com,
m-karicheri2@...com, horms@...nel.org, jacob.e.keller@...el.com,
m-malladi@...com, javier.carrasco.cruz@...il.com, afd@...com, s-anna@...com
Cc: linux-arm-kernel@...ts.infradead.org, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-omap@...r.kernel.org, pratheesh@...com, prajith@...com,
vigneshr@...com, praneeth@...com, srk@...com, rogerq@...com,
krishna@...thit.com, pmohan@...thit.com, mohan@...thit.com
Subject: Re: [RFC PATCH 04/10] net: ti: prueth: Adds link detection, RX and TX
support.
Le 09/01/2025 à 11:55, Basharath Hussain Khaja a écrit :
> From: Roger Quadros <rogerq@...com>
>
> Changes corresponding to link configuration such as speed and duplexity.
> IRQ and handler initializations are performed for packet reception.Firmware
> receives the packet from the wire and stores it into OCMC queue. Next, it
> notifies the CPU via interrupt. Upon receiving the interrupt CPU will
> service the IRQ and packet will be processed by pushing the newly allocated
> SKB to upper layers.
>
> When the user application want to transmit a packet, it will invoke
> sys_send() which will inturn invoke the PRUETH driver, then it will write
> the packet into OCMC queues. PRU firmware will pick up the packet and
> transmit it on to the wire.
Hi,
a few nitpicks.
...
> +static int icssm_prueth_tx_enqueue(struct prueth_emac *emac,
> + struct sk_buff *skb,
> + enum prueth_queue_id queue_id)
> +{
> + struct prueth_queue_desc __iomem *queue_desc;
> + const struct prueth_queue_info *txqueue;
> + u16 bd_rd_ptr, bd_wr_ptr, update_wr_ptr;
> + struct net_device *ndev = emac->ndev;
> + unsigned int buffer_desc_count;
> + int free_blocks, update_block;
> + bool buffer_wrapped = false;
> + int write_block, read_block;
> + void *src_addr, *dst_addr;
> + int pkt_block_size;
> + void __iomem *dram;
> + int txport, pktlen;
> + u32 wr_buf_desc;
> + void *ocmc_ram;
> +
> + dram = emac->prueth->mem[emac->dram].va;
> + if (eth_skb_pad(skb)) {
> + if (netif_msg_tx_err(emac) && net_ratelimit())
> + netdev_err(ndev, "packet pad failed");
Missing trailing \n.
> + return -ENOMEM;
> + }
> +
> + /* which port to tx: MII0 or MII1 */
> + txport = emac->tx_port_queue;
...
> +static int icssm_emac_request_irqs(struct prueth_emac *emac)
> +{
> + struct net_device *ndev = emac->ndev;
> + int ret = 0;
No need to init.
> +
> + ret = request_threaded_irq(emac->rx_irq, NULL, icssm_emac_rx_thread,
> + IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
> + ndev->name, ndev);
> + if (ret) {
> + netdev_err(ndev, "unable to request RX IRQ\n");
> + return ret;
> + }
...
> +static int icssm_emac_ndo_start_xmit(struct sk_buff *skb,
> + struct net_device *ndev)
> +{
> + struct prueth_emac *emac = netdev_priv(ndev);
> + int ret = 0;
> + u16 qid;
> +
> + if (unlikely(!emac->link)) {
> + if (netif_msg_tx_err(emac) && net_ratelimit())
> + netdev_err(ndev, "No link to transmit");
\n
> + goto fail_tx;
> + }
> +
> + qid = icssm_prueth_get_tx_queue_id(emac->prueth, skb);...
CJ
Powered by blists - more mailing lists