* Re: [PATCH net-next v2 4/4] virtio-net: initial debugfs support, export mergeable rx buffer size
From: Michael Dalton @ 2014-01-11 5:36 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: netdev, lf-virt, Eric Dumazet, David S. Miller
In-Reply-To: <CANJ5vP+Qxa5j_Cp1FBK-qdO+U+dy2kiY5N2bmWdMKbCoY9EwDQ@mail.gmail.com>
Also, one other note: if we use sysfs, the directory structure will
be different depending on our chosen sysfs strategy. If we augment
netdev_rx_queue, the new attributes will be found in the standard
'rx-<N>' netdev subdirectory, e.g.,
/sys/class/net/eth0/queues/rx-0/mergeable_rx_buffer_size
Whereas if we use per-netdev attributes, our attributes would be in
/sys/class/net/eth0/<group name>/<attribute name>, which may be
less intuitive as AFAICT we'd have to indicate both the queue # and
type of value being reported using the attribute name. E.g.,
/sys/class/net/eth0/virtio-net/rx-0_mergeable_buffer_size.
That's somewhat less elegant.
I don't see an easy way to add new attributes to the 'rx-<N>'
subdirectories without directly modifying struct netdev_rx_queue,
so I think this is another tradeoff between the two sysfs approaches.
Best,
Mike
^ permalink raw reply
* 3.13-rc7 USB networking oops
From: Daniel J Blueman @ 2014-01-11 7:58 UTC (permalink / raw)
To: Linux Kernel, linux-usb-u79uwXL29TY76Z2rM5mHXA, Netdev; +Cc: Oliver Neukum
I hit this on 3.13-rc7 while transferring data over an ASIX88179 USB 3
to gigabit ethernet adapter, transferring data at only 4MB/s.
What other debug options apart from SG debug would be useful here?
Thanks,
Daniel
On 30 December 2013 23:26, Daniel J Blueman <daniel-JCXMqzvhRcvYtjvyW6yDsg@public.gmane.org> wrote:
> When rsyncing data from a USB3 disk over a USB3-ethernet adapter to
> local server on 3.13-rc5 [1], I ran into fatal page-not-readable fault
> [2].
>
> Full dmesg (before the disk was plugged in) is at
> http://quora.org/2013/dmesg.txt
>
> I can test patches on the weekend if needed.
>
> Thanks and Happy New Year!
> Daniel
>
> --- [1]
>
> http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.13-rc5-trusty/linux-image-3.13.0-031300rc5-generic_3.13.0-031300rc5.201312221635_amd64.deb
>
> --- [2] (apologies for any typos due to OCR)
>
> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: [<ffffffff813979f2>] sg_next+0x2/0x20
> PGD 2354c5067 PUD 1b25b1067 PMD 0
> Oops: 0000 [#1] SMP
> Modules linked in: usb_storage dm_crypt autofs4 snd_hda_codec_hdmi
> parport_pc ppdev tusb bluetooth snd_page_alloc ax88179_178e usbnet
> snd_seq_midi crctlOdif_pcImul vldepdev snd_sedird _ich apple_gmux
> apple_bl mac_hid nIs_iS08859_1 lp parport btrfs xor raid6_pq libcrc32c
> hid_generic
> CPU: 0 PID: 6395 Comm: pool Not tainted 3.13.0-031300rc5-generic #201312221635
> Hardware name: Apple Inc. MacBookFro10,1/Mac-C3EC7CD22292981F, BIOS
> M8P101.632.00EE.I
> task: ffff880178ec6000 ti: ffff880061914000 task.ti: ffff880061914000
> RIP: 0010:[<ffffffff813979f2>] kffffffff813979f2A sg_next+0x2/0x20
> RSP: 0018:ffff880061915740 EFLAGS: 00010046
> RAX: 0000000000000000 RBX: ff1f880036255000 RCX: 0000000000000003
> RDX: 0000000000000003 RSI: ffff880036255000 RDI: 0000000000000000
> R6P: ffff880061915798 R08: 0000000000000201 R09: 0000000000003578
> R10: ffffffff8163fa52 R11: 00000000000002c0 R12: ffff88025e5dfc00
> R13: ffff8802634f2098 R14: 0000000000000001 R15: ffffffff81c26c40
> FS: 00007fc7c4b37700(0000) OS:fff188026f200000(0000) knIGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 0000000000000000 CR3: 00000001e8b12000 CR4: 00000000001407f0
> Stack:
> ffffffff8156d8fe 0000000000000000 ffff880100000003 ffff88011c144e40
> 00000003245ded00 ffff8801245ded00 ffff880036255000 ffff88025e5dfc00
> 0000000000000020 0000000000000200 1fff88007a3e59fc ffff8800619157d8
> Call Trace:
> [<ffffffff8156d8fe>] ? usb_hcd_map_urb_for_dma+0x30e/0x4b0
> [<ffffffff8156e535>] usb_hcd_submit_urb+0x125/0x1b0
> [<ffffffff8156f93f>] usb_submit_urb.part.7+0x15f/0x430
> [<ffffffff814c79a9>] ? __pm_runtime_resume+0x69/0x90
> [<ffffffff8156fc45>1 usb_submit_urb+0x35/0x80
> [<ffffffffa05c8b55>] usbnet_stert_xmit+0x245/0x640 [usbnet]
> [<ffffffff8165248d>] dev_hard_start_xmit+0x54d/0x5f0
> [<ffffffff8165248d>] ? dev_hard_start_xmit+0x54d/0x5f0
> [<ffffffff81671710>] sch_direct_xmit+0x100/0x1d0
> [<ffffffff816526a2>] dev_queue_xmit+0x172/0x4b0
> [<ffffffff8168c8b0>] ip_finish_output+0x224/0x3f0
> [<ffffffffB168d3b8>] ip_output+0x58/0x90
> [<ffffffff8168cb29>] 1p_local_out+0x29/0x30
> [<ffffffff8168cc70>] ip_queue_xmit+0x140/0x3d0
> [<ffffffff816a495a>] tcp_transmit_skb+0x3ba/0x620
> [<ffffffff816a55cc>] tcp_write_xmit+0xlic/0x470
> [<ffffffff81685992>] __tcp_push_pend1ng_frames+0x32/0xd0
> [<ffffffff816968af>] tcp_sendmsg+0xl2f/0xd70
> [<ffffffff816c0961>] inet_sendmsg+0x61/0xb0
> [<ffffffff8108f460>] ? __remove_hrtimer+0x60/0xc0
> [<ffffffff816374a2>] do_sock_write.isra.16+0xc2/0xe0
> [<ffffffff81637508>] sock_aio_write+0x48/0x60
> [<ffffffff8108f8c2>] ? hrtimer_cance1+0x22/0x30
> [<ffffffff811c38f8>] do_sync_readv_writev+0x48/0x80
> [<ffffffff811c4d18>] do_readv_writev+0xc8/0x2a0
> [<ffffffff8109fc6d>] ? vtime_account_user+0x5d/0x70
> [<ffffffffelic4f27>] vfs_writev+0x37/0x50
> [<ffffffff811c50a2>] SyS_writev+0x52/0xc0
> [<ffffffff8176c73f>] tracesys+0xe1/0xe6
> Code: 5c 41 5d 41 5e 41 5f 5d c3 55 48 c7 c2 00 7e 39 81 be 80 00 00
> 00 4S 89 eS e8 6b
> RIP [<ffffffffe13379f2>] sg_next+0x2/0x20
> RSP <ffff880061915740>
> CR2: 0000000000000000
> Kernel panic - not syncing: Fatal exception in interrupt
> drm_kms_helper: panic occurred, switching back to text console
--
Daniel J Blueman
--
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
* [PATCH net-next 2/2] net: 3com: fix warning for incorrect type in argument
From: Ding Tianhong @ 2014-01-11 8:23 UTC (permalink / raw)
To: David S. Miller, Netdev, Joe Perches, Julia Lawall
The commit c466a9b2b329f7d9982c14eedc83a923d3bc711c
(net: 3com: slight optimization of addr compare)
cause a warning: "passing argument 1 of 'ether_addr_equal'
from incompatible pointer type", so fix it.
I think julia will convert ether_addr_equal to ether_addr_equal_64bits later.
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
drivers/net/ethernet/3com/3c509.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/3com/3c509.c b/drivers/net/ethernet/3com/3c509.c
index 9142b47..c53384d 100644
--- a/drivers/net/ethernet/3com/3c509.c
+++ b/drivers/net/ethernet/3com/3c509.c
@@ -252,7 +252,7 @@ static int el3_isa_id_sequence(__be16 *phys_addr)
for (i = 0; i < el3_cards; i++) {
struct el3_private *lp = netdev_priv(el3_devs[i]);
if (lp->type == EL3_PNP &&
- ether_addr_equal(phys_addr, el3_devs[i]->dev_addr)) {
+ ether_addr_equal((u8 *)phys_addr, el3_devs[i]->dev_addr)) {
if (el3_debug > 3)
pr_debug("3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n",
phys_addr[0] & 0xff, phys_addr[0] >> 8,
--
1.8.0
^ permalink raw reply related
* [PATCH net-next 1/2] net: qlcnic: fix warning for incorrect type in argument
From: Ding Tianhong @ 2014-01-11 8:23 UTC (permalink / raw)
To: Himanshu Madhani, Rajesh Borundia, David S. Miller, Netdev,
Joe Perches, Julia Lawall
The commit 6878f79a8b71e8c7b0587a1185584f54fd31f185
(net: qlcnic: slight optimization of addr compare)
cause a warning "sparse: incorrect type in argument 2
(different type sizes)", so fix it.
I think julia will convert ether_addr_equal to ether_addr_equal_64bits later.
Cc: Himanshu Madhani <himanshu.madhani@qlogic.com>
Cc: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index 6373f60..24714de 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -346,7 +346,7 @@ static void qlcnic_send_filter(struct qlcnic_adapter *adapter,
head = &(adapter->fhash.fhead[hindex]);
hlist_for_each_entry_safe(tmp_fil, n, head, fnode) {
- if (ether_addr_equal(tmp_fil->faddr, &src_addr) &&
+ if (ether_addr_equal(tmp_fil->faddr, (u8 *)&src_addr) &&
tmp_fil->vlan_id == vlan_id) {
if (jiffies > (QLCNIC_READD_AGE * HZ + tmp_fil->ftime))
qlcnic_change_filter(adapter, &src_addr,
--
1.8.0
^ permalink raw reply related
* [PATCH v2] drivers: net: silence compiler warning.
From: Pankaj Dubey @ 2014-01-11 9:00 UTC (permalink / raw)
To: linux-samsung-soc, linux-arm-kernel; +Cc: davem, jg1.han, netdev, Pankaj Dubey
If used 64 bit compiler GCC warns that:
drivers/net/ethernet/smsc/smc91x.c:1897:7:
warning: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
This patch fixes this by changing typecast from "unsigned int" to "unsigned long"
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
Changes since v2:
Fix typo in commit message
drivers/net/ethernet/smsc/smc91x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 0c9b5d9..42e79b4 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -1894,7 +1894,7 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr,
SMC_SELECT_BANK(lp, 1);
val = SMC_GET_BASE(lp);
val = ((val & 0x1F00) >> 3) << SMC_IO_SHIFT;
- if (((unsigned int)ioaddr & (0x3e0 << SMC_IO_SHIFT)) != val) {
+ if (((unsigned long)ioaddr & (0x3e0 << SMC_IO_SHIFT)) != val) {
netdev_warn(dev, "%s: IOADDR %p doesn't match configuration (%x).\n",
CARDNAME, ioaddr, val);
}
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH v3 net-next] net: vxlan: when lower dev unregisters remove vxlan dev as well
From: Daniel Borkmann @ 2014-01-11 8:46 UTC (permalink / raw)
To: Cong Wang; +Cc: David Miller, netdev, Eric Dumazet
In-Reply-To: <CAHA+R7NB8sz1-W=QEmGxQkRyUmcMM6BzE7pZNU0W2_jzDfJjNw@mail.gmail.com>
On 01/11/2014 01:49 AM, Cong Wang wrote:
> On Fri, Jan 10, 2014 at 2:35 PM, Daniel Borkmann <dborkman@redhat.com> wrote:
>> @@ -2673,13 +2712,14 @@ static __net_init int vxlan_init_net(struct net *net)
>> static __net_exit void vxlan_exit_net(struct net *net)
>> {
>> struct vxlan_net *vn = net_generic(net, vxlan_net_id);
>> - struct vxlan_dev *vxlan;
>> - LIST_HEAD(list);
>> + struct vxlan_dev *vxlan, *next;
>> + LIST_HEAD(list_kill);
>>
>> rtnl_lock();
>> - list_for_each_entry(vxlan, &vn->vxlan_list, next)
>> - unregister_netdevice_queue(vxlan->dev, &list);
>> - unregister_netdevice_many(&list);
>> + list_for_each_entry_safe(vxlan, next, &vn->vxlan_list, next)
>> + vxlan_dellink(vxlan->dev, &list_kill);
>> + unregister_netdevice_many(&list_kill);
>> + list_del(&list_kill);
>
> The last list_del() looks suspicous... Since list_kill is a local list head,
> why do we need to delete the head at the end??
Cong, maybe I'm missing something, but we're doing this rtnl_dellink()
and elsewehere, e.g. commit 226bd341147 ("net: use batched device unregister
in veth and macvlan").
^ permalink raw reply
* Re: [PATCH net,stable] net: usbnet: fix SG initialisation
From: Ming Lei @ 2014-01-11 9:16 UTC (permalink / raw)
To: Bjørn Mork
Cc: Network Development, linux-usb, Thomas Kear, Ben Hutchings
In-Reply-To: <1389391817-27204-1-git-send-email-bjorn@mork.no>
On Sat, Jan 11, 2014 at 6:10 AM, Bjørn Mork <bjorn@mork.no> wrote:
> Commit 60e453a940ac ("USBNET: fix handling padding packet")
> added an extra SG entry in case padding is necessary, but
> failed to update the initialisation of the list. This can
> cause list traversal to fall off the end of the list,
> resulting in an oops.
>
> Fixes: 60e453a940ac ("USBNET: fix handling padding packet")
> Reported-by: Thomas Kear <thomas@kear.co.nz>
> Cc: Ming Lei <ming.lei@canonical.com>
> Signed-off-by: Bjørn Mork <bjorn@mork.no>
> ---
> I don't have the hardware to verify this fix. It would be good if
> someone could test it before it goes to stable...
>
> But in case this works, it should go into v3.12 stable.
Yes, the problem can only be triggered when the zlp padding
packet is needed, I remember I have a quick approach to
reproduce and test the case, and I will do it when I return
home tonight.
Looks the fix is correct, and sorry for introducing the issue.
>
>
> Bjørn
>
> drivers/net/usb/usbnet.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 8494bb53ebdc..aba04f561760 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -1245,7 +1245,7 @@ static int build_dma_sg(const struct sk_buff *skb, struct urb *urb)
> return -ENOMEM;
>
> urb->num_sgs = num_sgs;
> - sg_init_table(urb->sg, urb->num_sgs);
> + sg_init_table(urb->sg, urb->num_sgs + 1);
>
> sg_set_buf(&urb->sg[s++], skb->data, skb_headlen(skb));
> total_len += skb_headlen(skb);
Thanks,
--
Ming Lei
^ permalink raw reply
* [PATCH net-next] ipv6: copy traffic class from ping request to reply
From: Hannes Frederic Sowa @ 2014-01-11 10:55 UTC (permalink / raw)
To: Simon Schneider; +Cc: netdev
In-Reply-To: <trinity-4fd0752d-8ed9-432f-aa23-28055f886c4a-1389191682248@3capp-gmx-bs32>
Suggested-by: Simon Schneider <simon-schneider@gmx.net>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv6/icmp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 9a809a4..8003b49 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -67,6 +67,7 @@
#include <net/icmp.h>
#include <net/xfrm.h>
#include <net/inet_common.h>
+#include <net/dsfield.h>
#include <asm/uaccess.h>
@@ -553,6 +554,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
struct dst_entry *dst;
int err = 0;
int hlimit;
+ u8 tclass;
saddr = &ipv6_hdr(skb)->daddr;
@@ -603,8 +605,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
msg.offset = 0;
msg.type = ICMPV6_ECHO_REPLY;
+ tclass = ipv6_get_dsfield(ipv6_hdr(skb));
err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr),
- sizeof(struct icmp6hdr), hlimit, np->tclass, NULL, &fl6,
+ sizeof(struct icmp6hdr), hlimit, tclass, NULL, &fl6,
(struct rt6_info *)dst, MSG_DONTWAIT,
np->dontfrag);
--
1.8.4.2
^ permalink raw reply related
* [PATCH net-next] net: replace macros net_random and net_srandom with direct calls to prandom
From: Aruna-Hewapathirane @ 2014-01-11 12:15 UTC (permalink / raw)
To: netdev; +Cc: hannes, Aruna-Hewapathirane
This patch removes the net_random and net_srandom macros and replaces
them with direct calls to the prandom ones. As new commits only seem to
use prandom_u32 there is no use to keep them around.
This change makes it easier to grep for users of prandom_u32.
Signed-off-by: Aruna-Hewapathirane <aruna.hewapathirane@gmail.com>
Suggested-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
drivers/infiniband/core/cma.c | 2 +-
include/linux/net.h | 3 ---
include/net/red.h | 2 +-
net/802/garp.c | 2 +-
net/802/mrp.c | 2 +-
net/core/neighbour.c | 5 +++--
net/core/stream.c | 2 +-
net/ipv4/devinet.c | 2 +-
net/ipv4/igmp.c | 6 +++---
net/ipv4/inet_connection_sock.c | 2 +-
net/ipv4/udp.c | 2 +-
net/ipv6/addrconf.c | 4 ++--
net/ipv6/ip6_flowlabel.c | 2 +-
net/ipv6/mcast.c | 10 +++++-----
net/netfilter/ipvs/ip_vs_conn.c | 2 +-
net/netfilter/xt_statistic.c | 2 +-
net/openvswitch/actions.c | 2 +-
net/rds/bind.c | 2 +-
net/sched/act_gact.c | 2 +-
net/sched/sch_fq_codel.c | 2 +-
net/sched/sch_hhf.c | 2 +-
net/sched/sch_netem.c | 19 ++++++++++---------
net/sched/sch_pie.c | 2 +-
net/sched/sch_sfb.c | 4 ++--
net/sched/sch_sfq.c | 6 +++---
net/sctp/socket.c | 2 +-
net/sunrpc/cache.c | 2 +-
net/sunrpc/xprt.c | 2 +-
net/sunrpc/xprtsock.c | 2 +-
net/xfrm/xfrm_state.c | 2 +-
30 files changed, 50 insertions(+), 51 deletions(-)
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 8e49db6..6c17f2d 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -2310,7 +2310,7 @@ static int cma_alloc_any_port(struct idr *ps, struct rdma_id_private *id_priv)
inet_get_local_port_range(&init_net, &low, &high);
remaining = (high - low) + 1;
- rover = net_random() % remaining + low;
+ rover = prandom_u32() % remaining + low;
retry:
if (last_used_port != rover &&
!idr_find(ps, (unsigned short) rover)) {
diff --git a/include/linux/net.h b/include/linux/net.h
index 69be3e6..94734a6 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -245,9 +245,6 @@ do { \
#define net_dbg_ratelimited(fmt, ...) \
net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
-#define net_random() prandom_u32()
-#define net_srandom(seed) prandom_seed((__force u32)(seed))
-
bool __net_get_random_once(void *buf, int nbytes, bool *done,
struct static_key *done_key);
diff --git a/include/net/red.h b/include/net/red.h
index ef46058..168bb2f 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -303,7 +303,7 @@ static inline unsigned long red_calc_qavg(const struct red_parms *p,
static inline u32 red_random(const struct red_parms *p)
{
- return reciprocal_divide(net_random(), p->max_P_reciprocal);
+ return reciprocal_divide(prandom_u32(), p->max_P_reciprocal);
}
static inline int red_mark_probability(const struct red_parms *p,
diff --git a/net/802/garp.c b/net/802/garp.c
index 5d9630a..b38ee6d 100644
--- a/net/802/garp.c
+++ b/net/802/garp.c
@@ -397,7 +397,7 @@ static void garp_join_timer_arm(struct garp_applicant *app)
{
unsigned long delay;
- delay = (u64)msecs_to_jiffies(garp_join_time) * net_random() >> 32;
+ delay = (u64)msecs_to_jiffies(garp_join_time) * prandom_u32() >> 32;
mod_timer(&app->join_timer, jiffies + delay);
}
diff --git a/net/802/mrp.c b/net/802/mrp.c
index 3ed6162..72db278 100644
--- a/net/802/mrp.c
+++ b/net/802/mrp.c
@@ -583,7 +583,7 @@ static void mrp_join_timer_arm(struct mrp_applicant *app)
{
unsigned long delay;
- delay = (u64)msecs_to_jiffies(mrp_join_time) * net_random() >> 32;
+ delay = (u64)msecs_to_jiffies(mrp_join_time) * prandom_u32() >> 32;
mod_timer(&app->join_timer, jiffies + delay);
}
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index ea97361..e360d9e 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -117,7 +117,7 @@ static void neigh_cleanup_and_release(struct neighbour *neigh)
unsigned long neigh_rand_reach_time(unsigned long base)
{
- return base ? (net_random() % base) + (base >> 1) : 0;
+ return base ? (prandom_u32() % base) + (base >> 1) : 0;
}
EXPORT_SYMBOL(neigh_rand_reach_time);
@@ -1415,7 +1415,8 @@ void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
struct sk_buff *skb)
{
unsigned long now = jiffies;
- unsigned long sched_next = now + (net_random() %
+
+ unsigned long sched_next = now + (prandom_u32() %
NEIGH_VAR(p, PROXY_DELAY));
if (tbl->proxy_queue.qlen > NEIGH_VAR(p, PROXY_QLEN)) {
diff --git a/net/core/stream.c b/net/core/stream.c
index 512f0a2..301c05f 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -122,7 +122,7 @@ int sk_stream_wait_memory(struct sock *sk, long *timeo_p)
DEFINE_WAIT(wait);
if (sk_stream_memory_free(sk))
- current_timeo = vm_wait = (net_random() % (HZ / 5)) + 2;
+ current_timeo = vm_wait = (prandom_u32() % (HZ / 5)) + 2;
while (1) {
set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 9809f7b..646023b 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -464,7 +464,7 @@ static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh,
}
if (!(ifa->ifa_flags & IFA_F_SECONDARY)) {
- net_srandom(ifa->ifa_local);
+ prandom_seed((__force u32) ifa->ifa_local);
ifap = last_primary;
}
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 84c4329..8535777 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -211,7 +211,7 @@ static void igmp_stop_timer(struct ip_mc_list *im)
/* It must be called with locked im->lock */
static void igmp_start_timer(struct ip_mc_list *im, int max_delay)
{
- int tv = net_random() % max_delay;
+ int tv = prandom_u32() % max_delay;
im->tm_running = 1;
if (!mod_timer(&im->timer, jiffies+tv+2))
@@ -220,7 +220,7 @@ static void igmp_start_timer(struct ip_mc_list *im, int max_delay)
static void igmp_gq_start_timer(struct in_device *in_dev)
{
- int tv = net_random() % in_dev->mr_maxdelay;
+ int tv = prandom_u32() % in_dev->mr_maxdelay;
in_dev->mr_gq_running = 1;
if (!mod_timer(&in_dev->mr_gq_timer, jiffies+tv+2))
@@ -229,7 +229,7 @@ static void igmp_gq_start_timer(struct in_device *in_dev)
static void igmp_ifc_start_timer(struct in_device *in_dev, int delay)
{
- int tv = net_random() % delay;
+ int tv = prandom_u32() % delay;
if (!mod_timer(&in_dev->mr_ifc_timer, jiffies+tv+2))
in_dev_hold(in_dev);
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index fc0e649..0d1e2cb 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -109,7 +109,7 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum)
again:
inet_get_local_port_range(net, &low, &high);
remaining = (high - low) + 1;
- smallest_rover = rover = net_random() % remaining + low;
+ smallest_rover = rover = prandom_u32() % remaining + low;
smallest_size = -1;
do {
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 80f649f..3d3141f 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -223,7 +223,7 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum,
inet_get_local_port_range(net, &low, &high);
remaining = (high - low) + 1;
- rand = net_random();
+ rand = prandom_u32();
first = (((u64)rand * remaining) >> 32) + low;
/*
* force rand to be an odd multiple of UDP_HTABLE_SIZE
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index a9fa6c1..d2b3e04 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3102,7 +3102,7 @@ static void addrconf_dad_kick(struct inet6_ifaddr *ifp)
if (ifp->flags & IFA_F_OPTIMISTIC)
rand_num = 0;
else
- rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1);
+ rand_num = prandom_u32() % (idev->cnf.rtr_solicit_delay ? : 1);
ifp->dad_probes = idev->cnf.dad_transmits;
addrconf_mod_dad_timer(ifp, rand_num);
@@ -3115,7 +3115,7 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp)
addrconf_join_solict(dev, &ifp->addr);
- net_srandom(ifp->addr.s6_addr32[3]);
+ prandom_seed((__force u32) ifp->addr.s6_addr32[3]);
read_lock_bh(&idev->lock);
spin_lock(&ifp->lock);
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index e7fb710..cbc9351 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -210,7 +210,7 @@ static struct ip6_flowlabel *fl_intern(struct net *net,
spin_lock_bh(&ip6_fl_lock);
if (label == 0) {
for (;;) {
- fl->label = htonl(net_random())&IPV6_FLOWLABEL_MASK;
+ fl->label = htonl(prandom_u32())&IPV6_FLOWLABEL_MASK;
if (fl->label) {
lfl = __fl_lookup(net, fl->label);
if (lfl == NULL)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index d18f9f9..7ff82b3 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -999,7 +999,7 @@ bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
static void mld_gq_start_timer(struct inet6_dev *idev)
{
- unsigned long tv = net_random() % idev->mc_maxdelay;
+ unsigned long tv = prandom_u32() % idev->mc_maxdelay;
idev->mc_gq_running = 1;
if (!mod_timer(&idev->mc_gq_timer, jiffies+tv+2))
@@ -1015,7 +1015,7 @@ static void mld_gq_stop_timer(struct inet6_dev *idev)
static void mld_ifc_start_timer(struct inet6_dev *idev, unsigned long delay)
{
- unsigned long tv = net_random() % delay;
+ unsigned long tv = prandom_u32() % delay;
if (!mod_timer(&idev->mc_ifc_timer, jiffies+tv+2))
in6_dev_hold(idev);
@@ -1030,7 +1030,7 @@ static void mld_ifc_stop_timer(struct inet6_dev *idev)
static void mld_dad_start_timer(struct inet6_dev *idev, unsigned long delay)
{
- unsigned long tv = net_random() % delay;
+ unsigned long tv = prandom_u32() % delay;
if (!mod_timer(&idev->mc_dad_timer, jiffies+tv+2))
in6_dev_hold(idev);
@@ -1061,7 +1061,7 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime)
}
if (delay >= resptime)
- delay = net_random() % resptime;
+ delay = prandom_u32() % resptime;
ma->mca_timer.expires = jiffies + delay;
if (!mod_timer(&ma->mca_timer, jiffies + delay))
@@ -2328,7 +2328,7 @@ static void igmp6_join_group(struct ifmcaddr6 *ma)
igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT);
- delay = net_random() % unsolicited_report_interval(ma->idev);
+ delay = prandom_u32() % unsolicited_report_interval(ma->idev);
spin_lock_bh(&ma->mca_lock);
if (del_timer(&ma->mca_timer)) {
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 4c8e5c0..59a1a85 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -1209,7 +1209,7 @@ void ip_vs_random_dropentry(struct net *net)
* Randomly scan 1/32 of the whole table every second
*/
for (idx = 0; idx < (ip_vs_conn_tab_size>>5); idx++) {
- unsigned int hash = net_random() & ip_vs_conn_tab_mask;
+ unsigned int hash = prandom_u32() & ip_vs_conn_tab_mask;
hlist_for_each_entry_rcu(cp, &ip_vs_conn_tab[hash], c_list) {
if (cp->flags & IP_VS_CONN_F_TEMPLATE)
diff --git a/net/netfilter/xt_statistic.c b/net/netfilter/xt_statistic.c
index 4fe4fb4..11de55e 100644
--- a/net/netfilter/xt_statistic.c
+++ b/net/netfilter/xt_statistic.c
@@ -37,7 +37,7 @@ statistic_mt(const struct sk_buff *skb, struct xt_action_param *par)
switch (info->mode) {
case XT_STATISTIC_MODE_RANDOM:
- if ((net_random() & 0x7FFFFFFF) < info->u.random.probability)
+ if ((prandom_u32() & 0x7FFFFFFF) < info->u.random.probability)
ret = !ret;
break;
case XT_STATISTIC_MODE_NTH:
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 716b7ee..2c77e7b 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -445,7 +445,7 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
a = nla_next(a, &rem)) {
switch (nla_type(a)) {
case OVS_SAMPLE_ATTR_PROBABILITY:
- if (net_random() >= nla_get_u32(a))
+ if (prandom_u32() >= nla_get_u32(a))
return 0;
break;
diff --git a/net/rds/bind.c b/net/rds/bind.c
index b5ad65a..a2e6562 100644
--- a/net/rds/bind.c
+++ b/net/rds/bind.c
@@ -117,7 +117,7 @@ static int rds_add_bound(struct rds_sock *rs, __be32 addr, __be16 *port)
rover = be16_to_cpu(*port);
last = rover;
} else {
- rover = max_t(u16, net_random(), 2);
+ rover = max_t(u16, prandom_u32(), 2);
last = rover - 1;
}
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index af5641c..bef943e 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -30,7 +30,7 @@ static struct tcf_hashinfo gact_hash_info;
#ifdef CONFIG_GACT_PROB
static int gact_net_rand(struct tcf_gact *gact)
{
- if (!gact->tcfg_pval || net_random() % gact->tcfg_pval)
+ if (!gact->tcfg_pval || prandom_u32() % gact->tcfg_pval)
return gact->tcf_action;
return gact->tcfg_paction;
}
diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index 5578628..ba5bc92 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -390,7 +390,7 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt)
sch->limit = 10*1024;
q->flows_cnt = 1024;
q->quantum = psched_mtu(qdisc_dev(sch));
- q->perturbation = net_random();
+ q->perturbation = prandom_u32();
INIT_LIST_HEAD(&q->new_flows);
INIT_LIST_HEAD(&q->old_flows);
codel_params_init(&q->cparams);
diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c
index cf7f614..f412a79 100644
--- a/net/sched/sch_hhf.c
+++ b/net/sched/sch_hhf.c
@@ -607,7 +607,7 @@ static int hhf_init(struct Qdisc *sch, struct nlattr *opt)
sch->limit = 1000;
q->quantum = psched_mtu(qdisc_dev(sch));
- q->perturbation = net_random();
+ q->perturbation = prandom_u32();
INIT_LIST_HEAD(&q->new_buckets);
INIT_LIST_HEAD(&q->old_buckets);
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 090a4e3..3019c10 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -169,7 +169,7 @@ static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb)
static void init_crandom(struct crndstate *state, unsigned long rho)
{
state->rho = rho;
- state->last = net_random();
+ state->last = prandom_u32();
}
/* get_crandom - correlated random number generator
@@ -182,9 +182,9 @@ static u32 get_crandom(struct crndstate *state)
unsigned long answer;
if (state->rho == 0) /* no correlation */
- return net_random();
+ return prandom_u32();
- value = net_random();
+ value = prandom_u32();
rho = (u64)state->rho + 1;
answer = (value * ((1ull<<32) - rho) + state->last * rho) >> 32;
state->last = answer;
@@ -198,7 +198,7 @@ static u32 get_crandom(struct crndstate *state)
static bool loss_4state(struct netem_sched_data *q)
{
struct clgstate *clg = &q->clg;
- u32 rnd = net_random();
+ u32 rnd = prandom_u32();
/*
* Makes a comparison between rnd and the transition
@@ -264,15 +264,15 @@ static bool loss_gilb_ell(struct netem_sched_data *q)
switch (clg->state) {
case 1:
- if (net_random() < clg->a1)
+ if (prandom_u32() < clg->a1)
clg->state = 2;
- if (net_random() < clg->a4)
+ if (prandom_u32() < clg->a4)
return true;
break;
case 2:
- if (net_random() < clg->a2)
+ if (prandom_u32() < clg->a2)
clg->state = 1;
- if (net_random() > clg->a3)
+ if (prandom_u32() > clg->a3)
return true;
}
@@ -457,7 +457,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
skb_checksum_help(skb)))
return qdisc_drop(skb, sch);
- skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8);
+ skb->data[prandom_u32() % skb_headlen(skb)] ^=
+ 1<<(prandom_u32() % 8);
}
if (unlikely(skb_queue_len(&sch->q) >= sch->limit))
diff --git a/net/sched/sch_pie.c b/net/sched/sch_pie.c
index fe65340..a255d02 100644
--- a/net/sched/sch_pie.c
+++ b/net/sched/sch_pie.c
@@ -122,7 +122,7 @@ static bool drop_early(struct Qdisc *sch, u32 packet_size)
else
local_prob = q->vars.prob;
- rnd = net_random();
+ rnd = prandom_u32();
if (rnd < local_prob)
return true;
diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c
index 30ea467..9b0f709 100644
--- a/net/sched/sch_sfb.c
+++ b/net/sched/sch_sfb.c
@@ -220,7 +220,7 @@ static u32 sfb_compute_qlen(u32 *prob_r, u32 *avgpm_r, const struct sfb_sched_da
static void sfb_init_perturbation(u32 slot, struct sfb_sched_data *q)
{
- q->bins[slot].perturbation = net_random();
+ q->bins[slot].perturbation = prandom_u32();
}
static void sfb_swap_slot(struct sfb_sched_data *q)
@@ -381,7 +381,7 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
goto enqueue;
}
- r = net_random() & SFB_MAX_PROB;
+ r = prandom_u32() & SFB_MAX_PROB;
if (unlikely(r < p_min)) {
if (unlikely(p_min > SFB_MAX_PROB / 2)) {
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 76f01e0..87317ff 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -629,7 +629,7 @@ static void sfq_perturbation(unsigned long arg)
spinlock_t *root_lock = qdisc_lock(qdisc_root_sleeping(sch));
spin_lock(root_lock);
- q->perturbation = net_random();
+ q->perturbation = prandom_u32();
if (!q->filter_list && q->tail)
sfq_rehash(sch);
spin_unlock(root_lock);
@@ -698,7 +698,7 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
del_timer(&q->perturb_timer);
if (q->perturb_period) {
mod_timer(&q->perturb_timer, jiffies + q->perturb_period);
- q->perturbation = net_random();
+ q->perturbation = prandom_u32();
}
sch_tree_unlock(sch);
kfree(p);
@@ -759,7 +759,7 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt)
q->quantum = psched_mtu(qdisc_dev(sch));
q->scaled_quantum = SFQ_ALLOT_SIZE(q->quantum);
q->perturb_period = 0;
- q->perturbation = net_random();
+ q->perturbation = prandom_u32();
if (opt) {
int err = sfq_change(sch, opt);
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index d32dae7..7cc62b9 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5926,7 +5926,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
inet_get_local_port_range(sock_net(sk), &low, &high);
remaining = (high - low) + 1;
- rover = net_random() % remaining + low;
+ rover = prandom_u32() % remaining + low;
do {
rover++;
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index a72de07..e521d20 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -619,7 +619,7 @@ static void cache_limit_defers(void)
/* Consider removing either the first or the last */
if (cache_defer_cnt > DFR_MAX) {
- if (net_random() & 1)
+ if (prandom_u32() & 1)
discard = list_entry(cache_defer_list.next,
struct cache_deferred_req, recent);
else
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 04199bc..1750048 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1188,7 +1188,7 @@ static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt)
static inline void xprt_init_xid(struct rpc_xprt *xprt)
{
- xprt->xid = net_random();
+ xprt->xid = prandom_u32();
}
static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index dd9d295..75b045e 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1674,7 +1674,7 @@ static void xs_udp_timer(struct rpc_xprt *xprt, struct rpc_task *task)
static unsigned short xs_get_random_port(void)
{
unsigned short range = xprt_max_resvport - xprt_min_resvport;
- unsigned short rand = (unsigned short) net_random() % range;
+ unsigned short rand = (unsigned short) prandom_u32() % range;
return rand + xprt_min_resvport;
}
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index a62c25e..b3c9774 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1543,7 +1543,7 @@ int xfrm_alloc_spi(struct xfrm_state *x, u32 low, u32 high)
} else {
u32 spi = 0;
for (h=0; h<high-low+1; h++) {
- spi = low + net_random()%(high-low+1);
+ spi = low + prandom_u32()%(high-low+1);
x0 = xfrm_state_lookup(net, mark, &x->id.daddr, htonl(spi), x->id.proto, x->props.family);
if (x0 == NULL) {
x->id.spi = htonl(spi);
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH net-next] net: replace macros net_random and net_srandom with direct calls to prandom
From: Hannes Frederic Sowa @ 2014-01-11 12:21 UTC (permalink / raw)
To: Aruna-Hewapathirane; +Cc: netdev
In-Reply-To: <1389442559-13097-1-git-send-email-aruna.hewapathirane@gmail.com>
On Sat, Jan 11, 2014 at 07:15:59AM -0500, Aruna-Hewapathirane wrote:
> This patch removes the net_random and net_srandom macros and replaces
> them with direct calls to the prandom ones. As new commits only seem to
> use prandom_u32 there is no use to keep them around.
> This change makes it easier to grep for users of prandom_u32.
>
> Signed-off-by: Aruna-Hewapathirane <aruna.hewapathirane@gmail.com>
> Suggested-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Thanks!
^ permalink raw reply
* [PATCH net-next] IPv6: enable TCP to use an anycast address
From: Francois-Xavier Le Bail @ 2014-01-11 12:07 UTC (permalink / raw)
To: netdev
Cc: Hannes Frederic Sowa, David S. Miller, Alexey Kuznetsov,
James Morris, Hideaki Yoshifuji, Patrick McHardy,
Francois-Xavier Le Bail
- Use ipv6_anycast_destination() in tcp_v6_send_reset() and
tcp_v6_conn_request().
Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
---
Tested with link-local and global anycast addresses.
Tested with SOCK_STREAM socket, bind and TCP traffic OK.
net/ipv6/tcp_ipv6.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index ffd5fa8..85297b8 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -832,7 +832,8 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)
if (th->rst)
return;
- if (!ipv6_unicast_destination(skb))
+ if (!ipv6_unicast_destination(skb) &&
+ !ipv6_anycast_destination(skb))
return;
#ifdef CONFIG_TCP_MD5SIG
@@ -963,7 +964,8 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
if (skb->protocol == htons(ETH_P_IP))
return tcp_v4_conn_request(sk, skb);
- if (!ipv6_unicast_destination(skb))
+ if (!ipv6_unicast_destination(skb) &&
+ !ipv6_anycast_destination(skb))
goto drop;
if ((sysctl_tcp_syncookies == 2 ||
^ permalink raw reply related
* Re: [PATCH net-next] IPv6: enable TCP to use an anycast address
From: Alexey Kuznetsov @ 2014-01-11 12:46 UTC (permalink / raw)
To: Francois-Xavier Le Bail
Cc: netdev, Hannes Frederic Sowa, David S. Miller, James Morris,
Hideaki Yoshifuji, Patrick McHardy
In-Reply-To: <1389442059-3047-1-git-send-email-fx.lebail@yahoo.com>
Hello!
I am just curious: since when is TCP allowed to use anycast addresses?
Alexey Kuznetsov
^ permalink raw reply
* Re: [PATCH net-next] IPv6: enable TCP to use an anycast address
From: François-Xavier Le Bail @ 2014-01-11 13:06 UTC (permalink / raw)
To: Alexey Kuznetsov
Cc: netdev, Hannes Frederic Sowa, David S. Miller, James Morris,
Hideaki Yoshifuji, Patrick McHardy
In-Reply-To: <CAMrnHh6pBYMLn+zsR2P_oo8KufJq7Dkjm-cSq2N2Hi638yrUog@mail.gmail.com>
On Sat, 1/11/14, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> wrote:
> Hello!
> I am just curious: since when is TCP allowed to use anycast addresses?
As said in http://tools.ietf.org/html/draft-iab-anycast-arch-implications-12.html#section-2.1
(this informational draft is in RCF queue)
" No firm conclusion was reached regarding
use of TCP with anycasted services, but it was observed that
anycasting was useful for DNS, although it did introduce some new
complexities."
For this works, there is need for appropriate routing (BGP, ...).
Many DNS root-servers use TCP with anycast (IPv4 and IPV6).
see : http://tools.ietf.org/html/draft-jabley-dnsop-anycast-mapping-04#section-4
" L-Root service is provided using a single IPv4 address (199.7.83.42)
and a single IPv6 address (2001:500:3::42). It should be noted that
it is preferable to refer to the service using its DNS name (L.ROOT-
SERVERS.NET) rather than literal addresses, since addresses can
change from time to time."
François-Xavier Le Bail
^ permalink raw reply
* Re: [PATCH net-next] IPv6: enable TCP to use an anycast address
From: Alexey Kuznetsov @ 2014-01-11 13:38 UTC (permalink / raw)
To: François-Xavier Le Bail
Cc: netdev, Hannes Frederic Sowa, David S. Miller, James Morris,
Hideaki Yoshifuji, Patrick McHardy
In-Reply-To: <1389445570.24657.YahooMailBasic@web125502.mail.ne1.yahoo.com>
Hello!
On Sat, Jan 11, 2014 at 5:06 PM, François-Xavier Le Bail
<fx.lebail@yahoo.com> wrote:
> Many DNS root-servers use TCP with anycast (IPv4 and IPV6).
>
> see : http://tools.ietf.org/html/draft-jabley-dnsop-anycast-mapping-04#section-4
>
> " L-Root service is provided using a single IPv4 address (199.7.83.42)
> and a single IPv6 address (2001:500:3::42). It should be noted that
> it is preferable to refer to the service using its DNS name (L.ROOT-
> SERVERS.NET) rather than literal addresses, since addresses can
> change from time to time."
Is this all? It looks like this implies routing by deep packet inspection,
fetching some creepy node identification options from inside DNS payload
(not written directly, but implied). This smells funky.
Actually, I was alerted by reset processing in your patch, it cannot be right.
Do not you think this must not be enabled for common use? At least
some separate sysctl disabled by default.
^ permalink raw reply
* Re: [PATCH net-next] IPv6: enable TCP to use an anycast address
From: Christoph Paasch @ 2014-01-11 13:46 UTC (permalink / raw)
To: François-Xavier Le Bail
Cc: Alexey Kuznetsov, netdev, Hannes Frederic Sowa, David S. Miller,
James Morris, Hideaki Yoshifuji, Patrick McHardy
In-Reply-To: <1389445570.24657.YahooMailBasic@web125502.mail.ne1.yahoo.com>
On 11/01/14 - 05:06:10, François-Xavier Le Bail wrote:
> On Sat, 1/11/14, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> wrote:
> As said in http://tools.ietf.org/html/draft-iab-anycast-arch-implications-12.html#section-2.1
> (this informational draft is in RCF queue)
This draft does not say that TCP should be used with anycast
addresses. Rather the opposite:
" This document does not treat in any depth
the fact that there are deployed services with TCP transport using
anycast today. Evidence exists to suggest that such practice is not
"safe" in the traditional and architectural sense (as described in
Section 4.2). "
And Section 4.2 gives more information.
http://tools.ietf.org/html/draft-iab-anycast-arch-implications-12.html#section-4.2
Christoph
>
> " No firm conclusion was reached regarding
> use of TCP with anycasted services, but it was observed that
> anycasting was useful for DNS, although it did introduce some new
> complexities."
>
> For this works, there is need for appropriate routing (BGP, ...).
>
> Many DNS root-servers use TCP with anycast (IPv4 and IPV6).
>
> see : http://tools.ietf.org/html/draft-jabley-dnsop-anycast-mapping-04#section-4
>
> " L-Root service is provided using a single IPv4 address (199.7.83.42)
> and a single IPv6 address (2001:500:3::42). It should be noted that
> it is preferable to refer to the service using its DNS name (L.ROOT-
> SERVERS.NET) rather than literal addresses, since addresses can
> change from time to time."
>
> François-Xavier Le Bail
> --
> 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
^ permalink raw reply
* Re: [PATCH net-next] IPv6: enable TCP to use an anycast address
From: François-Xavier Le Bail @ 2014-01-11 14:07 UTC (permalink / raw)
To: Christoph Paasch
Cc: Alexey Kuznetsov, netdev, Hannes Frederic Sowa, David S. Miller,
James Morris, Hideaki Yoshifuji, Patrick McHardy
On Sat, 1/11/14, Christoph Paasch <christoph.paasch@uclouvain.be> wrote:
>> On 11/01/14 - 05:06:10, François-Xavier Le Bail wrote:
>> On Sat, 1/11/14, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> wrote:
>> As said in http://tools.ietf.org/html/draft-iab-anycast-arch-implications-12.html#section-2.1
>> (this informational draft is in RCF queue)
> This draft does not say that TCP should be used with anycast
> addresses. Rather the opposite:
> " This document does not treat in any depth
> the fact that there are deployed services with TCP transport using
> anycast today. Evidence exists to suggest that such practice is not
> "safe" in the traditional and architectural sense (as described in
> Section 4.2). "
> And Section 4.2 gives more information.
> http://tools.ietf.org/html/draft-iab-anycast-arch-implications-12.html#section-4.2
The draft say there are use cases for TCP with anycast services.
The DNS use case is widely deployed in real word.
I think enabled such possibility in Linux kernel is useful.
It's only a possibility for such use cases and it's dont break usual TCP usage.
Francois-Xavier
^ permalink raw reply
* Re: [PATCH net-next] IPv6: enable TCP to use an anycast address
From: François-Xavier Le Bail @ 2014-01-11 14:16 UTC (permalink / raw)
To: Alexey Kuznetsov
Cc: netdev, Hannes Frederic Sowa, David S. Miller, James Morris,
Hideaki Yoshifuji, Patrick McHardy
In-Reply-To: <CAMrnHh76D1d_JrXhtz+nvJP+Aiux2iPW+5uVZqQpbmWbQG0=OQ@mail.gmail.com>
On Sat, 1/11/14, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> wrote:
Hello,
> Actually, I was alerted by reset processing in your patch, it cannot be right.
Did I miss something, please explain why there is an error.
> Do not you think this must not be enabled for common use? At least
> some separate sysctl disabled by default.
Why not ? But if a patch can enable anycast case without break "normal" usage,
I think we can enable this by default. Those who don't need anycast will not use it.
^ permalink raw reply
* Re: [PATCH net-next] IPv6: enable TCP to use an anycast address
From: Hannes Frederic Sowa @ 2014-01-11 14:26 UTC (permalink / raw)
To: Alexey Kuznetsov
Cc: François-Xavier Le Bail, netdev, David S. Miller,
James Morris, Hideaki Yoshifuji, Patrick McHardy
In-Reply-To: <CAMrnHh76D1d_JrXhtz+nvJP+Aiux2iPW+5uVZqQpbmWbQG0=OQ@mail.gmail.com>
Hi!
On Sat, Jan 11, 2014 at 05:38:27PM +0400, Alexey Kuznetsov wrote:
> On Sat, Jan 11, 2014 at 5:06 PM, François-Xavier Le Bail
> <fx.lebail@yahoo.com> wrote:
> > Many DNS root-servers use TCP with anycast (IPv4 and IPV6).
> >
> > see : http://tools.ietf.org/html/draft-jabley-dnsop-anycast-mapping-04#section-4
> >
> > " L-Root service is provided using a single IPv4 address (199.7.83.42)
> > and a single IPv6 address (2001:500:3::42). It should be noted that
> > it is preferable to refer to the service using its DNS name (L.ROOT-
> > SERVERS.NET) rather than literal addresses, since addresses can
> > change from time to time."
>
> Is this all? It looks like this implies routing by deep packet inspection,
> fetching some creepy node identification options from inside DNS payload
> (not written directly, but implied). This smells funky.
>
> Actually, I was alerted by reset processing in your patch, it cannot be right.
>
> Do not you think this must not be enabled for common use? At least
> some separate sysctl disabled by default.
RFC 4291 - IP Version 6 Addressing Architecture started to allow the use of
anycast addresses as source addresses.
This would be great to have DNS servers listening on them but they need to
respond to both, UDP and TCP.
The idea I had, was, that if a socket does knowingly bind to an anycast
address, it is allowed to do so and process queries on it with both TCP and
UDP. I don't think we need a sysctl for that? Anycast addresses are either
pre-defined (e.g. the subnet router anycast address) or specified by a flag
when the administrator adds one. Currently one can only add anycast addresses
either by forwarding and gets the per-subnet anycast address or with a
setsockopt IPV6_JOIN_ANYCAST.
So the problem is what should be allowed when the socket listens on an any
address? Maybe this should be protected by a sysctl?
Greetings,
Hannes
^ permalink raw reply
* Re: [PATCH net,stable] net: usbnet: fix SG initialisation
From: Ming Lei @ 2014-01-11 16:22 UTC (permalink / raw)
To: Bjørn Mork
Cc: Network Development, linux-usb, Thomas Kear, Ben Hutchings
In-Reply-To: <CACVXFVPbi47ZLWm-AMeX1NLp3_BQWRSuWz7YjTXz-z3JmVoyRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Sat, Jan 11, 2014 at 5:16 PM, Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> wrote:
> On Sat, Jan 11, 2014 at 6:10 AM, Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org> wrote:
>> Commit 60e453a940ac ("USBNET: fix handling padding packet")
>> added an extra SG entry in case padding is necessary, but
>> failed to update the initialisation of the list. This can
>> cause list traversal to fall off the end of the list,
>> resulting in an oops.
>>
>> Fixes: 60e453a940ac ("USBNET: fix handling padding packet")
>> Reported-by: Thomas Kear <thomas-hrxM1pTBpuF02iOg2JU2CQ@public.gmane.org>
>> Cc: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
>> Signed-off-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
Tested-by: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
On one of my arm box, I can reproduce the problem with below
command every time:
$iperf -c $SRV -l 2398 -n 1 #the 2nd tcp packet
length is 1016
and the oops is same with Thomas's. After applying Oliver's patch,
I still can see zlp padding packet is appended, but no oops any more.
Thanks Oliver for fixing the problem.
Thanks,
--
Ming Lei
--
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] net: replace macros net_random and net_srandom with direct calls to prandom
From: Joe Perches @ 2014-01-11 17:52 UTC (permalink / raw)
To: Aruna-Hewapathirane; +Cc: netdev, hannes
In-Reply-To: <1389442559-13097-1-git-send-email-aruna.hewapathirane@gmail.com>
On Sat, 2014-01-11 at 07:15 -0500, Aruna-Hewapathirane wrote:
> This patch removes the net_random and net_srandom macros and replaces
> them with direct calls to the prandom ones. As new commits only seem to
> use prandom_u32 there is no use to keep them around.
> This change makes it easier to grep for users of prandom_u32.
Seems sensible.
Also, there may be some value in a future patch
to use reciprocal_divide in a few places
> diff --git a/net/802/garp.c b/net/802/garp.c
> @@ -397,7 +397,7 @@ static void garp_join_timer_arm(struct garp_applicant *app)
> {
> unsigned long delay;
>
> - delay = (u64)msecs_to_jiffies(garp_join_time) * net_random() >> 32;
> + delay = (u64)msecs_to_jiffies(garp_join_time) * prandom_u32() >> 32;
reciprocal_divide()
> diff --git a/net/802/mrp.c b/net/802/mrp.c
[]
> @@ -583,7 +583,7 @@ static void mrp_join_timer_arm(struct mrp_applicant *app)
> {
> unsigned long delay;
>
> - delay = (u64)msecs_to_jiffies(mrp_join_time) * net_random() >> 32;
> + delay = (u64)msecs_to_jiffies(mrp_join_time) * prandom_u32() >> 32;
here too
> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
[]
> @@ -223,7 +223,7 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum,
> inet_get_local_port_range(net, &low, &high);
> remaining = (high - low) + 1;
>
> - rand = net_random();
> + rand = prandom_u32();
> first = (((u64)rand * remaining) >> 32) + low;
another
^ permalink raw reply
* Re: [PATCH net-next] net: replace macros net_random and net_srandom with direct calls to prandom
From: Hannes Frederic Sowa @ 2014-01-11 18:00 UTC (permalink / raw)
To: Joe Perches; +Cc: Aruna-Hewapathirane, netdev
In-Reply-To: <1389462757.2537.61.camel@joe-AO722>
On Sat, Jan 11, 2014 at 09:52:37AM -0800, Joe Perches wrote:
> On Sat, 2014-01-11 at 07:15 -0500, Aruna-Hewapathirane wrote:
> > This patch removes the net_random and net_srandom macros and replaces
> > them with direct calls to the prandom ones. As new commits only seem to
> > use prandom_u32 there is no use to keep them around.
> > This change makes it easier to grep for users of prandom_u32.
>
> Seems sensible.
>
> Also, there may be some value in a future patch
> to use reciprocal_divide in a few places
>
> > diff --git a/net/802/garp.c b/net/802/garp.c
> > @@ -397,7 +397,7 @@ static void garp_join_timer_arm(struct garp_applicant *app)
> > {
> > unsigned long delay;
> >
> > - delay = (u64)msecs_to_jiffies(garp_join_time) * net_random() >> 32;
> > + delay = (u64)msecs_to_jiffies(garp_join_time) * prandom_u32() >> 32;
>
> reciprocal_divide()
Does reciprocal_divide() make sense without reciprocal_value() from a
stylish point of view?
I wouldn't do that just because it expands into the same code.
Greetings,
Hannes
^ permalink raw reply
* Re: [PATCH net-next] net: replace macros net_random and net_srandom with direct calls to prandom
From: Joe Perches @ 2014-01-11 18:43 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: Aruna-Hewapathirane, netdev
In-Reply-To: <20140111180025.GB6586@order.stressinduktion.org>
On Sat, 2014-01-11 at 19:00 +0100, Hannes Frederic Sowa wrote:
> On Sat, Jan 11, 2014 at 09:52:37AM -0800, Joe Perches wrote:
> > On Sat, 2014-01-11 at 07:15 -0500, Aruna-Hewapathirane wrote:
> > > This patch removes the net_random and net_srandom macros and replaces
> > > them with direct calls to the prandom ones. As new commits only seem to
> > > use prandom_u32 there is no use to keep them around.
> > > This change makes it easier to grep for users of prandom_u32.
> >
> > Seems sensible.
> >
> > Also, there may be some value in a future patch
> > to use reciprocal_divide in a few places
> >
> > > diff --git a/net/802/garp.c b/net/802/garp.c
> > > @@ -397,7 +397,7 @@ static void garp_join_timer_arm(struct garp_applicant *app)
> > > {
> > > unsigned long delay;
> > >
> > > - delay = (u64)msecs_to_jiffies(garp_join_time) * net_random() >> 32;
> > > + delay = (u64)msecs_to_jiffies(garp_join_time) * prandom_u32() >> 32;
> >
> > reciprocal_divide()
>
> Does reciprocal_divide() make sense without reciprocal_value() from a
> stylish point of view?
Hi again.
Dunno.
I think there's some value in the name triggering
reader recognition of what the code is doing.
> I wouldn't do that just because it expands into the same code.
There are a few places where reciprocal_device is
used today without using reciprocal_value()
^ permalink raw reply
* pull-request: can-next 2014-01-11
From: Marc Kleine-Budde @ 2014-01-11 18:48 UTC (permalink / raw)
To: netdev; +Cc: David Miller, linux-can@vger.kernel.org, kernel@pengutronix.de
[-- Attachment #1: Type: text/plain, Size: 1606 bytes --]
Hello David,
this is a pull request of three patches for net-next/master.
Oleg Moroz added support for a new PCI card to the generic SJA1000 PCI
driver, Guenter Roeck's patch limits the flexcan driver to little
endian arm (and powerpc) and I fixed a sparse warning found by the
kbuild robot in the ti_hecc driver.
regards,
Marc
---
The following changes since commit 45593c2bd2d1e257d03d795f9c80e22e18f188f0:
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge (2014-01-10 17:59:34 -0500)
are available in the git repository at:
git://gitorious.org/linux-can/linux-can-next.git for-davem
for you to fetch changes up to ea79c1c18520c3a60a2fc8193e2fb58710812d4e:
can: ti_hecc: fix endianness related sparse warning (2014-01-11 19:43:26 +0100)
----------------------------------------------------------------
Guenter Roeck (1):
can: Disable flexcan driver build for big endian CPU on ARM
Marc Kleine-Budde (1):
can: ti_hecc: fix endianness related sparse warning
Oleg Moroz (1):
can: sja1000: add support for Elcus CAN200PCI
drivers/net/can/Kconfig | 2 +-
drivers/net/can/sja1000/plx_pci.c | 23 ++++++++++++++++++++++-
drivers/net/can/ti_hecc.c | 10 ++++------
3 files changed, 27 insertions(+), 8 deletions(-)
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
^ permalink raw reply
* Re: [PATCH net-next] net: replace macros net_random and net_srandom with direct calls to prandom
From: Daniel Borkmann @ 2014-01-11 18:52 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: Joe Perches, Aruna-Hewapathirane, netdev
In-Reply-To: <20140111180025.GB6586@order.stressinduktion.org>
On 01/11/2014 07:00 PM, Hannes Frederic Sowa wrote:
> On Sat, Jan 11, 2014 at 09:52:37AM -0800, Joe Perches wrote:
>> On Sat, 2014-01-11 at 07:15 -0500, Aruna-Hewapathirane wrote:
>>> This patch removes the net_random and net_srandom macros and replaces
>>> them with direct calls to the prandom ones. As new commits only seem to
>>> use prandom_u32 there is no use to keep them around.
>>> This change makes it easier to grep for users of prandom_u32.
>>
>> Seems sensible.
>>
>> Also, there may be some value in a future patch
>> to use reciprocal_divide in a few places
>>
>>> diff --git a/net/802/garp.c b/net/802/garp.c
>>> @@ -397,7 +397,7 @@ static void garp_join_timer_arm(struct garp_applicant *app)
>>> {
>>> unsigned long delay;
>>>
>>> - delay = (u64)msecs_to_jiffies(garp_join_time) * net_random() >> 32;
>>> + delay = (u64)msecs_to_jiffies(garp_join_time) * prandom_u32() >> 32;
>>
>> reciprocal_divide()
>
> Does reciprocal_divide() make sense without reciprocal_value() from a
> stylish point of view?
No. ;-)
There was already some work, but I didn't have time to finish it:
http://www.spinics.net/lists/netdev/msg249395.html
Maybe it's time that we should revisit that.
> I wouldn't do that just because it expands into the same code.
>
> Greetings,
>
> Hannes
^ permalink raw reply
* Re: [PATCH net-next] net: replace macros net_random and net_srandom with direct calls to prandom
From: Hannes Frederic Sowa @ 2014-01-11 18:58 UTC (permalink / raw)
To: Joe Perches; +Cc: Aruna-Hewapathirane, netdev
In-Reply-To: <1389465789.2537.66.camel@joe-AO722>
Hi!
On Sat, Jan 11, 2014 at 10:43:09AM -0800, Joe Perches wrote:
> There are a few places where reciprocal_device is
> used today without using reciprocal_value()
Maybe it would be helpful to clean those up and maybe introduce a
typedef struct { u32 i; } reciprocal_t; to make it harder to misuse this api.
;)
Greetings,
Hannes
^ 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