8000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · bsd-unix/linux@32826ac · GitHub
[go: up one dir, main page]

Skip to content

Commit 32826ac

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "I've been traveling so this accumulates more than week or so of bug fixing. It perhaps looks a little worse than it really is. 1) Fix deadlock in ath10k driver, from Ben Greear. 2) Increase scan timeout in iwlwifi, from Luca Coelho. 3) Unbreak STP by properly reinjecting STP packets back into the stack. Regression fix from Ido Schimmel. 4) Mediatek driver fixes (missing malloc failure checks, leaking of scratch memory, wrong indexing when mapping TX buffers, etc.) from John Crispin. 5) Fix endianness bug in icmpv6_err() handler, from Hannes Frederic Sowa. 6) Fix hashing of flows in UDP in the ruseport case, from Xuemin Su. 7) Fix netlink notifications in ovs for tunnels, delete link messages are never emitted because of how the device registry state is handled. From Nicolas Dichtel. 8) Conntrack module leaks kmemcache on unload, from Florian Westphal. 9) Prevent endless jump loops in nft rules, from Liping Zhang and Pablo Neira Ayuso. 10) Not early enough spinlock initialization in mlx4, from Eric Dumazet. 11) Bind refcount leak in act_ipt, from Cong WANG. 12) Missing RCU locking in HTB scheduler, from Florian Westphal. 13) Several small MACSEC bug fixes from Sabrina Dubroca (missing RCU barrier, using heap for SG and IV, and erroneous use of async flag when allocating AEAD conext.) 14) RCU handling fix in TIPC, from Ying Xue. 15) Pass correct protocol down into ipv4_{update_pmtu,redirect}() in SIT driver, from Simon Horman. 16) Socket timer deadlock fix in TIPC from Jon Paul Maloy. 17) Fix potential deadlock in team enslave, from Ido Schimmel. 18) Memory leak in KCM procfs handling, from Jiri Slaby. 19) ESN generation fix in ipv4 ESP, from Herbert Xu. 20) Fix GFP_KERNEL allocations with locks held in act_ife, from Cong WANG. 21) Use after free in netem, from Eric Dumazet. 22) Uninitialized last assert time in multicast router code, from Tom Goff. 23) Skip raw sockets in sock_diag destruction broadcast, from Willem de Bruijn. 24) Fix link status reporting in thunderx, from Sunil Goutham. 25) Limit resegmentation of retransmit queue so that we do not retransmit too large GSO frames. From Eric Dumazet. 26) Delay bpf program release after grace period, from Daniel Borkmann" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (141 commits) openvswitch: fix conntrack netlink event delivery qed: Protect the doorbell BAR with the write barriers. neigh: Explicitly declare RCU-bh read side critical section in neigh_xmit() e1000e: keep VLAN interfaces functional after rxvlan off cfg80211: fix proto in ieee80211_data_to_8023 for frames without LLC header qlcnic: use the correct ring in qlcnic_83xx_process_rcv_ring_diag() bpf, perf: delay release of BPF prog after grace period net: bridge: fix vlan stats continue counter tcp: do not send too big packets at retransmit time ibmvnic: fix to use list_for_each_safe() when delete items net: thunderx: Fix TL4 configuration for secondary Qsets net: thunderx: Fix link status reporting net/mlx5e: Reorganize ethtool statistics net/mlx5e: Fix number of PFC counters reported to ethtool net/mlx5e: Prevent adding the same vxlan port net/mlx5e: Check for BlueFlame capability before allocating SQ uar net/mlx5e: Change enum to better reflect usage net/mlx5: Add ConnectX-5 PCIe 4.0 to list of supported devices net/mlx5: Update command strings net: marvell: Add separate config ANEG function for Marvell 88E1111 ...
2 parents 653c574 + 751ad81 commit 32826ac

File tree

140 files changed

+1270
-893
lines changed

Some content is hidden

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

140 files changed

+1270
-893
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7424,7 +7424,7 @@ F: drivers/scsi/megaraid.*
74247424
F: drivers/scsi/megaraid/
74257425

74267426
MELLANOX ETHERNET DRIVER (mlx4_en)
7427-
M: Eugenia Emantayev <eugenia@mellanox.com>
7427+
M: Tariq Toukan <tariqt@mellanox.com>
74287428
L: netdev@vger.kernel.org
74297429
S: Supported
74307430
W: http://www.mellanox.com

drivers/connector/cn_proc.c

Lines changed: 22 additions & 21 deletions
10000
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,21 @@ static struct cb_id cn_proc_event_id = { CN_IDX_PROC, CN_VAL_PROC };
5656
/* proc_event_counts is used as the sequence number of the netlink message */
5757
static DEFINE_PER_CPU(__u32, proc_event_counts) = { 0 };
5858

59-
static inline void get_seq(__u32 *ts, int *cpu)
59+
static inline void send_msg(struct cn_msg *msg)
6060
{
6161
preempt_disable();
62-
*ts = __this_cpu_inc_return(proc_event_counts) - 1;
63-
*cpu = smp_processor_id();
62+
63+
msg->seq = __this_cpu_inc_return(proc_event_counts) - 1;
64+
((struct proc_event *)msg->data)->cpu = smp_processor_id();
65+
66+
/*
67+
* Preemption remains disabled during send to ensure the messages are
68+
* ordered according to their sequence numbers.
69+
*
70+
* If cn_netlink_send() fails, the data is not sent.
71+
*/
72+
cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_NOWAIT);
73+
6474
preempt_enable();
6575
}
6676

@@ -77,7 +87,6 @@ void proc_fork_connector(struct task_struct *task)
7787
msg = buffer_to_cn_msg(buffer);
7888
ev = (struct proc_event *)msg->data;
7989
memset(&ev->event_data, 0, sizeof(ev->event_data));
80-
get_seq(&msg->seq, &ev->cpu);
8190
ev->timestamp_ns = ktime_get_ns();
8291
ev->what = PROC_EVENT_FORK;
8392
rcu_read_lock();
@@ -92,8 +101,7 @@ void proc_fork_connector(struct task_struct *task)
92101
msg->ack = 0; /* not used */
93102
msg->len = sizeof(*ev);
94103
msg->flags = 0; /* not used */
95-
/* If cn_netlink_send() failed, the data is not sent */
96-
cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL);
104+
send_msg(msg);
97105
}
98106

99107
void proc_exec_connector(struct task_struct *task)
@@ -108,7 +116,6 @@ void proc_exec_connector(struct task_struct *task)
108116
msg = buffer_to_cn_msg(buffer);
109117
ev = (struct proc_event *)msg->data;
110118
memset(&ev->event_data, 0, sizeof(ev->event_data));
111-
get_seq(&msg->seq, &ev->cpu);
112119
ev->timestamp_ns = ktime_get_ns();
113120
ev->what = PROC_EVENT_EXEC;
114121
ev->event_data.exec.process_pid = task->pid;
@@ -118,7 +125,7 @@ void proc_exec_connector(struct task_struct *task)
118125
msg->ack = 0; /* not used */
119126
msg->len = sizeof(*ev);
120127
msg->flags = 0; /* not used */
121-
cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL);
128+
send_msg(msg);
122129
}
123130

124131
void proc_id_connector(struct task_struct *task, int which_id)
@@ -150,14 +157,13 @@ void proc_id_connector(struct task_struct *task, int which_id)
150157
return;
151158
}
152159
rcu_read_unlock();
153-
get_seq(&msg->seq, &ev->cpu);
154160
ev->timestamp_ns = ktime_get_ns();
155161

156162
memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
157163
msg->ack = 0; /* not used */
158164
msg->len = sizeof(*ev);
159165
msg->flags = 0; /* not used */
160-
cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL);
166+
send_msg(msg);
161167
}
162168

163169
void proc_sid_connector(struct task_struct *task)
@@ -172,7 +178,6 @@ void proc_sid_connector(struct task_struct *task)
172178
msg = buffer_to_cn_msg(buffer);
173179
ev = (struct proc_event *)msg->data;
174180
memset(&ev->event_data, 0, sizeof(ev->event_data));
175-
get_seq(&msg->seq, &ev->cpu);
176181
ev->timestamp_ns = ktime_get_ns();
177182
ev->what = PROC_EVENT_SID;
178183
ev->event_data.sid.process_pid = task->pid;
@@ -182,7 +187,7 @@ void proc_sid_connector(struct task_struct *task)
182187
msg->ack = 0; /* not used */
183188
msg->len = sizeof(*ev);
184189
msg->flags = 0; /* not used */
185-
cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL);
190+
send_msg(msg);
186191
}
187192

188193
void proc_ptrace_connector(struct task_struct *task, int ptrace_id)
@@ -197,7 +202,6 @@ void proc_ptrace_connector(struct task_struct *task, int ptrace_id)
197202
msg = buffer_to_cn_msg(buffer);
198203
ev = (struct proc_event *)msg->data;
199204
memset(&ev->event_data, 0, sizeof(ev->event_data));
200-
get_seq(&msg->seq, &ev->cpu);
201205
ev->timestamp_ns = ktime_get_ns();
202206
ev->what = PROC_EVENT_PTRACE;
203207
ev->event_data.ptrace.process_pid = task->pid;
@@ -215,7 +219,7 @@ void proc_ptrace_connector(struct task_struct *task, int ptrace_id)
215219
msg->ack = 0; /* not used */
216220
msg->len = sizeof(*ev);
217221
msg->flags = 0; /* not used */
218-
cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL);
222+
send_msg(msg);
219223
}
220224

221225
void proc_comm_connector(struct task_struct *task)
@@ -230,7 +234,6 @@ void proc_comm_connector(struct task_struct *task)
230234
msg = buffer_to_cn_msg(buffer);
231235
ev = (struct proc_event *)msg->data;
232236
memset(&ev->event_data, 0, sizeof(ev->event_data));
233-
get_seq(&msg->seq, &ev->cpu);
234237
ev->timestamp_ns = ktime_get_ns();
235238
ev->what = PROC_EVENT_COMM;
236239
ev->event_data.comm.process_pid = task->pid;
@@ -241,7 +244,7 @@ void proc_comm_connector(struct task_struct *task)
241244
msg->ack = 0; /* not used */
242245
msg->len = sizeof(*ev);
243246
msg->flags = 0; /* not used */
244-
cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL);
247+
send_msg(msg);
245248
}
246249

247250
void proc_coredump_connector(struct task_struct *task)
@@ -256,7 +259,6 @@ void proc_coredump_connector(struct task_struct *task)
256259
msg = buffer_to_cn_msg(buffer);
257260
ev = (struct proc_event *)msg->data;
258261
memset(&ev->event_data, 0, sizeof(ev->event_data));
259-
get_seq(&msg->seq, &ev->cpu);
260262
ev->timestamp_ns = ktime_get_ns();
261263
ev->what = PROC_EVENT_COREDUMP;
262264
ev->event_data.coredump.process_pid = task->pid;
@@ -266,7 +268,7 @@ void proc_coredump_connector(struct task_struct *task)
266268
msg->ack = 0; /* not used */
267269
msg->len = sizeof(*ev);
268270
msg->flags = 0; /* not used */
269-
cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL);
271+
send_msg(msg);
270272
}
271273

272274
void proc_exit_connector(struct task_struct *task)
@@ -281,7 +283,6 @@ void proc_exit_connector(struct task_struct *task)
281283
msg = buffer_to_cn_msg(buffer);
282284
ev = (struct proc_event *)msg->data;
283285
memset(&ev->event_data, 0, sizeof(ev->event_data));
284-
get_seq(&msg->seq, &ev->cpu);
285286
ev->timestamp_ns = ktime_get_ns();
286287
ev->what = PROC_EVENT_EXIT;
287288
ev->event_data.exit.process_pid = task->pid;
@@ -293,7 +294,7 @@ void proc_exit_connector(struct task_struct *task)
293294
msg->ack = 0; /* not used */
294295
msg->len = sizeof(*ev);
295296
msg->flags = 0; /* not used */
296-
cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL);
297+
send_msg(msg);
297298
}
298299

299300
/*
@@ -325,7 +326,7 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack)
325326
msg->ack = rcvd_ack + 1;
326327
msg->len = sizeof(*ev);
327328
msg->flags = 0; /* not used */
328-
cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL);
329+
send_msg(msg);
329330
}
330331

331332
/**

drivers/net/bonding/bond_3ad.c

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -657,46 +657,61 @@ static void __set_agg_ports_ready(struct aggregator *aggregator, int val)
657657
}
658658
}
659659

660+
static int __agg_active_ports(struct aggregator *agg)
661+
{
662+
struct port *port;
663+
int active = 0;
664+
665+
for (port = agg->lag_ports; port;
666+
port = port->next_port_in_aggregator) {
667+
if (port->is_enabled)
668+
active++;
669+
}
670+
671+
return active;
672+
}
673+
660674
/**
661675
* __get_agg_bandwidth - get the total bandwidth of an aggregator
662676
* @aggregator: the aggregator we're looking at
663677
*
664678
*/
665679
static u32 __get_agg_bandwidth(struct aggregator *aggregator)
666680
{
681+
int nports = __agg_active_ports(aggregator);
667682
u32 bandwidth = 0;
668683

669-
if (aggregator->num_of_ports) {
684+
if (nports) {
670685
switch (__get_link_speed(aggregator->lag_ports)) {
671686
case AD_LINK_SPEED_1MBPS:
672-
bandwidth = aggregator->num_of_ports;
687+
bandwidth = nports;
673688
break;
674689
case AD_LINK_SPEED_10MBPS:
675-
bandwidth = aggregator->num_of_ports * 10;
690+
bandwidth = nports * 10;
676691
break;
677692
case AD_LINK_SPEED_100MBPS:
678-
bandwidth = aggregator->num_of_ports * 100;
693+
bandwidth = nports * 100;
679694
break;
680695
case AD_LINK_SPEED_1000MBPS:
681-
bandwidth = aggregator->num_of_ports * 1000;
696+
bandwidth = nports * 1000;
682697
break;
683698
case AD_LINK_SPEED_2500MBPS:
684-
bandwidth = aggregator->num_of_ports * 2500;
699+
bandwidth = nports * 2500;
685700
break;
686701
case AD_LINK_SPEED_10000MBPS:
687-
bandwidth = aggregator->num_of_ports * 10000;
702+
bandwidth = nports * 10000;
688703
break;
689704
case AD_LINK_SPEED_20000MBPS:
690-
bandwidth = aggregator->num_of_ports * 20000;
705+
bandwidth = nports * 20000;
691706
break;
692707
case AD_LINK_SPEED_40000MBPS:
693-
bandwidth = aggregator->num_of_ports * 40000;
708+
bandwidth = nports * 40000;
694709
break;
695710
case AD_LINK_SPEED_56000MBPS:
696-
bandwidth = aggregator->num_of_ports * 56000;
711+
bandwidth = nports * 56000;
697712
break;
698713
case AD_LINK_SPEED_100000MBPS:
699-
bandwidth = aggregator->num_of_ports * 100000;
714+
bandwidth = nports * 100000;
700715
break;
701716
default:
702717
bandwidth = 0; /* to silence the compiler */
@@ -1530,10 +1545,10 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
15301545

15311546
switch (__get_agg_selection_mode(curr->lag_ports)) {
15321547
case BOND_AD_COUNT:
1533-
if (curr->num_of_ports > best->num_of_ports)
1548+
if (__agg_active_ports(curr) > __agg_active_ports(best))
15341549
return curr;
15351550

1536-
if (curr->num_of_ports < best->num_of_ports)
1551+
if (__agg_active_ports(curr) < __agg_active_ports(best))
15371552
return best;
15381553

15391554
/*FALLTHROUGH*/
@@ -1561,8 +1576,14 @@ static int agg_device_up(const struct aggregator *agg)
15611576
if (!port)
15621577
return 0;
15631578

1564-
return netif_running(port->slave->dev) &&
1565-
netif_carrier_ok(port->slave->dev);
1579+
for (port = agg->lag_ports; port;
1580+
port = port->next_port_in_aggregator) {
1581+
if (netif_running(port->slave->dev) &&
1582+
netif_carrier_ok(port->slave->dev))
1583+
return 1;
1584+
}
1585+
1586+
return 0;
15661587
}
15671588

15681589
/**
@@ -1610,7 +1631,7 @@ static void ad_agg_selection_logic(struct aggregator *agg,
16101631

16111632
agg->is_active = 0;
16121633

1613-
if (agg->num_of_ports && agg_device_up(agg))
1634+
if (__agg_active_ports(agg) && agg_device_up(agg))
161416 57AE 35
best = ad_agg_selection_test(best, agg);
16151636
}
16161637

@@ -1622,7 +1643,7 @@ static void ad_agg_selection_logic(struct aggregator *agg,
16221643
* answering partner.
16231644
*/
16241645
if (active && active->lag_ports &&
1625-
active->lag_ports->is_enabled &&
1646+
__agg_active_ports(active) &&
16261647
(__agg_has_partner(active) ||
16271648
(!__agg_has_partner(active) &&
16281649
!__agg_has_partner(best)))) {
@@ -2133,7 +2154,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
21332154
else
21342155
temp_aggregator->lag_ports = temp_port->next_port_in_aggregator;
21352156
temp_aggregator->num_of_ports--;
2136-
if (temp_aggregator->num_of_ports == 0) {
2157+
if (__agg_active_ports(temp_aggregator) == 0) {
21372158
select_new_active_agg = temp_aggregator->is_active;
21382159
ad_clear_agg(temp_aggregator);
21392160
if (select_new_active_agg) {
@@ -2432,7 +2453,9 @@ void bond_3ad_adapter_speed_duplex_changed(struct slave *slave)
24322453
*/
24332454
void bond_3ad_handle_link_change(struct slave *slave, char link)
24342455
{
2456+
struct aggregator *agg;
24352457
struct port *port;
2458+
bool dummy;
24362459

24372460
port = &(SLAVE_AD_INFO(slave)->port);
24382461

@@ -2459,6 +2482,9 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
24592482
port->is_enabled = false;
24602483
ad_update_actor_keys(port, true);
24612484
}
2485+
agg = __get_first_agg(port);
2486+
ad_agg_selection_logic(agg, &dummy);
2487+
24622488
netdev_dbg(slave->bond->dev, "Port %d changed link status to %s\n",
24632489
port->actor_port_number,
24642490
link == BOND_LINK_UP ? "UP" : "DOWN");
@@ -2499,7 +2525,7 @@ int bond_3ad_set_carrier(struct bonding *bond)
24992525
active = __get_active_agg(&(SLAVE_AD_INFO(first_slave)->aggregator));
25002526
if (active) {
25012527
/* are enough slaves available to consider link up? */
2502-
if (active->num_of_ports < bond->params.min_links) {
2528+
if (__agg_active_ports(active) < bond->params.min_links) {
25032529
if (netif_carrier_ok(bond->dev)) {
25042530
netif_carrier_off(bond->dev);
25052531
goto out;

drivers/net/can/at91_can.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,10 @@ static int at91_poll_rx(struct net_device *dev, int quota)
712712

713713
/* upper group completed, look again in lower */
714714
if (priv->rx_next > get_mb_rx_low_last(priv) &&
715-
quota > 0 && mb > get_mb_rx_last(priv)) {
715+
mb > get_mb_rx_last(priv)) {
716716
priv->rx_next = get_mb_rx_first(priv);
717-
goto again;
717+
if (quota > 0)
718+
goto again;
718719
}
719720

720721
return received;

0 commit comments

Comments
 (0)
0