Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 3/8] bpf: reset id on CONST_IMM transition
From: Daniel Borkmann @ 2017-06-10 22:50 UTC (permalink / raw)
  To: davem; +Cc: ast, netdev, Daniel Borkmann
In-Reply-To: <cover.1497133948.git.daniel@iogearbox.net>

Whenever we set the register to the type CONST_IMM, we currently don't
reset the id to 0. id member is not used in CONST_IMM case, so don't
let it become stale, where pruning won't be able to match later on.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
---
 kernel/bpf/verifier.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index d031b3b..d195d82 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -1952,6 +1952,7 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)
 			 */
 			regs[insn->dst_reg].type = CONST_IMM;
 			regs[insn->dst_reg].imm = insn->imm;
+			regs[insn->dst_reg].id = 0;
 			regs[insn->dst_reg].max_value = insn->imm;
 			regs[insn->dst_reg].min_value = insn->imm;
 			regs[insn->dst_reg].min_align = calc_align(insn->imm);
@@ -2409,6 +2410,7 @@ static int check_ld_imm(struct bpf_verifier_env *env, struct bpf_insn *insn)
 
 		regs[insn->dst_reg].type = CONST_IMM;
 		regs[insn->dst_reg].imm = imm;
+		regs[insn->dst_reg].id = 0;
 		return 0;
 	}
 
-- 
1.9.3

^ permalink raw reply related

* [PATCH net-next 1/8] bpf: avoid excessive stack usage for perf_sample_data
From: Daniel Borkmann @ 2017-06-10 22:50 UTC (permalink / raw)
  To: davem; +Cc: ast, netdev, Daniel Borkmann
In-Reply-To: <cover.1497133948.git.daniel@iogearbox.net>

perf_sample_data consumes 386 bytes on stack, reduce excessive stack
usage and move it to per cpu buffer. It's allowed due to preemption
being disabled for tracing, xdp and tc programs, thus at all times
only one program can run on a specific CPU and programs cannot run
from interrupt. We similarly also handle bpf_pt_regs.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
---
 kernel/trace/bpf_trace.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 08eb072..051d7fc 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -266,14 +266,16 @@ const struct bpf_func_proto *bpf_get_trace_printk_proto(void)
 	.arg2_type	= ARG_ANYTHING,
 };
 
+static DEFINE_PER_CPU(struct perf_sample_data, bpf_sd);
+
 static __always_inline u64
 __bpf_perf_event_output(struct pt_regs *regs, struct bpf_map *map,
 			u64 flags, struct perf_raw_record *raw)
 {
 	struct bpf_array *array = container_of(map, struct bpf_array, map);
+	struct perf_sample_data *sd = this_cpu_ptr(&bpf_sd);
 	unsigned int cpu = smp_processor_id();
 	u64 index = flags & BPF_F_INDEX_MASK;
-	struct perf_sample_data sample_data;
 	struct bpf_event_entry *ee;
 	struct perf_event *event;
 
@@ -294,9 +296,9 @@ const struct bpf_func_proto *bpf_get_trace_printk_proto(void)
 	if (unlikely(event->oncpu != cpu))
 		return -EOPNOTSUPP;
 
-	perf_sample_data_init(&sample_data, 0, 0);
-	sample_data.raw = raw;
-	perf_event_output(event, &sample_data, regs);
+	perf_sample_data_init(sd, 0, 0);
+	sd->raw = raw;
+	perf_event_output(event, sd, regs);
 	return 0;
 }
 
-- 
1.9.3

^ permalink raw reply related

* [PATCH net-next 0/8] Misc BPF updates
From: Daniel Borkmann @ 2017-06-10 22:50 UTC (permalink / raw)
  To: davem; +Cc: ast, netdev, Daniel Borkmann

This set contains a couple of misc updates: stack usage reduction
for perf_sample_data in tracing progs, reduction of stale data in
verifier on register state transitions that I still had in my queue
and few selftest improvements as well as bpf_set_hash() helper for
tc programs.

Thanks!

Daniel Borkmann (8):
  bpf: avoid excessive stack usage for perf_sample_data
  bpf: don't check spilled reg state for non-STACK_SPILLed type slots
  bpf: reset id on CONST_IMM transition
  bpf: reset id on spilled regs in clear_all_pkt_pointers
  bpf, tests: add a test for htab lookup + update traversal
  bpf, tests: set rlimit also for test_align, so it doesn't fail
  bpf: remove cg_skb_func_proto and use sk_filter_func_proto directly
  bpf: add bpf_set_hash helper for tc progs

 include/uapi/linux/bpf.h                 |  8 ++++-
 kernel/bpf/verifier.c                    |  8 +++--
 kernel/trace/bpf_trace.c                 | 10 ++++---
 net/core/filter.c                        | 28 +++++++++++++-----
 tools/include/uapi/linux/bpf.h           |  8 ++++-
 tools/testing/selftests/bpf/test_align.c |  5 ++++
 tools/testing/selftests/bpf/test_maps.c  | 50 ++++++++++++++++++++++++++++++++
 7 files changed, 102 insertions(+), 15 deletions(-)

-- 
1.9.3

^ permalink raw reply

* [PATCH net-next 2/8] bpf: don't check spilled reg state for non-STACK_SPILLed type slots
From: Daniel Borkmann @ 2017-06-10 22:50 UTC (permalink / raw)
  To: davem; +Cc: ast, netdev, Daniel Borkmann
In-Reply-To: <cover.1497133948.git.daniel@iogearbox.net>

spilled_regs[] state is only used for stack slots of type STACK_SPILL,
never for STACK_MISC. Right now, in states_equal(), even if we have
old and current stack state of type STACK_MISC, we compare spilled_regs[]
for that particular offset. Just skip these like we do everywhere else.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
---
 kernel/bpf/verifier.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 14ccb07..d031b3b 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -2828,6 +2828,8 @@ static bool states_equal(struct bpf_verifier_env *env,
 			return false;
 		if (i % BPF_REG_SIZE)
 			continue;
+		if (old->stack_slot_type[i] != STACK_SPILL)
+			continue;
 		if (memcmp(&old->spilled_regs[i / BPF_REG_SIZE],
 			   &cur->spilled_regs[i / BPF_REG_SIZE],
 			   sizeof(old->spilled_regs[0])))
-- 
1.9.3

^ permalink raw reply related

* Re: [PATCH v2 0/2] net: mvpp2: driver fixes
From: David Miller @ 2017-06-10 22:23 UTC (permalink / raw)
  To: thomas.petazzoni
  Cc: netdev, marc.zyngier, jason, andrew, sebastian.hesselbarth,
	gregory.clement, antoine.tenart, nadavh, hannah, yehuday, mw
In-Reply-To: <20170610211822.24371-1-thomas.petazzoni@free-electrons.com>

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Sat, 10 Jun 2017 23:18:20 +0200

> As requested, here is a series of patches containing only bug fixes
> for the mvpp2 driver. It is based on the latest "net" branch.
> 
> Changes since v1:
> 
>  - Fixed a build breakage that occurred when only PATCH 1 was only,
>    and not later patches in the series. Was reported by the kbuild
>    report on the first submission.
> 
>  - Added Tested-by from Marc Zyngier on PATCH 2.

Series applied, thank you.

^ permalink raw reply

* Re: [PATCH] net: tipc: Fix a sleep-in-atomic bug in tipc_msg_reverse
From: David Miller @ 2017-06-10 22:21 UTC (permalink / raw)
  To: baijiaju1990; +Cc: jon.maloy, tipc-discussion, linux-kernel, netdev
In-Reply-To: <1497085415-630-1-git-send-email-baijiaju1990@163.com>

From: Jia-Ju Bai <baijiaju1990@163.com>
Date: Sat, 10 Jun 2017 17:03:35 +0800

> The kernel may sleep under a rcu read lock in tipc_msg_reverse, and the
> function call path is:
> tipc_l2_rcv_msg (acquire the lock by rcu_read_lock)
>   tipc_rcv
>     tipc_sk_rcv
>       tipc_msg_reverse
>         pskb_expand_head(GFP_KERNEL) --> may sleep
> tipc_node_broadcast
>   tipc_node_xmit_skb
>     tipc_node_xmit
>       tipc_sk_rcv
>         tipc_msg_reverse
>           pskb_expand_head(GFP_KERNEL) --> may sleep
> 
> To fix it, "GFP_KERNEL" is replaced with "GFP_ATOMIC".
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>

Applied and queued up for -stable.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply

* Re: [PATCH] net: caif: Fix a sleep-in-atomic bug in cfpkt_create_pfx
From: David Miller @ 2017-06-10 22:21 UTC (permalink / raw)
  To: baijiaju1990; +Cc: dmitry.tarnyagin, netdev, linux-kernel
In-Reply-To: <1497084579-32434-1-git-send-email-baijiaju1990@163.com>

From: Jia-Ju Bai <baijiaju1990@163.com>
Date: Sat, 10 Jun 2017 16:49:39 +0800

> The kernel may sleep under a rcu read lock in cfpkt_create_pfx, and the
> function call path is:
> cfcnfg_linkup_rsp (acquire the lock by rcu_read_lock)
>   cfctrl_linkdown_req
>     cfpkt_create
>       cfpkt_create_pfx
>         alloc_skb(GFP_KERNEL) --> may sleep
> cfserl_receive (acquire the lock by rcu_read_lock)
>   cfpkt_split
>     cfpkt_create_pfx
>       alloc_skb(GFP_KERNEL) --> may sleep
> 
> There is "in_interrupt" in cfpkt_create_pfx to decide use "GFP_KERNEL" or
> "GFP_ATOMIC". In this situation, "GFP_KERNEL" is used because the function 
> is called under a rcu read lock, instead in interrupt.
> 
> To fix it, only "GFP_ATOMIC" is used in cfpkt_create_pfx.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>

Applied and queued up for -stable.

^ permalink raw reply

* [PATCH v2 2/2] net: mvpp2: use {get,put}_cpu() instead of smp_processor_id()
From: Thomas Petazzoni @ 2017-06-10 21:18 UTC (permalink / raw)
  To: David S. Miller, netdev
  Cc: Marc Zyngier, Jason Cooper, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Antoine Tenart, Nadav Haklai, Hanna Hawa,
	Yehuda Yitschak, Marcin Wojtas, Thomas Petazzoni
In-Reply-To: <20170610211822.24371-1-thomas.petazzoni@free-electrons.com>

smp_processor_id() should not be used in migration-enabled contexts. We
originally thought it was OK in the specific situation of this driver,
but it was wrong, and calling smp_processor_id() in a migration-enabled
context prints a big fat warning when CONFIG_DEBUG_PREEMPT=y.

Therefore, this commit replaces the smp_processor_id() in
migration-enabled contexts by the appropriate get_cpu/put_cpu sections.

Reported-by: Marc Zyngier <marc.zyngier@arm.com>
Fixes: a786841df72e ("net: mvpp2: handle register mapping and access for PPv2.2")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 5841e53..33c9016 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -3719,7 +3719,7 @@ static void mvpp2_bm_bufs_get_addrs(struct device *dev, struct mvpp2 *priv,
 				    dma_addr_t *dma_addr,
 				    phys_addr_t *phys_addr)
 {
-	int cpu = smp_processor_id();
+	int cpu = get_cpu();
 
 	*dma_addr = mvpp2_percpu_read(priv, cpu,
 				      MVPP2_BM_PHY_ALLOC_REG(bm_pool->id));
@@ -3740,6 +3740,8 @@ static void mvpp2_bm_bufs_get_addrs(struct device *dev, struct mvpp2 *priv,
 		if (sizeof(phys_addr_t) == 8)
 			*phys_addr |= (u64)phys_addr_highbits << 32;
 	}
+
+	put_cpu();
 }
 
 /* Free all buffers from the pool */
@@ -3925,7 +3927,7 @@ static inline void mvpp2_bm_pool_put(struct mvpp2_port *port, int pool,
 				     dma_addr_t buf_dma_addr,
 				     phys_addr_t buf_phys_addr)
 {
-	int cpu = smp_processor_id();
+	int cpu = get_cpu();
 
 	if (port->priv->hw_version == MVPP22) {
 		u32 val = 0;
@@ -3952,6 +3954,8 @@ static inline void mvpp2_bm_pool_put(struct mvpp2_port *port, int pool,
 			   MVPP2_BM_VIRT_RLS_REG, buf_phys_addr);
 	mvpp2_percpu_write(port->priv, cpu,
 			   MVPP2_BM_PHY_RLS_REG(pool), buf_dma_addr);
+
+	put_cpu();
 }
 
 /* Refill BM pool */
@@ -4732,7 +4736,7 @@ static void mvpp2_txp_max_tx_size_set(struct mvpp2_port *port)
 static void mvpp2_rx_pkts_coal_set(struct mvpp2_port *port,
 				   struct mvpp2_rx_queue *rxq)
 {
-	int cpu = smp_processor_id();
+	int cpu = get_cpu();
 
 	if (rxq->pkts_coal > MVPP2_OCCUPIED_THRESH_MASK)
 		rxq->pkts_coal = MVPP2_OCCUPIED_THRESH_MASK;
@@ -4740,6 +4744,8 @@ static void mvpp2_rx_pkts_coal_set(struct mvpp2_port *port,
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_NUM_REG, rxq->id);
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_THRESH_REG,
 			   rxq->pkts_coal);
+
+	put_cpu();
 }
 
 static u32 mvpp2_usec_to_cycles(u32 usec, unsigned long clk_hz)
@@ -4920,7 +4926,7 @@ static int mvpp2_rxq_init(struct mvpp2_port *port,
 	mvpp2_write(port->priv, MVPP2_RXQ_STATUS_REG(rxq->id), 0);
 
 	/* Set Rx descriptors queue starting address - indirect access */
-	cpu = smp_processor_id();
+	cpu = get_cpu();
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_NUM_REG, rxq->id);
 	if (port->priv->hw_version == MVPP21)
 		rxq_dma = rxq->descs_dma;
@@ -4929,6 +4935,7 @@ static int mvpp2_rxq_init(struct mvpp2_port *port,
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_ADDR_REG, rxq_dma);
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_SIZE_REG, rxq->size);
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_INDEX_REG, 0);
+	put_cpu();
 
 	/* Set Offset */
 	mvpp2_rxq_offset_set(port, rxq->id, NET_SKB_PAD);
@@ -4991,10 +4998,11 @@ static void mvpp2_rxq_deinit(struct mvpp2_port *port,
 	 * free descriptor number
 	 */
 	mvpp2_write(port->priv, MVPP2_RXQ_STATUS_REG(rxq->id), 0);
-	cpu = smp_processor_id();
+	cpu = get_cpu();
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_NUM_REG, rxq->id);
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_ADDR_REG, 0);
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_SIZE_REG, 0);
+	put_cpu();
 }
 
 /* Create and initialize a Tx queue */
@@ -5017,7 +5025,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
 	txq->last_desc = txq->size - 1;
 
 	/* Set Tx descriptors queue starting address - indirect access */
-	cpu = smp_processor_id();
+	cpu = get_cpu();
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_NUM_REG, txq->id);
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_DESC_ADDR_REG,
 			   txq->descs_dma);
@@ -5042,6 +5050,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_PREF_BUF_REG,
 			   MVPP2_PREF_BUF_PTR(desc) | MVPP2_PREF_BUF_SIZE_16 |
 			   MVPP2_PREF_BUF_THRESH(desc_per_txq / 2));
+	put_cpu();
 
 	/* WRR / EJP configuration - indirect access */
 	tx_port_num = mvpp2_egress_port(port);
@@ -5112,10 +5121,11 @@ static void mvpp2_txq_deinit(struct mvpp2_port *port,
 	mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_CNTR_REG(txq->id), 0);
 
 	/* Set Tx descriptors queue starting address and size */
-	cpu = smp_processor_id();
+	cpu = get_cpu();
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_NUM_REG, txq->id);
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_DESC_ADDR_REG, 0);
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_DESC_SIZE_REG, 0);
+	put_cpu();
 }
 
 /* Cleanup Tx ports */
@@ -5125,7 +5135,7 @@ static void mvpp2_txq_clean(struct mvpp2_port *port, struct mvpp2_tx_queue *txq)
 	int delay, pending, cpu;
 	u32 val;
 
-	cpu = smp_processor_id();
+	cpu = get_cpu();
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_NUM_REG, txq->id);
 	val = mvpp2_percpu_read(port->priv, cpu, MVPP2_TXQ_PREF_BUF_REG);
 	val |= MVPP2_TXQ_DRAIN_EN_MASK;
@@ -5152,6 +5162,7 @@ static void mvpp2_txq_clean(struct mvpp2_port *port, struct mvpp2_tx_queue *txq)
 
 	val &= ~MVPP2_TXQ_DRAIN_EN_MASK;
 	mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_PREF_BUF_REG, val);
+	put_cpu();
 
 	for_each_present_cpu(cpu) {
 		txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
-- 
2.9.4

^ permalink raw reply related

* [PATCH v2 1/2] net: mvpp2: remove mvpp2_bm_cookie_{build,pool_get}
From: Thomas Petazzoni @ 2017-06-10 21:18 UTC (permalink / raw)
  To: David S. Miller, netdev
  Cc: Marc Zyngier, Jason Cooper, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Antoine Tenart, Nadav Haklai, Hanna Hawa,
	Yehuda Yitschak, Marcin Wojtas, Thomas Petazzoni
In-Reply-To: <20170610211822.24371-1-thomas.petazzoni@free-electrons.com>

This commit removes the useless remove
mvpp2_bm_cookie_{build,pool_get} functions. All what
mvpp2_bm_cookie_build() was doing is compute a 32-bit value by
concatenating the pool number and the CPU number... only to get the pool
number re-extracted by mvpp2_bm_cookie_pool_get() later on.

Instead, just get the pool number directly from RX descriptor status,
and pass it to mvpp2_pool_refill() and mvpp2_rx_refill().

This has the added benefit of dropping a smp_processor_id() call in a
migration-enabled context, which is wrong, and is the original
motivation for making this change.

Fixes: 3f518509dedc9 ("ethernet: Add new driver for Marvell Armada 375 network unit")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 47 +++++++++++-------------------------
 1 file changed, 14 insertions(+), 33 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 70bca2a..5841e53 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -3920,12 +3920,6 @@ static inline u32 mvpp2_bm_cookie_pool_set(u32 cookie, int pool)
 	return bm;
 }
 
-/* Get pool number from a BM cookie */
-static inline int mvpp2_bm_cookie_pool_get(unsigned long cookie)
-{
-	return (cookie >> MVPP2_BM_COOKIE_POOL_OFFS) & 0xFF;
-}
-
 /* Release buffer to BM */
 static inline void mvpp2_bm_pool_put(struct mvpp2_port *port, int pool,
 				     dma_addr_t buf_dma_addr,
@@ -3961,12 +3955,10 @@ static inline void mvpp2_bm_pool_put(struct mvpp2_port *port, int pool,
 }
 
 /* Refill BM pool */
-static void mvpp2_pool_refill(struct mvpp2_port *port, u32 bm,
+static void mvpp2_pool_refill(struct mvpp2_port *port, int pool,
 			      dma_addr_t dma_addr,
 			      phys_addr_t phys_addr)
 {
-	int pool = mvpp2_bm_cookie_pool_get(bm);
-
 	mvpp2_bm_pool_put(port, pool, dma_addr, phys_addr);
 }
 
@@ -4513,21 +4505,6 @@ static void mvpp2_rxq_offset_set(struct mvpp2_port *port,
 	mvpp2_write(port->priv, MVPP2_RXQ_CONFIG_REG(prxq), val);
 }
 
-/* Obtain BM cookie information from descriptor */
-static u32 mvpp2_bm_cookie_build(struct mvpp2_port *port,
-				 struct mvpp2_rx_desc *rx_desc)
-{
-	int cpu = smp_processor_id();
-	int pool;
-
-	pool = (mvpp2_rxdesc_status_get(port, rx_desc) &
-		MVPP2_RXD_BM_POOL_ID_MASK) >>
-		MVPP2_RXD_BM_POOL_ID_OFFS;
-
-	return ((pool & 0xFF) << MVPP2_BM_COOKIE_POOL_OFFS) |
-	       ((cpu & 0xFF) << MVPP2_BM_COOKIE_CPU_OFFS);
-}
-
 /* Tx descriptors helper methods */
 
 /* Get pointer to next Tx descriptor to be processed (send) by HW */
@@ -4978,9 +4955,13 @@ static void mvpp2_rxq_drop_pkts(struct mvpp2_port *port,
 
 	for (i = 0; i < rx_received; i++) {
 		struct mvpp2_rx_desc *rx_desc = mvpp2_rxq_next_desc_get(rxq);
-		u32 bm = mvpp2_bm_cookie_build(port, rx_desc);
+		u32 status = mvpp2_rxdesc_status_get(port, rx_desc);
+		int pool;
+
+		pool = (status & MVPP2_RXD_BM_POOL_ID_MASK) >>
+			MVPP2_RXD_BM_POOL_ID_OFFS;
 
-		mvpp2_pool_refill(port, bm,
+		mvpp2_pool_refill(port, pool,
 				  mvpp2_rxdesc_dma_addr_get(port, rx_desc),
 				  mvpp2_rxdesc_cookie_get(port, rx_desc));
 	}
@@ -5418,7 +5399,7 @@ static void mvpp2_rx_csum(struct mvpp2_port *port, u32 status,
 
 /* Reuse skb if possible, or allocate a new skb and add it to BM pool */
 static int mvpp2_rx_refill(struct mvpp2_port *port,
-			   struct mvpp2_bm_pool *bm_pool, u32 bm)
+			   struct mvpp2_bm_pool *bm_pool, int pool)
 {
 	dma_addr_t dma_addr;
 	phys_addr_t phys_addr;
@@ -5430,7 +5411,7 @@ static int mvpp2_rx_refill(struct mvpp2_port *port,
 	if (!buf)
 		return -ENOMEM;
 
-	mvpp2_pool_refill(port, bm, dma_addr, phys_addr);
+	mvpp2_pool_refill(port, pool, dma_addr, phys_addr);
 
 	return 0;
 }
@@ -5488,7 +5469,7 @@ static int mvpp2_rx(struct mvpp2_port *port, int rx_todo,
 		unsigned int frag_size;
 		dma_addr_t dma_addr;
 		phys_addr_t phys_addr;
-		u32 bm, rx_status;
+		u32 rx_status;
 		int pool, rx_bytes, err;
 		void *data;
 
@@ -5500,8 +5481,8 @@ static int mvpp2_rx(struct mvpp2_port *port, int rx_todo,
 		phys_addr = mvpp2_rxdesc_cookie_get(port, rx_desc);
 		data = (void *)phys_to_virt(phys_addr);
 
-		bm = mvpp2_bm_cookie_build(port, rx_desc);
-		pool = mvpp2_bm_cookie_pool_get(bm);
+		pool = (rx_status & MVPP2_RXD_BM_POOL_ID_MASK) >>
+			MVPP2_RXD_BM_POOL_ID_OFFS;
 		bm_pool = &port->priv->bm_pools[pool];
 
 		/* In case of an error, release the requested buffer pointer
@@ -5514,7 +5495,7 @@ static int mvpp2_rx(struct mvpp2_port *port, int rx_todo,
 			dev->stats.rx_errors++;
 			mvpp2_rx_error(port, rx_desc);
 			/* Return the buffer to the pool */
-			mvpp2_pool_refill(port, bm, dma_addr, phys_addr);
+			mvpp2_pool_refill(port, pool, dma_addr, phys_addr);
 			continue;
 		}
 
@@ -5529,7 +5510,7 @@ static int mvpp2_rx(struct mvpp2_port *port, int rx_todo,
 			goto err_drop_frame;
 		}
 
-		err = mvpp2_rx_refill(port, bm_pool, bm);
+		err = mvpp2_rx_refill(port, bm_pool, pool);
 		if (err) {
 			netdev_err(port->dev, "failed to refill BM pools\n");
 			goto err_drop_frame;
-- 
2.9.4

^ permalink raw reply related

* [PATCH v2 0/2] net: mvpp2: driver fixes
From: Thomas Petazzoni @ 2017-06-10 21:18 UTC (permalink / raw)
  To: David S. Miller, netdev
  Cc: Marc Zyngier, Jason Cooper, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Antoine Tenart, Nadav Haklai, Hanna Hawa,
	Yehuda Yitschak, Marcin Wojtas, Thomas Petazzoni

Hello,

As requested, here is a series of patches containing only bug fixes
for the mvpp2 driver. It is based on the latest "net" branch.

Changes since v1:

 - Fixed a build breakage that occurred when only PATCH 1 was only,
   and not later patches in the series. Was reported by the kbuild
   report on the first submission.

 - Added Tested-by from Marc Zyngier on PATCH 2.

Thanks!

Thomas

Thomas Petazzoni (2):
  net: mvpp2: remove mvpp2_bm_cookie_{build,pool_get}
  net: mvpp2: use {get,put}_cpu() instead of smp_processor_id()

 drivers/net/ethernet/marvell/mvpp2.c | 74 ++++++++++++++++--------------------
 1 file changed, 33 insertions(+), 41 deletions(-)

-- 
2.9.4

^ permalink raw reply

* (unknown), 
From: morice.diane @ 2017-06-10 21:03 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: 6681956269.zip --]
[-- Type: application/zip, Size: 3204 bytes --]

^ permalink raw reply

* Re: [PATCH] net: fec: Add a fec_enet_clear_ethtool_stats() stub for CONFIG_M5272
From: David Miller @ 2017-06-10 20:45 UTC (permalink / raw)
  To: festevam
  Cc: fugang.duan, andrew, cphealy, netdev, paul.gortmaker,
	fabio.estevam
In-Reply-To: <CAOMZO5A8hv2+kr_aFQyfA=MFLGbcHwTLtdXBHhRNc_tQpDkBeA@mail.gmail.com>

From: Fabio Estevam <festevam@gmail.com>
Date: Sat, 10 Jun 2017 17:33:01 -0300

> On Sat, Jun 10, 2017 at 5:16 PM, David Miller <davem@davemloft.net> wrote:
>> From: Fabio Estevam <festevam@gmail.com>
>> Date: Fri,  9 Jun 2017 22:37:22 -0300
>>
>>> From: Fabio Estevam <fabio.estevam@nxp.com>
>>>
>>> Commit 2b30842b23b9 ("net: fec: Clear and enable MIB counters on imx51")
>>> introduced fec_enet_clear_ethtool_stats(), but missed to add a stub
>>> for the CONFIG_M5272=y case, causing build failure for the
>>> m5272c3_defconfig.
>>>
>>> Add the missing empty stub to fix the build failure.
>>>
>>> Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>>> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
>>
>> Applied, thanks.
> 
> I should have marked net-next in the Subject.
> 
> Commit 2b30842b23b9 ("net: fec: Clear and enable MIB counters on
> imx51") is in net-next, so this one should go to net-next, not to net.
> 
> Sorry about that.

Ok, reverted from 'net' and applied to 'net-next' with an appropriate
Fixes: tag added.

Thanks.

^ permalink raw reply

* Re: [PATCH] net: fec: Add a fec_enet_clear_ethtool_stats() stub for CONFIG_M5272
From: Fabio Estevam @ 2017-06-10 20:33 UTC (permalink / raw)
  To: David Miller
  Cc: Fugang Duan, Andrew Lunn, Chris Healy, netdev@vger.kernel.org,
	Paul Gortmaker, Fabio Estevam
In-Reply-To: <20170610.161649.2086289606620760235.davem@davemloft.net>

On Sat, Jun 10, 2017 at 5:16 PM, David Miller <davem@davemloft.net> wrote:
> From: Fabio Estevam <festevam@gmail.com>
> Date: Fri,  9 Jun 2017 22:37:22 -0300
>
>> From: Fabio Estevam <fabio.estevam@nxp.com>
>>
>> Commit 2b30842b23b9 ("net: fec: Clear and enable MIB counters on imx51")
>> introduced fec_enet_clear_ethtool_stats(), but missed to add a stub
>> for the CONFIG_M5272=y case, causing build failure for the
>> m5272c3_defconfig.
>>
>> Add the missing empty stub to fix the build failure.
>>
>> Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
>
> Applied, thanks.

I should have marked net-next in the Subject.

Commit 2b30842b23b9 ("net: fec: Clear and enable MIB counters on
imx51") is in net-next, so this one should go to net-next, not to net.

Sorry about that.

^ permalink raw reply

* [PATCH net v3] net: ipmr: Fix some mroute forwarding issues in vrf's
From: Donald Sharp @ 2017-06-10 20:30 UTC (permalink / raw)
  To: netdev, dsahern, Thomas.Winter, nikolay, yotamg, idosch, roopa

This patch fixes two issues:

1) When forwarding on *,G mroutes that are in a vrf, the
kernel was dropping information about the actual incoming
interface when calling ip_mr_forward from ip_mr_input.
This caused ip_mr_forward to send the multicast packet
back out the incoming interface.  Fix this by
modifying ip_mr_forward to be handed the correctly
resolved dev.

2) When a unresolved cache entry is created we store
the incoming skb on the unresolved cache entry and
upon mroute resolution from the user space daemon,
we attempt to forward the packet.  Again we were
not resolving to the correct incoming device for
a vrf scenario, before calling ip_mr_forward.
Fix this by resolving to the correct interface
and calling ip_mr_forward with the result.

Fixes: e58e41596811 ("net: Enable support for VRF with ipv4 multicast")
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
---
v2: Fixed title
v3: Addressed Review comments by Andrew Lunn and David Ahern

 net/ipv4/ipmr.c | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 551de4d..09368a1 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -101,8 +101,8 @@ static struct mr_table *ipmr_new_table(struct net *net, u32 id);
 static void ipmr_free_table(struct mr_table *mrt);
 
 static void ip_mr_forward(struct net *net, struct mr_table *mrt,
-			  struct sk_buff *skb, struct mfc_cache *cache,
-			  int local);
+			  struct net_device *dev, struct sk_buff *skb,
+			  struct mfc_cache *cache, int local);
 static int ipmr_cache_report(struct mr_table *mrt,
 			     struct sk_buff *pkt, vifi_t vifi, int assert);
 static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
@@ -988,7 +988,7 @@ static void ipmr_cache_resolve(struct net *net, struct mr_table *mrt,
 
 			rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
 		} else {
-			ip_mr_forward(net, mrt, skb, c, 0);
+			ip_mr_forward(net, mrt, skb->dev, skb, c, 0);
 		}
 	}
 }
@@ -1073,7 +1073,7 @@ static int ipmr_cache_report(struct mr_table *mrt,
 
 /* Queue a packet for resolution. It gets locked cache entry! */
 static int ipmr_cache_unresolved(struct mr_table *mrt, vifi_t vifi,
-				 struct sk_buff *skb)
+				 struct sk_buff *skb, struct net_device *dev)
 {
 	const struct iphdr *iph = ip_hdr(skb);
 	struct mfc_cache *c;
@@ -1130,6 +1130,10 @@ static int ipmr_cache_unresolved(struct mr_table *mrt, vifi_t vifi,
 		kfree_skb(skb);
 		err = -ENOBUFS;
 	} else {
+		if (dev) {
+			skb->dev = dev;
+			skb->skb_iif = dev->ifindex;
+		}
 		skb_queue_tail(&c->mfc_un.unres.unresolved, skb);
 		err = 0;
 	}
@@ -1828,10 +1832,10 @@ static int ipmr_find_vif(struct mr_table *mrt, struct net_device *dev)
 
 /* "local" means that we should preserve one skb (for local delivery) */
 static void ip_mr_forward(struct net *net, struct mr_table *mrt,
-			  struct sk_buff *skb, struct mfc_cache *cache,
-			  int local)
+			  struct net_device *dev, struct sk_buff *skb,
+			  struct mfc_cache *cache, int local)
 {
-	int true_vifi = ipmr_find_vif(mrt, skb->dev);
+	int true_vifi = ipmr_find_vif(mrt, dev);
 	int psend = -1;
 	int vif, ct;
 
@@ -1853,13 +1857,7 @@ static void ip_mr_forward(struct net *net, struct mr_table *mrt,
 	}
 
 	/* Wrong interface: drop packet and (maybe) send PIM assert. */
-	if (mrt->vif_table[vif].dev != skb->dev) {
-		struct net_device *mdev;
-
-		mdev = l3mdev_master_dev_rcu(mrt->vif_table[vif].dev);
-		if (mdev == skb->dev)
-			goto forward;
-
+	if (mrt->vif_table[vif].dev != dev) {
 		if (rt_is_output_route(skb_rtable(skb))) {
 			/* It is our own packet, looped back.
 			 * Very complicated situation...
@@ -2053,7 +2051,7 @@ int ip_mr_input(struct sk_buff *skb)
 		read_lock(&mrt_lock);
 		vif = ipmr_find_vif(mrt, dev);
 		if (vif >= 0) {
-			int err2 = ipmr_cache_unresolved(mrt, vif, skb);
+			int err2 = ipmr_cache_unresolved(mrt, vif, skb, dev);
 			read_unlock(&mrt_lock);
 
 			return err2;
@@ -2064,7 +2062,7 @@ int ip_mr_input(struct sk_buff *skb)
 	}
 
 	read_lock(&mrt_lock);
-	ip_mr_forward(net, mrt, skb, cache, local);
+	ip_mr_forward(net, mrt, dev, skb, cache, local);
 	read_unlock(&mrt_lock);
 
 	if (local)
@@ -2238,7 +2236,7 @@ int ipmr_get_route(struct net *net, struct sk_buff *skb,
 		iph->saddr = saddr;
 		iph->daddr = daddr;
 		iph->version = 0;
-		err = ipmr_cache_unresolved(mrt, vif, skb2);
+		err = ipmr_cache_unresolved(mrt, vif, skb2, dev);
 		read_unlock(&mrt_lock);
 		rcu_read_unlock();
 		return err;
-- 
2.9.4

^ permalink raw reply related

* Re: [PATCH net-next] Remove the redundant skb->dev initialization in ip6_fragment
From: David Miller @ 2017-06-10 20:25 UTC (permalink / raw)
  To: chenbofeng.kernel; +Cc: netdev, lorenzo, edumazet, fengc
In-Reply-To: <1497123338-16571-1-git-send-email-chenbofeng.kernel@gmail.com>

From: Chenbo Feng <chenbofeng.kernel@gmail.com>
Date: Sat, 10 Jun 2017 12:35:38 -0700

> From: Chenbo Feng <fengc@google.com>
> 
> After moves the skb->dev and skb->protocol initialization into
> ip6_output, setting the skb->dev inside ip6_fragment is unnecessary.
> 
> Fixes: 97a7a37a7b7b("ipv6: Initial skb->dev and skb->protocol in ip6_output")
> Signed-off-by: Chenbo Feng <fengc@google.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCHv2 net-next] sctp: no need to check assoc id before calling sctp_assoc_set_id
From: David Miller @ 2017-06-10 20:23 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman
In-Reply-To: <ea556c7733c5bf63532ce35186e4bc7a519bf858.1497079632.git.lucien.xin@gmail.com>

From: Xin Long <lucien.xin@gmail.com>
Date: Sat, 10 Jun 2017 15:27:12 +0800

> sctp_assoc_set_id does the assoc id check in the beginning when
> processing dupcookie, no need to do the same check before calling
> it.
> 
> v1->v2:
>   fix some typo errs Marcelo pointed in changelog.
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Also applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] sctp: use read_lock_bh in sctp_eps_seq_show
From: David Miller @ 2017-06-10 20:23 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman
In-Reply-To: <f845585a99f0cb76659f4d5dae4f7d6fd5552224.1497078812.git.lucien.xin@gmail.com>

From: Xin Long <lucien.xin@gmail.com>
Date: Sat, 10 Jun 2017 15:13:32 +0800

> This patch is to use read_lock_bh instead of local_bh_disable
> and read_lock in sctp_eps_seq_show.
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] sctp: fix recursive locking warning in sctp_do_peeloff
From: David Miller @ 2017-06-10 20:22 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman, xiyou.wangcong
In-Reply-To: <a5f7dc6e508e016041f685179f1d99fc04541bdd.1497077816.git.lucien.xin@gmail.com>

From: Xin Long <lucien.xin@gmail.com>
Date: Sat, 10 Jun 2017 14:56:56 +0800

> Dmitry got the following recursive locking report while running syzkaller
> fuzzer, the Call Trace:
 ...
> This warning is caused by the lock held by sctp_getsockopt() is on one
> socket, while the other lock that sctp_close() is getting later is on
> the newly created (which failed) socket during peeloff operation.
> 
> This patch is to avoid this warning by use lock_sock with subclass
> SINGLE_DEPTH_NESTING as Wang Cong and Marcelo's suggestion.
> 
> Reported-by: Dmitry Vyukov <dvyukov@google.com>
> Suggested-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> Suggested-by: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH net] sctp: disable BH in sctp_for_each_endpoint
From: David Miller @ 2017-06-10 20:18 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman
In-Reply-To: <fc2c69db46c2dc7c877a54fc0b0917d99d0b7f0c.1497077294.git.lucien.xin@gmail.com>

From: Xin Long <lucien.xin@gmail.com>
Date: Sat, 10 Jun 2017 14:48:14 +0800

> Now sctp holds read_lock when foreach sctp_ep_hashtable without disabling
> BH. If CPU schedules to another thread A at this moment, the thread A may
> be trying to hold the write_lock with disabling BH.
> 
> As BH is disabled and CPU cannot schedule back to the thread holding the
> read_lock, while the thread A keeps waiting for the read_lock. A dead
> lock would be triggered by this.
> 
> This patch is to fix this dead lock by calling read_lock_bh instead to
> disable BH when holding the read_lock in sctp_for_each_endpoint.
> 
> Fixes: 626d16f50f39 ("sctp: export some apis or variables for sctp_diag and reuse some for proc")
> Reported-by: Xiumei Mu <xmu@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: [PATCH] net: fec: Add a fec_enet_clear_ethtool_stats() stub for CONFIG_M5272
From: David Miller @ 2017-06-10 20:16 UTC (permalink / raw)
  To: festevam
  Cc: fugang.duan, andrew, cphealy, netdev, paul.gortmaker,
	fabio.estevam
In-Reply-To: <1497058642-31542-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <festevam@gmail.com>
Date: Fri,  9 Jun 2017 22:37:22 -0300

> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> Commit 2b30842b23b9 ("net: fec: Clear and enable MIB counters on imx51")
> introduced fec_enet_clear_ethtool_stats(), but missed to add a stub
> for the CONFIG_M5272=y case, causing build failure for the
> m5272c3_defconfig.
> 
> Add the missing empty stub to fix the build failure.
> 
> Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] net/packet: remove unneeded declaraion of tpacket_snd().
From: David Miller @ 2017-06-10 20:15 UTC (permalink / raw)
  To: rami.rosen; +Cc: netdev
In-Reply-To: <1497054168-5444-1-git-send-email-rami.rosen@intel.com>

From: Rami Rosen <rami.rosen@intel.com>
Date: Sat, 10 Jun 2017 03:22:48 +0300

> This patch removes unneeded forward declaration of tpacket_snd()
> in net/packet/af_packet.c.
> 
> Signed-off-by: Rami Rosen <rami.rosen@intel.com>

Applied, thanks Rami.

^ permalink raw reply

* Re: [PATCH] l2tp: cast l2tp traffic counter to unsigned
From: David Miller @ 2017-06-10 20:13 UTC (permalink / raw)
  To: eric.dumazet; +Cc: stephen, dheidler, netdev, linux-kernel, tparkin
In-Reply-To: <1497054551.736.99.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 09 Jun 2017 17:29:11 -0700

> On Fri, 2017-06-09 at 15:16 -0700, Stephen Hemminger wrote:
>> On Fri,  9 Jun 2017 16:29:47 +0200
>> Dominik Heidler <dheidler@suse.de> wrote:
>> 
>> > This fixes a counter problem on 32bit systems:
>> > When the rx_bytes counter reached 2 GiB, it jumpd to (2^64 Bytes - 2GiB) Bytes.
>> > 
>> > rtnl_link_stats64 has __u64 type and atomic_long_read returns
>> > atomic_long_t which is signed. Due to the conversation
>> > we get an incorrect value on 32bit systems if the MSB of
>> > the atomic_long_t value is set.
>> > 
>> > CC: Tom Parkin <tparkin@katalix.com>
>> > Fixes: 7b7c0719cd7a ("l2tp: avoid deadlock in l2tp stats update")
>> > Signed-off-by: Dominik Heidler <dheidler@suse.de>
>> > ---
>> >  net/l2tp/l2tp_eth.c | 13 +++++++------
>> >  1 file changed, 7 insertions(+), 6 deletions(-)
>> > 
>> > diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
>> > index 8b21af7321b9..668a75e002e9 100644
>> > --- a/net/l2tp/l2tp_eth.c
>> > +++ b/net/l2tp/l2tp_eth.c
>> > @@ -114,12 +114,13 @@ static void l2tp_eth_get_stats64(struct net_device *dev,
>> >  {
>> >  	struct l2tp_eth *priv = netdev_priv(dev);
>> >  
>> > -	stats->tx_bytes   = atomic_long_read(&priv->tx_bytes);
>> > -	stats->tx_packets = atomic_long_read(&priv->tx_packets);
>> > -	stats->tx_dropped = atomic_long_read(&priv->tx_dropped);
>> > -	stats->rx_bytes   = atomic_long_read(&priv->rx_bytes);
>> > -	stats->rx_packets = atomic_long_read(&priv->rx_packets);
>> > -	stats->rx_errors  = atomic_long_read(&priv->rx_errors);
>> > +	stats->tx_bytes   = (unsigned long) atomic_long_read(&priv->tx_bytes);
>> > +	stats->tx_packets = (unsigned long) atomic_long_read(&priv->tx_packets);
>> > +	stats->tx_dropped = (unsigned long) atomic_long_read(&priv->tx_dropped);
>> > +	stats->rx_bytes   = (unsigned long) atomic_long_read(&priv->rx_bytes);
>> > +	stats->rx_packets = (unsigned long) atomic_long_read(&priv->rx_packets);
>> > +	stats->rx_errors  = (unsigned long) atomic_long_read(&priv->rx_errors);
>> > +
>> >  }
>> >  
>> >  static const struct net_device_ops l2tp_eth_netdev_ops = {
>> 
>> This is not the right way to fix this.
>> 
>> 1. shouldn't be using atomic's for network counters, look at other network devices.
>> 
>> 2. should be using u64_stats_fetch  api to handle 64 bit counters.
> 
> But they do not want 64bit counters, and not per cpu counters for a
> driver handling few packets per second.
> 
> Just use native size of "unsigned long".

Ahh yeah, indeed.  I've applied this l2tp patch, therefore.

> We use the same atomic_long_t for (struct netdev)->rx_dropped,
> tx_dropped & rx_nohandler
> 
> So I guess same fix is needed in dev_get_stats()

Looks like it, I'll apply a formal submission of this.

^ permalink raw reply

* Re: [PATCH net-next 0/8] Bug fixes in ena ethernet driver
From: David Miller @ 2017-06-10 20:11 UTC (permalink / raw)
  To: f.fainelli
  Cc: netanel, netdev, dwmw, zorik, matua, saeedb, msw, aliguori, nafea,
	evgenys
In-Reply-To: <fac900d3-dae3-1c88-ceef-d28294ed7941@gmail.com>

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 9 Jun 2017 15:19:54 -0700

> On 06/09/2017 03:13 PM, netanel@amazon.com wrote:
>> From: Netanel Belgazal <netanel@amazon.com>
>> 
>> This patchset contains fixes for the bugs that were discovered so far.
> 
> If these are all fixes you should submit them against the "net" tree.
> net-next is for features [1].
> 
> Since these are fixes, you may also want to provide a Fixes: 12-digit
> commit ("commit subject") [2] such that David can queue these patches
> for stable trees and this can be retrofitted into kernel distributions.
> 
> [1]:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/netdev-FAQ.txt#n25
> 
> [2]:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n183

Yeah I agree.  If they are genuine bug fixes they should be submitted
against 'net'.  And yes, Fixes: tags are quite desirable as well.

^ permalink raw reply

* Re: [PATCH] net: aquantia: atlantic: remove declaration of hw_atl_utils_hw_set_power
From: David Miller @ 2017-06-10 20:10 UTC (permalink / raw)
  To: tremyfr
  Cc: Alexander.Loktionov, Pavel.Belous, Dmitry.Bezrukov, vomlehn,
	netdev, linux-kernel
In-Reply-To: <1497045057-18299-1-git-send-email-tremyfr@gmail.com>

From: Philippe Reynes <tremyfr@gmail.com>
Date: Fri,  9 Jun 2017 23:50:57 +0200

> This function is not defined, so no need to declare it.
> 
> As I don't have the hardware, I'd be very pleased if
> someone may test this patch.
> 
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] bpf: Remove duplicate tcp_filter hook in ipv6
From: David Miller @ 2017-06-10 20:08 UTC (permalink / raw)
  To: chenbofeng.kernel; +Cc: netdev, lorenzo, edumazet, fengc
In-Reply-To: <1497035857-9927-1-git-send-email-chenbofeng.kernel@gmail.com>

From: Chenbo Feng <chenbofeng.kernel@gmail.com>
Date: Fri,  9 Jun 2017 12:17:37 -0700

> From: Chenbo Feng <fengc@google.com>
> 
> There are two tcp_filter hooks in tcp_ipv6 ingress path currently.
> One is at tcp_v6_rcv and another is in tcp_v6_do_rcv. It seems the
> tcp_filter() call inside tcp_v6_do_rcv is redundent and some packet
> will be filtered twice in this situation. This will cause trouble
> when using eBPF filters to account traffic data.
> 
> Signed-off-by: Chenbo Feng <fengc@google.com>
> Acked-by: Eric Dumazet <edumazet@google.com>

Applied, thank you.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox