mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'net-7.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski:
"Including fixes from Netfilter, IPsec, Bluetooth and WiFi.
Current release - fix to a fix:
- ipmr: add __rcu to netns_ipv4.mrt, make sure we hold the RCU lock
in all relevant places
Current release - new code bugs:
- fixes for the recently added resizable hash tables
- ipv6: make sure we default IPv6 tunnel drivers to =m now that IPv6
itself is built in
- drv: octeontx2-af: fixes for parser/CAM fixes
Previous releases - regressions:
- phy: micrel: fix LAN8814 QSGMII soft reset
- wifi:
- cw1200: revert "Fix locking in error paths"
- ath12k: fix crash on WCN7850, due to adding the same queue
buffer to a list multiple times
Previous releases - always broken:
- number of info leak fixes
- ipv6: implement limits on extension header parsing
- wifi: number of fixes for missing bound checks in the drivers
- Bluetooth: fixes for races and locking issues
- af_unix:
- fix an issue between garbage collection and PEEK
- fix yet another issue with OOB data
- xfrm: esp: avoid in-place decrypt on shared skb frags
- netfilter: replace skb_try_make_writable() by skb_ensure_writable()
- openvswitch: vport: fix race between tunnel creation and linking
leading to invalid memory accesses (type confusion)
- drv: amd-xgbe: fix PTP addend overflow causing frozen clock
Misc:
- sched/isolation: make HK_TYPE_KTHREAD an alias of HK_TYPE_DOMAIN
(for relevant IPVS change)"
* tag 'net-7.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (190 commits)
net: sparx5: configure serdes for 1000BASE-X in sparx5_port_init()
net: sparx5: fix wrong chip ids for TSN SKUs
net: stmmac: dwmac-nuvoton: fix NULL pointer dereference in nvt_set_phy_intf_sel()
tcp: Fix dst leak in tcp_v6_connect().
ipmr: Call ipmr_fib_lookup() under RCU.
net: phy: broadcom: Save PHY counters during suspend
net/smc: fix missing sk_err when TCP handshake fails
af_unix: Reject SIOCATMARK on non-stream sockets
veth: fix OOB txq access in veth_poll() with asymmetric queue counts
eth: fbnic: fix double-free of PCS on phylink creation failure
net: ethernet: cortina: Drop half-assembled SKB
selftests: mptcp: pm: restrict 'unknown' check to pm_nl_ctl
selftests: mptcp: check output: catch cmd errors
mptcp: pm: prio: skip closed subflows
mptcp: pm: ADD_ADDR rtx: return early if no retrans
mptcp: pm: ADD_ADDR rtx: skip inactive subflows
mptcp: pm: ADD_ADDR rtx: resched blocked ADD_ADDR quicker
mptcp: pm: ADD_ADDR rtx: free sk if last
mptcp: pm: ADD_ADDR rtx: always decrease sk refcount
mptcp: pm: ADD_ADDR rtx: fix potential data-race
...
This commit is contained in:
@@ -7077,6 +7077,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/debugobjec
|
||||
F: include/linux/debugobjects.h
|
||||
F: lib/debugobjects.c
|
||||
|
||||
DEC LANCE NETWORK DRIVER
|
||||
M: "Maciej W. Rozycki" <macro@orcam.me.uk>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/ethernet/amd/declance.c
|
||||
|
||||
DECSTATION PLATFORM SUPPORT
|
||||
M: "Maciej W. Rozycki" <macro@orcam.me.uk>
|
||||
L: linux-mips@vger.kernel.org
|
||||
|
||||
@@ -289,6 +289,9 @@ static inline void btintel_pcie_dump_debug_registers(struct hci_dev *hdev)
|
||||
skb_put_data(skb, buf, strlen(buf));
|
||||
data->boot_stage_cache = reg;
|
||||
|
||||
if (reg & BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_WARNING)
|
||||
bt_dev_warn(hdev, "Controller device warning (boot_stage: 0x%8.8x)", reg);
|
||||
|
||||
reg = btintel_pcie_rd_reg32(data, BTINTEL_PCIE_CSR_IPC_STATUS_REG);
|
||||
snprintf(buf, sizeof(buf), "ipc status: 0x%8.8x", reg);
|
||||
skb_put_data(skb, buf, strlen(buf));
|
||||
@@ -880,8 +883,11 @@ static inline bool btintel_pcie_in_lockdown(struct btintel_pcie_data *data)
|
||||
|
||||
static inline bool btintel_pcie_in_error(struct btintel_pcie_data *data)
|
||||
{
|
||||
return (data->boot_stage_cache & BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_ERR) ||
|
||||
(data->boot_stage_cache & BTINTEL_PCIE_CSR_BOOT_STAGE_ABORT_HANDLER);
|
||||
if (data->boot_stage_cache & BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_WARNING)
|
||||
bt_dev_warn(data->hdev, "Controller device warning (boot_stage: 0x%8.8x)",
|
||||
data->boot_stage_cache);
|
||||
|
||||
return data->boot_stage_cache & BTINTEL_PCIE_CSR_BOOT_STAGE_ABORT_HANDLER;
|
||||
}
|
||||
|
||||
static void btintel_pcie_msix_gp1_handler(struct btintel_pcie_data *data)
|
||||
@@ -914,7 +920,8 @@ static void btintel_pcie_msix_gp0_handler(struct btintel_pcie_data *data)
|
||||
data->img_resp_cache = reg;
|
||||
|
||||
if (btintel_pcie_in_error(data)) {
|
||||
bt_dev_err(data->hdev, "Controller in error state");
|
||||
bt_dev_err(data->hdev, "Controller in error state (boot_stage: 0x%8.8x)",
|
||||
data->boot_stage_cache);
|
||||
btintel_pcie_dump_debug_registers(data->hdev);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#define BTINTEL_PCIE_CSR_BOOT_STAGE_OPFW (BIT(2))
|
||||
#define BTINTEL_PCIE_CSR_BOOT_STAGE_ROM_LOCKDOWN (BIT(10))
|
||||
#define BTINTEL_PCIE_CSR_BOOT_STAGE_IML_LOCKDOWN (BIT(11))
|
||||
#define BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_ERR (BIT(12))
|
||||
#define BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_WARNING (BIT(12))
|
||||
#define BTINTEL_PCIE_CSR_BOOT_STAGE_ABORT_HANDLER (BIT(13))
|
||||
#define BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_HALTED (BIT(14))
|
||||
#define BTINTEL_PCIE_CSR_BOOT_STAGE_MAC_ACCESS_ON (BIT(16))
|
||||
|
||||
@@ -695,8 +695,13 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,
|
||||
if (data->evt_skb == NULL)
|
||||
goto err_free_wc;
|
||||
|
||||
/* Parse and handle the return WMT event */
|
||||
wmt_evt = (struct btmtk_hci_wmt_evt *)data->evt_skb->data;
|
||||
wmt_evt = skb_pull_data(data->evt_skb, sizeof(*wmt_evt));
|
||||
if (!wmt_evt) {
|
||||
bt_dev_err(hdev, "WMT event too short (%u bytes)",
|
||||
data->evt_skb->len);
|
||||
err = -EINVAL;
|
||||
goto err_free_skb;
|
||||
}
|
||||
if (wmt_evt->whdr.op != hdr->op) {
|
||||
bt_dev_err(hdev, "Wrong op received %d expected %d",
|
||||
wmt_evt->whdr.op, hdr->op);
|
||||
@@ -712,6 +717,12 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,
|
||||
status = BTMTK_WMT_PATCH_DONE;
|
||||
break;
|
||||
case BTMTK_WMT_FUNC_CTRL:
|
||||
if (!skb_pull_data(data->evt_skb,
|
||||
sizeof(wmt_evt_funcc->status))) {
|
||||
err = -EINVAL;
|
||||
goto err_free_skb;
|
||||
}
|
||||
|
||||
wmt_evt_funcc = (struct btmtk_hci_wmt_evt_funcc *)wmt_evt;
|
||||
if (be16_to_cpu(wmt_evt_funcc->status) == 0x404)
|
||||
status = BTMTK_WMT_ON_DONE;
|
||||
|
||||
@@ -191,6 +191,9 @@ static int ath_recv(struct hci_uart *hu, const void *data, int count)
|
||||
{
|
||||
struct ath_struct *ath = hu->priv;
|
||||
|
||||
if (!ath)
|
||||
return -ENODEV;
|
||||
|
||||
ath->rx_skb = h4_recv_buf(hu, ath->rx_skb, data, count,
|
||||
ath_recv_pkts, ARRAY_SIZE(ath_recv_pkts));
|
||||
if (IS_ERR(ath->rx_skb)) {
|
||||
|
||||
@@ -585,6 +585,9 @@ static int bcsp_recv(struct hci_uart *hu, const void *data, int count)
|
||||
if (!test_bit(HCI_UART_REGISTERED, &hu->flags))
|
||||
return -EUNATCH;
|
||||
|
||||
if (!bcsp)
|
||||
return -ENODEV;
|
||||
|
||||
BT_DBG("hu %p count %d rx_state %d rx_count %ld",
|
||||
hu, count, bcsp->rx_state, bcsp->rx_count);
|
||||
|
||||
|
||||
@@ -109,6 +109,9 @@ static int h4_recv(struct hci_uart *hu, const void *data, int count)
|
||||
{
|
||||
struct h4_struct *h4 = hu->priv;
|
||||
|
||||
if (!h4)
|
||||
return -ENODEV;
|
||||
|
||||
h4->rx_skb = h4_recv_buf(hu, h4->rx_skb, data, count,
|
||||
h4_recv_pkts, ARRAY_SIZE(h4_recv_pkts));
|
||||
if (IS_ERR(h4->rx_skb)) {
|
||||
|
||||
@@ -587,6 +587,9 @@ static int h5_recv(struct hci_uart *hu, const void *data, int count)
|
||||
struct h5 *h5 = hu->priv;
|
||||
const unsigned char *ptr = data;
|
||||
|
||||
if (!h5)
|
||||
return -ENODEV;
|
||||
|
||||
BT_DBG("%s pending %zu count %d", hu->hdev->name, h5->rx_pending,
|
||||
count);
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <net/bluetooth/hci_core.h>
|
||||
|
||||
#define VERSION "0.1"
|
||||
#define VIRTBT_RX_BUF_SIZE 1000
|
||||
|
||||
enum {
|
||||
VIRTBT_VQ_TX,
|
||||
@@ -33,11 +34,11 @@ static int virtbt_add_inbuf(struct virtio_bluetooth *vbt)
|
||||
struct sk_buff *skb;
|
||||
int err;
|
||||
|
||||
skb = alloc_skb(1000, GFP_KERNEL);
|
||||
skb = alloc_skb(VIRTBT_RX_BUF_SIZE, GFP_KERNEL);
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
|
||||
sg_init_one(sg, skb->data, 1000);
|
||||
sg_init_one(sg, skb->data, VIRTBT_RX_BUF_SIZE);
|
||||
|
||||
err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_KERNEL);
|
||||
if (err < 0) {
|
||||
@@ -197,6 +198,7 @@ static int virtbt_shutdown_generic(struct hci_dev *hdev)
|
||||
|
||||
static void virtbt_rx_handle(struct virtio_bluetooth *vbt, struct sk_buff *skb)
|
||||
{
|
||||
size_t min_hdr;
|
||||
__u8 pkt_type;
|
||||
|
||||
pkt_type = *((__u8 *) skb->data);
|
||||
@@ -204,16 +206,32 @@ static void virtbt_rx_handle(struct virtio_bluetooth *vbt, struct sk_buff *skb)
|
||||
|
||||
switch (pkt_type) {
|
||||
case HCI_EVENT_PKT:
|
||||
min_hdr = sizeof(struct hci_event_hdr);
|
||||
break;
|
||||
case HCI_ACLDATA_PKT:
|
||||
min_hdr = sizeof(struct hci_acl_hdr);
|
||||
break;
|
||||
case HCI_SCODATA_PKT:
|
||||
min_hdr = sizeof(struct hci_sco_hdr);
|
||||
break;
|
||||
case HCI_ISODATA_PKT:
|
||||
hci_skb_pkt_type(skb) = pkt_type;
|
||||
hci_recv_frame(vbt->hdev, skb);
|
||||
min_hdr = sizeof(struct hci_iso_hdr);
|
||||
break;
|
||||
default:
|
||||
kfree_skb(skb);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
if (skb->len < min_hdr) {
|
||||
bt_dev_err_ratelimited(vbt->hdev,
|
||||
"rx pkt_type 0x%02x payload %u < hdr %zu\n",
|
||||
pkt_type, skb->len, min_hdr);
|
||||
kfree_skb(skb);
|
||||
return;
|
||||
}
|
||||
|
||||
hci_skb_pkt_type(skb) = pkt_type;
|
||||
hci_recv_frame(vbt->hdev, skb);
|
||||
}
|
||||
|
||||
static void virtbt_rx_work(struct work_struct *work)
|
||||
@@ -227,8 +245,15 @@ static void virtbt_rx_work(struct work_struct *work)
|
||||
if (!skb)
|
||||
return;
|
||||
|
||||
skb_put(skb, len);
|
||||
virtbt_rx_handle(vbt, skb);
|
||||
if (!len || len > VIRTBT_RX_BUF_SIZE) {
|
||||
bt_dev_err_ratelimited(vbt->hdev,
|
||||
"rx reply len %u outside [1, %u]\n",
|
||||
len, VIRTBT_RX_BUF_SIZE);
|
||||
kfree_skb(skb);
|
||||
} else {
|
||||
skb_put(skb, len);
|
||||
virtbt_rx_handle(vbt, skb);
|
||||
}
|
||||
|
||||
if (virtbt_add_inbuf(vbt) < 0)
|
||||
return;
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
|
||||
#include "mt7530.h"
|
||||
|
||||
#define MT7530_STATS_POLL_INTERVAL (1 * HZ)
|
||||
#define MT7530_STATS_RATE_LIMIT (HZ / 10)
|
||||
|
||||
static struct mt753x_pcs *pcs_to_mt753x_pcs(struct phylink_pcs *pcs)
|
||||
{
|
||||
return container_of(pcs, struct mt753x_pcs, pcs);
|
||||
@@ -906,10 +909,9 @@ static void mt7530_get_rmon_stats(struct dsa_switch *ds, int port,
|
||||
*ranges = mt7530_rmon_ranges;
|
||||
}
|
||||
|
||||
static void mt7530_get_stats64(struct dsa_switch *ds, int port,
|
||||
struct rtnl_link_stats64 *storage)
|
||||
static void mt7530_read_port_stats64(struct mt7530_priv *priv, int port,
|
||||
struct rtnl_link_stats64 *storage)
|
||||
{
|
||||
struct mt7530_priv *priv = ds->priv;
|
||||
uint64_t data;
|
||||
|
||||
/* MIB counter doesn't provide a FramesTransmittedOK but instead
|
||||
@@ -951,6 +953,54 @@ static void mt7530_get_stats64(struct dsa_switch *ds, int port,
|
||||
&storage->rx_crc_errors);
|
||||
}
|
||||
|
||||
static void mt7530_stats_refresh(struct mt7530_priv *priv)
|
||||
{
|
||||
struct rtnl_link_stats64 stats = {};
|
||||
struct dsa_port *dp;
|
||||
int port;
|
||||
|
||||
dsa_switch_for_each_user_port(dp, priv->ds) {
|
||||
port = dp->index;
|
||||
|
||||
mt7530_read_port_stats64(priv, port, &stats);
|
||||
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
priv->ports[port].stats = stats;
|
||||
priv->stats_last = jiffies;
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
}
|
||||
}
|
||||
|
||||
static void mt7530_stats_poll(struct work_struct *work)
|
||||
{
|
||||
struct mt7530_priv *priv = container_of(work, struct mt7530_priv,
|
||||
stats_work.work);
|
||||
|
||||
mt7530_stats_refresh(priv);
|
||||
schedule_delayed_work(&priv->stats_work,
|
||||
MT7530_STATS_POLL_INTERVAL);
|
||||
}
|
||||
|
||||
static void mt7530_get_stats64(struct dsa_switch *ds, int port,
|
||||
struct rtnl_link_stats64 *storage)
|
||||
{
|
||||
struct mt7530_priv *priv = ds->priv;
|
||||
bool refresh;
|
||||
|
||||
if (priv->bus) {
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
*storage = priv->ports[port].stats;
|
||||
refresh = time_after(jiffies, priv->stats_last +
|
||||
MT7530_STATS_RATE_LIMIT);
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
if (refresh)
|
||||
mod_delayed_work(system_percpu_wq,
|
||||
&priv->stats_work, 0);
|
||||
} else {
|
||||
mt7530_read_port_stats64(priv, port, storage);
|
||||
}
|
||||
}
|
||||
|
||||
static void mt7530_get_eth_ctrl_stats(struct dsa_switch *ds, int port,
|
||||
struct ethtool_eth_ctrl_stats *ctrl_stats)
|
||||
{
|
||||
@@ -3137,9 +3187,24 @@ mt753x_setup(struct dsa_switch *ds)
|
||||
if (ret && priv->irq_domain)
|
||||
mt7530_free_mdio_irq(priv);
|
||||
|
||||
if (!ret && priv->bus) {
|
||||
mt7530_stats_refresh(priv);
|
||||
schedule_delayed_work(&priv->stats_work,
|
||||
MT7530_STATS_POLL_INTERVAL);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
mt753x_teardown(struct dsa_switch *ds)
|
||||
{
|
||||
struct mt7530_priv *priv = ds->priv;
|
||||
|
||||
if (priv->bus)
|
||||
cancel_delayed_work_sync(&priv->stats_work);
|
||||
}
|
||||
|
||||
static int mt753x_set_mac_eee(struct dsa_switch *ds, int port,
|
||||
struct ethtool_keee *e)
|
||||
{
|
||||
@@ -3257,6 +3322,7 @@ static int mt7988_setup(struct dsa_switch *ds)
|
||||
static const struct dsa_switch_ops mt7530_switch_ops = {
|
||||
.get_tag_protocol = mtk_get_tag_protocol,
|
||||
.setup = mt753x_setup,
|
||||
.teardown = mt753x_teardown,
|
||||
.preferred_default_local_cpu_port = mt753x_preferred_default_local_cpu_port,
|
||||
.get_strings = mt7530_get_strings,
|
||||
.get_ethtool_stats = mt7530_get_ethtool_stats,
|
||||
@@ -3395,6 +3461,9 @@ mt7530_probe_common(struct mt7530_priv *priv)
|
||||
priv->ds->ops = &mt7530_switch_ops;
|
||||
priv->ds->phylink_mac_ops = &mt753x_phylink_mac_ops;
|
||||
mutex_init(&priv->reg_mutex);
|
||||
spin_lock_init(&priv->stats_lock);
|
||||
INIT_DELAYED_WORK(&priv->stats_work, mt7530_stats_poll);
|
||||
|
||||
dev_set_drvdata(dev, priv);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -796,6 +796,7 @@ struct mt7530_fdb {
|
||||
* @pvid: The VLAN specified is to be considered a PVID at ingress. Any
|
||||
* untagged frames will be assigned to the related VLAN.
|
||||
* @sgmii_pcs: Pointer to PCS instance for SerDes ports
|
||||
* @stats: Cached port statistics for MDIO-connected switches
|
||||
*/
|
||||
struct mt7530_port {
|
||||
bool enable;
|
||||
@@ -803,6 +804,7 @@ struct mt7530_port {
|
||||
u32 pm;
|
||||
u16 pvid;
|
||||
struct phylink_pcs *sgmii_pcs;
|
||||
struct rtnl_link_stats64 stats;
|
||||
};
|
||||
|
||||
/* Port 5 mode definitions of the MT7530 switch */
|
||||
@@ -875,6 +877,9 @@ struct mt753x_info {
|
||||
* @create_sgmii: Pointer to function creating SGMII PCS instance(s)
|
||||
* @active_cpu_ports: Holding the active CPU ports
|
||||
* @mdiodev: The pointer to the MDIO device structure
|
||||
* @stats_lock: Protects cached per-port stats from concurrent access
|
||||
* @stats_work: Delayed work for polling MIB counters on MDIO switches
|
||||
* @stats_last: Jiffies timestamp of last MIB counter poll
|
||||
*/
|
||||
struct mt7530_priv {
|
||||
struct device *dev;
|
||||
@@ -900,6 +905,9 @@ struct mt7530_priv {
|
||||
int (*create_sgmii)(struct mt7530_priv *priv);
|
||||
u8 active_cpu_ports;
|
||||
struct mdio_device *mdiodev;
|
||||
spinlock_t stats_lock; /* protects cached stats counters */
|
||||
struct delayed_work stats_work;
|
||||
unsigned long stats_last;
|
||||
};
|
||||
|
||||
struct mt7530_hw_vlan_entry {
|
||||
|
||||
@@ -2120,14 +2120,12 @@ static netdev_tx_t airoha_dev_xmit(struct sk_buff *skb,
|
||||
return NETDEV_TX_OK;
|
||||
|
||||
error_unmap:
|
||||
while (!list_empty(&tx_list)) {
|
||||
e = list_first_entry(&tx_list, struct airoha_queue_entry,
|
||||
list);
|
||||
list_for_each_entry(e, &tx_list, list) {
|
||||
dma_unmap_single(dev->dev.parent, e->dma_addr, e->dma_len,
|
||||
DMA_TO_DEVICE);
|
||||
e->dma_addr = 0;
|
||||
list_move_tail(&e->list, &q->tx_list);
|
||||
}
|
||||
list_splice(&tx_list, &q->tx_list);
|
||||
|
||||
spin_unlock_bh(&q->lock);
|
||||
error:
|
||||
|
||||
@@ -135,11 +135,11 @@
|
||||
*/
|
||||
#define XGBE_TSTAMP_SSINC 20
|
||||
#define XGBE_TSTAMP_SNSINC 0
|
||||
#define XGBE_PTP_ACT_CLK_FREQ 500000000
|
||||
#define XGBE_PTP_ACT_CLK_FREQ (NSEC_PER_SEC / XGBE_TSTAMP_SSINC)
|
||||
|
||||
#define XGBE_V2_TSTAMP_SSINC 0xA
|
||||
#define XGBE_V2_TSTAMP_SNSINC 0
|
||||
#define XGBE_V2_PTP_ACT_CLK_FREQ 1000000000
|
||||
#define XGBE_V2_PTP_ACT_CLK_FREQ (NSEC_PER_SEC / XGBE_V2_TSTAMP_SSINC)
|
||||
|
||||
/* Define maximum supported values */
|
||||
#define XGBE_MAX_PPS_OUT 4
|
||||
|
||||
@@ -3825,7 +3825,10 @@ static int bnxt_alloc_tpa_info(struct bnxt *bp)
|
||||
if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) {
|
||||
if (!bp->max_tpa_v2)
|
||||
return 0;
|
||||
bp->max_tpa = max_t(u16, bp->max_tpa_v2, MAX_TPA_P5);
|
||||
bp->max_tpa = min_t(u16, bp->max_tpa_v2, MAX_TPA_P5);
|
||||
/* Older P5 FW sets max_tpa_v2 low by mistake except NPAR */
|
||||
if (bp->max_tpa <= 32 && BNXT_CHIP_P5(bp) && !BNXT_NPAR(bp))
|
||||
bp->max_tpa = MAX_TPA_P5;
|
||||
}
|
||||
|
||||
for (i = 0; i < bp->rx_nr_rings; i++) {
|
||||
@@ -17360,9 +17363,14 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
|
||||
|
||||
netdev_info(bp->dev, "PCI Slot Reset\n");
|
||||
|
||||
if (!(bp->flags & BNXT_FLAG_CHIP_P5_PLUS) &&
|
||||
test_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, &bp->state))
|
||||
msleep(900);
|
||||
if (test_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, &bp->state)) {
|
||||
/* After DPC, the chip should return CRS when the vendor ID
|
||||
* config register is read until it is ready. On all chips,
|
||||
* this is not happening reliably so add a 5-second delay as a
|
||||
* workaround.
|
||||
*/
|
||||
msleep(5000);
|
||||
}
|
||||
|
||||
netdev_lock(netdev);
|
||||
|
||||
|
||||
@@ -419,31 +419,13 @@ void bnxt_ptp_reapply_pps(struct bnxt *bp)
|
||||
}
|
||||
}
|
||||
|
||||
static int bnxt_get_target_cycles(struct bnxt_ptp_cfg *ptp, u64 target_ns,
|
||||
u64 *cycles_delta)
|
||||
{
|
||||
u64 cycles_now;
|
||||
u64 nsec_now, nsec_delta;
|
||||
int rc;
|
||||
|
||||
rc = bnxt_refclk_read(ptp->bp, NULL, &cycles_now);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
nsec_now = bnxt_timecounter_cyc2time(ptp, cycles_now);
|
||||
|
||||
nsec_delta = target_ns - nsec_now;
|
||||
*cycles_delta = div64_u64(nsec_delta << ptp->cc.shift, ptp->cc.mult);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bnxt_ptp_perout_cfg(struct bnxt_ptp_cfg *ptp,
|
||||
struct ptp_clock_request *rq)
|
||||
{
|
||||
struct hwrm_func_ptp_cfg_input *req;
|
||||
struct bnxt *bp = ptp->bp;
|
||||
struct timespec64 ts;
|
||||
u64 target_ns, delta;
|
||||
u64 target_ns;
|
||||
u16 enables;
|
||||
int rc;
|
||||
|
||||
@@ -451,10 +433,6 @@ static int bnxt_ptp_perout_cfg(struct bnxt_ptp_cfg *ptp,
|
||||
ts.tv_nsec = rq->perout.start.nsec;
|
||||
target_ns = timespec64_to_ns(&ts);
|
||||
|
||||
rc = bnxt_get_target_cycles(ptp, target_ns, &delta);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = hwrm_req_init(bp, req, HWRM_FUNC_PTP_CFG);
|
||||
if (rc)
|
||||
return rc;
|
||||
@@ -468,7 +446,10 @@ static int bnxt_ptp_perout_cfg(struct bnxt_ptp_cfg *ptp,
|
||||
req->ptp_freq_adj_dll_phase = 0;
|
||||
req->ptp_freq_adj_ext_period = cpu_to_le32(NSEC_PER_SEC);
|
||||
req->ptp_freq_adj_ext_up = 0;
|
||||
req->ptp_freq_adj_ext_phase_lower = cpu_to_le32(delta);
|
||||
req->ptp_freq_adj_ext_phase_lower =
|
||||
cpu_to_le32(lower_32_bits(target_ns));
|
||||
req->ptp_freq_adj_ext_phase_upper =
|
||||
cpu_to_le32(upper_32_bits(target_ns));
|
||||
|
||||
return hwrm_req_send(bp, req);
|
||||
}
|
||||
|
||||
@@ -175,8 +175,14 @@ int bnxt_register_dev(struct bnxt_en_dev *edev,
|
||||
ulp->handle = handle;
|
||||
rcu_assign_pointer(ulp->ulp_ops, ulp_ops);
|
||||
|
||||
if (test_bit(BNXT_STATE_OPEN, &bp->state))
|
||||
bnxt_hwrm_vnic_cfg(bp, &bp->vnic_info[BNXT_VNIC_DEFAULT]);
|
||||
if (test_bit(BNXT_STATE_OPEN, &bp->state)) {
|
||||
rc = bnxt_hwrm_vnic_cfg(bp, &bp->vnic_info[BNXT_VNIC_DEFAULT]);
|
||||
if (rc) {
|
||||
netdev_err(dev, "Failed to configure dual VNIC mode\n");
|
||||
RCU_INIT_POINTER(ulp->ulp_ops, NULL);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
edev->ulp_tbl->msix_requested = bnxt_get_ulp_msix_num(bp);
|
||||
|
||||
|
||||
@@ -1491,6 +1491,11 @@ static unsigned int gmac_rx(struct net_device *netdev, unsigned int budget)
|
||||
gpage = gmac_get_queue_page(geth, port, mapping + PAGE_SIZE);
|
||||
if (!gpage) {
|
||||
dev_err(geth->dev, "could not find mapping\n");
|
||||
if (skb) {
|
||||
napi_free_frags(&port->napi);
|
||||
port->stats.rx_dropped++;
|
||||
skb = NULL;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
page = gpage->page;
|
||||
|
||||
@@ -330,6 +330,7 @@ struct enetc_si {
|
||||
struct workqueue_struct *workqueue;
|
||||
struct work_struct rx_mode_task;
|
||||
struct dentry *debugfs_root;
|
||||
struct enetc_msg_swbd msg; /* Only valid for VSI */
|
||||
};
|
||||
|
||||
#define ENETC_SI_ALIGN 32
|
||||
|
||||
@@ -17,11 +17,36 @@ static void enetc_msg_vsi_write_msg(struct enetc_hw *hw,
|
||||
enetc_wr(hw, ENETC_VSIMSGSNDAR0, val);
|
||||
}
|
||||
|
||||
static void enetc_msg_dma_free(struct device *dev, struct enetc_msg_swbd *msg)
|
||||
{
|
||||
if (msg->vaddr) {
|
||||
dma_free_coherent(dev, msg->size, msg->vaddr, msg->dma);
|
||||
msg->vaddr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static int enetc_msg_vsi_send(struct enetc_si *si, struct enetc_msg_swbd *msg)
|
||||
{
|
||||
struct device *dev = &si->pdev->dev;
|
||||
int timeout = 100;
|
||||
u32 vsimsgsr;
|
||||
|
||||
/* The VSI mailbox may be busy if last message was not yet processed
|
||||
* by PSI. So need to check the mailbox status before sending.
|
||||
*/
|
||||
vsimsgsr = enetc_rd(&si->hw, ENETC_VSIMSGSR);
|
||||
if (vsimsgsr & ENETC_VSIMSGSR_MB) {
|
||||
/* It is safe to free the DMA buffer here, the caller does
|
||||
* not access the DMA buffer if enetc_msg_vsi_send() fails.
|
||||
*/
|
||||
enetc_msg_dma_free(dev, msg);
|
||||
dev_err(dev, "VSI mailbox is busy\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Free the DMA buffer of the last message */
|
||||
enetc_msg_dma_free(dev, &si->msg);
|
||||
si->msg = *msg;
|
||||
enetc_msg_vsi_write_msg(&si->hw, msg);
|
||||
|
||||
do {
|
||||
@@ -32,12 +57,15 @@ static int enetc_msg_vsi_send(struct enetc_si *si, struct enetc_msg_swbd *msg)
|
||||
usleep_range(1000, 2000);
|
||||
} while (--timeout);
|
||||
|
||||
if (!timeout)
|
||||
if (!timeout) {
|
||||
dev_err(dev, "VSI mailbox timeout\n");
|
||||
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
/* check for message delivery error */
|
||||
if (vsimsgsr & ENETC_VSIMSGSR_MS) {
|
||||
dev_err(&si->pdev->dev, "VSI command execute error: %d\n",
|
||||
dev_err(dev, "VSI command execute error: %d\n",
|
||||
ENETC_SIMSGSR_GET_MC(vsimsgsr));
|
||||
return -EIO;
|
||||
}
|
||||
@@ -50,7 +78,6 @@ static int enetc_msg_vsi_set_primary_mac_addr(struct enetc_ndev_priv *priv,
|
||||
{
|
||||
struct enetc_msg_cmd_set_primary_mac *cmd;
|
||||
struct enetc_msg_swbd msg;
|
||||
int err;
|
||||
|
||||
msg.size = ALIGN(sizeof(struct enetc_msg_cmd_set_primary_mac), 64);
|
||||
msg.vaddr = dma_alloc_coherent(priv->dev, msg.size, &msg.dma,
|
||||
@@ -67,11 +94,7 @@ static int enetc_msg_vsi_set_primary_mac_addr(struct enetc_ndev_priv *priv,
|
||||
memcpy(&cmd->mac, saddr, sizeof(struct sockaddr));
|
||||
|
||||
/* send the command and wait */
|
||||
err = enetc_msg_vsi_send(priv->si, &msg);
|
||||
|
||||
dma_free_coherent(priv->dev, msg.size, msg.vaddr, msg.dma);
|
||||
|
||||
return err;
|
||||
return enetc_msg_vsi_send(priv->si, &msg);
|
||||
}
|
||||
|
||||
static int enetc_vf_set_mac_addr(struct net_device *ndev, void *addr)
|
||||
@@ -259,6 +282,7 @@ static void enetc_vf_remove(struct pci_dev *pdev)
|
||||
{
|
||||
struct enetc_si *si = pci_get_drvdata(pdev);
|
||||
struct enetc_ndev_priv *priv;
|
||||
struct enetc_msg_swbd msg;
|
||||
|
||||
priv = netdev_priv(si->ndev);
|
||||
unregister_netdev(si->ndev);
|
||||
@@ -270,7 +294,9 @@ static void enetc_vf_remove(struct pci_dev *pdev)
|
||||
|
||||
free_netdev(si->ndev);
|
||||
|
||||
msg = si->msg;
|
||||
enetc_pci_remove(pdev);
|
||||
enetc_msg_dma_free(&pdev->dev, &msg);
|
||||
}
|
||||
|
||||
static const struct pci_device_id enetc_vf_id_table[] = {
|
||||
|
||||
@@ -249,34 +249,21 @@ DEFINE_SHOW_ATTRIBUTE(npc_defrag);
|
||||
int npc_cn20k_debugfs_init(struct rvu *rvu)
|
||||
{
|
||||
struct npc_priv_t *npc_priv = npc_priv_get();
|
||||
struct dentry *npc_dentry;
|
||||
|
||||
npc_dentry = debugfs_create_file("mcam_layout", 0444, rvu->rvu_dbg.npc,
|
||||
npc_priv, &npc_mcam_layout_fops);
|
||||
debugfs_create_file("mcam_layout", 0444, rvu->rvu_dbg.npc,
|
||||
npc_priv, &npc_mcam_layout_fops);
|
||||
|
||||
if (!npc_dentry)
|
||||
return -EFAULT;
|
||||
debugfs_create_file("mcam_default", 0444, rvu->rvu_dbg.npc,
|
||||
rvu, &npc_mcam_default_fops);
|
||||
|
||||
npc_dentry = debugfs_create_file("mcam_default", 0444, rvu->rvu_dbg.npc,
|
||||
rvu, &npc_mcam_default_fops);
|
||||
debugfs_create_file("vidx2idx", 0444, rvu->rvu_dbg.npc,
|
||||
npc_priv, &npc_vidx2idx_map_fops);
|
||||
|
||||
if (!npc_dentry)
|
||||
return -EFAULT;
|
||||
debugfs_create_file("idx2vidx", 0444, rvu->rvu_dbg.npc,
|
||||
npc_priv, &npc_idx2vidx_map_fops);
|
||||
|
||||
npc_dentry = debugfs_create_file("vidx2idx", 0444, rvu->rvu_dbg.npc,
|
||||
npc_priv, &npc_vidx2idx_map_fops);
|
||||
if (!npc_dentry)
|
||||
return -EFAULT;
|
||||
|
||||
npc_dentry = debugfs_create_file("idx2vidx", 0444, rvu->rvu_dbg.npc,
|
||||
npc_priv, &npc_idx2vidx_map_fops);
|
||||
if (!npc_dentry)
|
||||
return -EFAULT;
|
||||
|
||||
npc_dentry = debugfs_create_file("defrag", 0444, rvu->rvu_dbg.npc,
|
||||
npc_priv, &npc_defrag_fops);
|
||||
if (!npc_dentry)
|
||||
return -EFAULT;
|
||||
debugfs_create_file("defrag", 0444, rvu->rvu_dbg.npc,
|
||||
npc_priv, &npc_defrag_fops);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user