Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Browse files Browse the repository at this point in the history
Pull networking fixes from David Miller:

 1) Fix non-blocking connect() in x25, from Martin Schiller.

 2) Fix spurious decryption errors in kTLS, from Jakub Kicinski.

 3) Netfilter use-after-free in mtype_destroy(), from Cong Wang.

 4) Limit size of TSO packets properly in lan78xx driver, from Eric
    Dumazet.

 5) r8152 probe needs an endpoint sanity check, from Johan Hovold.

 6) Prevent looping in tcp_bpf_unhash() during sockmap/tls free, from
    John Fastabend.

 7) hns3 needs short frames padded on transmit, from Yunsheng Lin.

 8) Fix netfilter ICMP header corruption, from Eyal Birger.

 9) Fix soft lockup when low on memory in hns3, from Yonglong Liu.

10) Fix NTUPLE firmware command failures in bnxt_en, from Michael Chan.

11) Fix memory leak in act_ctinfo, from Eric Dumazet.

* git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (91 commits)
  cxgb4: reject overlapped queues in TC-MQPRIO offload
  cxgb4: fix Tx multi channel port rate limit
  net: sched: act_ctinfo: fix memory leak
  bnxt_en: Do not treat DSN (Digital Serial Number) read failure as fatal.
  bnxt_en: Fix ipv6 RFS filter matching logic.
  bnxt_en: Fix NTUPLE firmware command failures.
  net: systemport: Fixed queue mapping in internal ring map
  net: dsa: bcm_sf2: Configure IMP port for 2Gb/sec
  net: dsa: sja1105: Don't error out on disabled ports with no phy-mode
  net: phy: dp83867: Set FORCE_LINK_GOOD to default after reset
  net: hns: fix soft lockup when there is not enough memory
  net: avoid updating qdisc_xmit_lock_key in netdev_update_lockdep_key()
  net/sched: act_ife: initalize ife->metalist earlier
  netfilter: nat: fix ICMP header corruption on ICMP errors
  net: wan: lapbether.c: Use built-in RCU list checking
  netfilter: nf_tables: fix flowtable list del corruption
  netfilter: nf_tables: fix memory leak in nf_tables_parse_netdev_hooks()
  netfilter: nf_tables: remove WARN and add NLA_STRING upper limits
  netfilter: nft_tunnel: ERSPAN_VERSION must not be null
  netfilter: nft_tunnel: fix null-attribute check
  ...
  • Loading branch information
Linus Torvalds committed Jan 19, 2020
2 parents 5f43644 + b2383ad commit 11a8272
Show file tree
Hide file tree
Showing 92 changed files with 773 additions and 377 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Jacob Shin <Jacob.Shin@amd.com>
Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@google.com>
Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@motorola.com>
Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk.kim@samsung.com>
Jakub Kicinski <kuba@kernel.org> <jakub.kicinski@netronome.com>
James Bottomley <jejb@mulgrave.(none)>
James Bottomley <jejb@titanic.il.steeleye.com>
James E Wilson <wilson@specifix.com>
Expand Down
2 changes: 1 addition & 1 deletion Documentation/admin-guide/devices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
182 = /dev/perfctr Performance-monitoring counters
183 = /dev/hwrng Generic random number generator
184 = /dev/cpu/microcode CPU microcode update interface
186 = /dev/atomicps Atomic shapshot of process state data
186 = /dev/atomicps Atomic snapshot of process state data
187 = /dev/irnet IrNET device
188 = /dev/smbusbios SMBus BIOS
189 = /dev/ussp_ctl User space serial port control
Expand Down
2 changes: 1 addition & 1 deletion Documentation/media/v4l-drivers/meye.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ so all video4linux tools (like xawtv) should work with this driver.

Besides the video4linux interface, the driver has a private interface
for accessing the Motion Eye extended parameters (camera sharpness,
agc, video framerate), the shapshot and the MJPEG capture facilities.
agc, video framerate), the snapshot and the MJPEG capture facilities.

This interface consists of several ioctls (prototypes and structures
can be found in include/linux/meye.h):
Expand Down
10 changes: 5 additions & 5 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3150,7 +3150,7 @@ S: Maintained
F: arch/mips/net/

BPF JIT for NFP NICs
M: Jakub Kicinski <jakub.kicinski@netronome.com>
M: Jakub Kicinski <kuba@kernel.org>
L: netdev@vger.kernel.org
L: bpf@vger.kernel.org
S: Supported
Expand Down Expand Up @@ -11431,7 +11431,7 @@ F: include/uapi/linux/netrom.h
F: net/netrom/

NETRONOME ETHERNET DRIVERS
M: Jakub Kicinski <jakub.kicinski@netronome.com>
M: Jakub Kicinski <kuba@kernel.org>
L: oss-drivers@netronome.com
S: Maintained
F: drivers/net/ethernet/netronome/
Expand Down Expand Up @@ -11591,7 +11591,7 @@ M: Boris Pismenny <borisp@mellanox.com>
M: Aviad Yehezkel <aviadye@mellanox.com>
M: John Fastabend <john.fastabend@gmail.com>
M: Daniel Borkmann <daniel@iogearbox.net>
M: Jakub Kicinski <jakub.kicinski@netronome.com>
M: Jakub Kicinski <kuba@kernel.org>
L: netdev@vger.kernel.org
S: Maintained
F: net/tls/*
Expand All @@ -11603,7 +11603,7 @@ L: linux-wireless@vger.kernel.org
Q: http://patchwork.kernel.org/project/linux-wireless/list/

NETDEVSIM
M: Jakub Kicinski <jakub.kicinski@netronome.com>
M: Jakub Kicinski <kuba@kernel.org>
S: Maintained
F: drivers/net/netdevsim/*

Expand Down Expand Up @@ -18042,7 +18042,7 @@ XDP (eXpress Data Path)
M: Alexei Starovoitov <ast@kernel.org>
M: Daniel Borkmann <daniel@iogearbox.net>
M: David S. Miller <davem@davemloft.net>
M: Jakub Kicinski <jakub.kicinski@netronome.com>
M: Jakub Kicinski <kuba@kernel.org>
M: Jesper Dangaard Brouer <hawk@kernel.org>
M: John Fastabend <john.fastabend@gmail.com>
L: netdev@vger.kernel.org
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/bcm_sf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port)

/* Force link status for IMP port */
reg = core_readl(priv, offset);
reg |= (MII_SW_OR | LINK_STS);
reg |= (MII_SW_OR | LINK_STS | GMII_SPEED_UP_2G);
core_writel(priv, reg, offset);

/* Enable Broadcast, Multicast, Unicast forwarding to IMP port */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/sja1105/sja1105_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv,
struct device *dev = &priv->spidev->dev;
struct device_node *child;

for_each_child_of_node(ports_node, child) {
for_each_available_child_of_node(ports_node, child) {
struct device_node *phy_node;
phy_interface_t phy_mode;
u32 index;
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/ethernet/broadcom/bcmsysport.c
Original file line number Diff line number Diff line change
Expand Up @@ -2323,7 +2323,7 @@ static int bcm_sysport_map_queues(struct notifier_block *nb,
ring->switch_queue = qp;
ring->switch_port = port;
ring->inspect = true;
priv->ring_map[q + port * num_tx_queues] = ring;
priv->ring_map[qp + port * num_tx_queues] = ring;
qp++;
}

Expand All @@ -2338,7 +2338,7 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb,
struct net_device *slave_dev;
unsigned int num_tx_queues;
struct net_device *dev;
unsigned int q, port;
unsigned int q, qp, port;

priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier);
if (priv->netdev != info->master)
Expand All @@ -2364,7 +2364,8 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb,
continue;

ring->inspect = false;
priv->ring_map[q + port * num_tx_queues] = NULL;
qp = ring->switch_queue;
priv->ring_map[qp + port * num_tx_queues] = NULL;
}

return 0;
Expand Down
29 changes: 20 additions & 9 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -11065,11 +11065,23 @@ static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1,
struct flow_keys *keys1 = &f1->fkeys;
struct flow_keys *keys2 = &f2->fkeys;

if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src &&
keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst &&
keys1->ports.ports == keys2->ports.ports &&
keys1->basic.ip_proto == keys2->basic.ip_proto &&
keys1->basic.n_proto == keys2->basic.n_proto &&
if (keys1->basic.n_proto != keys2->basic.n_proto ||
keys1->basic.ip_proto != keys2->basic.ip_proto)
return false;

if (keys1->basic.n_proto == htons(ETH_P_IP)) {
if (keys1->addrs.v4addrs.src != keys2->addrs.v4addrs.src ||
keys1->addrs.v4addrs.dst != keys2->addrs.v4addrs.dst)
return false;
} else {
if (memcmp(&keys1->addrs.v6addrs.src, &keys2->addrs.v6addrs.src,
sizeof(keys1->addrs.v6addrs.src)) ||
memcmp(&keys1->addrs.v6addrs.dst, &keys2->addrs.v6addrs.dst,
sizeof(keys1->addrs.v6addrs.dst)))
return false;
}

if (keys1->ports.ports == keys2->ports.ports &&
keys1->control.flags == keys2->control.flags &&
ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) &&
ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr))
Expand Down Expand Up @@ -11361,7 +11373,7 @@ int bnxt_get_port_parent_id(struct net_device *dev,
return -EOPNOTSUPP;

/* The PF and it's VF-reps only support the switchdev framework */
if (!BNXT_PF(bp))
if (!BNXT_PF(bp) || !(bp->flags & BNXT_FLAG_DSN_VALID))
return -EOPNOTSUPP;

ppid->id_len = sizeof(bp->switch_id);
Expand Down Expand Up @@ -11734,6 +11746,7 @@ static int bnxt_pcie_dsn_get(struct bnxt *bp, u8 dsn[])
put_unaligned_le32(dw, &dsn[0]);
pci_read_config_dword(pdev, pos + 4, &dw);
put_unaligned_le32(dw, &dsn[4]);
bp->flags |= BNXT_FLAG_DSN_VALID;
return 0;
}

Expand Down Expand Up @@ -11845,9 +11858,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)

if (BNXT_PF(bp)) {
/* Read the adapter's DSN to use as the eswitch switch_id */
rc = bnxt_pcie_dsn_get(bp, bp->switch_id);
if (rc)
goto init_err_pci_clean;
bnxt_pcie_dsn_get(bp, bp->switch_id);
}

/* MTU range: 60 - FW defined max */
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,7 @@ struct bnxt {
#define BNXT_FLAG_NO_AGG_RINGS 0x20000
#define BNXT_FLAG_RX_PAGE_MODE 0x40000
#define BNXT_FLAG_MULTI_HOST 0x100000
#define BNXT_FLAG_DSN_VALID 0x200000
#define BNXT_FLAG_DOUBLE_DB 0x400000
#define BNXT_FLAG_CHIP_NITRO_A0 0x1000000
#define BNXT_FLAG_DIM 0x2000000
Expand Down Expand Up @@ -1936,9 +1937,6 @@ static inline bool bnxt_cfa_hwrm_message(u16 req_type)
case HWRM_CFA_ENCAP_RECORD_FREE:
case HWRM_CFA_DECAP_FILTER_ALLOC:
case HWRM_CFA_DECAP_FILTER_FREE:
case HWRM_CFA_NTUPLE_FILTER_ALLOC:
case HWRM_CFA_NTUPLE_FILTER_FREE:
case HWRM_CFA_NTUPLE_FILTER_CFG:
case HWRM_CFA_EM_FLOW_ALLOC:
case HWRM_CFA_EM_FLOW_FREE:
case HWRM_CFA_EM_FLOW_CFG:
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@ static int bnxt_vf_reps_create(struct bnxt *bp)
struct net_device *dev;
int rc, i;

if (!(bp->flags & BNXT_FLAG_DSN_VALID))
return -ENODEV;

bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL);
if (!bp->vf_reps)
return -ENOMEM;
Expand Down
30 changes: 17 additions & 13 deletions drivers/net/ethernet/cadence/macb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,21 +611,24 @@ static const struct phylink_mac_ops macb_phylink_ops = {
.mac_link_up = macb_mac_link_up,
};

static bool macb_phy_handle_exists(struct device_node *dn)
{
dn = of_parse_phandle(dn, "phy-handle", 0);
of_node_put(dn);
return dn != NULL;
}

static int macb_phylink_connect(struct macb *bp)
{
struct device_node *dn = bp->pdev->dev.of_node;
struct net_device *dev = bp->dev;
struct phy_device *phydev;
int ret;

if (bp->pdev->dev.of_node &&
of_parse_phandle(bp->pdev->dev.of_node, "phy-handle", 0)) {
ret = phylink_of_phy_connect(bp->phylink, bp->pdev->dev.of_node,
0);
if (ret) {
netdev_err(dev, "Could not attach PHY (%d)\n", ret);
return ret;
}
} else {
if (dn)
ret = phylink_of_phy_connect(bp->phylink, dn, 0);

if (!dn || (ret && !macb_phy_handle_exists(dn))) {
phydev = phy_find_first(bp->mii_bus);
if (!phydev) {
netdev_err(dev, "no PHY found\n");
Expand All @@ -634,10 +637,11 @@ static int macb_phylink_connect(struct macb *bp)

/* attach the mac to the phy */
ret = phylink_connect_phy(bp->phylink, phydev);
if (ret) {
netdev_err(dev, "Could not attach to PHY (%d)\n", ret);
return ret;
}
}

if (ret) {
netdev_err(dev, "Could not attach PHY (%d)\n", ret);
return ret;
}

phylink_start(bp->phylink);
Expand Down
14 changes: 11 additions & 3 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3135,9 +3135,9 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate)
{
struct port_info *pi = netdev_priv(dev);
struct adapter *adap = pi->adapter;
struct ch_sched_queue qe = { 0 };
struct ch_sched_params p = { 0 };
struct sched_class *e;
struct ch_sched_params p;
struct ch_sched_queue qe;
u32 req_rate;
int err = 0;

Expand All @@ -3154,6 +3154,15 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate)
return -EINVAL;
}

qe.queue = index;
e = cxgb4_sched_queue_lookup(dev, &qe);
if (e && e->info.u.params.level != SCHED_CLASS_LEVEL_CL_RL) {
dev_err(adap->pdev_dev,
"Queue %u already bound to class %u of type: %u\n",
index, e->idx, e->info.u.params.level);
return -EBUSY;
}

/* Convert from Mbps to Kbps */
req_rate = rate * 1000;

Expand Down Expand Up @@ -3183,7 +3192,6 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate)
return 0;

/* Fetch any available unused or matching scheduling class */
memset(&p, 0, sizeof(p));
p.type = SCHED_CLASS_TYPE_PACKET;
p.u.params.level = SCHED_CLASS_LEVEL_CL_RL;
p.u.params.mode = SCHED_CLASS_MODE_CLASS;
Expand Down
67 changes: 67 additions & 0 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ static int cxgb4_matchall_egress_validate(struct net_device *dev,
struct flow_action *actions = &cls->rule->action;
struct port_info *pi = netdev2pinfo(dev);
struct flow_action_entry *entry;
struct ch_sched_queue qe;
struct sched_class *e;
u64 max_link_rate;
u32 i, speed;
int ret;
Expand Down Expand Up @@ -60,9 +62,61 @@ static int cxgb4_matchall_egress_validate(struct net_device *dev,
}
}

for (i = 0; i < pi->nqsets; i++) {
memset(&qe, 0, sizeof(qe));
qe.queue = i;

e = cxgb4_sched_queue_lookup(dev, &qe);
if (e && e->info.u.params.level != SCHED_CLASS_LEVEL_CH_RL) {
NL_SET_ERR_MSG_MOD(extack,
"Some queues are already bound to different class");
return -EBUSY;
}
}

return 0;
}

static int cxgb4_matchall_tc_bind_queues(struct net_device *dev, u32 tc)
{
struct port_info *pi = netdev2pinfo(dev);
struct ch_sched_queue qe;
int ret;
u32 i;

for (i = 0; i < pi->nqsets; i++) {
qe.queue = i;
qe.class = tc;
ret = cxgb4_sched_class_bind(dev, &qe, SCHED_QUEUE);
if (ret)
goto out_free;
}

return 0;

out_free:
while (i--) {
qe.queue = i;
qe.class = SCHED_CLS_NONE;
cxgb4_sched_class_unbind(dev, &qe, SCHED_QUEUE);
}

return ret;
}

static void cxgb4_matchall_tc_unbind_queues(struct net_device *dev)
{
struct port_info *pi = netdev2pinfo(dev);
struct ch_sched_queue qe;
u32 i;

for (i = 0; i < pi->nqsets; i++) {
qe.queue = i;
qe.class = SCHED_CLS_NONE;
cxgb4_sched_class_unbind(dev, &qe, SCHED_QUEUE);
}
}

static int cxgb4_matchall_alloc_tc(struct net_device *dev,
struct tc_cls_matchall_offload *cls)
{
Expand All @@ -83,6 +137,7 @@ static int cxgb4_matchall_alloc_tc(struct net_device *dev,
struct adapter *adap = netdev2adap(dev);
struct flow_action_entry *entry;
struct sched_class *e;
int ret;
u32 i;

tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id];
Expand All @@ -101,10 +156,21 @@ static int cxgb4_matchall_alloc_tc(struct net_device *dev,
return -ENOMEM;
}

ret = cxgb4_matchall_tc_bind_queues(dev, e->idx);
if (ret) {
NL_SET_ERR_MSG_MOD(extack,
"Could not bind queues to traffic class");
goto out_free;
}

tc_port_matchall->egress.hwtc = e->idx;
tc_port_matchall->egress.cookie = cls->cookie;
tc_port_matchall->egress.state = CXGB4_MATCHALL_STATE_ENABLED;
return 0;

out_free:
cxgb4_sched_class_free(dev, e->idx);
return ret;
}

static void cxgb4_matchall_free_tc(struct net_device *dev)
Expand All @@ -114,6 +180,7 @@ static void cxgb4_matchall_free_tc(struct net_device *dev)
struct adapter *adap = netdev2adap(dev);

tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id];
cxgb4_matchall_tc_unbind_queues(dev);
cxgb4_sched_class_free(dev, tc_port_matchall->egress.hwtc);

tc_port_matchall->egress.hwtc = SCHED_CLS_NONE;
Expand Down
Loading

0 comments on commit 11a8272

Please sign in to comment.