Skip to content

Commit 48f58ba

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull more networking fixes from David Miller: 1) Fix brcmfmac build with older gcc, from Arend van Spriel. 2) IRQ values unintentionally truncated to u8 in mlx5 driver, from Doron Tsur. 3) Fix build warnings wrt tcp cgroup changes, from Geert Uytterhoeven. 4) Limit deep recursion in ovs stack, from Hannes Frederic Sowa. 5) at803x phy driver bug fixes from, Martin Blumenstingl. 6) Fix TSO handling in hns driver, from Daode Huang * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (22 commits) ovs: limit ovs recursions in ovs_execute_actions to not corrupt stack team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid net: hns: bug fix about hisilicon TSO BD mode brcmfmac: fix BRCMF_FW_NVRAM_DEF macro for older gcc compilers net: phy: at803x: Add the interrupt register bit definitions net: phy: at803x: Clean up duplicate register definitions net: phy: at803x: Allow specifying the RGMII RX clock delay via phy mode net: phy: at803x: Don't set gbit features for the AR8030 phy arm64: bpf: add extra pass to handle faulty codegen arm64: insn: remove BUG_ON from codegen sctp: the temp asoc's transports should not be hashed/unhashed net/mlx5_core: Fix trimming down IRQ number tcp_memcontrol: Forward declare cgroup_subsys and mem_cgroup stucts batman-adv: Drop immediate orig_node free function batman-adv: Drop immediate batadv_hard_iface free function batman-adv: Drop immediate neigh_ifinfo free function batman-adv: Drop immediate batadv_hardif_neigh_node free function batman-adv: Drop immediate batadv_neigh_node free function batman-adv: Drop immediate batadv_orig_ifinfo free function batman-adv: Avoid recursive call_rcu for batadv_nc_node ...
2 parents 7f36f1b + b064d0d commit 48f58ba

File tree

24 files changed

+395
-285
lines changed

24 files changed

+395
-285
lines changed

arch/arm64/kernel/insn.c

Lines changed: 112 additions & 53 deletions
Large diffs are not rendered by default.

arch/arm64/net/bpf_jit_comp.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* BPF JIT compiler for ARM64
33
*
4-
* Copyright (C) 2014-2015 Zi Shen Lim <zlim.lnx@gmail.com>
4+
* Copyright (C) 2014-2016 Zi Shen Lim <zlim.lnx@gmail.com>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License version 2 as
@@ -737,6 +737,20 @@ static int build_body(struct jit_ctx *ctx)
737737
return 0;
738738
}
739739

740+
static int validate_code(struct jit_ctx *ctx)
741+
{
742+
int i;
743+
744+
for (i = 0; i < ctx->idx; i++) {
745+
u32 a64_insn = le32_to_cpu(ctx->image[i]);
746+
747+
if (a64_insn == AARCH64_BREAK_FAULT)
748+
return -1;
749+
}
750+
751+
return 0;
752+
}
753+
740754
static inline void bpf_flush_icache(void *start, void *end)
741755
{
742756
flush_icache_range((unsigned long)start, (unsigned long)end);
@@ -799,6 +813,12 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
799813

800814
build_epilogue(&ctx);
801815

816+
/* 3. Extra pass to validate JITed code. */
817+
if (validate_code(&ctx)) {
818+
bpf_jit_binary_free(header);
819+
goto out;
820+
}
821+
802822
/* And we're done. */
803823
if (bpf_jit_enable > 1)
804824
bpf_jit_dump(prog->len, image_size, 2, ctx.image);

drivers/infiniband/hw/mlx5/cq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
756756
int uninitialized_var(index);
757757
int uninitialized_var(inlen);
758758
int cqe_size;
759-
int irqn;
759+
unsigned int irqn;
760760
int eqn;
761761
int err;
762762

drivers/net/ethernet/brocade/bna/bnad.c

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -542,39 +542,50 @@ bnad_cq_drop_packet(struct bnad *bnad, struct bna_rcb *rcb,
542542
}
543543

544544
static void
545-
bnad_cq_setup_skb_frags(struct bna_rcb *rcb, struct sk_buff *skb,
546-
u32 sop_ci, u32 nvecs, u32 last_fraglen)
545+
bnad_cq_setup_skb_frags(struct bna_ccb *ccb, struct sk_buff *skb, u32 nvecs)
547546
{
547+
struct bna_rcb *rcb;
548548
struct bnad *bnad;
549-
u32 ci, vec, len, totlen = 0;
550549
struct bnad_rx_unmap_q *unmap_q;
551-
struct bnad_rx_unmap *unmap;
550+
struct bna_cq_entry *cq, *cmpl;
551+
u32 ci, pi, totlen = 0;
552+
553+
cq = ccb->sw_q;
554+
pi = ccb->producer_index;
555+
cmpl = &cq[pi];
552556

557+
rcb = bna_is_small_rxq(cmpl->rxq_id) ? ccb->rcb[1] : ccb->rcb[0];
553558
unmap_q = rcb->unmap_q;
554559
bnad = rcb->bnad;
560+
ci = rcb->consumer_index;
555561

556562
/* prefetch header */
557-
prefetch(page_address(unmap_q->unmap[sop_ci].page) +
558-
unmap_q->unmap[sop_ci].page_offset);
563+
prefetch(page_address(unmap_q->unmap[ci].page) +
564+
unmap_q->unmap[ci].page_offset);
565+
566+
while (nvecs--) {
567+
struct bnad_rx_unmap *unmap;
568+
u32 len;
559569

560-
for (vec = 1, ci = sop_ci; vec <= nvecs; vec++) {
561570
unmap = &unmap_q->unmap[ci];
562571
BNA_QE_INDX_INC(ci, rcb->q_depth);
563572

564573
dma_unmap_page(&bnad->pcidev->dev,
565-
dma_unmap_addr(&unmap->vector, dma_addr),
566-
unmap->vector.len, DMA_FROM_DEVICE);
574+
dma_unmap_addr(&unmap->vector, dma_addr),
575+
unmap->vector.len, DMA_FROM_DEVICE);
567576

568-
len = (vec == nvecs) ?
569-
last_fraglen : unmap->vector.len;
577+
len = ntohs(cmpl->length);
570578
skb->truesize += unmap->vector.len;
571579
totlen += len;
572580

573581
skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
574-
unmap->page, unmap->page_offset, len);
582+
unmap->page, unmap->page_offset, len);
575583

576584
unmap->page = NULL;
577585
unmap->vector.len = 0;
586+
587+
BNA_QE_INDX_INC(pi, ccb->q_depth);
588+
cmpl = &cq[pi];
578589
}
579590

580591
skb->len += totlen;
@@ -704,7 +715,7 @@ bnad_cq_process(struct bnad *bnad, struct bna_ccb *ccb, int budget)
704715
if (BNAD_RXBUF_IS_SK_BUFF(unmap_q->type))
705716
bnad_cq_setup_skb(bnad, skb, unmap, len);
706717
else
707-
bnad_cq_setup_skb_frags(rcb, skb, sop_ci, nvecs, len);
718+
bnad_cq_setup_skb_frags(ccb, skb, nvecs);
708719

709720
rcb->rxq->rx_packets++;
710721
rcb->rxq->rx_bytes += totlen;

drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,17 @@ int hns_rcb_common_init_hw(struct rcb_common_cb *rcb_common)
369369
dsaf_write_dev(rcb_common, RCB_COM_CFG_ENDIAN_REG,
370370
HNS_RCB_COMMON_ENDIAN);
371371

372-
dsaf_write_dev(rcb_common, RCB_COM_CFG_FNA_REG, 0x0);
373-
dsaf_write_dev(rcb_common, RCB_COM_CFG_FA_REG, 0x1);
372+
if (AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver)) {
373+
dsaf_write_dev(rcb_common, RCB_COM_CFG_FNA_REG, 0x0);
374+
dsaf_write_dev(rcb_common, RCB_COM_CFG_FA_REG, 0x1);
375+
} else {
376+
dsaf_set_dev_bit(rcb_common, RCBV2_COM_CFG_USER_REG,
377+
RCB_COM_CFG_FNA_B, false);
378+
dsaf_set_dev_bit(rcb_common, RCBV2_COM_CFG_USER_REG,
379+
RCB_COM_CFG_FA_B, true);
380+
dsaf_set_dev_bit(rcb_common, RCBV2_COM_CFG_TSO_MODE_REG,
381+
RCB_COM_TSO_MODE_B, HNS_TSO_MODE_8BD_32K);
382+
}
374383

375384
return 0;
376385
}

drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ struct rcb_common_cb;
5454
#define HNS_DUMP_REG_NUM 500
5555
#define HNS_STATIC_REG_NUM 12
5656

57+
#define HNS_TSO_MODE_8BD_32K 1
58+
#define HNS_TSO_MDOE_4BD_16K 0
59+
5760
enum rcb_int_flag {
5861
RCB_INT_FLAG_TX = 0x1,
5962
RCB_INT_FLAG_RX = (0x1 << 1),

drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@
363363
#define RCB_COM_CFG_FA_REG 0x3C
364364
#define RCB_COM_CFG_PKT_TC_BP_REG 0x40
365365
#define RCB_COM_CFG_PPE_TNL_CLKEN_REG 0x44
366+
#define RCBV2_COM_CFG_USER_REG 0x30
367+
#define RCBV2_COM_CFG_TSO_MODE_REG 0x50
366368

367369
#define RCB_COM_INTMSK_TX_PKT_REG 0x3A0
368370
#define RCB_COM_RINT_TX_PKT_REG 0x3A8
@@ -860,6 +862,9 @@
860862

861863
#define PPE_COMMON_CNT_CLR_CE_B 0
862864
#define PPE_COMMON_CNT_CLR_SNAP_EN_B 1
865+
#define RCB_COM_TSO_MODE_B 0
866+
#define RCB_COM_CFG_FNA_B 1
867+
#define RCB_COM_CFG_FA_B 0
863868

864869
#define GMAC_DUPLEX_TYPE_B 0
865870

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ static int mlx5e_create_cq(struct mlx5e_channel *c,
752752
struct mlx5_core_dev *mdev = priv->mdev;
753753
struct mlx5_core_cq *mcq = &cq->mcq;
754754
int eqn_not_used;
755-
int irqn;
755+
unsigned int irqn;
756756
int err;
757757
u32 i;
758758

@@ -806,7 +806,7 @@ static int mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param)
806806
void *in;
807807
void *cqc;
808808
int inlen;
809-
int irqn_not_used;
809+
unsigned int irqn_not_used;
810810
int eqn;
811811
int err;
812812

@@ -1517,7 +1517,7 @@ static int mlx5e_create_drop_cq(struct mlx5e_priv *priv,
15171517
struct mlx5_core_dev *mdev = priv->mdev;
15181518
struct mlx5_core_cq *mcq = &cq->mcq;
15191519
int eqn_not_used;
1520-
int irqn;
1520+
unsigned int irqn;
15211521
int err;
15221522

15231523
err = mlx5_cqwq_create(mdev, &param->wq, param->cqc, &cq->wq,

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ static void mlx5_irq_clear_affinity_hints(struct mlx5_core_dev *mdev)
585585
mlx5_irq_clear_affinity_hint(mdev, i);
586586
}
587587

588-
int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn, int *irqn)
588+
int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn,
589+
unsigned int *irqn)
589590
{
590591
struct mlx5_eq_table *table = &dev->priv.eq_table;
591592
struct mlx5_eq *eq, *n;

0 commit comments

Comments
 (0)