* (unknown)
From: James White @ 2013-01-12 20:29 UTC (permalink / raw)
Do you need a Loan?If yes,reply us for more Details
^ permalink raw reply
* Re: [patch net] net: correct check in dev_addr_del()
From: Jan Engelhardt @ 2013-01-12 20:39 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jiri Pirko, netdev, davem, shemminger, john.r.fastabend
In-Reply-To: <1352903939.4497.6.camel@edumazet-glaptop>
On Wednesday 2012-11-14 15:38, Eric Dumazet wrote:
>>
>> bug introduced by:
>>
>> commit a748ee2426817a95b1f03012d8f339c45c722ae1
>> Author: Jiri Pirko <jpirko@redhat.com>
>> Date: Thu Apr 1 21:22:09 2010 +0000
>>
>> net: move address list functions to a separate file
>
>Good, the usual way is then to add in the changelog :
>
>Bug added in commit a748ee242681
>(net: move address list functions to a separate file)
>
>(No need to give the author/date, and we can shorten the SHA1 to 10 or
>12 digits)
A shortened hash value is however not truly future-proof. I recommend
using `git describe` or `git describe --contains`, as that is
unambiguous into the future and shows a related version. In case of
a748ee, that would be v2.6.35-rc1~473^2~602, which immediately tells
us that the bug has been in tarballs since 2.6.35-rc1.
^ permalink raw reply
* Re: [RFC davem] revert: net: Make skb->skb_iif always track skb->dev
From: David Miller @ 2013-01-12 21:23 UTC (permalink / raw)
To: socketcan; +Cc: netdev
In-Reply-To: <50F1699E.1000200@hartkopp.net>
From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: Sat, 12 Jan 2013 14:48:14 +0100
> To me it is not clear why skb_iff is needed anyway as the value should
> always be available via skb->dev->ifindex, right?
But all the code uses skb_iif, in particular the ipv4 routing
lookups use that as the key.
It absolutely must follow whatever is skb->dev, it is a hard
invariant.
I am not reverting this change.
^ permalink raw reply
* Re: [RFC davem] revert: net: Make skb->skb_iif always track skb->dev
From: David Miller @ 2013-01-12 21:36 UTC (permalink / raw)
To: socketcan; +Cc: netdev
In-Reply-To: <20130112.132316.2121287993605534669.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Sat, 12 Jan 2013 13:23:16 -0800 (PST)
> From: Oliver Hartkopp <socketcan@hartkopp.net>
> Date: Sat, 12 Jan 2013 14:48:14 +0100
>
>> To me it is not clear why skb_iff is needed anyway as the value should
>> always be available via skb->dev->ifindex, right?
>
> But all the code uses skb_iif, in particular the ipv4 routing
> lookups use that as the key.
>
> It absolutely must follow whatever is skb->dev, it is a hard
> invariant.
>
> I am not reverting this change.
More information, because I can't believe how idiotic and
ignorant people are being able this issue.
skb->dev->ifindex IS NOT the same as skb->skb_iif
Why don't you put a test into tcp_recvmsg() for packets being removed
from the socket's receive queue and see if skb->dev->ifindex is the
same as skb->skb_iif
Surprise, skb->dev is going to be NULL at that point.
Why?
Because on packet receive we don't take references on devices we hook
into skb->dev, therefore we cannot let that pointer escape the
software interrupt packet input paths.
Therefore, as a bug trap, TCP input will set skb->dev to NULL.
The only valid way to figure out the final demuxed device the packet
arrived on, is therefore, via skb->skb_iif.
As per your problem with CAN, that's also rediculous. You have an SKB
control block in skb->cb[] that you can put whatever values with
whatever semantics you want.
Use it.
I'm not discussing this any further.
^ permalink raw reply
* Re: [PATCH 1/3] ssb: add missing method ssb_gige_get_macaddr
From: David Miller @ 2013-01-12 23:32 UTC (permalink / raw)
To: hauke; +Cc: mcarlson, mchan, netdev, m
In-Reply-To: <1358020905-9924-2-git-send-email-hauke@hauke-m.de>
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sat, 12 Jan 2013 21:01:43 +0100
> When CONFIG_SSB_DRIVER_GIGE is not set the header does not provide the
> needed method.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This isn't right.
You can't implement this function in a way that the caller cannot
determine that it didn't actually do anything.
You either have to protect calls with ifdefs or make this routine
return an error indication, in response to which the caller can
set a random ethernet address or take some other corrective action.
^ permalink raw reply
* Re: [PATCH 0/3] tg3: add support for Ethernet core in BCM4785
From: David Miller @ 2013-01-12 23:32 UTC (permalink / raw)
To: hauke; +Cc: mcarlson, mchan, netdev, m
In-Reply-To: <1358020905-9924-1-git-send-email-hauke@hauke-m.de>
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sat, 12 Jan 2013 21:01:42 +0100
> These patches are adding support for the Ethernet core found in the BCM4705/BCM4785 SoC.
>
You must always indicate what tree you are targetting your changes
at, rather than have me guess.
^ permalink raw reply
* Re: [PATCH net-next] be2net: fix unconditionally returning IRQ_HANDLED in INTx
From: David Miller @ 2013-01-12 23:33 UTC (permalink / raw)
To: Sathya.Perla; +Cc: netdev
In-Reply-To: <CF9D1877D81D214CB0CA0669EFAE020C0F1F0CD6@RVEXMB1.ad.emulex.com>
From: "Perla, Sathya" <Sathya.Perla@Emulex.Com>
Date: Sat, 12 Jan 2013 16:29:36 +0000
>>-----Original Message-----
>>From: David Miller [mailto:davem@davemloft.net]
>>
>>From: Sathya Perla <sathya.perla@emulex.com>
>>Date: Sat, 12 Jan 2013 14:17:02 +0530
>>
>>> commit e49cc34f introduced an unconditional IRQ_HANDLED return in be_intx()
>>> to workaround Lancer and BE2 HW issues. This is bad as it prevents the kernel
>>> from detecting interrupt storms due to broken HW.
>>>
> ...
>>> Issue (1) can cause the notified events to be orphaned, if NAPI was already
>>> running.
>>> This patch fixes this issue by scheduling NAPI only if it is not scheduled
>>> already. Doing this also takes care of possible events_get() race that may be
>>> caused due to issue (2) and (3). Also, IRQ_HANDLED is returned only the first
>>> time zero events are detected.
>>> (Thanks Ben H. for the feedback and suggestions.)
>>>
>>> Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
>>
>>Any particular reason why we shouldn't put this fix into 'net' instead
>>of 'net-next'?
>
> Dave, this fix can surely go into "net" as the previous commit is already in Linus tree....
> I guess I requested "net-next" just out of habit.
Applied to 'net', thanks.
^ permalink raw reply
* Re: [PATCH] CDC_NCM adding support IFF_NOARP for infineon modem platform
From: David Miller @ 2013-01-12 23:35 UTC (permalink / raw)
To: cpuwolf; +Cc: gregkh, alexey.orishko, bjorn, linux-usb, netdev
In-Reply-To: <1357990479-5836-1-git-send-email-cpuwolf@gmail.com>
From: Wei Shuai <cpuwolf@gmail.com>
Date: Sat, 12 Jan 2013 19:34:39 +0800
> Infineon(now Intel) HSPA Modem platform NCM cannot support ARP. so I
> introduce a flag CDC_NCM_DRIVER_DATA_NOARP which is defined in
> driver_info:data. so later on, if more such buggy devices are found,
> they could use same flag to handle.
Is it no able to do ARP or, the more likely case, does broadcast
not work at all?
If it's the latter, IFF_NOARP is just making over the real problem.
I'm not applying this, no hardware device should set IFF_NOARP.
You probably really want IFF_POINTOPOINT or similar.
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2013-01-12 23:56 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev
1) Fix regression allowing IP_TTL setting of zero, fix from Eric
Dumazet.
2) Fix leak regressions in tunap, from Jason Wang.
3) be2net driver always returns IRQ_HANDLED in INTx handler, fix
from Sathya Perla.
4) qlge doesn't really support NETIF_F_TSO6, don't set that
flag. Fix from Amerigo Wang.
5) Add 802.11ad Atheros wil6210 driver, from Vladimir Kondratiev.
6) Fix MTU calculations in mac80211 layer, from T Krishna Chaitanya.
7) Station info layer of mac80211 needs to use del_timer_sync(),
from Johannes Berg.
8) tcp_read_sock() can loop forever, because we don't immediately
stop when recv_actor() returns zero. Fix from Eric Dumazet.
9) Fix WARN_ON() in tcp_cleanup_rbuf(). We have to use sk_eat_skb()
in tcp_recv_skb() to handle the case where a large GRO packet
is split up while it is use by a splice() operation. Fix also
from Eric Dumazet.
10) addrconf_get_prefix_route() in ipv6 tests flags incorrectly, it
does:
if (X && (p->flags & Y) != 0)
when it really meant to go:
if (X && (p->flags & X) != 0)
fix from Romain Kuntz.
11) Fix lost Kconfig dependency for bfin_mac driver hardware
timestamping. From Lars-Peter Clausen.
12) Fix regression in handling of RST without ACK in TCP, from
Eric Dumazet.
Please pull, thanks a lot!
The following changes since commit ed2c8911684ac780d051d251ad0cd9d797dd029c:
Merge tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound (2013-01-08 07:33:41 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net master
for you to fetch changes up to d0b9cec3e27d0e9fda2fbf6aaacece68c99b1104:
be2net: fix unconditionally returning IRQ_HANDLED in INTx (2013-01-12 15:33:01 -0800)
----------------------------------------------------------------
Amerigo Wang (1):
qlge: remove NETIF_F_TSO6 flag
Amitkumar Karwar (1):
mwifiex: fix typo in setting up ibss network parameters
Barak Witkowski (1):
bnx2x: Allow management traffic after boot from SAN
Bing Zhao (1):
mwifiex: check wait_event_interruptible return value
Chaitanya (1):
mac80211: fix maximum MTU
Chen Gang (1):
drivers/net/wireless/iwlegacy: use strlcpy instead of strncpy
Cong Wang (1):
net: prevent setting ttl=0 via IP_TTL
Dan Carpenter (1):
bnx2x: move debugging code before the return
Emmanuel Grumbach (1):
iwlwifi: fix the reclaimed packet tracking upon flush queue
Eric Dumazet (3):
tcp: splice: fix an infinite loop in tcp_read_sock()
tcp: fix splice() and tcp collapsing interaction
tcp: accept RST without ACK flag
Felix Fietkau (1):
mac80211: flush AP_VLAN stations when tearing down the BSS AP
Jason Wang (3):
tuntap: switch to use rtnl_dereference()
tuntap: forbid calling TUNSETIFF when detached
tuntap: fix leaking reference count
Johannes Berg (5):
mac80211: assign VLAN channel contexts
mac80211: fix station destruction in AP/mesh modes
mac80211: use del_timer_sync for final sta cleanup timer deletion
mac80211: fix dtim_period in hidden SSID AP association
iwlwifi: fix PCIe interrupt handle return value
John W. Linville (3):
Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211
Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem
Julian Wollrath (1):
rtlwifi: Fix typo in debug output of rtl8192c and rtl8723ae
Larry Finger (1):
b43: Fix firmware loading when driver is built into the kernel
Lars-Peter Clausen (1):
bfin_mac: Restore hardware time-stamping dependency on BF518
Michael S. Tsirkin (1):
tun: avoid owner checks on IFF_ATTACH_QUEUE
Michal Simek (2):
net: ethernet: xilinx: Do not use axienet on PPC
net: ethernet: xilinx: Do not use NO_IRQ in axienet
Nickolai Zeldovich (1):
drivers/net/wireless/mwl8k.c: avoid use-after-free
Romain Kuntz (2):
ipv6: fix the noflags test in addrconf_get_prefix_route
ipv6: use addrconf_get_prefix_route for prefix route lookup [v2]
Sathya Perla (1):
be2net: fix unconditionally returning IRQ_HANDLED in INTx
Stanislaw Gruszka (2):
mac80211: fix ibss scanning
net, wireless: overwrite default_ethtool_ops
Stefan Hajnoczi (1):
tuntap: refuse to re-attach to different tun_struct
Thomas Pedersen (1):
mac80211: RMC buckets are just list heads
Vladimir Kondratiev (1):
wireless: add new wil6210 802.11ad 60GHz driver
Yuval Mintz (1):
bnx2x: Fix fastpath structures when memory allocation fails
MAINTAINERS | 8 +
drivers/net/ethernet/adi/Kconfig | 1 +
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 30 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 60 +++-
drivers/net/ethernet/emulex/benet/be.h | 1 +
drivers/net/ethernet/emulex/benet/be_main.c | 29 +-
drivers/net/ethernet/qlogic/qlge/qlge_main.c | 2 +-
drivers/net/ethernet/xilinx/Kconfig | 2 +-
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
drivers/net/tun.c | 44 +--
drivers/net/wireless/ath/Kconfig | 1 +
drivers/net/wireless/ath/Makefile | 1 +
drivers/net/wireless/ath/wil6210/Kconfig | 29 ++
drivers/net/wireless/ath/wil6210/Makefile | 13 +
drivers/net/wireless/ath/wil6210/cfg80211.c | 573 ++++++++++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/dbg_hexdump.h | 30 ++
drivers/net/wireless/ath/wil6210/debugfs.c | 603 ++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/interrupt.c | 471 +++++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/main.c | 407 ++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/netdev.c | 157 +++++++++
drivers/net/wireless/ath/wil6210/pcie_bus.c | 223 ++++++++++++
drivers/net/wireless/ath/wil6210/txrx.c | 871 ++++++++++++++++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/txrx.h | 362 +++++++++++++++++++
drivers/net/wireless/ath/wil6210/wil6210.h | 363 +++++++++++++++++++
drivers/net/wireless/ath/wil6210/wmi.c | 975 +++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/wmi.h | 1116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/net/wireless/b43/b43.h | 5 +
drivers/net/wireless/b43/main.c | 54 ++-
drivers/net/wireless/b43/main.h | 5 +-
drivers/net/wireless/iwlegacy/3945-mac.c | 2 +-
drivers/net/wireless/iwlwifi/dvm/tx.c | 24 +-
drivers/net/wireless/iwlwifi/pcie/rx.c | 1 +
drivers/net/wireless/mwifiex/cfg80211.c | 2 +-
drivers/net/wireless/mwifiex/sta_ioctl.c | 21 +-
drivers/net/wireless/mwl8k.c | 4 +-
drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c | 2 +-
drivers/net/wireless/rtlwifi/rtl8723ae/phy.c | 2 +-
include/linux/netdevice.h | 3 +
net/core/dev.c | 8 +
net/ipv4/ip_sockglue.c | 2 +-
net/ipv4/tcp.c | 15 +-
net/ipv4/tcp_input.c | 4 +-
net/ipv6/addrconf.c | 27 +-
net/mac80211/cfg.c | 2 +
net/mac80211/chan.c | 38 ++
net/mac80211/ibss.c | 9 +-
net/mac80211/ieee80211_i.h | 16 +-
net/mac80211/iface.c | 48 ++-
net/mac80211/mesh.c | 8 +-
net/mac80211/mesh.h | 2 +-
net/mac80211/mlme.c | 75 ++--
net/mac80211/scan.c | 46 +--
net/mac80211/sta_info.c | 46 ++-
net/mac80211/sta_info.h | 3 +-
net/wireless/core.c | 3 +-
56 files changed, 6654 insertions(+), 199 deletions(-)
create mode 100644 drivers/net/wireless/ath/wil6210/Kconfig
create mode 100644 drivers/net/wireless/ath/wil6210/Makefile
create mode 100644 drivers/net/wireless/ath/wil6210/cfg80211.c
create mode 100644 drivers/net/wireless/ath/wil6210/dbg_hexdump.h
create mode 100644 drivers/net/wireless/ath/wil6210/debugfs.c
create mode 100644 drivers/net/wireless/ath/wil6210/interrupt.c
create mode 100644 drivers/net/wireless/ath/wil6210/main.c
create mode 100644 drivers/net/wireless/ath/wil6210/netdev.c
create mode 100644 drivers/net/wireless/ath/wil6210/pcie_bus.c
create mode 100644 drivers/net/wireless/ath/wil6210/txrx.c
create mode 100644 drivers/net/wireless/ath/wil6210/txrx.h
create mode 100644 drivers/net/wireless/ath/wil6210/wil6210.h
create mode 100644 drivers/net/wireless/ath/wil6210/wmi.c
create mode 100644 drivers/net/wireless/ath/wil6210/wmi.h
^ permalink raw reply
* Re: [GIT] Networking
From: Eric Dumazet @ 2013-01-13 2:03 UTC (permalink / raw)
To: David Miller; +Cc: torvalds, akpm, netdev
In-Reply-To: <20130112.155651.1165922449897847275.davem@davemloft.net>
On Sat, 2013-01-12 at 15:56 -0800, David Miller wrote:
> 1) Fix regression allowing IP_TTL setting of zero, fix from Eric
> Dumazet.
To be fair, I added this bug some time ago, and Cong Wang did the fix ;)
Thanks !
^ permalink raw reply
* [PATCH net-next] pkt_sched: namespace aware ifb
From: Eric Dumazet @ 2013-01-13 3:06 UTC (permalink / raw)
To: David Miller; +Cc: socketcan, netdev
In-Reply-To: <20130112.133630.257139657732337147.davem@davemloft.net>
From: Eric Dumazet <edumazet@google.com>
act_mirred needs to find the current net_ns, and struct net
pointer is not provided in the call chain. We run in process
context and current->nsproxy->net_ns is the needed pointer.
For ifb, things are easier, as the current ifb device can provide
the net pointer immediately.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/ifb.c | 2 +-
net/sched/act_mirred.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 344dceb..8216438 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -90,7 +90,7 @@ static void ri_tasklet(unsigned long dev)
u64_stats_update_end(&dp->tsync);
rcu_read_lock();
- skb->dev = dev_get_by_index_rcu(&init_net, skb->skb_iif);
+ skb->dev = dev_get_by_index_rcu(dev_net(_dev), skb->skb_iif);
if (!skb->dev) {
rcu_read_unlock();
dev_kfree_skb(skb);
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 9c0fd0c..f5a7e18 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -88,7 +88,7 @@ static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est,
return -EINVAL;
}
if (parm->ifindex) {
- dev = __dev_get_by_index(&init_net, parm->ifindex);
+ dev = __dev_get_by_index(current->nsproxy->net_ns, parm->ifindex);
if (dev == NULL)
return -ENODEV;
switch (dev->type) {
^ permalink raw reply related
* Re: [PATCH] mm: compaction: Partially revert capture of suitable high-order page
From: Simon Jeons @ 2013-01-13 3:07 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Eric Wong, Eric Dumazet, Rik van Riel, Minchan Kim,
Linus Torvalds, linux-mm, netdev, linux-kernel
In-Reply-To: <20130111092701.GK13304@suse.de>
On Fri, 2013-01-11 at 09:27 +0000, Mel Gorman wrote:
> Eric Wong reported on 3.7 and 3.8-rc2 that ppoll() got stuck when waiting
> for POLLIN on a local TCP socket. It was easier to trigger if there was disk
> IO and dirty pages at the same time and he bisected it to commit 1fb3f8ca
> "mm: compaction: capture a suitable high-order page immediately when it
> is made available".
>
> The intention of that patch was to improve high-order allocations under
> memory pressure after changes made to reclaim in 3.6 drastically hurt
> THP allocations but the approach was flawed. For Eric, the problem was
> that page->pfmemalloc was not being cleared for captured pages leading to
> a poor interaction with swap-over-NFS support causing the packets to be
> dropped. However, I identified a few more problems with the patch including
> the fact that it can increase contention on zone->lock in some cases which
> could result in async direct compaction being aborted early.
>
> In retrospect the capture patch took the wrong approach. What it should
> have done is mark the pageblock being migrated as MIGRATE_ISOLATE if it
> was allocating for THP and avoided races that way. While the patch was
Hi Mel,
Mark pageblock being migrated as MIGRATE_ISOLATE if it was allocating
for THP and avoided races that way is a good idea. But why I can't see
you do it in this patch?
> showing to improve allocation success rates at the time, the benefit is
> marginal given the relative complexity and it should be revisited from
> scratch in the context of the other reclaim-related changes that have taken
> place since the patch was first written and tested. This patch partially
> reverts commit 1fb3f8ca "mm: compaction: capture a suitable high-order
> page immediately when it is made available".
>
> Reported-and-tested-by: Eric Wong <normalperson@yhbt.net>
> Tested-by: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Mel Gorman <mgorman@suse.de>
> ---
> include/linux/compaction.h | 4 +-
> include/linux/mm.h | 1 -
> mm/compaction.c | 92 +++++++-------------------------------------
> mm/internal.h | 1 -
> mm/page_alloc.c | 35 ++++-------------
> 5 files changed, 23 insertions(+), 110 deletions(-)
>
> diff --git a/include/linux/compaction.h b/include/linux/compaction.h
> index 6ecb6dc..cc7bdde 100644
> --- a/include/linux/compaction.h
> +++ b/include/linux/compaction.h
> @@ -22,7 +22,7 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
> extern int fragmentation_index(struct zone *zone, unsigned int order);
> extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
> int order, gfp_t gfp_mask, nodemask_t *mask,
> - bool sync, bool *contended, struct page **page);
> + bool sync, bool *contended);
> extern int compact_pgdat(pg_data_t *pgdat, int order);
> extern void reset_isolation_suitable(pg_data_t *pgdat);
> extern unsigned long compaction_suitable(struct zone *zone, int order);
> @@ -75,7 +75,7 @@ static inline bool compaction_restarting(struct zone *zone, int order)
> #else
> static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
> int order, gfp_t gfp_mask, nodemask_t *nodemask,
> - bool sync, bool *contended, struct page **page)
> + bool sync, bool *contended)
> {
> return COMPACT_CONTINUE;
> }
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 6320407..66e2f7c 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -455,7 +455,6 @@ void put_pages_list(struct list_head *pages);
>
> void split_page(struct page *page, unsigned int order);
> int split_free_page(struct page *page);
> -int capture_free_page(struct page *page, int alloc_order, int migratetype);
>
> /*
> * Compound pages have a destructor function. Provide a
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 6b807e4..2c57043 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -816,6 +816,7 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
> static int compact_finished(struct zone *zone,
> struct compact_control *cc)
> {
> + unsigned int order;
> unsigned long watermark;
>
> if (fatal_signal_pending(current))
> @@ -850,22 +851,16 @@ static int compact_finished(struct zone *zone,
> return COMPACT_CONTINUE;
>
> /* Direct compactor: Is a suitable page free? */
> - if (cc->page) {
> - /* Was a suitable page captured? */
> - if (*cc->page)
> + for (order = cc->order; order < MAX_ORDER; order++) {
> + struct free_area *area = &zone->free_area[order];
> +
> + /* Job done if page is free of the right migratetype */
> + if (!list_empty(&area->free_list[cc->migratetype]))
> + return COMPACT_PARTIAL;
> +
> + /* Job done if allocation would set block type */
> + if (cc->order >= pageblock_order && area->nr_free)
> return COMPACT_PARTIAL;
> - } else {
> - unsigned int order;
> - for (order = cc->order; order < MAX_ORDER; order++) {
> - struct free_area *area = &zone->free_area[cc->order];
> - /* Job done if page is free of the right migratetype */
> - if (!list_empty(&area->free_list[cc->migratetype]))
> - return COMPACT_PARTIAL;
> -
> - /* Job done if allocation would set block type */
> - if (cc->order >= pageblock_order && area->nr_free)
> - return COMPACT_PARTIAL;
> - }
> }
>
> return COMPACT_CONTINUE;
> @@ -921,60 +916,6 @@ unsigned long compaction_suitable(struct zone *zone, int order)
> return COMPACT_CONTINUE;
> }
>
> -static void compact_capture_page(struct compact_control *cc)
> -{
> - unsigned long flags;
> - int mtype, mtype_low, mtype_high;
> -
> - if (!cc->page || *cc->page)
> - return;
> -
> - /*
> - * For MIGRATE_MOVABLE allocations we capture a suitable page ASAP
> - * regardless of the migratetype of the freelist is is captured from.
> - * This is fine because the order for a high-order MIGRATE_MOVABLE
> - * allocation is typically at least a pageblock size and overall
> - * fragmentation is not impaired. Other allocation types must
> - * capture pages from their own migratelist because otherwise they
> - * could pollute other pageblocks like MIGRATE_MOVABLE with
> - * difficult to move pages and making fragmentation worse overall.
> - */
> - if (cc->migratetype == MIGRATE_MOVABLE) {
> - mtype_low = 0;
> - mtype_high = MIGRATE_PCPTYPES;
> - } else {
> - mtype_low = cc->migratetype;
> - mtype_high = cc->migratetype + 1;
> - }
> -
> - /* Speculatively examine the free lists without zone lock */
> - for (mtype = mtype_low; mtype < mtype_high; mtype++) {
> - int order;
> - for (order = cc->order; order < MAX_ORDER; order++) {
> - struct page *page;
> - struct free_area *area;
> - area = &(cc->zone->free_area[order]);
> - if (list_empty(&area->free_list[mtype]))
> - continue;
> -
> - /* Take the lock and attempt capture of the page */
> - if (!compact_trylock_irqsave(&cc->zone->lock, &flags, cc))
> - return;
> - if (!list_empty(&area->free_list[mtype])) {
> - page = list_entry(area->free_list[mtype].next,
> - struct page, lru);
> - if (capture_free_page(page, cc->order, mtype)) {
> - spin_unlock_irqrestore(&cc->zone->lock,
> - flags);
> - *cc->page = page;
> - return;
> - }
> - }
> - spin_unlock_irqrestore(&cc->zone->lock, flags);
> - }
> - }
> -}
> -
> static int compact_zone(struct zone *zone, struct compact_control *cc)
> {
> int ret;
> @@ -1054,9 +995,6 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
> goto out;
> }
> }
> -
> - /* Capture a page now if it is a suitable size */
> - compact_capture_page(cc);
> }
>
> out:
> @@ -1069,8 +1007,7 @@ out:
>
> static unsigned long compact_zone_order(struct zone *zone,
> int order, gfp_t gfp_mask,
> - bool sync, bool *contended,
> - struct page **page)
> + bool sync, bool *contended)
> {
> unsigned long ret;
> struct compact_control cc = {
> @@ -1080,7 +1017,6 @@ static unsigned long compact_zone_order(struct zone *zone,
> .migratetype = allocflags_to_migratetype(gfp_mask),
> .zone = zone,
> .sync = sync,
> - .page = page,
> };
> INIT_LIST_HEAD(&cc.freepages);
> INIT_LIST_HEAD(&cc.migratepages);
> @@ -1110,7 +1046,7 @@ int sysctl_extfrag_threshold = 500;
> */
> unsigned long try_to_compact_pages(struct zonelist *zonelist,
> int order, gfp_t gfp_mask, nodemask_t *nodemask,
> - bool sync, bool *contended, struct page **page)
> + bool sync, bool *contended)
> {
> enum zone_type high_zoneidx = gfp_zone(gfp_mask);
> int may_enter_fs = gfp_mask & __GFP_FS;
> @@ -1136,7 +1072,7 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist,
> int status;
>
> status = compact_zone_order(zone, order, gfp_mask, sync,
> - contended, page);
> + contended);
> rc = max(status, rc);
>
> /* If a normal allocation would succeed, stop compacting */
> @@ -1192,7 +1128,6 @@ int compact_pgdat(pg_data_t *pgdat, int order)
> struct compact_control cc = {
> .order = order,
> .sync = false,
> - .page = NULL,
> };
>
> return __compact_pgdat(pgdat, &cc);
> @@ -1203,7 +1138,6 @@ static int compact_node(int nid)
> struct compact_control cc = {
> .order = -1,
> .sync = true,
> - .page = NULL,
> };
>
> return __compact_pgdat(NODE_DATA(nid), &cc);
> diff --git a/mm/internal.h b/mm/internal.h
> index d597f94..9ba2110 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -135,7 +135,6 @@ struct compact_control {
> int migratetype; /* MOVABLE, RECLAIMABLE etc */
> struct zone *zone;
> bool contended; /* True if a lock was contended */
> - struct page **page; /* Page captured of requested size */
> };
>
> unsigned long
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 4ba5e37..7e4ae85 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1389,14 +1389,8 @@ void split_page(struct page *page, unsigned int order)
> set_page_refcounted(page + i);
> }
>
> -/*
> - * Similar to the split_page family of functions except that the page
> - * required at the given order and being isolated now to prevent races
> - * with parallel allocators
> - */
> -int capture_free_page(struct page *page, int alloc_order, int migratetype)
> +static int __isolate_free_page(struct page *page, unsigned int order)
> {
> - unsigned int order;
> unsigned long watermark;
> struct zone *zone;
> int mt;
> @@ -1404,7 +1398,6 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
> BUG_ON(!PageBuddy(page));
>
> zone = page_zone(page);
> - order = page_order(page);
> mt = get_pageblock_migratetype(page);
>
> if (mt != MIGRATE_ISOLATE) {
> @@ -1413,7 +1406,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
> if (!zone_watermark_ok(zone, 0, watermark, 0, 0))
> return 0;
>
> - __mod_zone_freepage_state(zone, -(1UL << alloc_order), mt);
> + __mod_zone_freepage_state(zone, -(1UL << order), mt);
> }
>
> /* Remove page from free list */
> @@ -1421,11 +1414,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
> zone->free_area[order].nr_free--;
> rmv_page_order(page);
>
> - if (alloc_order != order)
> - expand(zone, page, alloc_order, order,
> - &zone->free_area[order], migratetype);
> -
> - /* Set the pageblock if the captured page is at least a pageblock */
> + /* Set the pageblock if the isolated page is at least a pageblock */
> if (order >= pageblock_order - 1) {
> struct page *endpage = page + (1 << order) - 1;
> for (; page < endpage; page += pageblock_nr_pages) {
> @@ -1436,7 +1425,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
> }
> }
>
> - return 1UL << alloc_order;
> + return 1UL << order;
> }
>
> /*
> @@ -1454,10 +1443,9 @@ int split_free_page(struct page *page)
> unsigned int order;
> int nr_pages;
>
> - BUG_ON(!PageBuddy(page));
> order = page_order(page);
>
> - nr_pages = capture_free_page(page, order, 0);
> + nr_pages = __isolate_free_page(page, order);
> if (!nr_pages)
> return 0;
>
> @@ -2163,8 +2151,6 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
> bool *contended_compaction, bool *deferred_compaction,
> unsigned long *did_some_progress)
> {
> - struct page *page = NULL;
> -
> if (!order)
> return NULL;
>
> @@ -2176,16 +2162,12 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
> current->flags |= PF_MEMALLOC;
> *did_some_progress = try_to_compact_pages(zonelist, order, gfp_mask,
> nodemask, sync_migration,
> - contended_compaction, &page);
> + contended_compaction);
> current->flags &= ~PF_MEMALLOC;
>
> - /* If compaction captured a page, prep and use it */
> - if (page) {
> - prep_new_page(page, order, gfp_mask);
> - goto got_page;
> - }
> -
> if (*did_some_progress != COMPACT_SKIPPED) {
> + struct page *page;
> +
> /* Page migration frees to the PCP lists but we want merging */
> drain_pages(get_cpu());
> put_cpu();
> @@ -2195,7 +2177,6 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
> alloc_flags & ~ALLOC_NO_WATERMARKS,
> preferred_zone, migratetype);
> if (page) {
> -got_page:
> preferred_zone->compact_blockskip_flush = false;
> preferred_zone->compact_considered = 0;
> preferred_zone->compact_defer_shift = 0;
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Simon Jeons <simon.jeons@gmail.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH net-next] pkt_sched: namespace aware ifb
From: Benjamin LaHaise @ 2013-01-13 3:50 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, socketcan, netdev
In-Reply-To: <1358046374.20249.1789.camel@edumazet-glaptop>
On Sat, Jan 12, 2013 at 07:06:14PM -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> act_mirred needs to find the current net_ns, and struct net
> pointer is not provided in the call chain. We run in process
> context and current->nsproxy->net_ns is the needed pointer.
...
I don't think this is correct. Going by the call chain, tcf_action_add can
be called because of a netlink message, and that netlink message may not be
in the same "struct net" as the current process. It looks like the ->init
operation is going to need to have the namespace passed in for this to work
correctly.
-ben
> diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
> index 9c0fd0c..f5a7e18 100644
> --- a/net/sched/act_mirred.c
> +++ b/net/sched/act_mirred.c
> @@ -88,7 +88,7 @@ static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est,
> return -EINVAL;
> }
> if (parm->ifindex) {
> - dev = __dev_get_by_index(&init_net, parm->ifindex);
> + dev = __dev_get_by_index(current->nsproxy->net_ns, parm->ifindex);
> if (dev == NULL)
> return -ENODEV;
> switch (dev->type) {
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
"Thought is the essence of where you are now."
^ permalink raw reply
* Re: [RFC PATCH 6/6] ipv6: IPv6 over IEEE1394 (RFC3146) support.
From: YOSHIFUJI Hideaki @ 2013-01-13 3:57 UTC (permalink / raw)
To: stephan.gatzka; +Cc: Stefan Richter, netdev, linux1394-devel, YOSHIFUJI Hideaki
In-Reply-To: <50F192DF.9090100@gmail.com>
Stephan Gatzka wrote:
>> How about putting EUI64, maxrec, sspd and fifo in dev->dev_addr?
>> This enable us to send NDISC/ARP packet easily (based on neighbor
>> cache entry), and driver can be notified for new neighbors (thus
>> new peers).
> Hm, that looks a bit strange to me, because we need that only for link layer option packets and not for every IPv6 packet transmitted via firewire.
It seems the stack will be clearner, overall.
In addition to ARP/NDP things, for example, it will become easier to
implement multicast as well; IP layer can tell net_device layer
multicast listener information via special mapping.
Given multicast bit is disabled in the Unique ID (well, it should be
disabled; otherwise, disable multicast bit and trun on locally
administrated bit), IP layer can tell full IPv6 address via
ip6_mc_map() by copying full IPv6 address to EUI-64 + additional
space, e.g:
IPv6: FF xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx (IPv6 mutlicast address (FF00::/8))
Similar in IPv4:
IPv4: 01 00 00 00 00 00 00 00 00 00 00 00 xx xx xx xx (IPv4 multicast address)
Device will be notified via dev_mc_add() / dev_mc_del(),
then net_device_opts->ndo_set_rx_mode(), and you can manage
multicast lists based on that.
When sending the driver can determine if the packet is multicast or not
by seeing 0x01 bit in the first octet in the destination virtual
"MAC" address, and then MCAP manager can determine IP version by seeing
the first octet of our virtual "MAC" address.
--yoshfuji
^ permalink raw reply
* Regression in 3.6+: fib_validate_source breakage
From: Phil Oester @ 2013-01-13 4:45 UTC (permalink / raw)
To: netdev
In commit 7a9bc9b81a (Elide fib_validate_source() completely when possible) it
was stated:
If rpfilter is off (or the SKB has an IPSEC path) and there are not
tclassid users, we don't have to do anything at all when
fib_validate_source() is invoked besides setting the itag to zero.
However, this change was later proven to break redirects, fixed in commit
e81da0e113 (ipv4: fix sending of redirects).
In addition to this breakage, it also bypassed another necessary check, as
clearly stated in the preamble comment to fib_validate_source:
* - (main) check, that source is valid i.e. not broadcast or our local
* address.
Without this check (and if rp_filter is NOT enabled), packets with local source
addresses are accepted by the stack. This only came to light due to a buggy
switch which is occasionally reflecting packets back at a box running a VRRP
daemon, causing the local box to believe it has seen a higher priority
advertisement, when in reality it is only seeing a copy of its own advertisement.
Prior to 3.6, these packets would be silently dropped.
Also, not that I use it, but accept_local handling appears to now be broken.
I realize the original change likely made the route cache removal more palatable,
but given the number of issues it has caused, perhaps a revert is in order?
I can't find any easy alternative fix.
Phil Oester
^ permalink raw reply
* Re: [PATCH net-next] pkt_sched: namespace aware ifb
From: Eric Dumazet @ 2013-01-13 5:49 UTC (permalink / raw)
To: Benjamin LaHaise; +Cc: David Miller, socketcan, netdev
In-Reply-To: <20130113035013.GJ5259@kvack.org>
On Sat, 2013-01-12 at 22:50 -0500, Benjamin LaHaise wrote:
> On Sat, Jan 12, 2013 at 07:06:14PM -0800, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> >
> > act_mirred needs to find the current net_ns, and struct net
> > pointer is not provided in the call chain. We run in process
> > context and current->nsproxy->net_ns is the needed pointer.
> ...
>
> I don't think this is correct. Going by the call chain, tcf_action_add can
> be called because of a netlink message, and that netlink message may not be
> in the same "struct net" as the current process. It looks like the ->init
> operation is going to need to have the namespace passed in for this to work
> correctly.
But it is working in my tests.
I added a WARN and the call stack is :
[ 701.522282] [<ffffffff8108634f>] warn_slowpath_common+0x7f/0xc0
[ 701.522284] [<ffffffff810863aa>] warn_slowpath_null+0x1a/0x20
[ 701.522286] [<ffffffffa00e00e3>] tcf_mirred_init+0x43/0x340 [act_mirred]
[ 701.522289] [<ffffffff81506385>] ? __rtnl_unlock+0x15/0x20
[ 701.522293] [<ffffffff815195e8>] tcf_action_init_1+0x198/0x1e0
[ 701.522295] [<ffffffff815196c8>] tcf_action_init+0x98/0x100
[ 701.522298] [<ffffffff81517f30>] tcf_exts_validate+0x90/0xb0
[ 701.522300] [<ffffffff8151e55b>] u32_set_parms.isra.11+0x3b/0x270
[ 701.522303] [<ffffffff812ffdf0>] ? nla_parse+0x90/0xe0
[ 701.522304] [<ffffffff8151ed16>] u32_change+0x2e6/0x4c0
[ 701.522306] [<ffffffff81518432>] tc_ctl_tfilter+0x4e2/0x720
[ 701.522308] [<ffffffff815064ad>] rtnetlink_rcv_msg+0x11d/0x310
[ 701.522310] [<ffffffff81506390>] ? __rtnl_unlock+0x20/0x20
[ 701.522312] [<ffffffff81522d39>] netlink_rcv_skb+0xa9/0xd0
[ 701.522314] [<ffffffff81503875>] rtnetlink_rcv+0x25/0x40
[ 701.522316] [<ffffffff81522681>] netlink_unicast+0x1b1/0x230
[ 701.522317] [<ffffffff815229fe>] netlink_sendmsg+0x2fe/0x3b0
[ 701.522321] [<ffffffff814dbdf2>] sock_sendmsg+0xd2/0xf0
[ 701.522323] [<ffffffff814dbca0>] ? sock_recvmsg+0xe0/0x100
[ 701.522326] [<ffffffff814dd0f0>] __sys_sendmsg+0x380/0x390
[ 701.522329] [<ffffffff815b20b4>] ? __do_page_fault+0x214/0x460
[ 701.522331] [<ffffffff814df4e9>] sys_sendmsg+0x49/0x90
[ 701.522334] [<ffffffff815b68c2>] system_call_fastpath+0x16/0x1b
Could you elaborate on what could be the problem ?
We hold the RTNL, so I dont think another process could possibly call
tcf_mirred_init()
^ permalink raw reply
* [PATCH net-next] ipv6 route: Use ipv6_addr_hash() in rt6_info_hash_nhsfn().
From: YOSHIFUJI Hideaki @ 2013-01-13 8:32 UTC (permalink / raw)
To: davem, netdev; +Cc: yoshfuji
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
net/ipv6/route.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 621b68e..c408566 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -388,15 +388,8 @@ static int rt6_info_hash_nhsfn(unsigned int candidate_count,
{
unsigned int val = fl6->flowi6_proto;
- val ^= (__force u32)fl6->daddr.s6_addr32[0];
- val ^= (__force u32)fl6->daddr.s6_addr32[1];
- val ^= (__force u32)fl6->daddr.s6_addr32[2];
- val ^= (__force u32)fl6->daddr.s6_addr32[3];
-
- val ^= (__force u32)fl6->saddr.s6_addr32[0];
- val ^= (__force u32)fl6->saddr.s6_addr32[1];
- val ^= (__force u32)fl6->saddr.s6_addr32[2];
- val ^= (__force u32)fl6->saddr.s6_addr32[3];
+ val ^= ipv6_addr_hash(&fl6->daddr);
+ val ^= ipv6_addr_hash(&fl6->saddr);
/* Work only if this not encapsulated */
switch (fl6->flowi6_proto) {
--
1.7.9.5
^ permalink raw reply related
* [PATCH net-next] ipv6 xfrm: Use ipv6_addr_hash() in xfrm6_tunnel_spi_hash_byaddr().
From: YOSHIFUJI Hideaki @ 2013-01-13 8:32 UTC (permalink / raw)
To: davem, netdev; +Cc: yoshfuji
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
net/ipv6/xfrm6_tunnel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index ee5a706..babd167 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -72,7 +72,7 @@ static inline unsigned int xfrm6_tunnel_spi_hash_byaddr(const xfrm_address_t *ad
{
unsigned int h;
- h = (__force u32)(addr->a6[0] ^ addr->a6[1] ^ addr->a6[2] ^ addr->a6[3]);
+ h = ipv6_addr_hash((const struct in6_addr *)addr);
h ^= h >> 16;
h ^= h >> 8;
h &= XFRM6_TUNNEL_SPI_BYADDR_HSIZE - 1;
--
1.7.9.5
^ permalink raw reply related
* [PATCH net-next] ipv6: Use ipv6_get_dsfield() instead of ipv6_tclass().
From: YOSHIFUJI Hideaki @ 2013-01-13 8:32 UTC (permalink / raw)
To: davem, netdev; +Cc: yoshfuji
Commit 7a3198a8 ("ipv6: helper function to get tclass") introduced
ipv6_tclass(), but similar function is already available as
ipv6_get_dsfield().
We might be able to call ipv6_tclass() from ipv6_get_dsfield(),
but it is confusing to have two versions.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
include/linux/ipv6.h | 5 -----
net/ipv6/datagram.c | 3 ++-
net/ipv6/tcp_ipv6.c | 6 +++---
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index faed1e3..304a9f4 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -77,11 +77,6 @@ static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb)
return (struct ipv6hdr *)skb_transport_header(skb);
}
-static inline __u8 ipv6_tclass(const struct ipv6hdr *iph)
-{
- return (ntohl(*(__be32 *)iph) >> 20) & 0xff;
-}
-
/*
This structure contains results of exthdrs parsing
as offsets from skb->nh.
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 56b692b..633ac55 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -30,6 +30,7 @@
#include <net/transp_v6.h>
#include <net/ip6_route.h>
#include <net/tcp_states.h>
+#include <net/dsfield.h>
#include <linux/errqueue.h>
#include <asm/uaccess.h>
@@ -487,7 +488,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
}
if (np->rxopt.bits.rxtclass) {
- int tclass = ipv6_tclass(ipv6_hdr(skb));
+ int tclass = ipv6_get_dsfield(ipv6_hdr(skb));
put_cmsg(msg, SOL_IPV6, IPV6_TCLASS, sizeof(tclass), &tclass);
}
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 3164ad2..3701c3c 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1163,7 +1163,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
newnp->opt = NULL;
newnp->mcast_oif = inet6_iif(skb);
newnp->mcast_hops = ipv6_hdr(skb)->hop_limit;
- newnp->rcv_tclass = ipv6_tclass(ipv6_hdr(skb));
+ newnp->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb));
/*
* No need to charge this sock to the relevant IPv6 refcnt debug socks count
@@ -1243,7 +1243,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
newnp->opt = NULL;
newnp->mcast_oif = inet6_iif(skb);
newnp->mcast_hops = ipv6_hdr(skb)->hop_limit;
- newnp->rcv_tclass = ipv6_tclass(ipv6_hdr(skb));
+ newnp->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb));
/* Clone native IPv6 options from listening socket (if any)
@@ -1456,7 +1456,7 @@ ipv6_pktoptions:
if (np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim)
np->mcast_hops = ipv6_hdr(opt_skb)->hop_limit;
if (np->rxopt.bits.rxtclass)
- np->rcv_tclass = ipv6_tclass(ipv6_hdr(skb));
+ np->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb));
if (ipv6_opt_accepted(sk, opt_skb)) {
skb_set_owner_r(opt_skb, sk);
opt_skb = xchg(&np->pktoptions, opt_skb);
--
1.7.9.5
^ permalink raw reply related
* [PATCH net-next] ipv6: Use ipv6_is_mld() in ip6_mc_input().
From: YOSHIFUJI Hideaki @ 2013-01-13 8:32 UTC (permalink / raw)
To: davem, netdev; +Cc: yoshfuji
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
include/net/addrconf.h | 2 +-
net/ipv6/ip6_input.c | 21 +++------------------
net/ipv6/mcast.c | 4 ++--
3 files changed, 6 insertions(+), 21 deletions(-)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index df4ef94..59f14ab 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -150,7 +150,7 @@ extern void addrconf_dad_failure(struct inet6_ifaddr *ifp);
extern bool ipv6_chk_mcast_addr(struct net_device *dev,
const struct in6_addr *group,
const struct in6_addr *src_addr);
-extern bool ipv6_is_mld(struct sk_buff *skb, int nexthdr);
+extern bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset);
extern void addrconf_prefix_rcv(struct net_device *dev,
u8 *opt, int len, bool sllao);
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index a52d864..6de509e 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -212,7 +212,7 @@ resubmit:
if (ipv6_addr_is_multicast(&hdr->daddr) &&
!ipv6_chk_mcast_addr(skb->dev, &hdr->daddr,
&hdr->saddr) &&
- !ipv6_is_mld(skb, nexthdr))
+ !ipv6_is_mld(skb, nexthdr, 0))
goto discard;
}
if (!(ipprot->flags & INET6_PROTO_NOPOLICY) &&
@@ -283,7 +283,6 @@ int ip6_mc_input(struct sk_buff *skb)
if (unlikely(opt->ra)) {
/* Check if this is a mld message */
u8 *ptr = skb_network_header(skb) + opt->ra;
- struct icmp6hdr *icmp6;
u8 nexthdr = hdr->nexthdr;
__be16 frag_off;
int offset;
@@ -303,24 +302,10 @@ int ip6_mc_input(struct sk_buff *skb)
if (offset < 0)
goto out;
- if (nexthdr != IPPROTO_ICMPV6)
+ if (!ipv6_is_mld(skb, offset, nexthdr))
goto out;
- if (!pskb_may_pull(skb, (skb_network_header(skb) +
- offset + 1 - skb->data)))
- goto out;
-
- icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset);
-
- switch (icmp6->icmp6_type) {
- case ICMPV6_MGM_QUERY:
- case ICMPV6_MGM_REPORT:
- case ICMPV6_MGM_REDUCTION:
- case ICMPV6_MLD2_REPORT:
- deliver = true;
- break;
- }
- goto out;
+ deliver = true;
}
/* unknown RA - process it normally */
}
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 28dfa5f..b529c27 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -937,14 +937,14 @@ int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr)
/*
* identify MLD packets for MLD filter exceptions
*/
-bool ipv6_is_mld(struct sk_buff *skb, int nexthdr)
+bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset)
{
struct icmp6hdr *pic;
if (nexthdr != IPPROTO_ICMPV6)
return false;
- if (!pskb_may_pull(skb, sizeof(struct icmp6hdr)))
+ if (!pskb_may_pull(skb, offset + sizeof(struct icmp6hdr)))
return false;
pic = icmp6_hdr(skb);
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH net-next] ipv6: Use ipv6_is_mld() in ip6_mc_input().
From: YOSHIFUJI Hideaki @ 2013-01-13 8:43 UTC (permalink / raw)
To: davem; +Cc: YOSHIFUJI Hideaki, netdev
In-Reply-To: <50F27111.9020001@linux-ipv6.org>
YOSHIFUJI Hideaki wrote:
> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> ---
> include/net/addrconf.h | 2 +-
> net/ipv6/ip6_input.c | 21 +++------------------
> net/ipv6/mcast.c | 4 ++--
> 3 files changed, 6 insertions(+), 21 deletions(-)
>
> diff --git a/include/net/addrconf.h b/include/net/addrconf.h
> index df4ef94..59f14ab 100644
> --- a/include/net/addrconf.h
> +++ b/include/net/addrconf.h
> @@ -150,7 +150,7 @@ extern void addrconf_dad_failure(struct inet6_ifaddr *ifp);
> extern bool ipv6_chk_mcast_addr(struct net_device *dev,
> const struct in6_addr *group,
> const struct in6_addr *src_addr);
> -extern bool ipv6_is_mld(struct sk_buff *skb, int nexthdr);
> +extern bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset);
>
> extern void addrconf_prefix_rcv(struct net_device *dev,
> u8 *opt, int len, bool sllao);
> diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
> index a52d864..6de509e 100644
> --- a/net/ipv6/ip6_input.c
> +++ b/net/ipv6/ip6_input.c
> @@ -212,7 +212,7 @@ resubmit:
> if (ipv6_addr_is_multicast(&hdr->daddr) &&
> !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr,
> &hdr->saddr) &&
> - !ipv6_is_mld(skb, nexthdr))
> + !ipv6_is_mld(skb, nexthdr, 0))
> goto discard;
> }
> if (!(ipprot->flags & INET6_PROTO_NOPOLICY) &&
> @@ -283,7 +283,6 @@ int ip6_mc_input(struct sk_buff *skb)
> if (unlikely(opt->ra)) {
> /* Check if this is a mld message */
> u8 *ptr = skb_network_header(skb) + opt->ra;
> - struct icmp6hdr *icmp6;
> u8 nexthdr = hdr->nexthdr;
> __be16 frag_off;
> int offset;
> @@ -303,24 +302,10 @@ int ip6_mc_input(struct sk_buff *skb)
> if (offset < 0)
> goto out;
>
> - if (nexthdr != IPPROTO_ICMPV6)
> + if (!ipv6_is_mld(skb, offset, nexthdr))
> goto out;
>
> - if (!pskb_may_pull(skb, (skb_network_header(skb) +
> - offset + 1 - skb->data)))
> - goto out;
> -
> - icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset);
> -
> - switch (icmp6->icmp6_type) {
> - case ICMPV6_MGM_QUERY:
> - case ICMPV6_MGM_REPORT:
> - case ICMPV6_MGM_REDUCTION:
> - case ICMPV6_MLD2_REPORT:
> - deliver = true;
> - break;
> - }
> - goto out;
> + deliver = true;
> }
> /* unknown RA - process it normally */
> }
> diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
> index 28dfa5f..b529c27 100644
> --- a/net/ipv6/mcast.c
> +++ b/net/ipv6/mcast.c
> @@ -937,14 +937,14 @@ int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr)
> /*
> * identify MLD packets for MLD filter exceptions
> */
> -bool ipv6_is_mld(struct sk_buff *skb, int nexthdr)
> +bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset)
> {
> struct icmp6hdr *pic;
>
> if (nexthdr != IPPROTO_ICMPV6)
> return false;
>
> - if (!pskb_may_pull(skb, sizeof(struct icmp6hdr)))
> + if (!pskb_may_pull(skb, offset + sizeof(struct icmp6hdr)))
> return false;
>
> pic = icmp6_hdr(skb);
>
Sorry I found some bugs, I'll repost.
--yoshfuji
^ permalink raw reply
* RE: [RFC PATCH] net: phy: remove flags argument from phy_{attach,connect,connect_direct}
From: Kosta Zertsekel @ 2013-01-13 8:54 UTC (permalink / raw)
To: Florian Fainelli, netdev@vger.kernel.org
Cc: davem@davemloft.net, afleming@gmail.com
In-Reply-To: <1357903907-16049-1-git-send-email-florian@openwrt.org>
> The flags argument of the phy_{attach,connect,connect_direct} functions is used to assign a struct phy_device dev_flags with the value passed.
> All callers but the tg3 driver pass the flag 0, which results in the underlying PHY drivers in drivers/net/phy/ not being able to actually use any
> of the flags they would check in dev_flags. This patch gets rid of the flags argument, and passes phydev->dev_flags to the internal PHY library call
> phy_attach_direct() such that drivers which actually modify a phy device dev_flags get the value preserved for use by the underly phy driver.
Acked by konszert@marvell.com.
It seems this patch should be reposted on linux-kernel@vger.kernel.org list for wider approval, isn't it?
Anyway, I think it is prudent to abandon my narrow patch that fixed only phy_attach() in mv643xx network driver.
--- KostaZ
^ permalink raw reply
* [PATCH net-next] ipv6: Make ipv6_is_mld() inline and use it from ip6_mc_input().
From: YOSHIFUJI Hideaki @ 2013-01-13 10:09 UTC (permalink / raw)
To: davem, netdev; +Cc: yoshfuji
Move generalized version of ipv6_is_mld() to header,
and use it from ip6_mc_input().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
include/net/addrconf.h | 26 +++++++++++++++++++++++++-
net/ipv6/ip6_input.c | 21 +++------------------
net/ipv6/mcast.c | 27 ---------------------------
3 files changed, 28 insertions(+), 46 deletions(-)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index df4ef94..7cd14c0 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -150,7 +150,31 @@ extern void addrconf_dad_failure(struct inet6_ifaddr *ifp);
extern bool ipv6_chk_mcast_addr(struct net_device *dev,
const struct in6_addr *group,
const struct in6_addr *src_addr);
-extern bool ipv6_is_mld(struct sk_buff *skb, int nexthdr);
+
+/*
+ * identify MLD packets for MLD filter exceptions
+ */
+static inline bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset)
+{
+ struct icmp6hdr *hdr;
+
+ if (nexthdr != IPPROTO_ICMPV6 ||
+ !pskb_network_may_pull(skb, offset + sizeof(struct icmp6hdr)))
+ return false;
+
+ hdr = (struct icmp6hdr *)(skb_network_header(skb) + offset);
+
+ switch (hdr->icmp6_type) {
+ case ICMPV6_MGM_QUERY:
+ case ICMPV6_MGM_REPORT:
+ case ICMPV6_MGM_REDUCTION:
+ case ICMPV6_MLD2_REPORT:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
extern void addrconf_prefix_rcv(struct net_device *dev,
u8 *opt, int len, bool sllao);
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index a52d864..2ccd35e 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -212,7 +212,7 @@ resubmit:
if (ipv6_addr_is_multicast(&hdr->daddr) &&
!ipv6_chk_mcast_addr(skb->dev, &hdr->daddr,
&hdr->saddr) &&
- !ipv6_is_mld(skb, nexthdr))
+ !ipv6_is_mld(skb, nexthdr, skb_network_header_len(skb)))
goto discard;
}
if (!(ipprot->flags & INET6_PROTO_NOPOLICY) &&
@@ -283,7 +283,6 @@ int ip6_mc_input(struct sk_buff *skb)
if (unlikely(opt->ra)) {
/* Check if this is a mld message */
u8 *ptr = skb_network_header(skb) + opt->ra;
- struct icmp6hdr *icmp6;
u8 nexthdr = hdr->nexthdr;
__be16 frag_off;
int offset;
@@ -303,24 +302,10 @@ int ip6_mc_input(struct sk_buff *skb)
if (offset < 0)
goto out;
- if (nexthdr != IPPROTO_ICMPV6)
+ if (!ipv6_is_mld(skb, nexthdr, offset))
goto out;
- if (!pskb_may_pull(skb, (skb_network_header(skb) +
- offset + 1 - skb->data)))
- goto out;
-
- icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset);
-
- switch (icmp6->icmp6_type) {
- case ICMPV6_MGM_QUERY:
- case ICMPV6_MGM_REPORT:
- case ICMPV6_MGM_REDUCTION:
- case ICMPV6_MLD2_REPORT:
- deliver = true;
- break;
- }
- goto out;
+ deliver = true;
}
/* unknown RA - process it normally */
}
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 28dfa5f..8237ee1 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -935,33 +935,6 @@ int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr)
}
/*
- * identify MLD packets for MLD filter exceptions
- */
-bool ipv6_is_mld(struct sk_buff *skb, int nexthdr)
-{
- struct icmp6hdr *pic;
-
- if (nexthdr != IPPROTO_ICMPV6)
- return false;
-
- if (!pskb_may_pull(skb, sizeof(struct icmp6hdr)))
- return false;
-
- pic = icmp6_hdr(skb);
-
- switch (pic->icmp6_type) {
- case ICMPV6_MGM_QUERY:
- case ICMPV6_MGM_REPORT:
- case ICMPV6_MGM_REDUCTION:
- case ICMPV6_MLD2_REPORT:
- return true;
- default:
- break;
- }
- return false;
-}
-
-/*
* check if the interface/address pair is valid
*/
bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 1/3] ssb: add missing method ssb_gige_get_macaddr
From: Michael Büsch @ 2013-01-13 9:47 UTC (permalink / raw)
To: David Miller; +Cc: hauke, mcarlson, mchan, netdev
In-Reply-To: <20130112.153211.562541025115995797.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 862 bytes --]
On Sat, 12 Jan 2013 15:32:11 -0800 (PST)
David Miller <davem@davemloft.net> wrote:
> From: Hauke Mehrtens <hauke@hauke-m.de>
> Date: Sat, 12 Jan 2013 21:01:43 +0100
>
> > When CONFIG_SSB_DRIVER_GIGE is not set the header does not provide the
> > needed method.
> >
> > Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>
> This isn't right.
>
> You can't implement this function in a way that the caller cannot
> determine that it didn't actually do anything.
>
> You either have to protect calls with ifdefs or make this routine
> return an error indication, in response to which the caller can
> set a random ethernet address or take some other corrective action.
tg3 uses is_valid_ether_addr() afterwards anyway. An error code return value
could be added, but it didn't seem necessary.
--
Greetings, Michael.
PGP: 908D8B0E
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [RFC davem] revert: net: Make skb->skb_iif always track skb->dev
From: Oliver Hartkopp @ 2013-01-13 11:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20130112.133630.257139657732337147.davem@davemloft.net>
On 12.01.2013 22:36, David Miller wrote:
> As per your problem with CAN, that's also rediculous. You have an SKB
> control block in skb->cb[] that you can put whatever values with
> whatever semantics you want.
>
> Use it.
I'm not writing a RFC to you, when i'm not sure having checked several options
before.
In the tx path already net/sched is using cb[] for it's purposes.
Adding the information somewhere at the end of cb[] to not interfere with
sched becomes tricky. See users of qdisc_cb_private_validate().
So the 'incoming interface index' could be stored safely in the tx path in
- skb->data
- skb_shared_info
- skb_iif
skb_iif was the obvious choice then. And the question why a seven year old
if-statement in net/core/dev.c has been removed must be allowed.
Networking is not only IP networking.
Oliver
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox