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] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1748532C@AcuExch.aculab.com>
Date:	Tue, 2 Sep 2014 08:49:09 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Tom Herbert' <therbert@...gle.com>,
	David Miller <davem@...emloft.net>
CC:	Linux Netdev List <netdev@...r.kernel.org>
Subject: RE: [PATCH 8/9] net: Don't keep around original SKB when we
 software segment GSO frames.

From: Tom Herbert
> On Mon, Sep 1, 2014 at 3:25 PM, David Miller <davem@...emloft.net> wrote:
> >
> > Just maintain the list properly by returning the head of the remaining
> > SKB list from dev_hard_start_xmit().
> >
> > Signed-off-by: David S. Miller <davem@...emloft.net>
> > ---
> >  include/linux/netdevice.h |  4 +--
> >  net/core/dev.c            | 79 +++++++++--------------------------------------
> >  net/sched/sch_generic.c   |  2 +-
> >  3 files changed, 17 insertions(+), 68 deletions(-)
> >
> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > index 47c49ba..202c25a 100644
> > --- a/include/linux/netdevice.h
> > +++ b/include/linux/netdevice.h
> > @@ -2828,8 +2828,8 @@ int dev_change_carrier(struct net_device *, bool new_carrier);
> >  int dev_get_phys_port_id(struct net_device *dev,
> >                          struct netdev_phys_port_id *ppid);
> >  struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device *dev);
> > -int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
> > -                       struct netdev_queue *txq);
> > +struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
> > +                                   struct netdev_queue *txq, int *ret);
> 
> Might be slightly better to still return int but pass struct sk_buff
> **skb. One less argument and doesn't change return type.

It makes a difference to how the compiler can compile the calling code.
Whichever variable you pass by reference has to be assumed to be changeable
by every following function call - so can't be placed in a callee saved register.

Ideally you want both values returned in registers - difficult to do portably.

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ