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]
Message-ID: <20100217223104.41d91a83@wker>
Date:	Wed, 17 Feb 2010 22:31:04 +0100
From:	Anatolij Gustschin <agust@...x.de>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	netdev@...r.kernel.org, linuxppc-dev@...abs.org,
	"David S. Miller" <davem@...emloft.net>,
	Grant Likely <grant.likely@...retlab.ca>,
	Detlev Zundel <dzu@...x.de>, Wolfgang Denk <wd@...x.de>,
	John Rigby <jcrigby@...il.com>,
	Piotr Ziecik <kosmo@...ihalf.com>
Subject: Re: [net-next-2.6 PATCH v2 3/3] fs_enet: add FEC TX buffer
 alignment workaround for MPC5121

On Wed, 17 Feb 2010 16:17:16 +0100
Eric Dumazet <eric.dumazet@...il.com> wrote:

> Le mercredi 17 février 2010 à 15:55 +0100, Anatolij Gustschin a écrit :
...
> > +static struct sk_buff *tx_skb_align_workaround(struct net_device *dev,
> > +					       struct sk_buff *skb)
> > +{
> > +	struct sk_buff *new_skb;
> > +	struct fs_enet_private *fep = netdev_priv(dev);
> > +
> > +	/* Alloc new skb */
> > +	new_skb = dev_alloc_skb(ENET_RX_FRSIZE + 4);
> 
> 
> ENET_RX_FRSIZE looks strange in TX path
> 
> Why not using skb->len + 4 instead of ENET_RX_FRSIZE + 4 ?

I will fix it.

> > +	if (!new_skb) {
> > +		dev_warn(fep->dev, "Memory squeeze, dropping tx packet.\n");
> 
> I am just wondering if this is ratelimited ?

Right, it should be ratelimited, will fix it, too.

...
> >  static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
> >  {
> >  	struct fs_enet_private *fep = netdev_priv(dev);
> > @@ -588,6 +619,19 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
> >  	u16 sc;
> >  	unsigned long flags;
> >  
> > +#ifdef CONFIG_FS_ENET_MPC5121_FEC
> > +	if (((unsigned long)skb->data) & 0x3) {
> > +		skb = tx_skb_align_workaround(dev, skb);
> > +		if (!skb) {
> > +			/*
> > +			 * We have lost packet due to memory allocation error
> > +			 * in tx_skb_align_workaround(). Hopefully original
> > +			 * skb is still valid, so try transmit it later.
> > +			 */
> 
> Could you define 'try to transmit later' ?
> Who is responsible to trigger this event ?

The function returns NETDEV_TX_BUSY here, skb is not
consumed and will be requeued by sch_direct_xmit(), so
it is scheduled for resending later.

Thanks,
Anatolij
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ