Skip to content

Commit

Permalink
Merge tag 'net-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/netdev/net

Pull networking fixes from Paolo Abeni:
 "Including fixes from bpf and netfilter.

  Current release - regressions:

   - netfilter: cttimeout: fix slab-out-of-bounds read in
     cttimeout_net_exit

Current release - new code bugs:

   - bpf: ftrace: keep address offset in ftrace_lookup_symbols

   - bpf: force cookies array to follow symbols sorting

  Previous releases - regressions:

   - ipv4: ping: fix bind address validity check

   - tipc: fix use-after-free read in tipc_named_reinit

   - eth: veth: add updating of trans_start

  Previous releases - always broken:

   - sock: redo the psock vs ULP protection check

   - netfilter: nf_dup_netdev: fix skb_under_panic

   - bpf: fix request_sock leak in sk lookup helpers

   - eth: igb: fix a use-after-free issue in igb_clean_tx_ring

   - eth: ice: prohibit improper channel config for DCB

   - eth: at803x: fix null pointer dereference on AR9331 phy

   - eth: virtio_net: fix xdp_rxq_info bug after suspend/resume

  Misc:

   - eth: hinic: replace memcpy() with direct assignment"

* tag 'net-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (47 commits)
  net: openvswitch: fix parsing of nw_proto for IPv6 fragments
  sock: redo the psock vs ULP protection check
  Revert "net/tls: fix tls_sk_proto_close executed repeatedly"
  virtio_net: fix xdp_rxq_info bug after suspend/resume
  igb: Make DMA faster when CPU is active on the PCIe link
  net: dsa: qca8k: reduce mgmt ethernet timeout
  net: dsa: qca8k: reset cpu port on MTU change
  MAINTAINERS: Add a maintainer for OCP Time Card
  hinic: Replace memcpy() with direct assignment
  Revert "drivers/net/ethernet/neterion/vxge: Fix a use-after-free bug in vxge-main.c"
  net: phy: smsc: Disable Energy Detect Power-Down in interrupt mode
  ice: ethtool: Prohibit improper channel config for DCB
  ice: ethtool: advertise 1000M speeds properly
  ice: Fix switchdev rules book keeping
  ice: ignore protocol field in GTP offload
  netfilter: nf_dup_netdev: add and use recursion counter
  netfilter: nf_dup_netdev: do not push mac header a second time
  selftests: netfilter: correct PKTGEN_SCRIPT_PATHS in nft_concat_range.sh
  net/tls: fix tls_sk_proto_close executed repeatedly
  erspan: do not assume transport header is always set
  ...
  • Loading branch information
torvalds committed Jun 23, 2022
2 parents f410c3e + 12378a5 commit 399bd66
Show file tree
Hide file tree
Showing 47 changed files with 617 additions and 215 deletions.
42 changes: 21 additions & 21 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3662,7 +3662,7 @@ BPF JIT for ARM
M: Shubham Bansal <[email protected]>
L: [email protected]
L: [email protected]
S: Maintained
S: Odd Fixes
F: arch/arm/net/

BPF JIT for ARM64
Expand All @@ -3686,14 +3686,15 @@ BPF JIT for NFP NICs
M: Jakub Kicinski <[email protected]>
L: [email protected]
L: [email protected]
S: Supported
S: Odd Fixes
F: drivers/net/ethernet/netronome/nfp/bpf/

BPF JIT for POWERPC (32-BIT AND 64-BIT)
M: Naveen N. Rao <[email protected]>
M: Michael Ellerman <[email protected]>
L: [email protected]
L: [email protected]
S: Maintained
S: Supported
F: arch/powerpc/net/

BPF JIT for RISC-V (32-bit)
Expand All @@ -3719,22 +3720,22 @@ M: Heiko Carstens <[email protected]>
M: Vasily Gorbik <[email protected]>
L: [email protected]
L: [email protected]
S: Maintained
S: Supported
F: arch/s390/net/
X: arch/s390/net/pnet.c

BPF JIT for SPARC (32-BIT AND 64-BIT)
M: David S. Miller <[email protected]>
L: [email protected]
L: [email protected]
S: Maintained
S: Odd Fixes
F: arch/sparc/net/

BPF JIT for X86 32-BIT
M: Wang YanQing <[email protected]>
L: [email protected]
L: [email protected]
S: Maintained
S: Odd Fixes
F: arch/x86/net/bpf_jit_comp32.c

BPF JIT for X86 64-BIT
Expand All @@ -3757,6 +3758,19 @@ F: include/linux/bpf_lsm.h
F: kernel/bpf/bpf_lsm.c
F: security/bpf/

BPF L7 FRAMEWORK
M: John Fastabend <[email protected]>
M: Jakub Sitnicki <[email protected]>
L: [email protected]
L: [email protected]
S: Maintained
F: include/linux/skmsg.h
F: net/core/skmsg.c
F: net/core/sock_map.c
F: net/ipv4/tcp_bpf.c
F: net/ipv4/udp_bpf.c
F: net/unix/unix_bpf.c

BPFTOOL
M: Quentin Monnet <[email protected]>
L: [email protected]
Expand Down Expand Up @@ -11098,20 +11112,6 @@ S: Maintained
F: include/net/l3mdev.h
F: net/l3mdev

L7 BPF FRAMEWORK
M: John Fastabend <[email protected]>
M: Daniel Borkmann <[email protected]>
M: Jakub Sitnicki <[email protected]>
L: [email protected]
L: [email protected]
S: Maintained
F: include/linux/skmsg.h
F: net/core/skmsg.c
F: net/core/sock_map.c
F: net/ipv4/tcp_bpf.c
F: net/ipv4/udp_bpf.c
F: net/unix/unix_bpf.c

LANDLOCK SECURITY MODULE
M: Mickaël Salaün <[email protected]>
L: [email protected]
Expand Down Expand Up @@ -13954,7 +13954,6 @@ F: net/ipv6/tcp*.c
NETWORKING [TLS]
M: Boris Pismenny <[email protected]>
M: John Fastabend <[email protected]>
M: Daniel Borkmann <[email protected]>
M: Jakub Kicinski <[email protected]>
L: [email protected]
S: Maintained
Expand Down Expand Up @@ -14871,6 +14870,7 @@ F: include/dt-bindings/

OPENCOMPUTE PTP CLOCK DRIVER
M: Jonathan Lemon <[email protected]>
M: Vadim Fedorenko <[email protected]>
L: [email protected]
S: Maintained
F: drivers/ptp/ptp_ocp.c
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1420,8 +1420,9 @@ st: if (is_imm8(insn->off))
case BPF_JMP | BPF_CALL:
func = (u8 *) __bpf_call_base + imm32;
if (tail_call_reachable) {
/* mov rax, qword ptr [rbp - rounded_stack_depth - 8] */
EMIT3_off32(0x48, 0x8B, 0x85,
-(bpf_prog->aux->stack_depth + 8));
-round_up(bpf_prog->aux->stack_depth, 8) - 8);
if (!imm32 || emit_call(&prog, func, image + addrs[i - 1] + 7))
return -EINVAL;
} else {
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3684,9 +3684,11 @@ static void bond_activebackup_arp_mon(struct bonding *bond)
if (!rtnl_trylock())
return;

if (should_notify_peers)
if (should_notify_peers) {
bond->send_peer_notif--;
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
bond->dev);
}
if (should_notify_rtnl) {
bond_slave_state_notify(bond);
bond_slave_link_notify(bond);
Expand Down
22 changes: 21 additions & 1 deletion drivers/net/dsa/qca8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -2334,6 +2334,7 @@ static int
qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
{
struct qca8k_priv *priv = ds->priv;
int ret;

/* We have only have a general MTU setting.
* DSA always set the CPU port's MTU to the largest MTU of the slave
Expand All @@ -2344,8 +2345,27 @@ qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
if (!dsa_is_cpu_port(ds, port))
return 0;

/* To change the MAX_FRAME_SIZE the cpu ports must be off or
* the switch panics.
* Turn off both cpu ports before applying the new value to prevent
* this.
*/
if (priv->port_enabled_map & BIT(0))
qca8k_port_set_status(priv, 0, 0);

if (priv->port_enabled_map & BIT(6))
qca8k_port_set_status(priv, 6, 0);

/* Include L2 header / FCS length */
return qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, new_mtu + ETH_HLEN + ETH_FCS_LEN);
ret = qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, new_mtu + ETH_HLEN + ETH_FCS_LEN);

if (priv->port_enabled_map & BIT(0))
qca8k_port_set_status(priv, 0, 1);

if (priv->port_enabled_map & BIT(6))
qca8k_port_set_status(priv, 6, 1);

return ret;
}

static int
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/qca8k.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define QCA8K_ETHERNET_MDIO_PRIORITY 7
#define QCA8K_ETHERNET_PHY_PRIORITY 6
#define QCA8K_ETHERNET_TIMEOUT 100
#define QCA8K_ETHERNET_TIMEOUT 5

#define QCA8K_NUM_PORTS 7
#define QCA8K_NUM_CPU_PORTS 2
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/ethernet/huawei/hinic/hinic_devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ static bool check_image_valid(struct hinic_devlink_priv *priv, const u8 *buf,

for (i = 0; i < fw_image->fw_info.fw_section_cnt; i++) {
len += fw_image->fw_section_info[i].fw_section_len;
memcpy(&host_image->image_section_info[i],
&fw_image->fw_section_info[i],
sizeof(struct fw_section_info_st));
host_image->image_section_info[i] = fw_image->fw_section_info[i];
}

if (len != fw_image->fw_len ||
Expand Down
49 changes: 48 additions & 1 deletion drivers/net/ethernet/intel/ice/ice_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -2189,6 +2189,42 @@ ice_setup_autoneg(struct ice_port_info *p, struct ethtool_link_ksettings *ks,
return err;
}

/**
* ice_set_phy_type_from_speed - set phy_types based on speeds
* and advertised modes
* @ks: ethtool link ksettings struct
* @phy_type_low: pointer to the lower part of phy_type
* @phy_type_high: pointer to the higher part of phy_type
* @adv_link_speed: targeted link speeds bitmap
*/
static void
ice_set_phy_type_from_speed(const struct ethtool_link_ksettings *ks,
u64 *phy_type_low, u64 *phy_type_high,
u16 adv_link_speed)
{
/* Handle 1000M speed in a special way because ice_update_phy_type
* enables all link modes, but having mixed copper and optical
* standards is not supported.
*/
adv_link_speed &= ~ICE_AQ_LINK_SPEED_1000MB;

if (ethtool_link_ksettings_test_link_mode(ks, advertising,
1000baseT_Full))
*phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_T |
ICE_PHY_TYPE_LOW_1G_SGMII;

if (ethtool_link_ksettings_test_link_mode(ks, advertising,
1000baseKX_Full))
*phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_KX;

if (ethtool_link_ksettings_test_link_mode(ks, advertising,
1000baseX_Full))
*phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_SX |
ICE_PHY_TYPE_LOW_1000BASE_LX;

ice_update_phy_type(phy_type_low, phy_type_high, adv_link_speed);
}

/**
* ice_set_link_ksettings - Set Speed and Duplex
* @netdev: network interface device structure
Expand Down Expand Up @@ -2320,7 +2356,8 @@ ice_set_link_ksettings(struct net_device *netdev,
adv_link_speed = curr_link_speed;

/* Convert the advertise link speeds to their corresponded PHY_TYPE */
ice_update_phy_type(&phy_type_low, &phy_type_high, adv_link_speed);
ice_set_phy_type_from_speed(ks, &phy_type_low, &phy_type_high,
adv_link_speed);

if (!autoneg_changed && adv_link_speed == curr_link_speed) {
netdev_info(netdev, "Nothing changed, exiting without setting anything.\n");
Expand Down Expand Up @@ -3470,6 +3507,16 @@ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch)
new_rx = ch->combined_count + ch->rx_count;
new_tx = ch->combined_count + ch->tx_count;

if (new_rx < vsi->tc_cfg.numtc) {
netdev_err(dev, "Cannot set less Rx channels, than Traffic Classes you have (%u)\n",
vsi->tc_cfg.numtc);
return -EINVAL;
}
if (new_tx < vsi->tc_cfg.numtc) {
netdev_err(dev, "Cannot set less Tx channels, than Traffic Classes you have (%u)\n",
vsi->tc_cfg.numtc);
return -EINVAL;
}
if (new_rx > ice_get_max_rxq(pf)) {
netdev_err(dev, "Maximum allowed Rx channels is %d\n",
ice_get_max_rxq(pf));
Expand Down
42 changes: 37 additions & 5 deletions drivers/net/ethernet/intel/ice/ice_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ static void ice_set_dflt_vsi_ctx(struct ice_hw *hw, struct ice_vsi_ctx *ctxt)
* @vsi: the VSI being configured
* @ctxt: VSI context structure
*/
static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
static int ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
{
u16 offset = 0, qmap = 0, tx_count = 0, pow = 0;
u16 num_txq_per_tc, num_rxq_per_tc;
Expand Down Expand Up @@ -982,7 +982,18 @@ static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
else
vsi->num_rxq = num_rxq_per_tc;

if (vsi->num_rxq > vsi->alloc_rxq) {
dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Rx queues (%u), than were allocated (%u)!\n",
vsi->num_rxq, vsi->alloc_rxq);
return -EINVAL;
}

vsi->num_txq = tx_count;
if (vsi->num_txq > vsi->alloc_txq) {
dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Tx queues (%u), than were allocated (%u)!\n",
vsi->num_txq, vsi->alloc_txq);
return -EINVAL;
}

if (vsi->type == ICE_VSI_VF && vsi->num_txq != vsi->num_rxq) {
dev_dbg(ice_pf_to_dev(vsi->back), "VF VSI should have same number of Tx and Rx queues. Hence making them equal\n");
Expand All @@ -1000,6 +1011,8 @@ static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
*/
ctxt->info.q_mapping[0] = cpu_to_le16(vsi->rxq_map[0]);
ctxt->info.q_mapping[1] = cpu_to_le16(vsi->num_rxq);

return 0;
}

/**
Expand Down Expand Up @@ -1187,7 +1200,10 @@ static int ice_vsi_init(struct ice_vsi *vsi, bool init_vsi)
if (vsi->type == ICE_VSI_CHNL) {
ice_chnl_vsi_setup_q_map(vsi, ctxt);
} else {
ice_vsi_setup_q_map(vsi, ctxt);
ret = ice_vsi_setup_q_map(vsi, ctxt);
if (ret)
goto out;

if (!init_vsi) /* means VSI being updated */
/* must to indicate which section of VSI context are
* being modified
Expand Down Expand Up @@ -3464,7 +3480,7 @@ void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi, u8 ena_tc)
*
* Prepares VSI tc_config to have queue configurations based on MQPRIO options.
*/
static void
static int
ice_vsi_setup_q_map_mqprio(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt,
u8 ena_tc)
{
Expand Down Expand Up @@ -3513,7 +3529,18 @@ ice_vsi_setup_q_map_mqprio(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt,

/* Set actual Tx/Rx queue pairs */
vsi->num_txq = offset + qcount_tx;
if (vsi->num_txq > vsi->alloc_txq) {
dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Tx queues (%u), than were allocated (%u)!\n",
vsi->num_txq, vsi->alloc_txq);
return -EINVAL;
}

vsi->num_rxq = offset + qcount_rx;
if (vsi->num_rxq > vsi->alloc_rxq) {
dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Rx queues (%u), than were allocated (%u)!\n",
vsi->num_rxq, vsi->alloc_rxq);
return -EINVAL;
}

/* Setup queue TC[0].qmap for given VSI context */
ctxt->info.tc_mapping[0] = cpu_to_le16(qmap);
Expand All @@ -3531,6 +3558,8 @@ ice_vsi_setup_q_map_mqprio(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt,
dev_dbg(ice_pf_to_dev(vsi->back), "vsi->num_rxq = %d\n", vsi->num_rxq);
dev_dbg(ice_pf_to_dev(vsi->back), "all_numtc %u, all_enatc: 0x%04x, tc_cfg.numtc %u\n",
vsi->all_numtc, vsi->all_enatc, vsi->tc_cfg.numtc);

return 0;
}

/**
Expand Down Expand Up @@ -3580,9 +3609,12 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)

if (vsi->type == ICE_VSI_PF &&
test_bit(ICE_FLAG_TC_MQPRIO, pf->flags))
ice_vsi_setup_q_map_mqprio(vsi, ctx, ena_tc);
ret = ice_vsi_setup_q_map_mqprio(vsi, ctx, ena_tc);
else
ice_vsi_setup_q_map(vsi, ctx);
ret = ice_vsi_setup_q_map(vsi, ctx);

if (ret)
goto out;

/* must to indicate which section of VSI context are being modified */
ctx->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_RXQ_MAP_VALID);
Expand Down
5 changes: 4 additions & 1 deletion drivers/net/ethernet/intel/ice/ice_tc_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
*/
fltr->rid = rule_added.rid;
fltr->rule_id = rule_added.rule_id;
fltr->dest_id = rule_added.vsi_handle;

exit:
kfree(list);
Expand Down Expand Up @@ -993,7 +994,9 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi,
n_proto_key = ntohs(match.key->n_proto);
n_proto_mask = ntohs(match.mask->n_proto);

if (n_proto_key == ETH_P_ALL || n_proto_key == 0) {
if (n_proto_key == ETH_P_ALL || n_proto_key == 0 ||
fltr->tunnel_type == TNL_GTPU ||
fltr->tunnel_type == TNL_GTPC) {
n_proto_key = 0;
n_proto_mask = 0;
} else {
Expand Down
Loading

0 comments on commit 399bd66

Please sign in to comment.