Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 2/5] ipv4: Kill ip_rt_frag_needed().
From: David Miller @ 2012-06-12 20:33 UTC (permalink / raw)
  To: steffen.klassert; +Cc: netdev
In-Reply-To: <20120612114440.GM27795@secunet.com>

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Tue, 12 Jun 2012 13:44:40 +0200

> On Mon, Jun 11, 2012 at 04:02:58PM -0700, David Miller wrote:
>> UDP works by notifying userspace of PMTU events.  And this is
>> mandatory, if we're setting DF we have to get the user to decrease the
>> size of it's datagram writes below the reported PMTU value.
>> 
>> As a consequence I believe RAW sockets should also work via
>> notifications.
>> 
>> And therefore it can be argued that in neither case should we update
>> the routing cache PMTU information.  
> 
> Should be ok as long as all userspace applications that use UDP or
> RAW sockets handle pmtu event notifications properly.

I am convinced that they absolutely must, if they use IP_PMTUDISC_DO.

Otherwise they will continue making larger-than-PMTU sendmsg()
requests.  As these are datagram sockets, we can't simply segment the
data.

> ping might be a special case, but now the behaviour of a big
> sized ping (say 1400 byte on a network that has a router with
> mtu 1300 along the path) with IP_PMTUDISC_WANT might depend on
> whether the cached pmtu informations are updated by a recent
> tcp connection.
> 
> If we had no tcp connection before, we see the behaviour that
> I described in my first mail. All packets have the DF bit set.
> 
> If a tcp connection updated the cached pmtu informations recently,
> the packets don't have the DF bit set. They are fragmented according
> the cached pmtu informations instead.
> 
> Other applications that do not care for pmtu event notifications
> might be in a similar situation. So perhaps we need the kind of
> patch you are suggested.

We can't do exactly as my patch did, because it allows remote entities
to easily poison PMTU information.  All they have to know is that
there is some UDP or RAW socket open with a certain ID and then send
forged ICMP to us.

What we possibly could do is adjust the socket's IP_PMTUDISC_* setting
from IP_PMTUDISC_WANT to IP_PMTUDISC_DONT in response to PMTU
messages.

This seems to solve all the problems.  Individual RAW and UDP sockets
get the behavior they did before, and route cache PMTU poisoning is
less of an issue.

^ permalink raw reply

* Re: [Bug 43327] New: IP routing: cached route is applied to wrong network interface
From: David Miller @ 2012-06-12 20:39 UTC (permalink / raw)
  To: shemminger; +Cc: netdev
In-Reply-To: <20120531174641.2809b5c4@nehalam.linuxnetplumber.net>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 31 May 2012 17:46:41 -0700

> https://bugzilla.kernel.org/show_bug.cgi?id=43327
> 
>            Summary: IP routing: cached route is applied to wrong network
>                     interface

This should now be fixed in net-next, inetpeer trees are rooted in the
FIB rules, so should handle arbitrary route lookup key situations.

^ permalink raw reply

* Re: pull request: wireless-next 2012-06-12
From: David Miller @ 2012-06-12 22:15 UTC (permalink / raw)
  To: linville-2XuSBdqkA4R54TAoqtyWWQ
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20120612200500.GC1932-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>

From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Date: Tue, 12 Jun 2012 16:05:01 -0400

> This is the first big wireless pull request intended for 3.6.
> This includes big updates for the ti bits (expecially regarding
> wl18xx support), a large batch of NFC changes (particularly for
> pn533 hardware support), and the usual large amount of updates for
> ath9k and iwlwifi, as well as a variety of other bits here and there.
> In order to fix/avoid some merge problems, this also includes a pull
> of some wireless fixes that have already been sent for 3.5.
> 
> Please let me know if there are problems!

Pulled, thanks John.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 0/2] netfilter updates for net tree (3.5-rc2)
From: David Miller @ 2012-06-12 22:20 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <1339522563-9227-1-git-send-email-pablo@netfilter.org>

From: pablo@netfilter.org
Date: Tue, 12 Jun 2012 19:36:01 +0200

> You can pull these two changes from:
> 
> git://1984.lsi.us.es/net master

Pulled, thanks Pablo.

^ permalink raw reply

* Re: [PATCH net 1/3] bonding:record primary when modify it via sysfs
From: David Miller @ 2012-06-12 22:24 UTC (permalink / raw)
  To: nicolas.2p.debian; +Cc: fubar, wpan, netdev
In-Reply-To: <4FD7A111.9040004@gmail.com>

From: Nicolas de Pesloüan <nicolas.2p.debian@gmail.com>
Date: Tue, 12 Jun 2012 22:05:37 +0200

> I think this patch (http://patchwork.ozlabs.org/patch/164100/) was
> erroneously flagged as "Changes Requested". Despite my suggestion to
> add a "possible typo" warning, I acked the patch and so do Jay. We
> eventually decided not to add the "possible typo" warning, so the
> patch should be accepted.

Thanks for bringing this to my attention.

Applied and pushed out.

^ permalink raw reply

* Re: [PATCHv2 net-next] ipv4: Add interface option to enable routing of 127.0.0.0/8
From: David Miller @ 2012-06-12 22:26 UTC (permalink / raw)
  To: nhorman; +Cc: netdev
In-Reply-To: <20120612123238.GB15984@hmsreliant.think-freely.org>

From: Neil Horman <nhorman@tuxdriver.com>
Date: Tue, 12 Jun 2012 08:32:38 -0400

> On Tue, Jun 12, 2012 at 07:31:15AM -0400, Thomas Graf wrote:
>> On Tue, Jun 12, 2012 at 07:14:44AM -0400, Neil Horman wrote:
>> > Just out of curiosity, would it be more efficient to implement this by
>> > optionally adding a prohibit route to the local table for 127.0.0.0/8 to every
>> > interface that was brought up, based on weather or not that interfaces
>> > route_localnet bool was true or not?  It would save the additional checks in the
>> > routing path I think.  Not sure how much a savings that is, but I thought I
>> > would ask.
>> 
>> It's not that simple because we also use the local table for source
>> address selection and local address verification. So we would have to
>> exclude/include such routes conditionally based on some route lookup
>> purpose indicator. Such a prohibit route would have to be valid only
>> in the output context.
> 
> ah, understood, so that doesn't really save us anything, it just moves the point
> at which we do the check.
> 
> Acked-by: Neil Horman <nhorman@tuxdriver.com>

Applied, thanks guys.

^ permalink raw reply

* Re: [PATCH v2] bonding: Fix corrupted queue_mapping
From: David Miller @ 2012-06-12 22:30 UTC (permalink / raw)
  To: nhorman; +Cc: eric.dumazet, netdev, therbert, john.r.fastabend, roland
In-Reply-To: <20120612171608.GC15984@hmsreliant.think-freely.org>

From: Neil Horman <nhorman@tuxdriver.com>
Date: Tue, 12 Jun 2012 13:16:08 -0400

> On Tue, Jun 12, 2012 at 06:03:51PM +0200, Eric Dumazet wrote:
>> From: Eric Dumazet <edumazet@google.com>
>> 
>> In the transmit path of the bonding driver, skb->cb is used to
>> stash the skb->queue_mapping so that the bonding device can set its
>> own queue mapping.  This value becomes corrupted since the skb->cb is
>> also used in __dev_xmit_skb.
>> 
>> When transmitting through bonding driver, bond_select_queue is
>> called from dev_queue_xmit.  In bond_select_queue the original
>> skb->queue_mapping is copied into skb->cb (via bond_queue_mapping)
>> and skb->queue_mapping is overwritten with the bond driver queue.
>> 
>> Subsequently in dev_queue_xmit, __dev_xmit_skb is called which writes
>> the packet length into skb->cb, thereby overwriting the stashed
>> queue mappping.  In bond_dev_queue_xmit (called from hard_start_xmit),
>> the queue mapping for the skb is set to the stashed value which is now
>> the skb length and hence is an invalid queue for the slave device.
>> 
>> If we want to save skb->queue_mapping into skb->cb[], best place is to
>> add a field in struct qdisc_skb_cb, to make sure it wont conflict with
>> other layers (eg : Qdiscc, Infiniband...)
>> 
>> This patchs also makes sure (struct qdisc_skb_cb)->data is aligned on 8
>> bytes :
>> 
>> netem qdisc for example assumes it can store an u64 in it, without
>> misalignment penalty.
>> 
>> Note : we only have 20 bytes left in (struct qdisc_skb_cb)->data[].
>> The largest user is CHOKe and it fills it.
>> 
>> Based on a previous patch from Tom Herbert.
>> 
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> Reported-by: Tom Herbert <therbert@google.com>
>> Cc: John Fastabend <john.r.fastabend@intel.com>
>> Cc: Roland Dreier <roland@kernel.org>
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
> 
> Looking at this, it would be really nice if we could have some sort of layer
> independent space in an skb.  It seems we're often looking to shoehorn more
> stuff into the control bock.

Applied.

The problem is that we always have layers that want to record something before
the packet goes through the scheduler, then be able to retrieve it afterwards.
Even more problematic are entities that can encapsulte multiple times for a
single packet.

If we supported bonds of bonds, even Eric's patch here is insufficient.

^ permalink raw reply

* Re: [PATCH 2/7] netfilter: nf_ct_ext: support variable length extensions
From: David Miller @ 2012-06-12 22:35 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <1339524380-2707-3-git-send-email-pablo@netfilter.org>

From: pablo@netfilter.org
Date: Tue, 12 Jun 2012 20:06:15 +0200

> @@ -79,11 +79,16 @@ static inline void nf_ct_ext_free(struct nf_conn *ct)
>  		kfree(ct->ext);
>  }
>  
> +void *__nf_ct_ext_add_length(struct nf_conn *ct, enum nf_ct_ext_id id,
> +			     size_t var_alloc_len, gfp_t gfp);
> +
>  /* Add this type, returns pointer to data or NULL. */
>  void *
>  __nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp);

You should remove this extern declaration for __nf_ct_ext_add() since you
are removing, or rather renaming, it in this patch.

^ permalink raw reply

* Re: [PATCH 7/7] netfilter: add user-space connection tracking helper infrastructure
From: David Miller @ 2012-06-12 22:46 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <1339524380-2707-8-git-send-email-pablo@netfilter.org>

From: pablo@netfilter.org
Date: Tue, 12 Jun 2012 20:06:20 +0200

> +	pr_info("nfnl_cthelper: registering with nfnetlink.\n");
 ...
> +	pr_info("nfnl_cthelper: unregistering from nfnetlink.\n");

These messages are fine during development, but not for the copy you
actually finally commit into your tree :-)

^ permalink raw reply

* [PATCH net-next] ethtool: Make more commands available to unprivileged processes
From: Ben Hutchings @ 2012-06-12 23:05 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

'Get' commands should generally not require CAP_NET_ADMIN, with
the exception of those that expose internal state.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
The one command I'm not sure about is ETHTOOL_STATS.  It might reveal
too much detail about network traffic.  That said, /proc/net/dev and
/sys/class/net/*/statistics are already world-readable.

Ben.

 net/core/ethtool.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index c73d0a5..cbf033d 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1443,6 +1443,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
 	case ETHTOOL_GSET:
 	case ETHTOOL_GDRVINFO:
 	case ETHTOOL_GMSGLVL:
+	case ETHTOOL_GLINK:
 	case ETHTOOL_GCOALESCE:
 	case ETHTOOL_GRINGPARAM:
 	case ETHTOOL_GPAUSEPARAM:
@@ -1451,6 +1452,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
 	case ETHTOOL_GSG:
 	case ETHTOOL_GSSET_INFO:
 	case ETHTOOL_GSTRINGS:
+	case ETHTOOL_GSTATS:
 	case ETHTOOL_GTSO:
 	case ETHTOOL_GPERMADDR:
 	case ETHTOOL_GUFO:
@@ -1463,8 +1465,11 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
 	case ETHTOOL_GRXCLSRLCNT:
 	case ETHTOOL_GRXCLSRULE:
 	case ETHTOOL_GRXCLSRLALL:
+	case ETHTOOL_GRXFHINDIR:
 	case ETHTOOL_GFEATURES:
+	case ETHTOOL_GCHANNELS:
 	case ETHTOOL_GET_TS_INFO:
+	case ETHTOOL_GEEE:
 		break;
 	default:
 		if (!capable(CAP_NET_ADMIN))
-- 
1.7.7.6


-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related

* ethtool: allow ETHTOOL_GSSET_INFO for users
From: Ben Hutchings @ 2012-06-12 23:27 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Michał Mirosław

Please consider this for stable 3.0.y and 3.2.y:

commit f80400a26a2e8bff541de12834a1134358bb6642
Author: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date:   Sun Jan 22 00:20:40 2012 +0000

    ethtool: allow ETHTOOL_GSSET_INFO for users
    
    Allow ETHTOOL_GSSET_INFO ethtool ioctl() for unprivileged users.
    ETHTOOL_GSTRINGS is already allowed, but is unusable without this one.
    
    Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
    Acked-by: Ben Hutchings <bhutchings@solarflare.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* Re: [PATCH v2] bonding: Fix corrupted queue_mapping
From: Neil Horman @ 2012-06-13  0:26 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, netdev, therbert, john.r.fastabend, roland
In-Reply-To: <20120612.153058.508089648695433178.davem@davemloft.net>

On Tue, Jun 12, 2012 at 03:30:58PM -0700, David Miller wrote:
> From: Neil Horman <nhorman@tuxdriver.com>
> Date: Tue, 12 Jun 2012 13:16:08 -0400
> 
> > On Tue, Jun 12, 2012 at 06:03:51PM +0200, Eric Dumazet wrote:
> >> From: Eric Dumazet <edumazet@google.com>
> >> 
> >> In the transmit path of the bonding driver, skb->cb is used to
> >> stash the skb->queue_mapping so that the bonding device can set its
> >> own queue mapping.  This value becomes corrupted since the skb->cb is
> >> also used in __dev_xmit_skb.
> >> 
> >> When transmitting through bonding driver, bond_select_queue is
> >> called from dev_queue_xmit.  In bond_select_queue the original
> >> skb->queue_mapping is copied into skb->cb (via bond_queue_mapping)
> >> and skb->queue_mapping is overwritten with the bond driver queue.
> >> 
> >> Subsequently in dev_queue_xmit, __dev_xmit_skb is called which writes
> >> the packet length into skb->cb, thereby overwriting the stashed
> >> queue mappping.  In bond_dev_queue_xmit (called from hard_start_xmit),
> >> the queue mapping for the skb is set to the stashed value which is now
> >> the skb length and hence is an invalid queue for the slave device.
> >> 
> >> If we want to save skb->queue_mapping into skb->cb[], best place is to
> >> add a field in struct qdisc_skb_cb, to make sure it wont conflict with
> >> other layers (eg : Qdiscc, Infiniband...)
> >> 
> >> This patchs also makes sure (struct qdisc_skb_cb)->data is aligned on 8
> >> bytes :
> >> 
> >> netem qdisc for example assumes it can store an u64 in it, without
> >> misalignment penalty.
> >> 
> >> Note : we only have 20 bytes left in (struct qdisc_skb_cb)->data[].
> >> The largest user is CHOKe and it fills it.
> >> 
> >> Based on a previous patch from Tom Herbert.
> >> 
> >> Signed-off-by: Eric Dumazet <edumazet@google.com>
> >> Reported-by: Tom Herbert <therbert@google.com>
> >> Cc: John Fastabend <john.r.fastabend@intel.com>
> >> Cc: Roland Dreier <roland@kernel.org>
> > Acked-by: Neil Horman <nhorman@tuxdriver.com>
> > 
> > Looking at this, it would be really nice if we could have some sort of layer
> > independent space in an skb.  It seems we're often looking to shoehorn more
> > stuff into the control bock.
> 
> Applied.
> 
> The problem is that we always have layers that want to record something before
> the packet goes through the scheduler, then be able to retrieve it afterwards.
> Even more problematic are entities that can encapsulte multiple times for a
> single packet.
> 
Yeah, those are both problematic, although perhaps not insurmountable.  I know
Eric has attempted to implement a destructor chain in the past.  I was more
interested in just being able to get per-context scratch space on an skb as a
start, but clearly the two go hand in hand.
 
> If we supported bonds of bonds, even Eric's patch here is insufficient.
> 
Agreed.  I think I'm going to try my hand at putting something together though,
just out of curiosity.  I'll try have something RFC in a few weeks.

Thanks & Regards
Neil

^ permalink raw reply

* ethtool 3.4.1 released
From: Ben Hutchings @ 2012-06-13  0:31 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 704 bytes --]

ethtool version 3.4.1 has been released.  This fixes a regression in
version 3.4.

Home page: https://ftp.kernel.org/pub/software/network/ethtool/
Download link:
https://ftp.kernel.org/pub/software/network/ethtool/ethtool-3.4.1.tar.gz

Release notes:

	* Fix: Work around failure of ETHTOOL_GSSET_INFO for unprivileged
	  users (-k option)
	* Fix: Report any unexpected error code from ETHTOOL_GSSET_INFO
	  (-k and -K options)
	* Doc: Fix the date of the man page to match the last update

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [PATCH net-next] bonding: remove packet cloning in recv_probe()
From: Jay Vosburgh @ 2012-06-13  0:47 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David Miller, netdev, Andy Gospodarek, Jiri Bohac,
	Nicolas de =?ISO-8859-1?Q?Peslo=FCan?=,
	Maciej =?UTF-8?Q?=C5=BBenczykowski?=
In-Reply-To: <1339478587.22704.16.camel@edumazet-glaptop>

Eric Dumazet <eric.dumazet@gmail.com> wrote:

>From: Eric Dumazet <edumazet@google.com>
>
>Cloning all packets in input path have a significant cost.
>
>Use skb_header_pointer()/skb_copy_bits() instead of pskb_may_pull() so
>that recv_probe handlers (bond_3ad_lacpdu_recv / bond_arp_rcv /
>rlb_arp_recv ) dont touch input skb.
>
>bond_handle_frame() can avoid the skb_clone()/dev_kfree_skb()
>
>Signed-off-by: Eric Dumazet <edumazet@google.com>
>Cc: Jay Vosburgh <fubar@us.ibm.com>
>Cc: Andy Gospodarek <andy@greyhouse.net>
>Cc: Jiri Bohac <jbohac@suse.cz>
>Cc: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
>Cc: Maciej Żenczykowski <maze@google.com>

	This looks really good to me.

	-J

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>


>---
> drivers/net/bonding/bond_3ad.c  |   11 +++++---
> drivers/net/bonding/bond_3ad.h  |    4 +--
> drivers/net/bonding/bond_alb.c  |   20 ++++------------
> drivers/net/bonding/bond_main.c |   37 ++++++++++++++++--------------
> drivers/net/bonding/bonding.h   |    4 +--
> 5 files changed, 36 insertions(+), 40 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>index 3463b46..3031e04 100644
>--- a/drivers/net/bonding/bond_3ad.c
>+++ b/drivers/net/bonding/bond_3ad.c
>@@ -2460,18 +2460,21 @@ out:
> 	return NETDEV_TX_OK;
> }
>
>-int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
>-			  struct slave *slave)
>+int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
>+			 struct slave *slave)
> {
> 	int ret = RX_HANDLER_ANOTHER;
>+	struct lacpdu *lacpdu, _lacpdu;
>+
> 	if (skb->protocol != PKT_TYPE_LACPDU)
> 		return ret;
>
>-	if (!pskb_may_pull(skb, sizeof(struct lacpdu)))
>+	lacpdu = skb_header_pointer(skb, 0, sizeof(_lacpdu), &_lacpdu);
>+	if (!lacpdu)
> 		return ret;
>
> 	read_lock(&bond->lock);
>-	ret = bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
>+	ret = bond_3ad_rx_indication(lacpdu, slave, skb->len);
> 	read_unlock(&bond->lock);
> 	return ret;
> }
>diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h
>index 5ee7e3c..0cfaa4a 100644
>--- a/drivers/net/bonding/bond_3ad.h
>+++ b/drivers/net/bonding/bond_3ad.h
>@@ -274,8 +274,8 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave);
> void bond_3ad_handle_link_change(struct slave *slave, char link);
> int  bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
> int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
>-int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
>-			  struct slave *slave);
>+int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
>+			 struct slave *slave);
> int bond_3ad_set_carrier(struct bonding *bond);
> void bond_3ad_update_lacp_rate(struct bonding *bond);
> #endif //__BOND_3AD_H__
>diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
>index 0f59c15..ef3791a 100644
>--- a/drivers/net/bonding/bond_alb.c
>+++ b/drivers/net/bonding/bond_alb.c
>@@ -342,27 +342,17 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
> 	_unlock_rx_hashtbl_bh(bond);
> }
>
>-static int rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
>-			 struct slave *slave)
>+static int rlb_arp_recv(const struct sk_buff *skb, struct bonding *bond,
>+			struct slave *slave)
> {
>-	struct arp_pkt *arp;
>+	struct arp_pkt *arp, _arp;
>
> 	if (skb->protocol != cpu_to_be16(ETH_P_ARP))
> 		goto out;
>
>-	arp = (struct arp_pkt *) skb->data;
>-	if (!arp) {
>-		pr_debug("Packet has no ARP data\n");
>+	arp = skb_header_pointer(skb, 0, sizeof(_arp), &_arp);
>+	if (!arp)
> 		goto out;
>-	}
>-
>-	if (!pskb_may_pull(skb, arp_hdr_len(bond->dev)))
>-		goto out;
>-
>-	if (skb->len < sizeof(struct arp_pkt)) {
>-		pr_debug("Packet is too small to be an ARP\n");
>-		goto out;
>-	}
>
> 	if (arp->op_code == htons(ARPOP_REPLY)) {
> 		/* update rx hash table for this ARP */
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 2ee8cf9..9e2301e 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1444,8 +1444,8 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
> 	struct sk_buff *skb = *pskb;
> 	struct slave *slave;
> 	struct bonding *bond;
>-	int (*recv_probe)(struct sk_buff *, struct bonding *,
>-				struct slave *);
>+	int (*recv_probe)(const struct sk_buff *, struct bonding *,
>+			  struct slave *);
> 	int ret = RX_HANDLER_ANOTHER;
>
> 	skb = skb_share_check(skb, GFP_ATOMIC);
>@@ -1462,15 +1462,10 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
>
> 	recv_probe = ACCESS_ONCE(bond->recv_probe);
> 	if (recv_probe) {
>-		struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
>-
>-		if (likely(nskb)) {
>-			ret = recv_probe(nskb, bond, slave);
>-			dev_kfree_skb(nskb);
>-			if (ret == RX_HANDLER_CONSUMED) {
>-				consume_skb(skb);
>-				return ret;
>-			}
>+		ret = recv_probe(skb, bond, slave);
>+		if (ret == RX_HANDLER_CONSUMED) {
>+			consume_skb(skb);
>+			return ret;
> 		}
> 	}
>
>@@ -2737,25 +2732,31 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
> 	}
> }
>
>-static int bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
>-			 struct slave *slave)
>+static int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
>+			struct slave *slave)
> {
>-	struct arphdr *arp;
>+	struct arphdr *arp = (struct arphdr *)skb->data;
> 	unsigned char *arp_ptr;
> 	__be32 sip, tip;
>+	int alen;
>
> 	if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
> 		return RX_HANDLER_ANOTHER;
>
> 	read_lock(&bond->lock);
>+	alen = arp_hdr_len(bond->dev);
>
> 	pr_debug("bond_arp_rcv: bond %s skb->dev %s\n",
> 		 bond->dev->name, skb->dev->name);
>
>-	if (!pskb_may_pull(skb, arp_hdr_len(bond->dev)))
>-		goto out_unlock;
>+	if (alen > skb_headlen(skb)) {
>+		arp = kmalloc(alen, GFP_ATOMIC);
>+		if (!arp)
>+			goto out_unlock;
>+		if (skb_copy_bits(skb, 0, arp, alen) < 0)
>+			goto out_unlock;
>+	}
>
>-	arp = arp_hdr(skb);
> 	if (arp->ar_hln != bond->dev->addr_len ||
> 	    skb->pkt_type == PACKET_OTHERHOST ||
> 	    skb->pkt_type == PACKET_LOOPBACK ||
>@@ -2790,6 +2791,8 @@ static int bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
>
> out_unlock:
> 	read_unlock(&bond->lock);
>+	if (arp != (struct arphdr *)skb->data)
>+		kfree(arp);
> 	return RX_HANDLER_ANOTHER;
> }
>
>diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
>index 4581aa5..f8af2fc 100644
>--- a/drivers/net/bonding/bonding.h
>+++ b/drivers/net/bonding/bonding.h
>@@ -218,8 +218,8 @@ struct bonding {
> 	struct   slave *primary_slave;
> 	bool     force_primary;
> 	s32      slave_cnt; /* never change this value outside the attach/detach wrappers */
>-	int     (*recv_probe)(struct sk_buff *, struct bonding *,
>-			       struct slave *);
>+	int     (*recv_probe)(const struct sk_buff *, struct bonding *,
>+			      struct slave *);
> 	rwlock_t lock;
> 	rwlock_t curr_slave_lock;
> 	u8	 send_peer_notif;
>
>

^ permalink raw reply

* Re: [PATCH 0/7] usbnet: misc cleanup
From: David Miller @ 2012-06-13  1:51 UTC (permalink / raw)
  To: tom.leiming-Re5JQEeQqe8AvxtiuMwx3w
  Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, oneukum-l3A5Bk7waGM,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1339463985-9006-1-git-send-email-tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

From: Ming Lei <tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Tue, 12 Jun 2012 09:19:38 +0800

> This patchset does some cleanup on usbnet.

I've applied all of these patches except the EVENT_DEV_OPEN removal
which still needs some discussion.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH net-next] bonding: remove packet cloning in recv_probe()
From: David Miller @ 2012-06-13  1:52 UTC (permalink / raw)
  To: fubar; +Cc: eric.dumazet, netdev, andy, jbohac, nicolas.2p.debian, maze
In-Reply-To: <24088.1339548479@death.nxdomain>

From: Jay Vosburgh <fubar@us.ibm.com>
Date: Tue, 12 Jun 2012 17:47:59 -0700

> Eric Dumazet <eric.dumazet@gmail.com> wrote:
> 
>>From: Eric Dumazet <edumazet@google.com>
>>
>>Cloning all packets in input path have a significant cost.
>>
>>Use skb_header_pointer()/skb_copy_bits() instead of pskb_may_pull() so
>>that recv_probe handlers (bond_3ad_lacpdu_recv / bond_arp_rcv /
>>rlb_arp_recv ) dont touch input skb.
>>
>>bond_handle_frame() can avoid the skb_clone()/dev_kfree_skb()
>>
>>Signed-off-by: Eric Dumazet <edumazet@google.com>
>>Cc: Jay Vosburgh <fubar@us.ibm.com>
>>Cc: Andy Gospodarek <andy@greyhouse.net>
>>Cc: Jiri Bohac <jbohac@suse.cz>
>>Cc: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
>>Cc: Maciej Żenczykowski <maze@google.com>
> 
> 	This looks really good to me.
> 
> 	-J
> 
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

Applied.

^ permalink raw reply

* Re: [PATCH 1/1] net-next: add dev_loopback_xmit() to avoid duplicate code
From: David Miller @ 2012-06-13  1:52 UTC (permalink / raw)
  To: michel
  Cc: netdev, linux-kernel, kuznet, jmorris, yoshfuji, kaber, edumazet,
	jpirko, mirq-linux, bhutchings
In-Reply-To: <1339532195.2701.8.camel@Thor>

From: Michel Machado <michel@digirati.com.br>
Date: Tue, 12 Jun 2012 16:16:35 -0400

> Add dev_loopback_xmit() in order to deduplicate functions
> ip_dev_loopback_xmit() (in net/ipv4/ip_output.c) and
> ip6_dev_loopback_xmit() (in net/ipv6/ip6_output.c).
> 
> I was about to reinvent the wheel when I noticed that
> ip_dev_loopback_xmit() and ip6_dev_loopback_xmit() do exactly what I
> need and are not IP-only functions, but they were not available to reuse
> elsewhere.
> 
> ip6_dev_loopback_xmit() does not have line "skb_dst_force(skb);", but I
> understand that this is harmless, and should be in dev_loopback_xmit().
> 
> Signed-off-by: Michel Machado <michel@digirati.com.br>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] ethtool: Make more commands available to unprivileged processes
From: David Miller @ 2012-06-13  1:52 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev, linux-net-drivers
In-Reply-To: <1339542341.15266.3.camel@bwh-desktop.uk.solarflarecom.com>

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 13 Jun 2012 00:05:41 +0100

> 'Get' commands should generally not require CAP_NET_ADMIN, with
> the exception of those that expose internal state.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> The one command I'm not sure about is ETHTOOL_STATS.  It might reveal
> too much detail about network traffic.  That said, /proc/net/dev and
> /sys/class/net/*/statistics are already world-readable.

Applied, it just means we need to scrutinize what people put into the
stats a little bit more.

^ permalink raw reply

* Re: net/netfilter/nf_conntrack_proto_tcp.c:1606:9: error: ‘struct nf_proto_net’ has no member named ‘user’
From: Gao feng @ 2012-06-13  2:06 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: David Miller, wfg, netdev
In-Reply-To: <20120612160304.GA31427@1984>

于 2012年06月13日 00:03, Pablo Neira Ayuso 写道:
> On Tue, Jun 12, 2012 at 07:03:31PM +0800, Gao feng wrote:
>> 于 2012年06月12日 17:29, Pablo Neira Ayuso 写道:
>>
>>>> nf_proto_net.users has different meaning when SYSCTL enabled or disabled.
>>>>
>>>> when SYSCTL enabled,it means if both tcpv4 and tcpv6 register the sysctl,
>>>> it is increased when register sysctl success and decreased when unregister sysctl.
>>>> we can regard it as the refcnt of ctl_table.
>>>>
>>>> when SYSCTL disabled,it just used to identify if the proto's pernet data
>>>> has been initialized.
>>>
>>> We have to use two different counters for this. The conditional
>>> meaning of that variable is really confusing.
>>>
>> Hi David & Pablo
>>
>> Please have a look at this patch and tell me if it's OK.
>> it base on Pable's patch.
> 
> I think we have to merge those tcpv4_init_net and tcpv6_init_net
> functions into one single function tcp_init_net. Then, we can pass
> l4proto->l3proto to init_net:
> 
>         if (proto->init_net) {
>                 ret = proto->init_net(net, l4proto->l3proto);
>                 if (ret < 0)
>                         return ret;
>         }
> 
> Thus, we can check if this is IPv4 or IPv6 and initialize the compat
> part accordingly.

Agree, it will be more clearer and will decrease the redundancy codes.

> 
> Still, we have that pn->users thing:
> 
>         if (!pn->users++) {
>                 for (i = 0; i < TCP_CONNTRACK_TIMEOUT_MAX; i++)
>                         tn->timeouts[i] = tcp_timeouts[i];
> 
>                 tn->tcp_loose = nf_ct_tcp_loose;
>                 tn->tcp_be_liberal = nf_ct_tcp_be_liberal;
>                 tn->tcp_max_retrans = nf_ct_tcp_max_retrans;
>         }
> 
> Define some pn->initialized boolean. Set it to true at the end of
> the new tcp_init_net.
> 
> Similar thing for other protocol trackers.
> 
> Let me know if you are going to send me patches. In that case, please
> do it on top of the current tree.

Ok,I will clean up it as you said.

> 
> Once that has been cleaned up, we can prepare follow-up patches to
> move the sysctl code to nf_conntrack_proto_*_sysctl.c to reduce the
> ifdef pollution.
> 

^ permalink raw reply

* Re: [PATCH 4/7] usbnet: remove EVENT_DEV_OPEN flag
From: Ming Lei @ 2012-06-13  2:12 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: David S. Miller, Greg Kroah-Hartman, netdev, linux-usb
In-Reply-To: <201206122014.28408.oliver@neukum.org>

On Wed, Jun 13, 2012 at 2:14 AM, Oliver Neukum <oliver@neukum.org> wrote:
> Am Dienstag, 12. Juni 2012, 03:19:42 schrieb Ming Lei:
>> EVENT_DEV_OPEN is introduced to mark if the interface is opened or
>> not, but we already have IFF_UP to handle it, so just
>> remove the flag and use IFF_UP.
>
> When is IFF_UP cleared? The flag is tested in usbnet_resume(),

The flag is cleared just after usbnet_stop completes.

> so it must be cleared before usbnet_stop() is called.

Yes, I see, otherwise system or runtime resume may happen
at the same time with usbnet_stop.

Thanking you for point it out.

Thanks,
-- 
Ming Lei

^ permalink raw reply

* [PATCH 0/5] Introduce generic set_bit_le() -v2
From: Takuya Yoshikawa @ 2012-06-13  4:00 UTC (permalink / raw)
  To: akpm
  Cc: bhutchings, grundler, arnd, benh, avi, mtosatti,
	linux-net-drivers, netdev, linux-kernel, linux-arch, kvm,
	takuya.yoshikawa

  [ Andrew, can you take this or should I send to other person?
    Note: the whole series is against linux-next. ]

KVM is using test_and_set_bit_le() for this missing function; this patch
series corrects this usage.

As some drivers have their own definitions of set_bit_le(), a bit of
preparation is also needed.

  Although these are differently implemented, especially for big-endian
  case, than the generic __set_bit_le(), it should not be a problem to
  use the latter since both maintainers prefer it.

Changes from v1:
  - sfc:     Ben made a patch
  - tulip:   followed suggestion by Grant
  - bitops:  added clear_bit_le -- suggested by Arnd
  - powerpc: added the same code


Ben Hutchings (1):
  sfc: Use standard __{clear,set}_bit_le() functions

Takuya Yoshikawa (4):
  drivers/net/ethernet/dec/tulip: Use standard __set_bit_le() function
  bitops: Introduce generic {clear,set}_bit_le()
  powerpc: bitops: Introduce {clear,set}_bit_le()
  KVM: Replace test_and_set_bit_le() in mark_page_dirty_in_slot() with set_bit_le()

 arch/powerpc/include/asm/bitops.h           |   10 ++++++++++
 drivers/net/ethernet/dec/tulip/de2104x.c    |    7 ++-----
 drivers/net/ethernet/dec/tulip/tulip_core.c |    7 ++-----
 drivers/net/ethernet/sfc/efx.c              |    4 ++--
 drivers/net/ethernet/sfc/net_driver.h       |   12 ------------
 drivers/net/ethernet/sfc/nic.c              |    4 ++--
 include/asm-generic/bitops/le.h             |   10 ++++++++++
 virt/kvm/kvm_main.c                         |    3 +--
 8 files changed, 29 insertions(+), 28 deletions(-)

-- 
1.7.5.4


^ permalink raw reply

* [PATCH 1/5] sfc: Use standard __{clear,set}_bit_le() functions
From: Takuya Yoshikawa @ 2012-06-13  4:02 UTC (permalink / raw)
  To: akpm
  Cc: bhutchings, grundler, arnd, benh, avi, mtosatti,
	linux-net-drivers, netdev, linux-kernel, linux-arch, kvm,
	takuya.yoshikawa
In-Reply-To: <20120613130054.b5695621.yoshikawa.takuya@oss.ntt.co.jp>

From: Ben Hutchings <bhutchings@solarflare.com>

There are now standard functions for dealing with little-endian bit
arrays, so use them instead of our own implementations.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
---
 drivers/net/ethernet/sfc/efx.c        |    4 ++--
 drivers/net/ethernet/sfc/net_driver.h |   12 ------------
 drivers/net/ethernet/sfc/nic.c        |    4 ++--
 3 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index b95f2e1..ca2a348 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1976,14 +1976,14 @@ static void efx_set_rx_mode(struct net_device *net_dev)
 		netdev_for_each_mc_addr(ha, net_dev) {
 			crc = ether_crc_le(ETH_ALEN, ha->addr);
 			bit = crc & (EFX_MCAST_HASH_ENTRIES - 1);
-			set_bit_le(bit, mc_hash->byte);
+			__set_bit_le(bit, mc_hash);
 		}
 
 		/* Broadcast packets go through the multicast hash filter.
 		 * ether_crc_le() of the broadcast address is 0xbe2612ff
 		 * so we always add bit 0xff to the mask.
 		 */
-		set_bit_le(0xff, mc_hash->byte);
+		__set_bit_le(0xff, mc_hash);
 	}
 
 	if (efx->port_enabled)
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 0e57535..6f1a7f7 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -1080,18 +1080,6 @@ static inline struct efx_rx_buffer *efx_rx_buffer(struct efx_rx_queue *rx_queue,
 	return &rx_queue->buffer[index];
 }
 
-/* Set bit in a little-endian bitfield */
-static inline void set_bit_le(unsigned nr, unsigned char *addr)
-{
-	addr[nr / 8] |= (1 << (nr % 8));
-}
-
-/* Clear bit in a little-endian bitfield */
-static inline void clear_bit_le(unsigned nr, unsigned char *addr)
-{
-	addr[nr / 8] &= ~(1 << (nr % 8));
-}
-
 
 /**
  * EFX_MAX_FRAME_LEN - calculate maximum frame length
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c
index 4a9a5be..bb0172d 100644
--- a/drivers/net/ethernet/sfc/nic.c
+++ b/drivers/net/ethernet/sfc/nic.c
@@ -473,9 +473,9 @@ void efx_nic_init_tx(struct efx_tx_queue *tx_queue)
 
 		efx_reado(efx, &reg, FR_AA_TX_CHKSM_CFG);
 		if (tx_queue->queue & EFX_TXQ_TYPE_OFFLOAD)
-			clear_bit_le(tx_queue->queue, (void *)&reg);
+			__clear_bit_le(tx_queue->queue, &reg);
 		else
-			set_bit_le(tx_queue->queue, (void *)&reg);
+			__set_bit_le(tx_queue->queue, &reg);
 		efx_writeo(efx, &reg, FR_AA_TX_CHKSM_CFG);
 	}
 
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 2/5] drivers/net/ethernet/dec/tulip: Use standard __set_bit_le() function
From: Takuya Yoshikawa @ 2012-06-13  4:03 UTC (permalink / raw)
  To: akpm
  Cc: bhutchings, grundler, arnd, benh, avi, mtosatti,
	linux-net-drivers, netdev, linux-kernel, linux-arch, kvm,
	takuya.yoshikawa
In-Reply-To: <20120613130054.b5695621.yoshikawa.takuya@oss.ntt.co.jp>

From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>

To introduce generic set_bit_le() later, we remove our own definition
and use a proper non-atomic bitops function: __set_bit_le().

Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
---
 drivers/net/ethernet/dec/tulip/de2104x.c    |    7 ++-----
 drivers/net/ethernet/dec/tulip/tulip_core.c |    7 ++-----
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
index 61cc093..77335853 100644
--- a/drivers/net/ethernet/dec/tulip/de2104x.c
+++ b/drivers/net/ethernet/dec/tulip/de2104x.c
@@ -661,9 +661,6 @@ static netdev_tx_t de_start_xmit (struct sk_buff *skb,
    new frame, not around filling de->setup_frame.  This is non-deterministic
    when re-entered but still correct. */
 
-#undef set_bit_le
-#define set_bit_le(i,p) do { ((char *)(p))[(i)/8] |= (1<<((i)%8)); } while(0)
-
 static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
 {
 	struct de_private *de = netdev_priv(dev);
@@ -673,12 +670,12 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
 	u16 *eaddrs;
 
 	memset(hash_table, 0, sizeof(hash_table));
-	set_bit_le(255, hash_table); 			/* Broadcast entry */
+	__set_bit_le(255, hash_table);			/* Broadcast entry */
 	/* This should work on big-endian machines as well. */
 	netdev_for_each_mc_addr(ha, dev) {
 		int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff;
 
-		set_bit_le(index, hash_table);
+		__set_bit_le(index, hash_table);
 	}
 
 	for (i = 0; i < 32; i++) {
diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c
index c4f37ac..885700a 100644
--- a/drivers/net/ethernet/dec/tulip/tulip_core.c
+++ b/drivers/net/ethernet/dec/tulip/tulip_core.c
@@ -1010,9 +1010,6 @@ static int private_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
    new frame, not around filling tp->setup_frame.  This is non-deterministic
    when re-entered but still correct. */
 
-#undef set_bit_le
-#define set_bit_le(i,p) do { ((char *)(p))[(i)/8] |= (1<<((i)%8)); } while(0)
-
 static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
 {
 	struct tulip_private *tp = netdev_priv(dev);
@@ -1022,12 +1019,12 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
 	u16 *eaddrs;
 
 	memset(hash_table, 0, sizeof(hash_table));
-	set_bit_le(255, hash_table); 			/* Broadcast entry */
+	__set_bit_le(255, hash_table);			/* Broadcast entry */
 	/* This should work on big-endian machines as well. */
 	netdev_for_each_mc_addr(ha, dev) {
 		int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff;
 
-		set_bit_le(index, hash_table);
+		__set_bit_le(index, hash_table);
 	}
 	for (i = 0; i < 32; i++) {
 		*setup_frm++ = hash_table[i];
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 3/5] bitops: Introduce generic {clear,set}_bit_le()
From: Takuya Yoshikawa @ 2012-06-13  4:03 UTC (permalink / raw)
  To: akpm
  Cc: bhutchings, grundler, arnd, benh, avi, mtosatti,
	linux-net-drivers, netdev, linux-kernel, linux-arch, kvm,
	takuya.yoshikawa
In-Reply-To: <20120613130054.b5695621.yoshikawa.takuya@oss.ntt.co.jp>

From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>

Needed to replace test_and_set_bit_le() in virt/kvm/kvm_main.c which is
being used for this missing function.

Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 include/asm-generic/bitops/le.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index f95c663..6173154 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -54,6 +54,16 @@ static inline int test_bit_le(int nr, const void *addr)
 	return test_bit(nr ^ BITOP_LE_SWIZZLE, addr);
 }
 
+static inline void set_bit_le(int nr, void *addr)
+{
+	set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline void clear_bit_le(int nr, void *addr)
+{
+	clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
 static inline void __set_bit_le(int nr, void *addr)
 {
 	__set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 4/5] powerpc: bitops: Introduce {clear,set}_bit_le()
From: Takuya Yoshikawa @ 2012-06-13  4:04 UTC (permalink / raw)
  To: akpm
  Cc: bhutchings, grundler, arnd, benh, avi, mtosatti,
	linux-net-drivers, netdev, linux-kernel, linux-arch, kvm,
	takuya.yoshikawa
In-Reply-To: <20120613130054.b5695621.yoshikawa.takuya@oss.ntt.co.jp>

From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>

Needed to replace test_and_set_bit_le() in virt/kvm/kvm_main.c which is
being used for this missing function.

Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/include/asm/bitops.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index efdc926..dc2cf9c 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -288,6 +288,16 @@ static __inline__ int test_bit_le(unsigned long nr,
 	return (tmp[nr >> 3] >> (nr & 7)) & 1;
 }
 
+static inline void set_bit_le(int nr, void *addr)
+{
+	set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline void clear_bit_le(int nr, void *addr)
+{
+	clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
 static inline void __set_bit_le(int nr, void *addr)
 {
 	__set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
-- 
1.7.5.4

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox