Skip to content

Commit 98f75b8

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) If the user gives us a msg_namelen of 0, don't try to interpret anything pointed to by msg_name. From Ani Sinha. 2) Fix some bnx2i/bnx2fc randconfig compilation errors. The gist of the issue is that we firstly have drivers that span both SCSI and networking. And at the top of that chain of dependencies we have things like SCSI_FC_ATTRS and SCSI_NETLINK which are selected. But since select is a sledgehammer and ignores dependencies, everything to select's SCSI_FC_ATTRS and/or SCSI_NETLINK has to also explicitly select their dependencies and so on and so forth. Generally speaking 'select' is supposed to only be used for child nodes, those which have no dependencies of their own. And this whole chain of dependencies in the scsi layer violates that rather strongly. So just make SCSI_NETLINK depend upon it's dependencies, and so on and so forth for the things selecting it (either directly or indirectly). From Anish Bhatt and Randy Dunlap. 3) Fix generation of blackhole routes in IPSEC, from Steffen Klassert. 4) Actually notice netdev feature changes in rtl_open() code, from Hayes Wang. 5) Fix divide by zero in bond enslaving, from Nikolay Aleksandrov. 6) Missing memory barrier in sunvnet driver, from David Stevens. 7) Don't leave anycast addresses around when ipv6 interface is destroyed, from Sabrina Dubroca. 8) Don't call efx_{arch}_filter_sync_rx_mode before addr_list_lock is initialized in SFC driver, from Edward Cree. 9) Fix missing DMA error checking in 3c59x, from Neal Horman. 10) Openvswitch doesn't emit OVS_FLOW_CMD_NEW notifications accidently, fix from Samuel Gauthier. 11) pch_gbe needs to select NET_PTP_CLASSIFY otherwise we can get a build error. 12) Fix macvlan regression wherein we stopped emitting broadcast/multicast frames over software devices. From Nicolas Dichtel. 13) Fix infiniband bug due to unintended overflow of skb->cb[], from Eric Dumazet. And add an assertion so this doesn't happen again. 14) dm9000_parse_dt() should return error pointers, not NULL. From Tobias Klauser. 15) IP tunneling code uses this_cpu_ptr() in preemptible contexts, fix from Eric Dumazet. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (87 commits) net: bcmgenet: call bcmgenet_dma_teardown in bcmgenet_fini_dma net: bcmgenet: fix TX reclaim accounting for fragments ipv4: do not use this_cpu_ptr() in preemptible context dm9000: Return an ERR_PTR() in all error conditions of dm9000_parse_dt() r8169: fix an if condition r8152: disable ALDPS ipoib: validate struct ipoib_cb size net: sched: shrink struct qdisc_skb_cb to 28 bytes tg3: Work around HW/FW limitations with vlan encapsulated frames macvlan: allow to enqueue broadcast pkt on virtual device pch_gbe: 'select' NET_PTP_CLASSIFY. scsi: Use 'depends' with LIBFC instead of 'select'. openvswitch: restore OVS_FLOW_CMD_NEW notifications genetlink: add function genl_has_listeners() lib: rhashtable: remove second linux/log2.h inclusion net: allow macvlans to move to net namespace 3c59x: Fix bad offset spec in skb_frag_dma_map 3c59x: Add dma error checking and recovery sparc: bpf_jit: fix support for ldx/stx mem and SKF_AD_VLAN_TAG can: at91_can: add missing prepare and unprepare of the clock ...
2 parents 9478303 + e18b7fa commit 98f75b8

85 files changed

Lines changed: 828 additions & 355 deletions

Some content is hidden

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

‎Documentation/networking/filter.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ JIT compiler
462462
------------
463463

464464
The Linux kernel has a built-in BPF JIT compiler for x86_64, SPARC, PowerPC,
465-
ARM and s390 and can be enabled through CONFIG_BPF_JIT. The JIT compiler is
466-
transparently invoked for each attached filter from user space or for internal
467-
kernel users if it has been previously enabled by root:
465+
ARM, MIPS and s390 and can be enabled through CONFIG_BPF_JIT. The JIT compiler
466+
is transparently invoked for each attached filter from user space or for
467+
internal kernel users if it has been previously enabled by root:
468468

469469
echo 1 > /proc/sys/net/core/bpf_jit_enable
470470

‎arch/sparc/net/bpf_jit_comp.c‎

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,18 @@ do { BUILD_BUG_ON(FIELD_SIZEOF(STRUCT, FIELD) != sizeof(u8)); \
234234
__emit_load8(BASE, STRUCT, FIELD, DEST); \
235235
} while (0)
236236

237-
#define emit_ldmem(OFF, DEST) \
238-
do { *prog++ = LD32I | RS1(FP) | S13(-(OFF)) | RD(DEST); \
237+
#ifdef CONFIG_SPARC64
238+
#define BIAS (STACK_BIAS - 4)
239+
#else
240+
#define BIAS (-4)
241+
#endif
242+
243+
#define emit_ldmem(OFF, DEST) \
244+
do { *prog++ = LD32I | RS1(SP) | S13(BIAS - (OFF)) | RD(DEST); \
239245
} while (0)
240246

241-
#define emit_stmem(OFF, SRC) \
242-
do { *prog++ = LD32I | RS1(FP) | S13(-(OFF)) | RD(SRC); \
247+
#define emit_stmem(OFF, SRC) \
248+
do { *prog++ = ST32I | RS1(SP) | S13(BIAS - (OFF)) | RD(SRC); \
243249
} while (0)
244250

245251
#ifdef CONFIG_SMP
@@ -615,10 +621,11 @@ void bpf_jit_compile(struct bpf_prog *fp)
615621
case BPF_ANC | SKF_AD_VLAN_TAG:
616622
case BPF_ANC | SKF_AD_VLAN_TAG_PRESENT:
617623
emit_skb_load16(vlan_tci, r_A);
618-
if (code == (BPF_ANC | SKF_AD_VLAN_TAG)) {
619-
emit_andi(r_A, VLAN_VID_MASK, r_A);
624+
if (code != (BPF_ANC | SKF_AD_VLAN_TAG)) {
625+
emit_alu_K(SRL, 12);
626+
emit_andi(r_A, 1, r_A);
620627
} else {
621-
emit_loadimm(VLAN_TAG_PRESENT, r_TMP);
628+
emit_loadimm(~VLAN_TAG_PRESENT, r_TMP);
622629
emit_and(r_A, r_TMP, r_A);
623630
}
624631
break;
@@ -630,15 +637,19 @@ void bpf_jit_compile(struct bpf_prog *fp)
630637
emit_loadimm(K, r_X);
631638
break;
632639
case BPF_LD | BPF_MEM:
640+
seen |= SEEN_MEM;
633641
emit_ldmem(K * 4, r_A);
634642
break;
635643
case BPF_LDX | BPF_MEM:
644+
seen |= SEEN_MEM | SEEN_XREG;
636645
emit_ldmem(K * 4, r_X);
637646
break;
638647
case BPF_ST:
648+
seen |= SEEN_MEM;
639649
emit_stmem(K * 4, r_A);
640650
break;
641651
case BPF_STX:
652+
seen |= SEEN_MEM | SEEN_XREG;
642653
emit_stmem(K * 4, r_X);
643654
break;
644655

‎drivers/infiniband/hw/mlx4/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev,
16801680
goto unlock;
16811681

16821682
update_params.smac_index = new_smac_index;
1683-
if (mlx4_update_qp(ibdev->dev, &qp->mqp, MLX4_UPDATE_QP_SMAC,
1683+
if (mlx4_update_qp(ibdev->dev, qp->mqp.qpn, MLX4_UPDATE_QP_SMAC,
16841684
&update_params)) {
16851685
release_mac = new_smac;
16861686
goto unlock;

‎drivers/infiniband/hw/mlx4/qp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
16821682
MLX4_IB_LINK_TYPE_ETH;
16831683
if (dev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) {
16841684
/* set QP to receive both tunneled & non-tunneled packets */
1685-
if (!(context->flags & (1 << MLX4_RSS_QPC_FLAG_OFFSET)))
1685+
if (!(context->flags & cpu_to_be32(1 << MLX4_RSS_QPC_FLAG_OFFSET)))
16861686
context->srqn = cpu_to_be32(7 << 28);
16871687
}
16881688
}

‎drivers/infiniband/ulp/ipoib/ipoib.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ struct ipoib_cb {
131131
u8 hwaddr[INFINIBAND_ALEN];
132132
};
133133

134+
static inline struct ipoib_cb *ipoib_skb_cb(const struct sk_buff *skb)
135+
{
136+
BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct ipoib_cb));
137+
return (struct ipoib_cb *)skb->cb;
138+
}
139+
134140
/* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */
135141
struct ipoib_mcast {
136142
struct ib_sa_mcmember_rec mcmember;

‎drivers/infiniband/ulp/ipoib/ipoib_main.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
716716
{
717717
struct ipoib_dev_priv *priv = netdev_priv(dev);
718718
struct ipoib_neigh *neigh;
719-
struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
719+
struct ipoib_cb *cb = ipoib_skb_cb(skb);
720720
struct ipoib_header *header;
721721
unsigned long flags;
722722

@@ -813,7 +813,7 @@ static int ipoib_hard_header(struct sk_buff *skb,
813813
const void *daddr, const void *saddr, unsigned len)
814814
{
815815
struct ipoib_header *header;
816-
struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
816+
struct ipoib_cb *cb = ipoib_skb_cb(skb);
817817

818818
header = (struct ipoib_header *) skb_push(skb, sizeof *header);
819819

‎drivers/message/fusion/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ config FUSION_SPI
2929
config FUSION_FC
3030
tristate "Fusion MPT ScsiHost drivers for FC"
3131
depends on PCI && SCSI
32-
select SCSI_FC_ATTRS
32+
depends on SCSI_FC_ATTRS
3333
---help---
3434
SCSI HOST support for a Fiber Channel host adapters.
3535

‎drivers/net/bonding/bond_main.c‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ MODULE_PARM_DESC(fail_over_mac, "For active-backup, do not set all slaves to "
175175
"the same MAC; 0 for none (default), "
176176
"1 for active, 2 for follow");
177177
module_param(all_slaves_active, int, 0);
178-
MODULE_PARM_DESC(all_slaves_active, "Keep all frames received on an interface"
178+
MODULE_PARM_DESC(all_slaves_active, "Keep all frames received on an interface "
179179
"by setting active flag for all slaves; "
180180
"0 for never (default), 1 for always.");
181181
module_param(resend_igmp, int, 0);
@@ -3659,8 +3659,14 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
36593659
else
36603660
bond_xmit_slave_id(bond, skb, 0);
36613661
} else {
3662-
slave_id = bond_rr_gen_slave_id(bond);
3663-
bond_xmit_slave_id(bond, skb, slave_id % bond->slave_cnt);
3662+
int slave_cnt = ACCESS_ONCE(bond->slave_cnt);
3663+
3664+
if (likely(slave_cnt)) {
3665+
slave_id = bond_rr_gen_slave_id(bond);
3666+
bond_xmit_slave_id(bond, skb, slave_id % slave_cnt);
3667+
} else {
3668+
dev_kfree_skb_any(skb);
3669+
}
36643670
}
36653671

36663672
return NETDEV_TX_OK;
@@ -3691,8 +3697,13 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d
36913697
static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
36923698
{
36933699
struct bonding *bond = netdev_priv(bond_dev);
3700+
int slave_cnt = ACCESS_ONCE(bond->slave_cnt);
36943701

3695-
bond_xmit_slave_id(bond, skb, bond_xmit_hash(bond, skb) % bond->slave_cnt);
3702+
if (likely(slave_cnt))
3703+
bond_xmit_slave_id(bond, skb,
3704+
bond_xmit_hash(bond, skb) % slave_cnt);
3705+
else
3706+
dev_kfree_skb_any(skb);
36963707

36973708
return NETDEV_TX_OK;
36983709
}

‎drivers/net/can/at91_can.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,9 @@ static int at91_open(struct net_device *dev)
11231123
struct at91_priv *priv = netdev_priv(dev);
11241124
int err;
11251125

1126-
clk_enable(priv->clk);
1126+
err = clk_prepare_enable(priv->clk);
1127+
if (err)
1128+
return err;
11271129

11281130
/* check or determine and set bittime */
11291131
err = open_candev(dev);
@@ -1149,7 +1151,7 @@ static int at91_open(struct net_device *dev)
11491151
out_close:
11501152
close_candev(dev);
11511153
out:
1152-
clk_disable(priv->clk);
1154+
clk_disable_unprepare(priv->clk);
11531155

11541156
return err;
11551157
}
@@ -1166,7 +1168,7 @@ static int at91_close(struct net_device *dev)
11661168
at91_chip_stop(dev, CAN_STATE_STOPPED);
11671169

11681170
free_irq(dev->irq, dev);
1169-
clk_disable(priv->clk);
1171+
clk_disable_unprepare(priv->clk);
11701172

11711173
close_candev(dev);
11721174

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ static void c_can_hw_raminit_ti(const struct c_can_priv *priv, bool enable)
9797
ctrl |= CAN_RAMINIT_DONE_MASK(priv->instance);
9898
writel(ctrl, priv->raminit_ctrlreg);
9999
ctrl &= ~CAN_RAMINIT_DONE_MASK(priv->instance);
100-
c_can_hw_raminit_wait_ti(priv, ctrl, mask);
100+
c_can_hw_raminit_wait_ti(priv, mask, ctrl);
101101

102102
if (enable) {
103103
/* Set start bit and wait for the done bit. */
104104
ctrl |= CAN_RAMINIT_START_MASK(priv->instance);
105105
writel(ctrl, priv->raminit_ctrlreg);
106106
ctrl |= CAN_RAMINIT_DONE_MASK(priv->instance);
107-
c_can_hw_raminit_wait_ti(priv, ctrl, mask);
107+
c_can_hw_raminit_wait_ti(priv, mask, ctrl);
108108
}
109109
spin_unlock(&raminit_lock);
110110
}

0 commit comments

Comments
 (0)