Daniel Borkmann
c540594f86
bpf, mlx4: fix prog refcount in mlx4_en_try_alloc_resources error path
...
Commit 67f8b1dcb9 ("net/mlx4_en: Refactor the XDP forwarding rings
scheme") added a bug in that the prog's reference count is not dropped
in the error path when mlx4_en_try_alloc_resources() is failing from
mlx4_xdp_set().
We previously took bpf_prog_add(prog, priv->rx_ring_num - 1), that we
need to release again. Earlier in the call path, dev_change_xdp_fd()
itself holds a reference to the prog as well (hence the '- 1' in the
bpf_prog_add()), so a simple atomic_sub() is safe to use here. When
an error is propagated, then bpf_prog_put() is called eventually from
dev_change_xdp_fd()
Fixes: 67f8b1dcb9 ("net/mlx4_en: Refactor the XDP forwarding rings scheme")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Acked-by: Alexei Starovoitov <ast@kernel.org >
Signed-off-by: David S. Miller <davem@davemloft.net >
2016-11-12 23:31:57 -05:00
..
2016-11-12 23:31:57 -05:00
2016-10-11 15:06:32 -07:00
2016-02-22 08:51:37 +01:00
2016-10-28 16:27:16 -07:00
2016-07-15 14:54:27 +09:00
2016-10-21 10:21:38 +02:00
2016-08-26 14:42:08 +02:00
2016-09-22 15:25:56 +02:00
2016-10-24 14:38:02 +02:00
2016-10-19 09:11:24 -07:00
2016-10-15 10:03:15 -07:00
2016-10-28 10:12:27 -07:00
2016-10-25 16:32:50 +02:00
2016-10-22 17:05:52 -04:00
2015-10-21 15:18:35 +01:00
2015-04-11 22:27:55 -04:00
2015-11-19 17:51:48 +01:00
2016-01-22 18:04:28 -05:00
2016-04-04 09:46:47 -04:00
2016-09-01 15:55:56 -07:00
2016-10-04 14:21:41 -07:00
2016-07-29 17:54:17 -07:00
2016-06-27 11:01:00 -04:00
2016-10-04 14:21:41 -07:00
2016-06-06 20:16:18 +10:00
2015-12-03 10:24:08 -05:00
2016-06-21 15:03:36 -04:00
2016-10-14 12:18:50 -07:00
2015-06-04 23:57:18 +02:00
2015-11-24 09:56:43 +01:00
2015-09-03 02:42:20 +02:00
2016-10-16 11:09:32 +02:00
2016-10-14 12:18:50 -07:00
2016-06-30 18:05:09 -05:00
2016-01-14 16:00:49 -08:00
2015-04-12 21:03:31 +02:00
2016-10-07 18:46:28 -07:00
2015-09-10 13:29:01 -07:00
2016-10-15 10:03:15 -07:00
2016-07-28 16:07:41 -07:00
2016-01-20 17:09:18 -08:00
2016-09-05 17:20:18 +02:00
2016-10-07 18:46:30 -07:00
2016-10-11 15:06:33 -07:00
2015-11-23 09:44:58 +01:00
2016-08-05 09:00:54 -04:00
2016-03-15 16:55:16 -07:00
2016-01-20 17:09:18 -08:00
2015-05-12 09:46:00 +02:00
2016-10-27 18:43:42 -07:00
2016-08-02 19:35:31 -04:00
2016-09-01 17:52:01 -07:00
2016-01-20 17:09:18 -08:00
2016-08-02 19:35:27 -04:00
2015-10-23 17:55:10 +09:00
2016-10-11 15:06:31 -07:00
2016-08-02 19:35:30 -04:00
2016-10-11 15:06:33 -07:00
2016-02-09 11:54:23 +01:00
2016-08-08 13:18:58 -05:00
2015-09-11 15:21:34 -07:00
2016-09-09 17:34:46 -07:00
2016-04-11 22:43:43 +01:00
2016-08-26 14:42:08 +02:00
2015-09-01 08:40:25 -07:00
2016-02-16 13:04:58 -05:00
2016-09-19 21:44:30 +02:00
2016-10-11 15:06:32 -07:00
2015-11-09 15:53:39 -08:00
2016-09-22 20:00:36 -05:00
2016-05-27 15:26:11 -07:00
2016-07-15 10:41:42 +02:00
2016-10-19 08:31:25 -07:00
2015-09-10 13:29:01 -07:00
2016-10-11 15:06:32 -07:00
2016-04-14 12:56:09 -07:00
2016-08-30 16:12:46 -07:00
2016-09-14 21:28:11 +02:00
2016-09-22 14:49:10 +02:00
2016-10-11 15:06:33 -07:00
2016-03-01 20:36:56 +01:00
2016-10-21 15:45:47 -06:00
2016-10-03 13:39:00 -07:00
2016-09-13 14:41:36 +02:00
2016-05-23 17:04:14 -07:00
2016-05-20 17:58:30 -07:00
2016-10-10 13:04:49 -07:00
2016-08-02 19:35:02 -04:00
2016-10-27 16:16:09 -04:00
2016-08-22 10:01:49 -07:00
2016-03-22 15:36:02 -07:00
2016-02-29 09:53:09 +01:00
2016-08-31 07:28:35 -05:00
2016-10-07 18:46:30 -07:00
2016-09-05 13:52:39 +02:00
2016-09-22 20:00:36 -05:00
2016-09-22 20:00:36 -05:00
2016-07-10 20:58:36 +02:00
2016-03-02 10:28:47 -05:00
2016-10-11 15:06:33 -07:00