diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-09 17:46:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-09 17:46:52 -0500 |
commit | 38e5781bbf8e82c1635ea845e0d07b2228a5ac7a (patch) | |
tree | 69ced9c509c864a67122c5e1337f14cd1d9e988d | |
parent | 979ecef5b89a8003902299566d9cdc08de34a3ee (diff) | |
parent | a8c1f65c79cbbb2f7da782d4c9d15639a9b94b27 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
igmp: Avoid zero delay when receiving odd mixture of IGMP queries
netdev: make net_device_ops const
bcm63xx: make ethtool_ops const
usbnet: make ethtool_ops const
net: Fix build with INET disabled.
net: introduce netif_addr_lock_nested() and call if when appropriate
net: correct lock name in dev_[uc/mc]_sync documentations.
net: sk_update_clone is only used in net/core/sock.c
8139cp: fix missing napi_gro_flush.
pktgen: set correct max and min in pktgen_setup_inject()
smsc911x: Unconditionally include linux/smscphy.h in smsc911x.h
asix: fix infinite loop in rx_fixup()
net: Default UDP and UNIX diag to 'n'.
r6040: fix typo in use of MCR0 register bits
net: fix sock_clone reference mismatch with tcp memcontrol
-rw-r--r-- | drivers/net/ethernet/broadcom/bcm63xx_enet.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/rdc/r6040.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/realtek/8139cp.c | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/smsc/smsc911x.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/tile/tilepro.c | 3 | ||||
-rw-r--r-- | drivers/net/usb/asix.c | 4 | ||||
-rw-r--r-- | drivers/net/usb/cdc_ncm.c | 4 | ||||
-rw-r--r-- | drivers/net/usb/ipheth.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/sierra_net.c | 2 | ||||
-rw-r--r-- | include/linux/memcontrol.h | 2 | ||||
-rw-r--r-- | include/linux/netdevice.h | 5 | ||||
-rw-r--r-- | mm/memcontrol.c | 19 | ||||
-rw-r--r-- | net/core/dev_addr_lists.c | 16 | ||||
-rw-r--r-- | net/core/pktgen.c | 4 | ||||
-rw-r--r-- | net/core/sock.c | 9 | ||||
-rw-r--r-- | net/ipv4/Kconfig | 6 | ||||
-rw-r--r-- | net/ipv4/igmp.c | 2 | ||||
-rw-r--r-- | net/unix/Kconfig | 2 |
19 files changed, 57 insertions, 32 deletions
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index a11a8ad94226..d44331eb07fe 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c | |||
@@ -1469,7 +1469,7 @@ static int bcm_enet_set_pauseparam(struct net_device *dev, | |||
1469 | return 0; | 1469 | return 0; |
1470 | } | 1470 | } |
1471 | 1471 | ||
1472 | static struct ethtool_ops bcm_enet_ethtool_ops = { | 1472 | static const struct ethtool_ops bcm_enet_ethtool_ops = { |
1473 | .get_strings = bcm_enet_get_strings, | 1473 | .get_strings = bcm_enet_get_strings, |
1474 | .get_sset_count = bcm_enet_get_sset_count, | 1474 | .get_sset_count = bcm_enet_get_sset_count, |
1475 | .get_ethtool_stats = bcm_enet_get_ethtool_stats, | 1475 | .get_ethtool_stats = bcm_enet_get_ethtool_stats, |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 6c46753aeb43..a6bcdb5cd2be 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -3080,7 +3080,7 @@ fw_exit: | |||
3080 | return status; | 3080 | return status; |
3081 | } | 3081 | } |
3082 | 3082 | ||
3083 | static struct net_device_ops be_netdev_ops = { | 3083 | static const struct net_device_ops be_netdev_ops = { |
3084 | .ndo_open = be_open, | 3084 | .ndo_open = be_open, |
3085 | .ndo_stop = be_close, | 3085 | .ndo_stop = be_close, |
3086 | .ndo_start_xmit = be_xmit, | 3086 | .ndo_start_xmit = be_xmit, |
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c index 87aa43935070..cb0eca807852 100644 --- a/drivers/net/ethernet/rdc/r6040.c +++ b/drivers/net/ethernet/rdc/r6040.c | |||
@@ -1160,7 +1160,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev, | |||
1160 | lp->dev = dev; | 1160 | lp->dev = dev; |
1161 | 1161 | ||
1162 | /* Init RDC private data */ | 1162 | /* Init RDC private data */ |
1163 | lp->mcr0 = MCR0_XMTEN | MCR0; | 1163 | lp->mcr0 = MCR0_XMTEN | MCR0_RCVEN; |
1164 | 1164 | ||
1165 | /* The RDC-specific entries in the device structure. */ | 1165 | /* The RDC-specific entries in the device structure. */ |
1166 | dev->netdev_ops = &r6040_netdev_ops; | 1166 | dev->netdev_ops = &r6040_netdev_ops; |
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index cc6b391479ca..abc79076f867 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c | |||
@@ -563,6 +563,7 @@ rx_next: | |||
563 | if (cpr16(IntrStatus) & cp_rx_intr_mask) | 563 | if (cpr16(IntrStatus) & cp_rx_intr_mask) |
564 | goto rx_status_loop; | 564 | goto rx_status_loop; |
565 | 565 | ||
566 | napi_gro_flush(napi); | ||
566 | spin_lock_irqsave(&cp->lock, flags); | 567 | spin_lock_irqsave(&cp->lock, flags); |
567 | __napi_complete(napi); | 568 | __napi_complete(napi); |
568 | cpw16_f(IntrMask, cp_intr_mask); | 569 | cpw16_f(IntrMask, cp_intr_mask); |
diff --git a/drivers/net/ethernet/smsc/smsc911x.h b/drivers/net/ethernet/smsc/smsc911x.h index 938ecf290813..9ad5e5d39a03 100644 --- a/drivers/net/ethernet/smsc/smsc911x.h +++ b/drivers/net/ethernet/smsc/smsc911x.h | |||
@@ -401,8 +401,6 @@ | |||
401 | #include <asm/smsc911x.h> | 401 | #include <asm/smsc911x.h> |
402 | #endif | 402 | #endif |
403 | 403 | ||
404 | #ifdef CONFIG_SMSC_PHY | ||
405 | #include <linux/smscphy.h> | 404 | #include <linux/smscphy.h> |
406 | #endif | ||
407 | 405 | ||
408 | #endif /* __SMSC911X_H__ */ | 406 | #endif /* __SMSC911X_H__ */ |
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c index 6b75063988ec..d9951afb9269 100644 --- a/drivers/net/ethernet/tile/tilepro.c +++ b/drivers/net/ethernet/tile/tilepro.c | |||
@@ -2260,8 +2260,7 @@ static int tile_net_get_mac(struct net_device *dev) | |||
2260 | return 0; | 2260 | return 0; |
2261 | } | 2261 | } |
2262 | 2262 | ||
2263 | 2263 | static const struct net_device_ops tile_net_ops = { | |
2264 | static struct net_device_ops tile_net_ops = { | ||
2265 | .ndo_open = tile_net_open, | 2264 | .ndo_open = tile_net_open, |
2266 | .ndo_stop = tile_net_stop, | 2265 | .ndo_stop = tile_net_stop, |
2267 | .ndo_start_xmit = tile_net_tx, | 2266 | .ndo_start_xmit = tile_net_tx, |
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index 1ff7163bc348..d0937c4634c9 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -376,7 +376,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
376 | 376 | ||
377 | skb_pull(skb, (size + 1) & 0xfffe); | 377 | skb_pull(skb, (size + 1) & 0xfffe); |
378 | 378 | ||
379 | if (skb->len == 0) | 379 | if (skb->len < sizeof(header)) |
380 | break; | 380 | break; |
381 | 381 | ||
382 | head = (u8 *) skb->data; | 382 | head = (u8 *) skb->data; |
@@ -1152,7 +1152,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1152 | return 0; | 1152 | return 0; |
1153 | } | 1153 | } |
1154 | 1154 | ||
1155 | static struct ethtool_ops ax88178_ethtool_ops = { | 1155 | static const struct ethtool_ops ax88178_ethtool_ops = { |
1156 | .get_drvinfo = asix_get_drvinfo, | 1156 | .get_drvinfo = asix_get_drvinfo, |
1157 | .get_link = asix_get_link, | 1157 | .get_link = asix_get_link, |
1158 | .get_msglevel = usbnet_get_msglevel, | 1158 | .get_msglevel = usbnet_get_msglevel, |
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index cb8e595c5021..3a539a9cac54 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c | |||
@@ -138,7 +138,7 @@ struct cdc_ncm_ctx { | |||
138 | static void cdc_ncm_tx_timeout(unsigned long arg); | 138 | static void cdc_ncm_tx_timeout(unsigned long arg); |
139 | static const struct driver_info cdc_ncm_info; | 139 | static const struct driver_info cdc_ncm_info; |
140 | static struct usb_driver cdc_ncm_driver; | 140 | static struct usb_driver cdc_ncm_driver; |
141 | static struct ethtool_ops cdc_ncm_ethtool_ops; | 141 | static const struct ethtool_ops cdc_ncm_ethtool_ops; |
142 | 142 | ||
143 | static const struct usb_device_id cdc_devs[] = { | 143 | static const struct usb_device_id cdc_devs[] = { |
144 | { USB_INTERFACE_INFO(USB_CLASS_COMM, | 144 | { USB_INTERFACE_INFO(USB_CLASS_COMM, |
@@ -1220,7 +1220,7 @@ static struct usb_driver cdc_ncm_driver = { | |||
1220 | .supports_autosuspend = 1, | 1220 | .supports_autosuspend = 1, |
1221 | }; | 1221 | }; |
1222 | 1222 | ||
1223 | static struct ethtool_ops cdc_ncm_ethtool_ops = { | 1223 | static const struct ethtool_ops cdc_ncm_ethtool_ops = { |
1224 | .get_drvinfo = cdc_ncm_get_drvinfo, | 1224 | .get_drvinfo = cdc_ncm_get_drvinfo, |
1225 | .get_link = usbnet_get_link, | 1225 | .get_link = usbnet_get_link, |
1226 | .get_msglevel = usbnet_get_msglevel, | 1226 | .get_msglevel = usbnet_get_msglevel, |
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c index 08a4df238796..e84662db51cc 100644 --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/usb/ipheth.c | |||
@@ -420,7 +420,7 @@ static u32 ipheth_ethtool_op_get_link(struct net_device *net) | |||
420 | return netif_carrier_ok(dev->net); | 420 | return netif_carrier_ok(dev->net); |
421 | } | 421 | } |
422 | 422 | ||
423 | static struct ethtool_ops ops = { | 423 | static const struct ethtool_ops ops = { |
424 | .get_link = ipheth_ethtool_op_get_link | 424 | .get_link = ipheth_ethtool_op_get_link |
425 | }; | 425 | }; |
426 | 426 | ||
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index e45dfdcb8718..b59cf20c7817 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
@@ -618,7 +618,7 @@ static u32 sierra_net_get_link(struct net_device *net) | |||
618 | return sierra_net_get_private(dev)->link_up && netif_running(net); | 618 | return sierra_net_get_private(dev)->link_up && netif_running(net); |
619 | } | 619 | } |
620 | 620 | ||
621 | static struct ethtool_ops sierra_net_ethtool_ops = { | 621 | static const struct ethtool_ops sierra_net_ethtool_ops = { |
622 | .get_drvinfo = sierra_net_get_drvinfo, | 622 | .get_drvinfo = sierra_net_get_drvinfo, |
623 | .get_link = sierra_net_get_link, | 623 | .get_link = sierra_net_get_link, |
624 | .get_msglevel = usbnet_get_msglevel, | 624 | .get_msglevel = usbnet_get_msglevel, |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 9b296ea41bb8..f944591765eb 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -390,7 +390,6 @@ enum { | |||
390 | OVER_LIMIT, | 390 | OVER_LIMIT, |
391 | }; | 391 | }; |
392 | 392 | ||
393 | #ifdef CONFIG_INET | ||
394 | struct sock; | 393 | struct sock; |
395 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM | 394 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM |
396 | void sock_update_memcg(struct sock *sk); | 395 | void sock_update_memcg(struct sock *sk); |
@@ -403,6 +402,5 @@ static inline void sock_release_memcg(struct sock *sk) | |||
403 | { | 402 | { |
404 | } | 403 | } |
405 | #endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */ | 404 | #endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */ |
406 | #endif /* CONFIG_INET */ | ||
407 | #endif /* _LINUX_MEMCONTROL_H */ | 405 | #endif /* _LINUX_MEMCONTROL_H */ |
408 | 406 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 4c06cc0f194b..0eac07c95255 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2450,6 +2450,11 @@ static inline void netif_addr_lock(struct net_device *dev) | |||
2450 | spin_lock(&dev->addr_list_lock); | 2450 | spin_lock(&dev->addr_list_lock); |
2451 | } | 2451 | } |
2452 | 2452 | ||
2453 | static inline void netif_addr_lock_nested(struct net_device *dev) | ||
2454 | { | ||
2455 | spin_lock_nested(&dev->addr_list_lock, SINGLE_DEPTH_NESTING); | ||
2456 | } | ||
2457 | |||
2453 | static inline void netif_addr_lock_bh(struct net_device *dev) | 2458 | static inline void netif_addr_lock_bh(struct net_device *dev) |
2454 | { | 2459 | { |
2455 | spin_lock_bh(&dev->addr_list_lock); | 2460 | spin_lock_bh(&dev->addr_list_lock); |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 00d4fa27d3e6..d87aa3510c5e 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -381,16 +381,25 @@ static void mem_cgroup_put(struct mem_cgroup *memcg); | |||
381 | static bool mem_cgroup_is_root(struct mem_cgroup *memcg); | 381 | static bool mem_cgroup_is_root(struct mem_cgroup *memcg); |
382 | void sock_update_memcg(struct sock *sk) | 382 | void sock_update_memcg(struct sock *sk) |
383 | { | 383 | { |
384 | /* A socket spends its whole life in the same cgroup */ | ||
385 | if (sk->sk_cgrp) { | ||
386 | WARN_ON(1); | ||
387 | return; | ||
388 | } | ||
389 | if (static_branch(&memcg_socket_limit_enabled)) { | 384 | if (static_branch(&memcg_socket_limit_enabled)) { |
390 | struct mem_cgroup *memcg; | 385 | struct mem_cgroup *memcg; |
391 | 386 | ||
392 | BUG_ON(!sk->sk_prot->proto_cgroup); | 387 | BUG_ON(!sk->sk_prot->proto_cgroup); |
393 | 388 | ||
389 | /* Socket cloning can throw us here with sk_cgrp already | ||
390 | * filled. It won't however, necessarily happen from | ||
391 | * process context. So the test for root memcg given | ||
392 | * the current task's memcg won't help us in this case. | ||
393 | * | ||
394 | * Respecting the original socket's memcg is a better | ||
395 | * decision in this case. | ||
396 | */ | ||
397 | if (sk->sk_cgrp) { | ||
398 | BUG_ON(mem_cgroup_is_root(sk->sk_cgrp->memcg)); | ||
399 | mem_cgroup_get(sk->sk_cgrp->memcg); | ||
400 | return; | ||
401 | } | ||
402 | |||
394 | rcu_read_lock(); | 403 | rcu_read_lock(); |
395 | memcg = mem_cgroup_from_task(current); | 404 | memcg = mem_cgroup_from_task(current); |
396 | if (!mem_cgroup_is_root(memcg)) { | 405 | if (!mem_cgroup_is_root(memcg)) { |
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c index febba516db62..29c07fef9228 100644 --- a/net/core/dev_addr_lists.c +++ b/net/core/dev_addr_lists.c | |||
@@ -427,7 +427,7 @@ EXPORT_SYMBOL(dev_uc_del); | |||
427 | * | 427 | * |
428 | * Add newly added addresses to the destination device and release | 428 | * Add newly added addresses to the destination device and release |
429 | * addresses that have no users left. The source device must be | 429 | * addresses that have no users left. The source device must be |
430 | * locked by netif_tx_lock_bh. | 430 | * locked by netif_addr_lock_bh. |
431 | * | 431 | * |
432 | * This function is intended to be called from the dev->set_rx_mode | 432 | * This function is intended to be called from the dev->set_rx_mode |
433 | * function of layered software devices. | 433 | * function of layered software devices. |
@@ -439,11 +439,11 @@ int dev_uc_sync(struct net_device *to, struct net_device *from) | |||
439 | if (to->addr_len != from->addr_len) | 439 | if (to->addr_len != from->addr_len) |
440 | return -EINVAL; | 440 | return -EINVAL; |
441 | 441 | ||
442 | netif_addr_lock_bh(to); | 442 | netif_addr_lock_nested(to); |
443 | err = __hw_addr_sync(&to->uc, &from->uc, to->addr_len); | 443 | err = __hw_addr_sync(&to->uc, &from->uc, to->addr_len); |
444 | if (!err) | 444 | if (!err) |
445 | __dev_set_rx_mode(to); | 445 | __dev_set_rx_mode(to); |
446 | netif_addr_unlock_bh(to); | 446 | netif_addr_unlock(to); |
447 | return err; | 447 | return err; |
448 | } | 448 | } |
449 | EXPORT_SYMBOL(dev_uc_sync); | 449 | EXPORT_SYMBOL(dev_uc_sync); |
@@ -463,7 +463,7 @@ void dev_uc_unsync(struct net_device *to, struct net_device *from) | |||
463 | return; | 463 | return; |
464 | 464 | ||
465 | netif_addr_lock_bh(from); | 465 | netif_addr_lock_bh(from); |
466 | netif_addr_lock(to); | 466 | netif_addr_lock_nested(to); |
467 | __hw_addr_unsync(&to->uc, &from->uc, to->addr_len); | 467 | __hw_addr_unsync(&to->uc, &from->uc, to->addr_len); |
468 | __dev_set_rx_mode(to); | 468 | __dev_set_rx_mode(to); |
469 | netif_addr_unlock(to); | 469 | netif_addr_unlock(to); |
@@ -590,7 +590,7 @@ EXPORT_SYMBOL(dev_mc_del_global); | |||
590 | * | 590 | * |
591 | * Add newly added addresses to the destination device and release | 591 | * Add newly added addresses to the destination device and release |
592 | * addresses that have no users left. The source device must be | 592 | * addresses that have no users left. The source device must be |
593 | * locked by netif_tx_lock_bh. | 593 | * locked by netif_addr_lock_bh. |
594 | * | 594 | * |
595 | * This function is intended to be called from the ndo_set_rx_mode | 595 | * This function is intended to be called from the ndo_set_rx_mode |
596 | * function of layered software devices. | 596 | * function of layered software devices. |
@@ -602,11 +602,11 @@ int dev_mc_sync(struct net_device *to, struct net_device *from) | |||
602 | if (to->addr_len != from->addr_len) | 602 | if (to->addr_len != from->addr_len) |
603 | return -EINVAL; | 603 | return -EINVAL; |
604 | 604 | ||
605 | netif_addr_lock_bh(to); | 605 | netif_addr_lock_nested(to); |
606 | err = __hw_addr_sync(&to->mc, &from->mc, to->addr_len); | 606 | err = __hw_addr_sync(&to->mc, &from->mc, to->addr_len); |
607 | if (!err) | 607 | if (!err) |
608 | __dev_set_rx_mode(to); | 608 | __dev_set_rx_mode(to); |
609 | netif_addr_unlock_bh(to); | 609 | netif_addr_unlock(to); |
610 | return err; | 610 | return err; |
611 | } | 611 | } |
612 | EXPORT_SYMBOL(dev_mc_sync); | 612 | EXPORT_SYMBOL(dev_mc_sync); |
@@ -626,7 +626,7 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from) | |||
626 | return; | 626 | return; |
627 | 627 | ||
628 | netif_addr_lock_bh(from); | 628 | netif_addr_lock_bh(from); |
629 | netif_addr_lock(to); | 629 | netif_addr_lock_nested(to); |
630 | __hw_addr_unsync(&to->mc, &from->mc, to->addr_len); | 630 | __hw_addr_unsync(&to->mc, &from->mc, to->addr_len); |
631 | __dev_set_rx_mode(to); | 631 | __dev_set_rx_mode(to); |
632 | netif_addr_unlock(to); | 632 | netif_addr_unlock(to); |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 449fe0f068f8..65f80c7b1656 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -2024,13 +2024,13 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) | |||
2024 | pr_warning("WARNING: Requested queue_map_min (zero-based) (%d) exceeds valid range [0 - %d] for (%d) queues on %s, resetting\n", | 2024 | pr_warning("WARNING: Requested queue_map_min (zero-based) (%d) exceeds valid range [0 - %d] for (%d) queues on %s, resetting\n", |
2025 | pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq, | 2025 | pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq, |
2026 | pkt_dev->odevname); | 2026 | pkt_dev->odevname); |
2027 | pkt_dev->queue_map_min = ntxq - 1; | 2027 | pkt_dev->queue_map_min = (ntxq ?: 1) - 1; |
2028 | } | 2028 | } |
2029 | if (pkt_dev->queue_map_max >= ntxq) { | 2029 | if (pkt_dev->queue_map_max >= ntxq) { |
2030 | pr_warning("WARNING: Requested queue_map_max (zero-based) (%d) exceeds valid range [0 - %d] for (%d) queues on %s, resetting\n", | 2030 | pr_warning("WARNING: Requested queue_map_max (zero-based) (%d) exceeds valid range [0 - %d] for (%d) queues on %s, resetting\n", |
2031 | pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq, | 2031 | pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq, |
2032 | pkt_dev->odevname); | 2032 | pkt_dev->odevname); |
2033 | pkt_dev->queue_map_max = ntxq - 1; | 2033 | pkt_dev->queue_map_max = (ntxq ?: 1) - 1; |
2034 | } | 2034 | } |
2035 | 2035 | ||
2036 | /* Default to the interface's mac if not explicitly set. */ | 2036 | /* Default to the interface's mac if not explicitly set. */ |
diff --git a/net/core/sock.c b/net/core/sock.c index 002939cfc069..5c5af9988f94 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -112,6 +112,7 @@ | |||
112 | #include <linux/highmem.h> | 112 | #include <linux/highmem.h> |
113 | #include <linux/user_namespace.h> | 113 | #include <linux/user_namespace.h> |
114 | #include <linux/jump_label.h> | 114 | #include <linux/jump_label.h> |
115 | #include <linux/memcontrol.h> | ||
115 | 116 | ||
116 | #include <asm/uaccess.h> | 117 | #include <asm/uaccess.h> |
117 | #include <asm/system.h> | 118 | #include <asm/system.h> |
@@ -1272,6 +1273,12 @@ void sk_release_kernel(struct sock *sk) | |||
1272 | } | 1273 | } |
1273 | EXPORT_SYMBOL(sk_release_kernel); | 1274 | EXPORT_SYMBOL(sk_release_kernel); |
1274 | 1275 | ||
1276 | static void sk_update_clone(const struct sock *sk, struct sock *newsk) | ||
1277 | { | ||
1278 | if (mem_cgroup_sockets_enabled && sk->sk_cgrp) | ||
1279 | sock_update_memcg(newsk); | ||
1280 | } | ||
1281 | |||
1275 | /** | 1282 | /** |
1276 | * sk_clone_lock - clone a socket, and lock its clone | 1283 | * sk_clone_lock - clone a socket, and lock its clone |
1277 | * @sk: the socket to clone | 1284 | * @sk: the socket to clone |
@@ -1362,6 +1369,8 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) | |||
1362 | sk_set_socket(newsk, NULL); | 1369 | sk_set_socket(newsk, NULL); |
1363 | newsk->sk_wq = NULL; | 1370 | newsk->sk_wq = NULL; |
1364 | 1371 | ||
1372 | sk_update_clone(sk, newsk); | ||
1373 | |||
1365 | if (newsk->sk_prot->sockets_allocated) | 1374 | if (newsk->sk_prot->sockets_allocated) |
1366 | sk_sockets_allocated_inc(newsk); | 1375 | sk_sockets_allocated_inc(newsk); |
1367 | 1376 | ||
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig index 335ca7abbd46..aa2a2c79776f 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig | |||
@@ -408,8 +408,12 @@ config INET_TCP_DIAG | |||
408 | def_tristate INET_DIAG | 408 | def_tristate INET_DIAG |
409 | 409 | ||
410 | config INET_UDP_DIAG | 410 | config INET_UDP_DIAG |
411 | tristate "UDP: socket monitoring interface" | ||
411 | depends on INET_DIAG | 412 | depends on INET_DIAG |
412 | def_tristate INET_DIAG && IPV6 | 413 | default n |
414 | ---help--- | ||
415 | Support for UDP socket monitoring interface used by the ss tool. | ||
416 | If unsure, say Y. | ||
413 | 417 | ||
414 | menuconfig TCP_CONG_ADVANCED | 418 | menuconfig TCP_CONG_ADVANCED |
415 | bool "TCP: advanced congestion control" | 419 | bool "TCP: advanced congestion control" |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index fa057d105bef..5104bc0bbdbe 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -880,6 +880,8 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb, | |||
880 | * to be intended in a v3 query. | 880 | * to be intended in a v3 query. |
881 | */ | 881 | */ |
882 | max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE); | 882 | max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE); |
883 | if (!max_delay) | ||
884 | max_delay = 1; /* can't mod w/ 0 */ | ||
883 | } else { /* v3 */ | 885 | } else { /* v3 */ |
884 | if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) | 886 | if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) |
885 | return; | 887 | return; |
diff --git a/net/unix/Kconfig b/net/unix/Kconfig index c2128b10e5f9..8b31ab85d050 100644 --- a/net/unix/Kconfig +++ b/net/unix/Kconfig | |||
@@ -22,7 +22,7 @@ config UNIX | |||
22 | config UNIX_DIAG | 22 | config UNIX_DIAG |
23 | tristate "UNIX: socket monitoring interface" | 23 | tristate "UNIX: socket monitoring interface" |
24 | depends on UNIX | 24 | depends on UNIX |
25 | default UNIX | 25 | default n |
26 | ---help--- | 26 | ---help--- |
27 | Support for UNIX socket monitoring interface used by the ss tool. | 27 | Support for UNIX socket monitoring interface used by the ss tool. |
28 | If unsure, say Y. | 28 | If unsure, say Y. |