mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge tag 'net-6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski:
"Including fixes from bluetooth, WiFi and netfilter.
We have one outstanding issue with the stmmac driver, which may be a
LOCKDEP false positive, not a blocker.
Current release - regressions:
- netfilter: nf_tables: re-allow NFPROTO_INET in
nft_(match/target)_validate()
- eth: ionic: fix error handling in PCI reset code
Current release - new code bugs:
- eth: stmmac: complete meta data only when enabled, fix null-deref
- kunit: fix again checksum tests on big endian CPUs
Previous releases - regressions:
- veth: try harder when allocating queue memory
- Bluetooth:
- hci_bcm4377: do not mark valid bd_addr as invalid
- hci_event: fix handling of HCI_EV_IO_CAPA_REQUEST
Previous releases - always broken:
- info leak in __skb_datagram_iter() on netlink socket
- mptcp:
- map v4 address to v6 when destroying subflow
- fix potential wake-up event loss due to sndbuf auto-tuning
- fix double-free on socket dismantle
- wifi: nl80211: reject iftype change with mesh ID change
- fix small out-of-bound read when validating netlink be16/32 types
- rtnetlink: fix error logic of IFLA_BRIDGE_FLAGS writing back
- ipv6: fix potential "struct net" ref-leak in inet6_rtm_getaddr()
- ip_tunnel: prevent perpetual headroom growth with huge number of
tunnels on top of each other
- mctp: fix skb leaks on error paths of mctp_local_output()
- eth: ice: fixes for DPLL state reporting
- dpll: rely on rcu for netdev_dpll_pin() to prevent UaF
- eth: dpaa: accept phy-interface-type = '10gbase-r' in the device
tree"
* tag 'net-6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (73 commits)
dpll: fix build failure due to rcu_dereference_check() on unknown type
kunit: Fix again checksum tests on big endian CPUs
tls: fix use-after-free on failed backlog decryption
tls: separate no-async decryption request handling from async
tls: fix peeking with sync+async decryption
tls: decrement decrypt_pending if no async completion will be called
gtp: fix use-after-free and null-ptr-deref in gtp_newlink()
net: hsr: Use correct offset for HSR TLV values in supervisory HSR frames
igb: extend PTP timestamp adjustments to i211
rtnetlink: fix error logic of IFLA_BRIDGE_FLAGS writing back
tools: ynl: fix handling of multiple mcast groups
selftests: netfilter: add bridge conntrack + multicast test case
netfilter: bridge: confirm multicast packets before passing them up the stack
netfilter: nf_tables: allow NFPROTO_INET in nft_(match/target)_validate()
Bluetooth: qca: Fix triggering coredump implementation
Bluetooth: hci_qca: Set BDA quirk bit if fwnode exists in DT
Bluetooth: qca: Fix wrong event type for patch config command
Bluetooth: Enforce validation on max value of connection interval
Bluetooth: hci_event: Fix handling of HCI_EV_IO_CAPA_REQUEST
Bluetooth: mgmt: Fix limited discoverable off timeout
...
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. Copyright (C) 2023 Google LLC
|
||||
|
||||
=====================================================
|
||||
inet_connection_sock struct fast path usage breakdown
|
||||
=====================================================
|
||||
==========================================
|
||||
inet_sock struct fast path usage breakdown
|
||||
==========================================
|
||||
|
||||
Type Name fastpath_tx_access fastpath_rx_access comment
|
||||
..struct ..inet_sock
|
||||
|
||||
11
MAINTAINERS
11
MAINTAINERS
@@ -17995,33 +17995,34 @@ F: drivers/media/tuners/qt1010*
|
||||
|
||||
QUALCOMM ATH12K WIRELESS DRIVER
|
||||
M: Kalle Valo <kvalo@kernel.org>
|
||||
M: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
M: Jeff Johnson <jjohnson@kernel.org>
|
||||
L: ath12k@lists.infradead.org
|
||||
S: Supported
|
||||
W: https://wireless.wiki.kernel.org/en/users/Drivers/ath12k
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
|
||||
F: drivers/net/wireless/ath/ath12k/
|
||||
N: ath12k
|
||||
|
||||
QUALCOMM ATHEROS ATH10K WIRELESS DRIVER
|
||||
M: Kalle Valo <kvalo@kernel.org>
|
||||
M: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
M: Jeff Johnson <jjohnson@kernel.org>
|
||||
L: ath10k@lists.infradead.org
|
||||
S: Supported
|
||||
W: https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
|
||||
F: Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml
|
||||
F: drivers/net/wireless/ath/ath10k/
|
||||
N: ath10k
|
||||
|
||||
QUALCOMM ATHEROS ATH11K WIRELESS DRIVER
|
||||
M: Kalle Valo <kvalo@kernel.org>
|
||||
M: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
M: Jeff Johnson <jjohnson@kernel.org>
|
||||
L: ath11k@lists.infradead.org
|
||||
S: Supported
|
||||
W: https://wireless.wiki.kernel.org/en/users/Drivers/ath11k
|
||||
B: https://wireless.wiki.kernel.org/en/users/Drivers/ath11k/bugreport
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
|
||||
F: Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
|
||||
F: drivers/net/wireless/ath/ath11k/
|
||||
N: ath11k
|
||||
|
||||
QUALCOMM ATHEROS ATH9K WIRELESS DRIVER
|
||||
M: Toke Høiland-Jørgensen <toke@toke.dk>
|
||||
|
||||
@@ -152,7 +152,7 @@ static int qca_send_patch_config_cmd(struct hci_dev *hdev)
|
||||
bt_dev_dbg(hdev, "QCA Patch config");
|
||||
|
||||
skb = __hci_cmd_sync_ev(hdev, EDL_PATCH_CMD_OPCODE, sizeof(cmd),
|
||||
cmd, HCI_EV_VENDOR, HCI_INIT_TIMEOUT);
|
||||
cmd, 0, HCI_INIT_TIMEOUT);
|
||||
if (IS_ERR(skb)) {
|
||||
err = PTR_ERR(skb);
|
||||
bt_dev_err(hdev, "Sending QCA Patch config failed (%d)", err);
|
||||
|
||||
@@ -1417,7 +1417,7 @@ static int bcm4377_check_bdaddr(struct bcm4377_data *bcm4377)
|
||||
|
||||
bda = (struct hci_rp_read_bd_addr *)skb->data;
|
||||
if (!bcm4377_is_valid_bdaddr(bcm4377, &bda->bdaddr))
|
||||
set_bit(HCI_QUIRK_INVALID_BDADDR, &bcm4377->hdev->quirks);
|
||||
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &bcm4377->hdev->quirks);
|
||||
|
||||
kfree_skb(skb);
|
||||
return 0;
|
||||
@@ -2368,7 +2368,6 @@ static int bcm4377_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
hdev->set_bdaddr = bcm4377_hci_set_bdaddr;
|
||||
hdev->setup = bcm4377_hci_setup;
|
||||
|
||||
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
|
||||
if (bcm4377->hw->broken_mws_transport_config)
|
||||
set_bit(HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG, &hdev->quirks);
|
||||
if (bcm4377->hw->broken_ext_scan)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*
|
||||
* Copyright (C) 2007 Texas Instruments, Inc.
|
||||
* Copyright (c) 2010, 2012, 2018 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Acknowledgements:
|
||||
* This file is based on hci_ll.c, which was...
|
||||
@@ -1806,13 +1807,12 @@ static int qca_power_on(struct hci_dev *hdev)
|
||||
|
||||
static void hci_coredump_qca(struct hci_dev *hdev)
|
||||
{
|
||||
int err;
|
||||
static const u8 param[] = { 0x26 };
|
||||
struct sk_buff *skb;
|
||||
|
||||
skb = __hci_cmd_sync(hdev, 0xfc0c, 1, param, HCI_CMD_TIMEOUT);
|
||||
if (IS_ERR(skb))
|
||||
bt_dev_err(hdev, "%s: trigger crash failed (%ld)", __func__, PTR_ERR(skb));
|
||||
kfree_skb(skb);
|
||||
err = __hci_cmd_send(hdev, 0xfc0c, 1, param);
|
||||
if (err < 0)
|
||||
bt_dev_err(hdev, "%s: trigger crash failed (%d)", __func__, err);
|
||||
}
|
||||
|
||||
static int qca_get_data_path_id(struct hci_dev *hdev, __u8 *data_path_id)
|
||||
@@ -1904,7 +1904,17 @@ retry:
|
||||
case QCA_WCN6750:
|
||||
case QCA_WCN6855:
|
||||
case QCA_WCN7850:
|
||||
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
|
||||
|
||||
/* Set BDA quirk bit for reading BDA value from fwnode property
|
||||
* only if that property exist in DT.
|
||||
*/
|
||||
if (fwnode_property_present(dev_fwnode(hdev->dev.parent), "local-bd-address")) {
|
||||
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
|
||||
bt_dev_info(hdev, "setting quirk bit to read BDA from fwnode later");
|
||||
} else {
|
||||
bt_dev_dbg(hdev, "local-bd-address` is not present in the devicetree so not setting quirk bit for BDA");
|
||||
}
|
||||
|
||||
hci_set_aosp_capable(hdev);
|
||||
|
||||
ret = qca_read_soc_version(hdev, &ver, soc_type);
|
||||
|
||||
@@ -42,6 +42,11 @@ struct dpll_pin_registration {
|
||||
void *priv;
|
||||
};
|
||||
|
||||
struct dpll_pin *netdev_dpll_pin(const struct net_device *dev)
|
||||
{
|
||||
return rcu_dereference_rtnl(dev->dpll_pin);
|
||||
}
|
||||
|
||||
struct dpll_device *dpll_device_get_by_id(int id)
|
||||
{
|
||||
if (xa_get_mark(&dpll_device_xa, id, DPLL_REGISTERED))
|
||||
@@ -564,7 +569,7 @@ void dpll_pin_put(struct dpll_pin *pin)
|
||||
xa_destroy(&pin->parent_refs);
|
||||
xa_erase(&dpll_pin_xa, pin->id);
|
||||
dpll_pin_prop_free(&pin->prop);
|
||||
kfree(pin);
|
||||
kfree_rcu(pin, rcu);
|
||||
}
|
||||
mutex_unlock(&dpll_lock);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ struct dpll_device {
|
||||
* @prop: pin properties copied from the registerer
|
||||
* @rclk_dev_name: holds name of device when pin can recover clock from it
|
||||
* @refcount: refcount
|
||||
* @rcu: rcu_head for kfree_rcu()
|
||||
**/
|
||||
struct dpll_pin {
|
||||
u32 id;
|
||||
@@ -57,6 +58,7 @@ struct dpll_pin {
|
||||
struct xarray parent_refs;
|
||||
struct dpll_pin_properties prop;
|
||||
refcount_t refcount;
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,6 @@ config NET_VENDOR_ADI
|
||||
bool "Analog Devices devices"
|
||||
default y
|
||||
depends on SPI
|
||||
select PHYLIB
|
||||
help
|
||||
If you have a network (Ethernet) card belonging to this class, say Y.
|
||||
|
||||
@@ -22,6 +21,7 @@ config ADIN1110
|
||||
tristate "Analog Devices ADIN1110 MAC-PHY"
|
||||
depends on SPI && NET_SWITCHDEV
|
||||
select CRC8
|
||||
select PHYLIB
|
||||
help
|
||||
Say yes here to build support for Analog Devices ADIN1110
|
||||
Low Power 10BASE-T1L Ethernet MAC-PHY.
|
||||
|
||||
@@ -1073,6 +1073,14 @@ int memac_initialization(struct mac_device *mac_dev,
|
||||
unsigned long capabilities;
|
||||
unsigned long *supported;
|
||||
|
||||
/* The internal connection to the serdes is XGMII, but this isn't
|
||||
* really correct for the phy mode (which is the external connection).
|
||||
* However, this is how all older device trees say that they want
|
||||
* 10GBASE-R (aka XFI), so just convert it for them.
|
||||
*/
|
||||
if (mac_dev->phy_if == PHY_INTERFACE_MODE_XGMII)
|
||||
mac_dev->phy_if = PHY_INTERFACE_MODE_10GBASER;
|
||||
|
||||
mac_dev->phylink_ops = &memac_mac_ops;
|
||||
mac_dev->set_promisc = memac_set_promiscuous;
|
||||
mac_dev->change_addr = memac_modify_mac_address;
|
||||
@@ -1139,7 +1147,7 @@ int memac_initialization(struct mac_device *mac_dev,
|
||||
* (and therefore that xfi_pcs cannot be set). If we are defaulting to
|
||||
* XGMII, assume this is for XFI. Otherwise, assume it is for SGMII.
|
||||
*/
|
||||
if (err && mac_dev->phy_if == PHY_INTERFACE_MODE_XGMII)
|
||||
if (err && mac_dev->phy_if == PHY_INTERFACE_MODE_10GBASER)
|
||||
memac->xfi_pcs = pcs;
|
||||
else
|
||||
memac->sgmii_pcs = pcs;
|
||||
@@ -1153,14 +1161,6 @@ int memac_initialization(struct mac_device *mac_dev,
|
||||
goto _return_fm_mac_free;
|
||||
}
|
||||
|
||||
/* The internal connection to the serdes is XGMII, but this isn't
|
||||
* really correct for the phy mode (which is the external connection).
|
||||
* However, this is how all older device trees say that they want
|
||||
* 10GBASE-R (aka XFI), so just convert it for them.
|
||||
*/
|
||||
if (mac_dev->phy_if == PHY_INTERFACE_MODE_XGMII)
|
||||
mac_dev->phy_if = PHY_INTERFACE_MODE_10GBASER;
|
||||
|
||||
/* TODO: The following interface modes are supported by (some) hardware
|
||||
* but not by this driver:
|
||||
* - 1000BASE-KX
|
||||
|
||||
@@ -190,15 +190,13 @@ static void ice_free_q_vector(struct ice_vsi *vsi, int v_idx)
|
||||
q_vector = vsi->q_vectors[v_idx];
|
||||
|
||||
ice_for_each_tx_ring(tx_ring, q_vector->tx) {
|
||||
if (vsi->netdev)
|
||||
netif_queue_set_napi(vsi->netdev, tx_ring->q_index,
|
||||
NETDEV_QUEUE_TYPE_TX, NULL);
|
||||
ice_queue_set_napi(vsi, tx_ring->q_index, NETDEV_QUEUE_TYPE_TX,
|
||||
NULL);
|
||||
tx_ring->q_vector = NULL;
|
||||
}
|
||||
ice_for_each_rx_ring(rx_ring, q_vector->rx) {
|
||||
if (vsi->netdev)
|
||||
netif_queue_set_napi(vsi->netdev, rx_ring->q_index,
|
||||
NETDEV_QUEUE_TYPE_RX, NULL);
|
||||
ice_queue_set_napi(vsi, rx_ring->q_index, NETDEV_QUEUE_TYPE_RX,
|
||||
NULL);
|
||||
rx_ring->q_vector = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,26 @@ static const char * const pin_type_name[] = {
|
||||
[ICE_DPLL_PIN_TYPE_RCLK_INPUT] = "rclk-input",
|
||||
};
|
||||
|
||||
/**
|
||||
* ice_dpll_is_reset - check if reset is in progress
|
||||
* @pf: private board structure
|
||||
* @extack: error reporting
|
||||
*
|
||||
* If reset is in progress, fill extack with error.
|
||||
*
|
||||
* Return:
|
||||
* * false - no reset in progress
|
||||
* * true - reset in progress
|
||||
*/
|
||||
static bool ice_dpll_is_reset(struct ice_pf *pf, struct netlink_ext_ack *extack)
|
||||
{
|
||||
if (ice_is_reset_in_progress(pf->state)) {
|
||||
NL_SET_ERR_MSG(extack, "PF reset in progress");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_dpll_pin_freq_set - set pin's frequency
|
||||
* @pf: private board structure
|
||||
@@ -109,6 +129,9 @@ ice_dpll_frequency_set(const struct dpll_pin *pin, void *pin_priv,
|
||||
struct ice_pf *pf = d->pf;
|
||||
int ret;
|
||||
|
||||
if (ice_dpll_is_reset(pf, extack))
|
||||
return -EBUSY;
|
||||
|
||||
mutex_lock(&pf->dplls.lock);
|
||||
ret = ice_dpll_pin_freq_set(pf, p, pin_type, frequency, extack);
|
||||
mutex_unlock(&pf->dplls.lock);
|
||||
@@ -254,6 +277,7 @@ ice_dpll_output_frequency_get(const struct dpll_pin *pin, void *pin_priv,
|
||||
* ice_dpll_pin_enable - enable a pin on dplls
|
||||
* @hw: board private hw structure
|
||||
* @pin: pointer to a pin
|
||||
* @dpll_idx: dpll index to connect to output pin
|
||||
* @pin_type: type of pin being enabled
|
||||
* @extack: error reporting
|
||||
*
|
||||
@@ -266,7 +290,7 @@ ice_dpll_output_frequency_get(const struct dpll_pin *pin, void *pin_priv,
|
||||
*/
|
||||
static int
|
||||
ice_dpll_pin_enable(struct ice_hw *hw, struct ice_dpll_pin *pin,
|
||||
enum ice_dpll_pin_type pin_type,
|
||||
u8 dpll_idx, enum ice_dpll_pin_type pin_type,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
u8 flags = 0;
|
||||
@@ -280,10 +304,12 @@ ice_dpll_pin_enable(struct ice_hw *hw, struct ice_dpll_pin *pin,
|
||||
ret = ice_aq_set_input_pin_cfg(hw, pin->idx, 0, flags, 0, 0);
|
||||
break;
|
||||
case ICE_DPLL_PIN_TYPE_OUTPUT:
|
||||
flags = ICE_AQC_SET_CGU_OUT_CFG_UPDATE_SRC_SEL;
|
||||
if (pin->flags[0] & ICE_AQC_GET_CGU_OUT_CFG_ESYNC_EN)
|
||||
flags |= ICE_AQC_SET_CGU_OUT_CFG_ESYNC_EN;
|
||||
flags |= ICE_AQC_SET_CGU_OUT_CFG_OUT_EN;
|
||||
ret = ice_aq_set_output_pin_cfg(hw, pin->idx, flags, 0, 0, 0);
|
||||
ret = ice_aq_set_output_pin_cfg(hw, pin->idx, flags, dpll_idx,
|
||||
0, 0);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
@@ -370,7 +396,7 @@ ice_dpll_pin_state_update(struct ice_pf *pf, struct ice_dpll_pin *pin,
|
||||
case ICE_DPLL_PIN_TYPE_INPUT:
|
||||
ret = ice_aq_get_input_pin_cfg(&pf->hw, pin->idx, NULL, NULL,
|
||||
NULL, &pin->flags[0],
|
||||
&pin->freq, NULL);
|
||||
&pin->freq, &pin->phase_adjust);
|
||||
if (ret)
|
||||
goto err;
|
||||
if (ICE_AQC_GET_CGU_IN_CFG_FLG2_INPUT_EN & pin->flags[0]) {
|
||||
@@ -398,14 +424,27 @@ ice_dpll_pin_state_update(struct ice_pf *pf, struct ice_dpll_pin *pin,
|
||||
break;
|
||||
case ICE_DPLL_PIN_TYPE_OUTPUT:
|
||||
ret = ice_aq_get_output_pin_cfg(&pf->hw, pin->idx,
|
||||
&pin->flags[0], NULL,
|
||||
&pin->flags[0], &parent,
|
||||
&pin->freq, NULL);
|
||||
if (ret)
|
||||
goto err;
|
||||
if (ICE_AQC_SET_CGU_OUT_CFG_OUT_EN & pin->flags[0])
|
||||
pin->state[0] = DPLL_PIN_STATE_CONNECTED;
|
||||
else
|
||||
pin->state[0] = DPLL_PIN_STATE_DISCONNECTED;
|
||||
|
||||
parent &= ICE_AQC_GET_CGU_OUT_CFG_DPLL_SRC_SEL;
|
||||
if (ICE_AQC_SET_CGU_OUT_CFG_OUT_EN & pin->flags[0]) {
|
||||
pin->state[pf->dplls.eec.dpll_idx] =
|
||||
parent == pf->dplls.eec.dpll_idx ?
|
||||
DPLL_PIN_STATE_CONNECTED :
|
||||
DPLL_PIN_STATE_DISCONNECTED;
|
||||
pin->state[pf->dplls.pps.dpll_idx] =
|
||||
parent == pf->dplls.pps.dpll_idx ?
|
||||
DPLL_PIN_STATE_CONNECTED :
|
||||
DPLL_PIN_STATE_DISCONNECTED;
|
||||
} else {
|
||||
pin->state[pf->dplls.eec.dpll_idx] =
|
||||
DPLL_PIN_STATE_DISCONNECTED;
|
||||
pin->state[pf->dplls.pps.dpll_idx] =
|
||||
DPLL_PIN_STATE_DISCONNECTED;
|
||||
}
|
||||
break;
|
||||
case ICE_DPLL_PIN_TYPE_RCLK_INPUT:
|
||||
for (parent = 0; parent < pf->dplls.rclk.num_parents;
|
||||
@@ -568,9 +607,13 @@ ice_dpll_pin_state_set(const struct dpll_pin *pin, void *pin_priv,
|
||||
struct ice_pf *pf = d->pf;
|
||||
int ret;
|
||||
|
||||
if (ice_dpll_is_reset(pf, extack))
|
||||
return -EBUSY;
|
||||
|
||||
mutex_lock(&pf->dplls.lock);
|
||||
if (enable)
|
||||
ret = ice_dpll_pin_enable(&pf->hw, p, pin_type, extack);
|
||||
ret = ice_dpll_pin_enable(&pf->hw, p, d->dpll_idx, pin_type,
|
||||
extack);
|
||||
else
|
||||
ret = ice_dpll_pin_disable(&pf->hw, p, pin_type, extack);
|
||||
if (!ret)
|
||||
@@ -603,6 +646,11 @@ ice_dpll_output_state_set(const struct dpll_pin *pin, void *pin_priv,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
bool enable = state == DPLL_PIN_STATE_CONNECTED;
|
||||
struct ice_dpll_pin *p = pin_priv;
|
||||
struct ice_dpll *d = dpll_priv;
|
||||
|
||||
if (!enable && p->state[d->dpll_idx] == DPLL_PIN_STATE_DISCONNECTED)
|
||||
return 0;
|
||||
|
||||
return ice_dpll_pin_state_set(pin, pin_priv, dpll, dpll_priv, enable,
|
||||
extack, ICE_DPLL_PIN_TYPE_OUTPUT);
|
||||
@@ -665,14 +713,16 @@ ice_dpll_pin_state_get(const struct dpll_pin *pin, void *pin_priv,
|
||||
struct ice_pf *pf = d->pf;
|
||||
int ret;
|
||||
|
||||
if (ice_dpll_is_reset(pf, extack))
|
||||
return -EBUSY;
|
||||
|
||||
mutex_lock(&pf->dplls.lock);
|
||||
ret = ice_dpll_pin_state_update(pf, p, pin_type, extack);
|
||||
if (ret)
|
||||
goto unlock;
|
||||
if (pin_type == ICE_DPLL_PIN_TYPE_INPUT)
|
||||
if (pin_type == ICE_DPLL_PIN_TYPE_INPUT ||
|
||||
pin_type == ICE_DPLL_PIN_TYPE_OUTPUT)
|
||||
*state = p->state[d->dpll_idx];
|
||||
else if (pin_type == ICE_DPLL_PIN_TYPE_OUTPUT)
|
||||
*state = p->state[0];
|
||||
ret = 0;
|
||||
unlock:
|
||||
mutex_unlock(&pf->dplls.lock);
|
||||
@@ -790,6 +840,9 @@ ice_dpll_input_prio_set(const struct dpll_pin *pin, void *pin_priv,
|
||||
struct ice_pf *pf = d->pf;
|
||||
int ret;
|
||||
|
||||
if (ice_dpll_is_reset(pf, extack))
|
||||
return -EBUSY;
|
||||
|
||||
mutex_lock(&pf->dplls.lock);
|
||||
ret = ice_dpll_hw_input_prio_set(pf, d, p, prio, extack);
|
||||
mutex_unlock(&pf->dplls.lock);
|
||||
@@ -910,6 +963,9 @@ ice_dpll_pin_phase_adjust_set(const struct dpll_pin *pin, void *pin_priv,
|
||||
u8 flag, flags_en = 0;
|
||||
int ret;
|
||||
|
||||
if (ice_dpll_is_reset(pf, extack))
|
||||
return -EBUSY;
|
||||
|
||||
mutex_lock(&pf->dplls.lock);
|
||||
switch (type) {
|
||||
case ICE_DPLL_PIN_TYPE_INPUT:
|
||||
@@ -1069,6 +1125,9 @@ ice_dpll_rclk_state_on_pin_set(const struct dpll_pin *pin, void *pin_priv,
|
||||
int ret = -EINVAL;
|
||||
u32 hw_idx;
|
||||
|
||||
if (ice_dpll_is_reset(pf, extack))
|
||||
return -EBUSY;
|
||||
|
||||
mutex_lock(&pf->dplls.lock);
|
||||
hw_idx = parent->idx - pf->dplls.base_rclk_idx;
|
||||
if (hw_idx >= pf->dplls.num_inputs)
|
||||
@@ -1123,6 +1182,9 @@ ice_dpll_rclk_state_on_pin_get(const struct dpll_pin *pin, void *pin_priv,
|
||||
int ret = -EINVAL;
|
||||
u32 hw_idx;
|
||||
|
||||
if (ice_dpll_is_reset(pf, extack))
|
||||
return -EBUSY;
|
||||
|
||||
mutex_lock(&pf->dplls.lock);
|
||||
hw_idx = parent->idx - pf->dplls.base_rclk_idx;
|
||||
if (hw_idx >= pf->dplls.num_inputs)
|
||||
@@ -1305,8 +1367,10 @@ static void ice_dpll_periodic_work(struct kthread_work *work)
|
||||
struct ice_pf *pf = container_of(d, struct ice_pf, dplls);
|
||||
struct ice_dpll *de = &pf->dplls.eec;
|
||||
struct ice_dpll *dp = &pf->dplls.pps;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (ice_is_reset_in_progress(pf->state))
|
||||
goto resched;
|
||||
mutex_lock(&pf->dplls.lock);
|
||||
ret = ice_dpll_update_state(pf, de, false);
|
||||
if (!ret)
|
||||
@@ -1326,6 +1390,7 @@ static void ice_dpll_periodic_work(struct kthread_work *work)
|
||||
ice_dpll_notify_changes(de);
|
||||
ice_dpll_notify_changes(dp);
|
||||
|
||||
resched:
|
||||
/* Run twice a second or reschedule if update failed */
|
||||
kthread_queue_delayed_work(d->kworker, &d->work,
|
||||
ret ? msecs_to_jiffies(10) :
|
||||
|
||||
@@ -2426,7 +2426,7 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
|
||||
ice_vsi_map_rings_to_vectors(vsi);
|
||||
|
||||
/* Associate q_vector rings to napi */
|
||||
ice_vsi_set_napi_queues(vsi, true);
|
||||
ice_vsi_set_napi_queues(vsi);
|
||||
|
||||
vsi->stat_offsets_loaded = false;
|
||||
|
||||
@@ -2904,19 +2904,19 @@ void ice_vsi_dis_irq(struct ice_vsi *vsi)
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_queue_set_napi - Set the napi instance for the queue
|
||||
* __ice_queue_set_napi - Set the napi instance for the queue
|
||||
* @dev: device to which NAPI and queue belong
|
||||
* @queue_index: Index of queue
|
||||
* @type: queue type as RX or TX
|
||||
* @napi: NAPI context
|
||||
* @locked: is the rtnl_lock already held
|
||||
*
|
||||
* Set the napi instance for the queue
|
||||
* Set the napi instance for the queue. Caller indicates the lock status.
|
||||
*/
|
||||
static void
|
||||
ice_queue_set_napi(struct net_device *dev, unsigned int queue_index,
|
||||
enum netdev_queue_type type, struct napi_struct *napi,
|
||||
bool locked)
|
||||
__ice_queue_set_napi(struct net_device *dev, unsigned int queue_index,
|
||||
enum netdev_queue_type type, struct napi_struct *napi,
|
||||
bool locked)
|
||||
{
|
||||
if (!locked)
|
||||
rtnl_lock();
|
||||
@@ -2926,26 +2926,79 @@ ice_queue_set_napi(struct net_device *dev, unsigned int queue_index,
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_q_vector_set_napi_queues - Map queue[s] associated with the napi
|
||||
* ice_queue_set_napi - Set the napi instance for the queue
|
||||
* @vsi: VSI being configured
|
||||
* @queue_index: Index of queue
|
||||
* @type: queue type as RX or TX
|
||||
* @napi: NAPI context
|
||||
*
|
||||
* Set the napi instance for the queue. The rtnl lock state is derived from the
|
||||
* execution path.
|
||||
*/
|
||||
void
|
||||
ice_queue_set_napi(struct ice_vsi *vsi, unsigned int queue_index,
|
||||
enum netdev_queue_type type, struct napi_struct *napi)
|
||||
{
|
||||
struct ice_pf *pf = vsi->back;
|
||||
|
||||
if (!vsi->netdev)
|
||||
return;
|
||||
|
||||
if (current_work() == &pf->serv_task ||
|
||||
test_bit(ICE_PREPARED_FOR_RESET, pf->state) ||
|
||||
test_bit(ICE_DOWN, pf->state) ||
|
||||
test_bit(ICE_SUSPENDED, pf->state))
|
||||
__ice_queue_set_napi(vsi->netdev, queue_index, type, napi,
|
||||
false);
|
||||
else
|
||||
__ice_queue_set_napi(vsi->netdev, queue_index, type, napi,
|
||||
true);
|
||||
}
|
||||
|
||||
/**
|
||||
* __ice_q_vector_set_napi_queues - Map queue[s] associated with the napi
|
||||
* @q_vector: q_vector pointer
|
||||
* @locked: is the rtnl_lock already held
|
||||
*
|
||||
* Associate the q_vector napi with all the queue[s] on the vector
|
||||
* Associate the q_vector napi with all the queue[s] on the vector.
|
||||
* Caller indicates the lock status.
|
||||
*/
|
||||
void ice_q_vector_set_napi_queues(struct ice_q_vector *q_vector, bool locked)
|
||||
void __ice_q_vector_set_napi_queues(struct ice_q_vector *q_vector, bool locked)
|
||||
{
|
||||
struct ice_rx_ring *rx_ring;
|
||||
struct ice_tx_ring *tx_ring;
|
||||
|
||||
ice_for_each_rx_ring(rx_ring, q_vector->rx)
|
||||
ice_queue_set_napi(q_vector->vsi->netdev, rx_ring->q_index,
|
||||
NETDEV_QUEUE_TYPE_RX, &q_vector->napi,
|
||||
locked);
|
||||
__ice_queue_set_napi(q_vector->vsi->netdev, rx_ring->q_index,
|
||||
NETDEV_QUEUE_TYPE_RX, &q_vector->napi,
|
||||
locked);
|
||||
|
||||
ice_for_each_tx_ring(tx_ring, q_vector->tx)
|
||||
ice_queue_set_napi(q_vector->vsi->netdev, tx_ring->q_index,
|
||||
NETDEV_QUEUE_TYPE_TX, &q_vector->napi,
|
||||
locked);
|
||||
__ice_queue_set_napi(q_vector->vsi->netdev, tx_ring->q_index,
|
||||
NETDEV_QUEUE_TYPE_TX, &q_vector->napi,
|
||||
locked);
|
||||
/* Also set the interrupt number for the NAPI */
|
||||
netif_napi_set_irq(&q_vector->napi, q_vector->irq.virq);
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_q_vector_set_napi_queues - Map queue[s] associated with the napi
|
||||
* @q_vector: q_vector pointer
|
||||
*
|
||||
* Associate the q_vector napi with all the queue[s] on the vector
|
||||
*/
|
||||
void ice_q_vector_set_napi_queues(struct ice_q_vector *q_vector)
|
||||
{
|
||||
struct ice_rx_ring *rx_ring;
|
||||
struct ice_tx_ring *tx_ring;
|
||||
|
||||
ice_for_each_rx_ring(rx_ring, q_vector->rx)
|
||||
ice_queue_set_napi(q_vector->vsi, rx_ring->q_index,
|
||||
NETDEV_QUEUE_TYPE_RX, &q_vector->napi);
|
||||
|
||||
ice_for_each_tx_ring(tx_ring, q_vector->tx)
|
||||
ice_queue_set_napi(q_vector->vsi, tx_ring->q_index,
|
||||
NETDEV_QUEUE_TYPE_TX, &q_vector->napi);
|
||||
/* Also set the interrupt number for the NAPI */
|
||||
netif_napi_set_irq(&q_vector->napi, q_vector->irq.virq);
|
||||
}
|
||||
@@ -2953,11 +3006,10 @@ void ice_q_vector_set_napi_queues(struct ice_q_vector *q_vector, bool locked)
|
||||
/**
|
||||
* ice_vsi_set_napi_queues
|
||||
* @vsi: VSI pointer
|
||||
* @locked: is the rtnl_lock already held
|
||||
*
|
||||
* Associate queue[s] with napi for all vectors
|
||||
*/
|
||||
void ice_vsi_set_napi_queues(struct ice_vsi *vsi, bool locked)
|
||||
void ice_vsi_set_napi_queues(struct ice_vsi *vsi)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2965,7 +3017,7 @@ void ice_vsi_set_napi_queues(struct ice_vsi *vsi, bool locked)
|
||||
return;
|
||||
|
||||
ice_for_each_q_vector(vsi, i)
|
||||
ice_q_vector_set_napi_queues(vsi->q_vectors[i], locked);
|
||||
ice_q_vector_set_napi_queues(vsi->q_vectors[i]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -91,9 +91,15 @@ void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi, u8 ena_tc);
|
||||
struct ice_vsi *
|
||||
ice_vsi_setup(struct ice_pf *pf, struct ice_vsi_cfg_params *params);
|
||||
|
||||
void ice_q_vector_set_napi_queues(struct ice_q_vector *q_vector, bool locked);
|
||||
void
|
||||
ice_queue_set_napi(struct ice_vsi *vsi, unsigned int queue_index,
|
||||
enum netdev_queue_type type, struct napi_struct *napi);
|
||||
|
||||
void ice_vsi_set_napi_queues(struct ice_vsi *vsi, bool locked);
|
||||
void __ice_q_vector_set_napi_queues(struct ice_q_vector *q_vector, bool locked);
|
||||
|
||||
void ice_q_vector_set_napi_queues(struct ice_q_vector *q_vector);
|
||||
|
||||
void ice_vsi_set_napi_queues(struct ice_vsi *vsi);
|
||||
|
||||
int ice_vsi_release(struct ice_vsi *vsi);
|
||||
|
||||
|
||||
@@ -3495,7 +3495,7 @@ static void ice_napi_add(struct ice_vsi *vsi)
|
||||
ice_for_each_q_vector(vsi, v_idx) {
|
||||
netif_napi_add(vsi->netdev, &vsi->q_vectors[v_idx]->napi,
|
||||
ice_napi_poll);
|
||||
ice_q_vector_set_napi_queues(vsi->q_vectors[v_idx], false);
|
||||
__ice_q_vector_set_napi_queues(vsi->q_vectors[v_idx], false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5447,6 +5447,7 @@ static int ice_reinit_interrupt_scheme(struct ice_pf *pf)
|
||||
if (ret)
|
||||
goto err_reinit;
|
||||
ice_vsi_map_rings_to_vectors(pf->vsi[v]);
|
||||
ice_vsi_set_napi_queues(pf->vsi[v]);
|
||||
}
|
||||
|
||||
ret = ice_req_irq_msix_misc(pf);
|
||||
|
||||
@@ -957,7 +957,7 @@ static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
|
||||
|
||||
igb_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval);
|
||||
/* adjust timestamp for the TX latency based on link speed */
|
||||
if (adapter->hw.mac.type == e1000_i210) {
|
||||
if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
|
||||
switch (adapter->link_speed) {
|
||||
case SPEED_10:
|
||||
adjust = IGB_I210_TX_LATENCY_10;
|
||||
@@ -1003,6 +1003,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va,
|
||||
ktime_t *timestamp)
|
||||
{
|
||||
struct igb_adapter *adapter = q_vector->adapter;
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
struct skb_shared_hwtstamps ts;
|
||||
__le64 *regval = (__le64 *)va;
|
||||
int adjust = 0;
|
||||
@@ -1022,7 +1023,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va,
|
||||
igb_ptp_systim_to_hwtstamp(adapter, &ts, le64_to_cpu(regval[1]));
|
||||
|
||||
/* adjust timestamp for the RX latency based on link speed */
|
||||
if (adapter->hw.mac.type == e1000_i210) {
|
||||
if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
|
||||
switch (adapter->link_speed) {
|
||||
case SPEED_10:
|
||||
adjust = IGB_I210_RX_LATENCY_10;
|
||||
|
||||
@@ -93,6 +93,7 @@ static void ionic_unmap_bars(struct ionic *ionic)
|
||||
bars[i].len = 0;
|
||||
}
|
||||
}
|
||||
ionic->num_bars = 0;
|
||||
}
|
||||
|
||||
void __iomem *ionic_bus_map_dbpage(struct ionic *ionic, int page_num)
|
||||
@@ -215,13 +216,15 @@ out:
|
||||
|
||||
static void ionic_clear_pci(struct ionic *ionic)
|
||||
{
|
||||
ionic->idev.dev_info_regs = NULL;
|
||||
ionic->idev.dev_cmd_regs = NULL;
|
||||
ionic->idev.intr_status = NULL;
|
||||
ionic->idev.intr_ctrl = NULL;
|
||||
if (ionic->num_bars) {
|
||||
ionic->idev.dev_info_regs = NULL;
|
||||
ionic->idev.dev_cmd_regs = NULL;
|
||||
ionic->idev.intr_status = NULL;
|
||||
ionic->idev.intr_ctrl = NULL;
|
||||
|
||||
ionic_unmap_bars(ionic);
|
||||
pci_release_regions(ionic->pdev);
|
||||
ionic_unmap_bars(ionic);
|
||||
pci_release_regions(ionic->pdev);
|
||||
}
|
||||
|
||||
if (pci_is_enabled(ionic->pdev))
|
||||
pci_disable_device(ionic->pdev);
|
||||
|
||||
@@ -319,22 +319,32 @@ do_check_time:
|
||||
|
||||
u8 ionic_dev_cmd_status(struct ionic_dev *idev)
|
||||
{
|
||||
if (!idev->dev_cmd_regs)
|
||||
return (u8)PCI_ERROR_RESPONSE;
|
||||
return ioread8(&idev->dev_cmd_regs->comp.comp.status);
|
||||
}
|
||||
|
||||
bool ionic_dev_cmd_done(struct ionic_dev *idev)
|
||||
{
|
||||
if (!idev->dev_cmd_regs)
|
||||
return false;
|
||||
return ioread32(&idev->dev_cmd_regs->done) & IONIC_DEV_CMD_DONE;
|
||||
}
|
||||
|
||||
void ionic_dev_cmd_comp(struct ionic_dev *idev, union ionic_dev_cmd_comp *comp)
|
||||
{
|
||||
if (!idev->dev_cmd_regs)
|
||||
return;
|
||||
memcpy_fromio(comp, &idev->dev_cmd_regs->comp, sizeof(*comp));
|
||||
}
|
||||
|
||||
void ionic_dev_cmd_go(struct ionic_dev *idev, union ionic_dev_cmd *cmd)
|
||||
{
|
||||
idev->opcode = cmd->cmd.opcode;
|
||||
|
||||
if (!idev->dev_cmd_regs)
|
||||
return;
|
||||
|
||||
memcpy_toio(&idev->dev_cmd_regs->cmd, cmd, sizeof(*cmd));
|
||||
iowrite32(0, &idev->dev_cmd_regs->done);
|
||||
iowrite32(1, &idev->dev_cmd_regs->doorbell);
|
||||
|
||||
@@ -90,18 +90,23 @@ static void ionic_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
|
||||
void *p)
|
||||
{
|
||||
struct ionic_lif *lif = netdev_priv(netdev);
|
||||
struct ionic_dev *idev;
|
||||
unsigned int offset;
|
||||
unsigned int size;
|
||||
|
||||
regs->version = IONIC_DEV_CMD_REG_VERSION;
|
||||
|
||||
idev = &lif->ionic->idev;
|
||||
if (!idev->dev_info_regs)
|
||||
return;
|
||||
|
||||
offset = 0;
|
||||
size = IONIC_DEV_INFO_REG_COUNT * sizeof(u32);
|
||||
memcpy_fromio(p + offset, lif->ionic->idev.dev_info_regs->words, size);
|
||||
|
||||
offset += size;
|
||||
size = IONIC_DEV_CMD_REG_COUNT * sizeof(u32);
|
||||
memcpy_fromio(p + offset, lif->ionic->idev.dev_cmd_regs->words, size);
|
||||
memcpy_fromio(p + offset, idev->dev_cmd_regs->words, size);
|
||||
}
|
||||
|
||||
static void ionic_get_link_ext_stats(struct net_device *netdev,
|
||||
|
||||
@@ -109,6 +109,11 @@ int ionic_firmware_update(struct ionic_lif *lif, const struct firmware *fw,
|
||||
dl = priv_to_devlink(ionic);
|
||||
devlink_flash_update_status_notify(dl, "Preparing to flash", NULL, 0, 0);
|
||||
|
||||
if (!idev->dev_cmd_regs) {
|
||||
err = -ENXIO;
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
buf_sz = sizeof(idev->dev_cmd_regs->data);
|
||||
|
||||
netdev_dbg(netdev,
|
||||
|
||||
@@ -3559,7 +3559,10 @@ int ionic_lif_init(struct ionic_lif *lif)
|
||||
goto err_out_notifyq_deinit;
|
||||
}
|
||||
|
||||
err = ionic_init_nic_features(lif);
|
||||
if (test_bit(IONIC_LIF_F_FW_RESET, lif->state))
|
||||
err = ionic_set_nic_features(lif, lif->netdev->features);
|
||||
else
|
||||
err = ionic_init_nic_features(lif);
|
||||
if (err)
|
||||
goto err_out_notifyq_deinit;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user