lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 1 Dec 2023 10:11:09 +0000
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To: Sergey Shtylyov <s.shtylyov@....ru>, "davem@...emloft.net"
	<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
	"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>
Subject: RE: [PATCH net-next v2 8/9] net: rswitch: Add jumbo frames handling
 for TX

Hello Sergey,

> From: Sergey Shtylyov, Sent: Friday, December 1, 2023 5:55 PM
> 
> On 12/1/23 8:46 AM, Yoshihiro Shimoda wrote:
> 
> > If the driver would like to transmit a jumbo frame like 2KiB or more,
> > it should be split into multiple queues. In the near future, to support
> > this, add handling specific descriptor types F{START,MID,END}. However,
> > such jumbo frames will not happen yet because the maximum MTU size is
> > still default for now.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
> [...]
> 
> > diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c
> > index 009e6bfdad27..c5e3ee8f82bc 100644
> > --- a/drivers/net/ethernet/renesas/rswitch.c
> > +++ b/drivers/net/ethernet/renesas/rswitch.c
> > @@ -1631,15 +1631,44 @@ static bool rswitch_ext_desc_set(struct rswitch_device *rdev,
> [...]
> >  static netdev_tx_t rswitch_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> >  {
> >  	struct rswitch_device *rdev = netdev_priv(ndev);
> >  	struct rswitch_gwca_queue *gq = rdev->tx_queue;
> > +	dma_addr_t dma_addr, dma_addr_orig;
> >  	netdev_tx_t ret = NETDEV_TX_OK;
> >  	struct rswitch_ext_desc *desc;
> > -	dma_addr_t dma_addr;
> > +	unsigned int i, nr_desc;
> > +	u8 die_dt;
> > +	u16 len;
> >
> > -	if (rswitch_get_num_cur_queues(gq) >= gq->ring_size - 1) {
> > +	nr_desc = (skb->len - 1) / RSWITCH_DESC_BUF_SIZE + 1;
> > +	if (rswitch_get_num_cur_queues(gq) >= gq->ring_size - nr_desc) {
> >  		netif_stop_subqueue(ndev, 0);
> >  		return NETDEV_TX_BUSY;
> >  	}
> > @@ -1647,19 +1676,26 @@ static netdev_tx_t rswitch_start_xmit(struct sk_buff *skb, struct net_device *nd
> >  	if (skb_put_padto(skb, ETH_ZLEN))
> >  		return ret;
> >
> > -	dma_addr = dma_map_single(ndev->dev.parent, skb->data, skb->len, DMA_TO_DEVICE);
> > +	dma_addr_orig = dma_map_single(ndev->dev.parent, skb->data, skb->len, DMA_TO_DEVICE);
> >  	if (dma_mapping_error(ndev->dev.parent, dma_addr))
> 
>    Not dma_addr_orig? dma_addr isn't even set at this point, no?

Oops. Thank you for your review! You're correct. I also realized the error path was wrong like below...
>        dma_unmap_single(ndev->dev.parent, dma_addr, skb->len, DMA_TO_DEVICE);

I'll fix them on v3.

Best regards,
Yoshihiro Shimoda

> 

> [...]
> 
> MBR, Sergey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ