Skip to content

Commit 5fc92de

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking updates from David Miller: "Here is a pile of bug fixes that accumulated while I was in Europe" 1) In fixing kernel leaks to userspace during copying of socket addresses, we broke a case that used to work, namely the user providing a buffer larger than the in-kernel generic socket address structure. This broke Ruby amongst other things. Fix from Dan Carpenter. 2) Fix regression added by byte queue limit support in 8139cp driver, from Yang Yingliang. 3) The addition of MSG_SENDPAGE_NOTLAST buggered up a few sendpage implementations, they should just treat it the same as MSG_MORE. Fix from Richard Weinberger and Shawn Landden. 4) Handle icmpv4 errors received on ipv6 SIT tunnels correctly, from Oussama Ghorbel. In particular we should send an ICMPv6 unreachable in such situations. 5) Fix some regressions in the recent genetlink fixes, in particular get the pmcraid driver to use the new safer interfaces correctly. From Johannes Berg. 6) macvtap was converted to use a per-cpu set of statistics, but some code was still bumping tx_dropped elsewhere. From Jason Wang. 7) Fix build failure of xen-netback due to missing include on some architectures, from Andy Whitecroft. 8) macvtap double counts received packets in statistics, fix from Vlad Yasevich. 9) Fix various cases of using *_STATS_BH() when *_STATS() is more appropriate. From Eric Dumazet and Hannes Frederic Sowa. 10) Pktgen ipsec mode doesn't update the ipv4 header length and checksum properly after encapsulation. Fix from Fan Du. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (61 commits) net/mlx4_en: Remove selftest TX queues empty condition {pktgen, xfrm} Update IPv4 header total len and checksum after tranformation virtio_net: make all RX paths handle erors consistently virtio_net: fix error handling for mergeable buffers virtio_net: Fixed a trivial typo (fitler --> filter) netem: fix gemodel loss generator netem: fix loss 4 state model netem: missing break in ge loss generator net/hsr: Support iproute print_opt ('ip -details ...') net/hsr: Very small fix of comment style. MAINTAINERS: Added net/hsr/ maintainer ipv6: fix possible seqlock deadlock in ip6_finish_output2 ixgbe: Make ixgbe_identify_qsfp_module_generic static ixgbe: turn NETIF_F_HW_L2FW_DOFFLOAD off by default ixgbe: ixgbe_fwd_ring_down needs to be static e1000: fix possible reset_task running after adapter down e1000: fix lockdep warning in e1000_reset_task e1000: prevent oops when adapter is being closed and reset simultaneously igb: Fixed Wake On LAN support inet: fix possible seqlock deadlocks ...
2 parents b0d8d22 + 833846e commit 5fc92de

70 files changed

Lines changed: 491 additions & 344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎MAINTAINERS‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4049,6 +4049,12 @@ W: http://www.pharscape.org
40494049
S: Maintained
40504050
F: drivers/net/usb/hso.c
40514051

4052+
HSR NETWORK PROTOCOL
4053+
M: Arvid Brodin <arvid.brodin@alten.se>
4054+
L: netdev@vger.kernel.org
4055+
S: Maintained
4056+
F: net/hsr/
4057+
40524058
HTCPEN TOUCHSCREEN DRIVER
40534059
M: Pau Oliva Fora <pof@eslack.org>
40544060
L: linux-input@vger.kernel.org

‎crypto/algif_hash.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ static ssize_t hash_sendpage(struct socket *sock, struct page *page,
114114
struct hash_ctx *ctx = ask->private;
115115
int err;
116116

117+
if (flags & MSG_SENDPAGE_NOTLAST)
118+
flags |= MSG_MORE;
119+
117120
lock_sock(sk);
118121
sg_init_table(ctx->sgl.sg, 1);
119122
sg_set_page(ctx->sgl.sg, page, size, offset);

‎crypto/algif_skcipher.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,9 @@ static ssize_t skcipher_sendpage(struct socket *sock, struct page *page,
378378
struct skcipher_sg_list *sgl;
379379
int err = -EINVAL;
380380

381+
if (flags & MSG_SENDPAGE_NOTLAST)
382+
flags |= MSG_MORE;
383+
381384
lock_sock(sk);
382385
if (!ctx->more && ctx->used)
383386
goto unlock;

‎drivers/net/bonding/bond_main.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4110,7 +4110,7 @@ static int bond_check_params(struct bond_params *params)
41104110
if (!miimon) {
41114111
pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n");
41124112
pr_warning("Forcing miimon to 100msec\n");
4113-
miimon = 100;
4113+
miimon = BOND_DEFAULT_MIIMON;
41144114
}
41154115
}
41164116

@@ -4147,7 +4147,7 @@ static int bond_check_params(struct bond_params *params)
41474147
if (!miimon) {
41484148
pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure and link speed which are essential for TLB/ALB load balancing\n");
41494149
pr_warning("Forcing miimon to 100msec\n");
4150-
miimon = 100;
4150+
miimon = BOND_DEFAULT_MIIMON;
41514151
}
41524152
}
41534153

‎drivers/net/bonding/bond_options.c‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,15 @@ int bond_option_mode_set(struct bonding *bond, int mode)
4545
return -EPERM;
4646
}
4747

48-
if (BOND_MODE_IS_LB(mode) && bond->params.arp_interval) {
49-
pr_err("%s: %s mode is incompatible with arp monitoring.\n",
50-
bond->dev->name, bond_mode_tbl[mode].modename);
51-
return -EINVAL;
48+
if (BOND_NO_USES_ARP(mode) && bond->params.arp_interval) {
49+
pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n",
50+
bond->dev->name, bond_mode_tbl[mode].modename);
51+
/* disable arp monitoring */
52+
bond->params.arp_interval = 0;
53+
/* set miimon to default value */
54+
bond->params.miimon = BOND_DEFAULT_MIIMON;
55+
pr_info("%s: Setting MII monitoring interval to %d.\n",
56+
bond->dev->name, bond->params.miimon);
5257
}
5358

5459
/* don't cache arp_validate between modes */

‎drivers/net/bonding/bond_sysfs.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,7 @@ static ssize_t bonding_store_arp_interval(struct device *d,
523523
ret = -EINVAL;
524524
goto out;
525525
}
526-
if (bond->params.mode == BOND_MODE_ALB ||
527-
bond->params.mode == BOND_MODE_TLB ||
528-
bond->params.mode == BOND_MODE_8023AD) {
526+
if (BOND_NO_USES_ARP(bond->params.mode)) {
529527
pr_info("%s: ARP monitoring cannot be used with ALB/TLB/802.3ad. Only MII monitoring is supported on %s.\n",
530528
bond->dev->name, bond->dev->name);
531529
ret = -EINVAL;

‎drivers/net/bonding/bonding.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
#define BOND_MAX_ARP_TARGETS 16
3737

38+
#define BOND_DEFAULT_MIIMON 100
39+
3840
#define IS_UP(dev) \
3941
((((dev)->flags & IFF_UP) == IFF_UP) && \
4042
netif_running(dev) && \
@@ -55,6 +57,11 @@
5557
((mode) == BOND_MODE_TLB) || \
5658
((mode) == BOND_MODE_ALB))
5759

60+
#define BOND_NO_USES_ARP(mode) \
61+
(((mode) == BOND_MODE_8023AD) || \
62+
((mode) == BOND_MODE_TLB) || \
63+
((mode) == BOND_MODE_ALB))
64+
5865
#define TX_QUEUE_OVERRIDE(mode) \
5966
(((mode) == BOND_MODE_ACTIVEBACKUP) || \
6067
((mode) == BOND_MODE_ROUNDROBIN))

‎drivers/net/can/c_can/c_can.c‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -712,22 +712,31 @@ static int c_can_set_mode(struct net_device *dev, enum can_mode mode)
712712
return 0;
713713
}
714714

715-
static int c_can_get_berr_counter(const struct net_device *dev,
716-
struct can_berr_counter *bec)
715+
static int __c_can_get_berr_counter(const struct net_device *dev,
716+
struct can_berr_counter *bec)
717717
{
718718
unsigned int reg_err_counter;
719719
struct c_can_priv *priv = netdev_priv(dev);
720720

721-
c_can_pm_runtime_get_sync(priv);
722-
723721
reg_err_counter = priv->read_reg(priv, C_CAN_ERR_CNT_REG);
724722
bec->rxerr = (reg_err_counter & ERR_CNT_REC_MASK) >>
725723
ERR_CNT_REC_SHIFT;
726724
bec->txerr = reg_err_counter & ERR_CNT_TEC_MASK;
727725

726+
return 0;
727+
}
728+
729+
static int c_can_get_berr_counter(const struct net_device *dev,
730+
struct can_berr_counter *bec)
731+
{
732+
struct c_can_priv *priv = netdev_priv(dev);
733+
int err;
734+
735+
c_can_pm_runtime_get_sync(priv);
736+
err = __c_can_get_berr_counter(dev, bec);
728737
c_can_pm_runtime_put_sync(priv);
729738

730-
return 0;
739+
return err;
731740
}
732741

733742
/*
@@ -754,6 +763,7 @@ static void c_can_do_tx(struct net_device *dev)
754763
if (!(val & (1 << (msg_obj_no - 1)))) {
755764
can_get_echo_skb(dev,
756765
msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST);
766+
c_can_object_get(dev, 0, msg_obj_no, IF_COMM_ALL);
757767
stats->tx_bytes += priv->read_reg(priv,
758768
C_CAN_IFACE(MSGCTRL_REG, 0))
759769
& IF_MCONT_DLC_MASK;
@@ -872,7 +882,7 @@ static int c_can_handle_state_change(struct net_device *dev,
872882
if (unlikely(!skb))
873883
return 0;
874884

875-
c_can_get_berr_counter(dev, &bec);
885+
__c_can_get_berr_counter(dev, &bec);
876886
reg_err_counter = priv->read_reg(priv, C_CAN_ERR_CNT_REG);
877887
rx_err_passive = (reg_err_counter & ERR_CNT_RP_MASK) >>
878888
ERR_CNT_RP_SHIFT;

‎drivers/net/can/flexcan.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,13 +1020,13 @@ static int flexcan_probe(struct platform_device *pdev)
10201020
dev_err(&pdev->dev, "no ipg clock defined\n");
10211021
return PTR_ERR(clk_ipg);
10221022
}
1023-
clock_freq = clk_get_rate(clk_ipg);
10241023

10251024
clk_per = devm_clk_get(&pdev->dev, "per");
10261025
if (IS_ERR(clk_per)) {
10271026
dev_err(&pdev->dev, "no per clock defined\n");
10281027
return PTR_ERR(clk_per);
10291028
}
1029+
clock_freq = clk_get_rate(clk_per);
10301030
}
10311031

10321032
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);

‎drivers/net/can/sja1000/sja1000.c‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -494,20 +494,20 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
494494
uint8_t isrc, status;
495495
int n = 0;
496496

497-
/* Shared interrupts and IRQ off? */
498-
if (priv->read_reg(priv, SJA1000_IER) == IRQ_OFF)
499-
return IRQ_NONE;
500-
501497
if (priv->pre_irq)
502498
priv->pre_irq(priv);
503499

500+
/* Shared interrupts and IRQ off? */
501+
if (priv->read_reg(priv, SJA1000_IER) == IRQ_OFF)
502+
goto out;
503+
504504
while ((isrc = priv->read_reg(priv, SJA1000_IR)) &&
505505
(n < SJA1000_MAX_IRQ)) {
506-
n++;
506+
507507
status = priv->read_reg(priv, SJA1000_SR);
508508
/* check for absent controller due to hw unplug */
509509
if (status == 0xFF && sja1000_is_absent(priv))
510-
return IRQ_NONE;
510+
goto out;
511511

512512
if (isrc & IRQ_WUI)
513513
netdev_warn(dev, "wakeup interrupt\n");
@@ -535,16 +535,17 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
535535
status = priv->read_reg(priv, SJA1000_SR);
536536
/* check for absent controller */
537537
if (status == 0xFF && sja1000_is_absent(priv))
538-
return IRQ_NONE;
538+
goto out;
539539
}
540540
}
541541
if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) {
542542
/* error interrupt */
543543
if (sja1000_err(dev, isrc, status))
544544
break;
545545
}
546+
n++;
546547
}
547-
548+
out:
548549
if (priv->post_irq)
549550
priv->post_irq(priv);
550551

0 commit comments

Comments
 (0)