* Re: [PATCH net v4 1/2] r8169: add handling DASH when DASH is disabled
From: Heiner Kallweit @ 2023-11-09 17:39 UTC (permalink / raw)
To: ChunHao Lin
Cc: nic_swsd, davem, edumazet, kuba, pabeni, netdev, linux-kernel,
stable
In-Reply-To: <20231109173400.4573-2-hau@realtek.com>
On 09.11.2023 18:33, ChunHao Lin wrote:
> For devices that support DASH, even DASH is disabled, there may still
> exist a default firmware that will influence device behavior.
> So driver needs to handle DASH for devices that support DASH, no
> matter the DASH status is.
>
> This patch also prepares for "fix network lost after resume on DASH
> systems".
>
> Fixes: ee7a1beb9759 ("r8169:call "rtl8168_driver_start" "rtl8168_driver_stop" only when hardware dash function is enabled")
> Cc: stable@vger.kernel.org
> Signed-off-by: ChunHao Lin <hau@realtek.com>
> ---
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
^ permalink raw reply
* Re: [PATCH net-next 1/1] net: stmmac: Add support for HW-accelerated VLAN stripping
From: Andrew Halaney @ 2023-11-09 17:41 UTC (permalink / raw)
To: Gan Yi Fang
Cc: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Russell King,
Simon Horman, Bartosz Golaszewski, Shenwei Wang, Russell King,
Johannes Zink, Jochen Henneberg, netdev, linux-stm32,
linux-arm-kernel, linux-kernel, Looi Hong Aun, Voon Weifeng,
Song Yoong Siang
In-Reply-To: <20231109053831.2572699-1-yi.fang.gan@intel.com>
On Thu, Nov 09, 2023 at 01:38:31PM +0800, Gan Yi Fang wrote:
> From: "Gan, Yi Fang" <yi.fang.gan@intel.com>
>
> Current implementation supports driver level VLAN tag stripping only.
> The features is always on if CONFIG_VLAN_8021Q is enabled in kernel
> config and is not user configurable.
>
> This patch add support to MAC level VLAN tag stripping and can be
> configured through ethtool. If the rx-vlan-offload is off, the VLAN tag
> will be stripped by driver. If the rx-vlan-offload is on, the VLAN tag
> will be stripped by MAC.
>
> Command: ethtool -K enp0s30f4 rx-vlan-offload off | on
>
> Signed-off-by: Gan, Yi Fang <yi.fang.gan@intel.com>
> Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
I'm confused by the SOB lines. Gan is the author and the last sender of
the patch as far as I can tell in this email. Gan's SOB should be last.
Since Gan is also the author as far as I can tell, I am confused why
Lai's Signed-off-by is present.
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
> ---
> drivers/net/ethernet/stmicro/stmmac/common.h | 1 +
> .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 3 +-
> .../net/ethernet/stmicro/stmmac/dwmac4_core.c | 35 +++++++++++++++++++
> .../ethernet/stmicro/stmmac/dwmac4_descs.c | 13 +++++++
> drivers/net/ethernet/stmicro/stmmac/hwif.h | 15 ++++++++
> .../net/ethernet/stmicro/stmmac/stmmac_main.c | 24 ++++++++++++-
> include/linux/stmmac.h | 1 +
> 7 files changed, 90 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
> index e3f650e88f82..6b935922054d 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/common.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/common.h
> @@ -580,6 +580,7 @@ struct mac_device_info {
> u32 vlan_filter[32];
> bool vlan_fail_q_en;
> u8 vlan_fail_q;
> + bool hw_vlan_en;
> };
>
> struct stmmac_rx_routing {
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> index 60283543ffc8..651fee867aac 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> @@ -457,7 +457,8 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
> plat->has_gmac = 0;
> plat->has_gmac4 = 1;
> plat->force_sf_dma_mode = 0;
> - plat->flags |= (STMMAC_FLAG_TSO_EN | STMMAC_FLAG_SPH_DISABLE);
> + plat->flags |= (STMMAC_FLAG_TSO_EN | STMMAC_FLAG_SPH_DISABLE |
> + STMMAC_FLAG_HW_VLAN_EN);
>
> /* Multiplying factor to the clk_eee_i clock time
> * period to make it closer to 100 ns. This value
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> index c6ff1fa0e04d..6a8d7873b456 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> @@ -1134,6 +1134,35 @@ static int dwmac4_config_l4_filter(struct mac_device_info *hw, u32 filter_no,
> return 0;
> }
>
> +static void dwmac4_rx_hw_vlan(struct mac_device_info *hw,
> + struct dma_desc *rx_desc, struct sk_buff *skb)
> +{
> + if (hw->desc->get_rx_vlan_valid(rx_desc)) {
> + u16 vid = (u16)hw->desc->get_rx_vlan_tci(rx_desc);
> +
> + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid);
> + }
> +}
> +
> +static void dwmac4_set_hw_vlan_mode(struct mac_device_info *hw)
> +{
> + void __iomem *ioaddr = hw->pcsr;
> + u32 value = readl(ioaddr + GMAC_VLAN_TAG);
> +
> + value &= ~GMAC_VLAN_TAG_CTRL_EVLS_MASK;
> +
> + if (hw->hw_vlan_en)
> + /* Always strip VLAN on Receive */
> + value |= GMAC_VLAN_TAG_STRIP_ALL;
> + else
> + /* Do not strip VLAN on Receive */
> + value |= GMAC_VLAN_TAG_STRIP_NONE;
> +
> + /* Enable outer VLAN Tag in Rx DMA descriptor */
> + value |= GMAC_VLAN_TAG_CTRL_EVLRXS;
> + writel(value, ioaddr + GMAC_VLAN_TAG);
> +}
> +
> const struct stmmac_ops dwmac4_ops = {
> .core_init = dwmac4_core_init,
> .phylink_get_caps = dwmac4_phylink_get_caps,
> @@ -1175,6 +1204,8 @@ const struct stmmac_ops dwmac4_ops = {
> .add_hw_vlan_rx_fltr = dwmac4_add_hw_vlan_rx_fltr,
> .del_hw_vlan_rx_fltr = dwmac4_del_hw_vlan_rx_fltr,
> .restore_hw_vlan_rx_fltr = dwmac4_restore_hw_vlan_rx_fltr,
> + .rx_hw_vlan = dwmac4_rx_hw_vlan,
> + .set_hw_vlan_mode = dwmac4_set_hw_vlan_mode,
> };
>
> const struct stmmac_ops dwmac410_ops = {
> @@ -1224,6 +1255,8 @@ const struct stmmac_ops dwmac410_ops = {
> .add_hw_vlan_rx_fltr = dwmac4_add_hw_vlan_rx_fltr,
> .del_hw_vlan_rx_fltr = dwmac4_del_hw_vlan_rx_fltr,
> .restore_hw_vlan_rx_fltr = dwmac4_restore_hw_vlan_rx_fltr,
> + .rx_hw_vlan = dwmac4_rx_hw_vlan,
> + .set_hw_vlan_mode = dwmac4_set_hw_vlan_mode,
> };
>
> const struct stmmac_ops dwmac510_ops = {
> @@ -1277,6 +1310,8 @@ const struct stmmac_ops dwmac510_ops = {
> .add_hw_vlan_rx_fltr = dwmac4_add_hw_vlan_rx_fltr,
> .del_hw_vlan_rx_fltr = dwmac4_del_hw_vlan_rx_fltr,
> .restore_hw_vlan_rx_fltr = dwmac4_restore_hw_vlan_rx_fltr,
> + .rx_hw_vlan = dwmac4_rx_hw_vlan,
> + .set_hw_vlan_mode = dwmac4_set_hw_vlan_mode,
> };
>
> static u32 dwmac4_get_num_vlan(void __iomem *ioaddr)
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
> index 89a14084c611..a01d71dfed6c 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
> @@ -198,6 +198,17 @@ static int dwmac4_get_tx_ls(struct dma_desc *p)
> >> TDES3_LAST_DESCRIPTOR_SHIFT;
> }
>
> +static inline int dwmac4_wrback_get_rx_vlan_tci(struct dma_desc *p)
> +{
> + return (le32_to_cpu(p->des0) & RDES0_VLAN_TAG_MASK);
> +}
> +
> +static inline bool dwmac4_wrback_get_rx_vlan_valid(struct dma_desc *p)
> +{
> + return ((le32_to_cpu(p->des3) & RDES3_LAST_DESCRIPTOR) &&
> + (le32_to_cpu(p->des3) & RDES3_RDES0_VALID));
> +}
> +
> static int dwmac4_wrback_get_rx_frame_len(struct dma_desc *p, int rx_coe)
> {
> return (le32_to_cpu(p->des3) & RDES3_PACKET_SIZE_MASK);
> @@ -551,6 +562,8 @@ const struct stmmac_desc_ops dwmac4_desc_ops = {
> .set_tx_owner = dwmac4_set_tx_owner,
> .set_rx_owner = dwmac4_set_rx_owner,
> .get_tx_ls = dwmac4_get_tx_ls,
> + .get_rx_vlan_tci = dwmac4_wrback_get_rx_vlan_tci,
> + .get_rx_vlan_valid = dwmac4_wrback_get_rx_vlan_valid,
> .get_rx_frame_len = dwmac4_wrback_get_rx_frame_len,
> .enable_tx_timestamp = dwmac4_rd_enable_tx_timestamp,
> .get_tx_timestamp_status = dwmac4_wrback_get_tx_timestamp_status,
> diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h
> index b95d3e137813..5a079dae1380 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
> @@ -56,6 +56,10 @@ struct stmmac_desc_ops {
> void (*set_tx_ic)(struct dma_desc *p);
> /* Last tx segment reports the transmit status */
> int (*get_tx_ls)(struct dma_desc *p);
> + /* Get the tag of the descriptor */
> + int (*get_rx_vlan_tci)(struct dma_desc *p);
> + /* Get the valid status of descriptor */
> + bool (*get_rx_vlan_valid)(struct dma_desc *p);
> /* Return the transmit status looking at the TDES1 */
> int (*tx_status)(struct stmmac_extra_stats *x,
> struct dma_desc *p, void __iomem *ioaddr);
> @@ -117,6 +121,10 @@ struct stmmac_desc_ops {
> stmmac_do_void_callback(__priv, desc, set_tx_ic, __args)
> #define stmmac_get_tx_ls(__priv, __args...) \
> stmmac_do_callback(__priv, desc, get_tx_ls, __args)
> +#define stmmac_get_rx_vlan_tci(__priv, __args...) \
> + stmmac_do_callback(__priv, desc, get_rx_vlan_tci, __args)
> +#define stmmac_get_rx_vlan_valid(__priv, __args...) \
> + stmmac_do_callback(__priv, desc, get_rx_vlan_valid, __args)
> #define stmmac_tx_status(__priv, __args...) \
> stmmac_do_callback(__priv, desc, tx_status, __args)
> #define stmmac_get_tx_len(__priv, __args...) \
> @@ -388,6 +396,9 @@ struct stmmac_ops {
> void (*update_vlan_hash)(struct mac_device_info *hw, u32 hash,
> __le16 perfect_match, bool is_double);
> void (*enable_vlan)(struct mac_device_info *hw, u32 type);
> + void (*rx_hw_vlan)(struct mac_device_info *hw, struct dma_desc *rx_desc,
> + struct sk_buff *skb);
> + void (*set_hw_vlan_mode)(struct mac_device_info *hw);
> int (*add_hw_vlan_rx_fltr)(struct net_device *dev,
> struct mac_device_info *hw,
> __be16 proto, u16 vid);
> @@ -497,6 +508,10 @@ struct stmmac_ops {
> stmmac_do_void_callback(__priv, mac, update_vlan_hash, __args)
> #define stmmac_enable_vlan(__priv, __args...) \
> stmmac_do_void_callback(__priv, mac, enable_vlan, __args)
> +#define stmmac_rx_hw_vlan(__priv, __args...) \
> + stmmac_do_void_callback(__priv, mac, rx_hw_vlan, __args)
> +#define stmmac_set_hw_vlan_mode(__priv, __args...) \
> + stmmac_do_void_callback(__priv, mac, set_hw_vlan_mode, __args)
> #define stmmac_add_hw_vlan_rx_fltr(__priv, __args...) \
> stmmac_do_callback(__priv, mac, add_hw_vlan_rx_fltr, __args)
> #define stmmac_del_hw_vlan_rx_fltr(__priv, __args...) \
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 3e50fd53a617..62299ec5179f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3469,6 +3469,9 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
> /* Start the ball rolling... */
> stmmac_start_all_dma(priv);
>
> + if (priv->hw->hw_vlan_en)
> + stmmac_set_hw_vlan_mode(priv, priv->hw);
> +
> if (priv->dma_cap.fpesel) {
> stmmac_fpe_start_wq(priv);
>
> @@ -5508,7 +5511,14 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
> /* Got entire packet into SKB. Finish it. */
>
> stmmac_get_rx_hwtstamp(priv, p, np, skb);
> - stmmac_rx_vlan(priv->dev, skb);
> +
> + if (priv->hw->hw_vlan_en)
> + /* MAC level stripping. */
> + stmmac_rx_hw_vlan(priv, priv->hw, p, skb);
> + else
> + /* Driver level stripping. */
> + stmmac_rx_vlan(priv->dev, skb);
> +
This same pattern exists in stmmac_dispatch_skb_zc, does it make sense
to update that as well?
> skb->protocol = eth_type_trans(skb, priv->dev);
>
> if (unlikely(!coe))
> @@ -5817,6 +5827,14 @@ static int stmmac_set_features(struct net_device *netdev,
> stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
> }
>
> + if ((features & NETIF_F_HW_VLAN_CTAG_RX) &&
> + (priv->plat->flags & STMMAC_FLAG_HW_VLAN_EN))
> + priv->hw->hw_vlan_en = true;
> + else
> + priv->hw->hw_vlan_en = false;
> +
> + stmmac_set_hw_vlan_mode(priv, priv->hw);
> +
> return 0;
> }
>
> @@ -7146,6 +7164,8 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
> "Enable RX Mitigation via HW Watchdog Timer\n");
> }
>
> + priv->hw->hw_vlan_en = (priv->plat->flags & STMMAC_FLAG_HW_VLAN_EN);
I'm curious, is there a particular reason you make this feature a
platform opt-in? My gut feeling is that if it's a dwmac4/5 feature, it
would be better to just enable it for all the platforms who use that IP
instead of making it opt-in per platform. To me that is more in the
spirit of a common IP driver.
> +
> return 0;
> }
>
> @@ -7515,6 +7535,8 @@ int stmmac_dvr_probe(struct device *device,
> #ifdef STMMAC_VLAN_TAG_USED
> /* Both mac100 and gmac support receive VLAN tag detection */
> ndev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX;
> + ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
> +
> if (priv->dma_cap.vlhash) {
> ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
> ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER;
> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
> index 0b4658a7eceb..1cf78e6bca5e 100644
> --- a/include/linux/stmmac.h
> +++ b/include/linux/stmmac.h
> @@ -220,6 +220,7 @@ struct dwmac4_addrs {
> #define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI BIT(10)
> #define STMMAC_FLAG_EN_TX_LPI_CLOCKGATING BIT(11)
> #define STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY BIT(12)
> +#define STMMAC_FLAG_HW_VLAN_EN BIT(13)
>
> struct plat_stmmacenet_data {
> int bus_id;
> --
> 2.34.1
>
^ permalink raw reply
* [PATCHv3] selftests: bpf: xskxceiver: ksft_print_msg: fix format type error
From: Anders Roxell @ 2023-11-09 17:43 UTC (permalink / raw)
To: bjorn, magnus.karlsson, maciej.fijalkowski, andrii.nakryiko
Cc: netdev, bpf, linux-kernel, Anders Roxell
Crossbuilding selftests/bpf for architecture arm64, format specifies
type error show up like.
xskxceiver.c:912:34: error: format specifies type 'int' but the argument
has type '__u64' (aka 'unsigned long long') [-Werror,-Wformat]
ksft_print_msg("[%s] expected meta_count [%d], got meta_count [%d]\n",
~~
%llu
__func__, pkt->pkt_nb, meta->count);
^~~~~~~~~~~
xskxceiver.c:929:55: error: format specifies type 'unsigned long long' but
the argument has type 'u64' (aka 'unsigned long') [-Werror,-Wformat]
ksft_print_msg("Frag invalid addr: %llx len: %u\n", addr, len);
~~~~ ^~~~
Fixing the issues by casting to (unsigned long long) and changing the
specifiers to be %llu from %d and %u, since with u64s it might be %llx
or %lx, depending on architecture.
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
tools/testing/selftests/bpf/xskxceiver.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
index 591ca9637b23..b604c570309a 100644
--- a/tools/testing/selftests/bpf/xskxceiver.c
+++ b/tools/testing/selftests/bpf/xskxceiver.c
@@ -908,8 +908,9 @@ static bool is_metadata_correct(struct pkt *pkt, void *buffer, u64 addr)
struct xdp_info *meta = data - sizeof(struct xdp_info);
if (meta->count != pkt->pkt_nb) {
- ksft_print_msg("[%s] expected meta_count [%d], got meta_count [%d]\n",
- __func__, pkt->pkt_nb, meta->count);
+ ksft_print_msg("[%s] expected meta_count [%d], got meta_count [%llu]\n",
+ __func__, pkt->pkt_nb,
+ (unsigned long long)meta->count);
return false;
}
@@ -926,11 +927,13 @@ static bool is_frag_valid(struct xsk_umem_info *umem, u64 addr, u32 len, u32 exp
if (addr >= umem->num_frames * umem->frame_size ||
addr + len > umem->num_frames * umem->frame_size) {
- ksft_print_msg("Frag invalid addr: %llx len: %u\n", addr, len);
+ ksft_print_msg("Frag invalid addr: %llx len: %u\n",
+ (unsigned long long)addr, len);
return false;
}
if (!umem->unaligned_mode && addr % umem->frame_size + len > umem->frame_size) {
- ksft_print_msg("Frag crosses frame boundary addr: %llx len: %u\n", addr, len);
+ ksft_print_msg("Frag crosses frame boundary addr: %llx len: %u\n",
+ (unsigned long long)addr, len);
return false;
}
@@ -1029,7 +1032,8 @@ static int complete_pkts(struct xsk_socket_info *xsk, int batch_size)
u64 addr = *xsk_ring_cons__comp_addr(&xsk->umem->cq, idx + rcvd - 1);
ksft_print_msg("[%s] Too many packets completed\n", __func__);
- ksft_print_msg("Last completion address: %llx\n", addr);
+ ksft_print_msg("Last completion address: %llx\n",
+ (unsigned long long)addr);
return TEST_FAILURE;
}
@@ -1513,8 +1517,9 @@ static int validate_tx_invalid_descs(struct ifobject *ifobject)
}
if (stats.tx_invalid_descs != ifobject->xsk->pkt_stream->nb_pkts / 2) {
- ksft_print_msg("[%s] tx_invalid_descs incorrect. Got [%u] expected [%u]\n",
- __func__, stats.tx_invalid_descs,
+ ksft_print_msg("[%s] tx_invalid_descs incorrect. Got [%llu] expected [%u]\n",
+ __func__,
+ (unsigned long long)stats.tx_invalid_descs,
ifobject->xsk->pkt_stream->nb_pkts);
return TEST_FAILURE;
}
--
2.42.0
^ permalink raw reply related
* [PATCH net] ptp: annotate data-race around q->head and q->tail
From: Eric Dumazet @ 2023-11-09 17:48 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: netdev, eric.dumazet, Eric Dumazet, Richard Cochran
As I was working on a syzbot report, I found that KCSAN would
probably complain that reading q->head or q->tail without
barriers could lead to invalid results.
Add corresponding READ_ONCE() and WRITE_ONCE() to avoid
load-store tearing.
Fixes: d94ba80ebbea ("ptp: Added a brand new class driver for ptp clocks.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Richard Cochran <richardcochran@gmail.com>
---
drivers/ptp/ptp_chardev.c | 3 ++-
drivers/ptp/ptp_clock.c | 5 +++--
drivers/ptp/ptp_private.h | 8 ++++++--
drivers/ptp/ptp_sysfs.c | 3 ++-
4 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index 3f7a7478880240a2d256caf624b61dcc8e7054af..7513018c9f9ac72d5c1b0055b55ae9ff36e710b0 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -572,7 +572,8 @@ ssize_t ptp_read(struct posix_clock_context *pccontext, uint rdflags,
for (i = 0; i < cnt; i++) {
event[i] = queue->buf[queue->head];
- queue->head = (queue->head + 1) % PTP_MAX_TIMESTAMPS;
+ /* Paired with READ_ONCE() in queue_cnt() */
+ WRITE_ONCE(queue->head, (queue->head + 1) % PTP_MAX_TIMESTAMPS);
}
spin_unlock_irqrestore(&queue->lock, flags);
diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index 3134568af622d396f6ab15049cd1a3ace3243269..15b804ba48685ee11a34b88df1ae738a136d17a1 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -57,10 +57,11 @@ static void enqueue_external_timestamp(struct timestamp_event_queue *queue,
dst->t.sec = seconds;
dst->t.nsec = remainder;
+ /* Both WRITE_ONCE() are paired with READ_ONCE() in queue_cnt() */
if (!queue_free(queue))
- queue->head = (queue->head + 1) % PTP_MAX_TIMESTAMPS;
+ WRITE_ONCE(queue->head, (queue->head + 1) % PTP_MAX_TIMESTAMPS);
- queue->tail = (queue->tail + 1) % PTP_MAX_TIMESTAMPS;
+ WRITE_ONCE(queue->tail, (queue->tail + 1) % PTP_MAX_TIMESTAMPS);
spin_unlock_irqrestore(&queue->lock, flags);
}
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
index 35fde0a0574606a04d6bdf0ab42a204da5fa6532..45f9002a5dcaea2c588c001fa83317fc318500ee 100644
--- a/drivers/ptp/ptp_private.h
+++ b/drivers/ptp/ptp_private.h
@@ -85,9 +85,13 @@ struct ptp_vclock {
* that a writer might concurrently increment the tail does not
* matter, since the queue remains nonempty nonetheless.
*/
-static inline int queue_cnt(struct timestamp_event_queue *q)
+static inline int queue_cnt(const struct timestamp_event_queue *q)
{
- int cnt = q->tail - q->head;
+ /*
+ * Paired with WRITE_ONCE() in enqueue_external_timestamp(),
+ * ptp_read(), extts_fifo_show().
+ */
+ int cnt = READ_ONCE(q->tail) - READ_ONCE(q->head);
return cnt < 0 ? PTP_MAX_TIMESTAMPS + cnt : cnt;
}
diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
index 7d023d9d0acbfb3d128be09578753588fa59e84d..f7a499a1bd39ec22edf6c77407a48736e137f277 100644
--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -94,7 +94,8 @@ static ssize_t extts_fifo_show(struct device *dev,
qcnt = queue_cnt(queue);
if (qcnt) {
event = queue->buf[queue->head];
- queue->head = (queue->head + 1) % PTP_MAX_TIMESTAMPS;
+ /* Paired with READ_ONCE() in queue_cnt() */
+ WRITE_ONCE(queue->head, (queue->head + 1) % PTP_MAX_TIMESTAMPS);
}
spin_unlock_irqrestore(&queue->lock, flags);
--
2.42.0.869.gea05f2083d-goog
^ permalink raw reply related
* Re: [PATCH 02/41] rxrpc: Fix two connection reaping bugs
From: patchwork-bot+netdevbpf @ 2023-11-09 17:50 UTC (permalink / raw)
To: David Howells
Cc: marc.dionne, linux-afs, linux-fsdevel, linux-kernel, davem,
edumazet, kuba, pabeni, netdev
In-Reply-To: <20231109154004.3317227-3-dhowells@redhat.com>
Hello:
This patch was applied to bpf/bpf.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 9 Nov 2023 15:39:25 +0000 you wrote:
> Fix two connection reaping bugs:
>
> (1) rxrpc_connection_expiry is in units of seconds, so
> rxrpc_disconnect_call() needs to multiply it by HZ when adding it to
> jiffies.
>
> (2) rxrpc_client_conn_reap_timeout() should set RXRPC_CLIENT_REAP_TIMER if
> local->kill_all_client_conns is clear, not if it is set (in which case
> we don't need the timer). Without this, old client connections don't
> get cleaned up until the local endpoint is cleaned up.
>
> [...]
Here is the summary with links:
- [02/41] rxrpc: Fix two connection reaping bugs
https://git.kernel.org/bpf/bpf/c/61e4a8660002
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* RE: Bypass qdiscs?
From: David Laight @ 2023-11-09 17:50 UTC (permalink / raw)
To: 'David Ahern', John Ousterhout
Cc: Stephen Hemminger, Andrew Lunn, netdev@vger.kernel.org
In-Reply-To: <89cd5f11-2c54-4905-b900-b1e06304805f@kernel.org>
From: David Ahern
> Sent: 08 November 2023 17:17
>
> On 11/8/23 9:50 AM, John Ousterhout wrote:
> > Hi David,
> >
> > Thanks for the suggestion, but if I understand this correctly, this
> > will disable qdiscs for TCP as well as Homa; I suspect I shouldn't do
> > that?
> >
>
> A means to separate issues - i.e., run Homa tests without qdisc overhead
> or delays. You can worry about how to handle if/when you start
> upstreaming the code.
Isn't the qdisc overhead pretty minimal most of the time anyway?
If I send a RAW_IP (and probably UDP) packet the ethernet MAC
packet setup (etc) is normally done by direct calls from the
process calling sendmsg().
If two threads call sendmsg (on different sockets) at the same
time something has to give somewhere.
To avoid stalling the 2nd thread, the packet gets queued and is
picked up by the first thread before it returns.
To bypass the qdisc wouldn't you need a MAC driver that can
processes multiple transmit setup requests in parallel?
It can be done for a simple memory ring based interface - just
use a lock to grab the required slots in the transmit ring.
Then it doesn't matter which order setups complete in.
But I don't think Linux makes that easy to write.
Transmit flow control will also require queueing (or discard).
If Homa and TCP are sharing a physical network then surely the
TCP traffic can cause flow control issue for both?
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
^ permalink raw reply
* Re: [PATCH] boning: use a read-write lock in bonding_show_bonds()
From: Stephen Hemminger @ 2023-11-09 17:55 UTC (permalink / raw)
To: Haifeng Xu
Cc: j.vosburgh, andy, davem, edumazet, kuba, pabeni, netdev,
linux-kernel
In-Reply-To: <20231108064641.65209-1-haifeng.xu@shopee.com>
On Wed, 8 Nov 2023 06:46:41 +0000
Haifeng Xu <haifeng.xu@shopee.com> wrote:
> call stack:
> ......
> PID: 210933 TASK: ffff92424e5ec080 CPU: 13 COMMAND: "kworker/u96:2"
> [ffffa7a8e96bbac0] __schedule at ffffffffb0719898
> [ffffa7a8e96bbb48] schedule at ffffffffb0719e9e
> [ffffa7a8e96bbb68] rwsem_down_write_slowpath at ffffffffafb3167a
> [ffffa7a8e96bbc00] down_write at ffffffffb071bfc1
> [ffffa7a8e96bbc18] kernfs_remove_by_name_ns at ffffffffafe3593e
> [ffffa7a8e96bbc48] sysfs_unmerge_group at ffffffffafe38922
> [ffffa7a8e96bbc68] dpm_sysfs_remove at ffffffffb021c96a
> [ffffa7a8e96bbc80] device_del at ffffffffb0209af8
> [ffffa7a8e96bbcd0] netdev_unregister_kobject at ffffffffb04a6b0e
> [ffffa7a8e96bbcf8] unregister_netdevice_many at ffffffffb046d3d9
> [ffffa7a8e96bbd60] default_device_exit_batch at ffffffffb046d8d1
> [ffffa7a8e96bbdd0] ops_exit_list at ffffffffb045e21d
> [ffffa7a8e96bbe00] cleanup_net at ffffffffb045ea46
> [ffffa7a8e96bbe60] process_one_work at ffffffffafad94bb
> [ffffa7a8e96bbeb0] worker_thread at ffffffffafad96ad
> [ffffa7a8e96bbf10] kthread at ffffffffafae132a
> [ffffa7a8e96bbf50] ret_from_fork at ffffffffafa04b92
>
> 290858 PID: 278176 TASK: ffff925deb39a040 CPU: 32 COMMAND: "node-exporter"
> [ffffa7a8d14dbb80] __schedule at ffffffffb0719898
> [ffffa7a8d14dbc08] schedule at ffffffffb0719e9e
> [ffffa7a8d14dbc28] schedule_preempt_disabled at ffffffffb071a24e
> [ffffa7a8d14dbc38] __mutex_lock at ffffffffb071af28
> [ffffa7a8d14dbcb8] __mutex_lock_slowpath at ffffffffb071b1a3
> [ffffa7a8d14dbcc8] mutex_lock at ffffffffb071b1e2
> [ffffa7a8d14dbce0] rtnl_lock at ffffffffb047f4b5
> [ffffa7a8d14dbcf0] bonding_show_bonds at ffffffffc079b1a1 [bonding]
> [ffffa7a8d14dbd20] class_attr_show at ffffffffb02117ce
> [ffffa7a8d14dbd30] sysfs_kf_seq_show at ffffffffafe37ba1
> [ffffa7a8d14dbd50] kernfs_seq_show at ffffffffafe35c07
> [ffffa7a8d14dbd60] seq_read_iter at ffffffffafd9fce0
> [ffffa7a8d14dbdc0] kernfs_fop_read_iter at ffffffffafe36a10
> [ffffa7a8d14dbe00] new_sync_read at ffffffffafd6de23
> [ffffa7a8d14dbe90] vfs_read at ffffffffafd6e64e
> [ffffa7a8d14dbed0] ksys_read at ffffffffafd70977
> [ffffa7a8d14dbf10] __x64_sys_read at ffffffffafd70a0a
> [ffffa7a8d14dbf20] do_syscall_64 at ffffffffb070bf1c
> [ffffa7a8d14dbf50] entry_SYSCALL_64_after_hwframe at ffffffffb080007c
> ......
>
> Problem description:
>
> Thread 210933 holds the rtnl_mutex and tries to acquire the kernfs_rwsem,
> but there are many readers which hold the kernfs_rwsem, so it has to sleep
> for a long time to wait the readers release the lock. Thread 278176 and any
> other threads which call bonding_show_bonds() also need to wait because
> they try to accuire the rtnl_mutex.
>
> bonding_show_bonds() uses rtnl_mutex to protect the bond_list traversal.
> However, the addition and deletion of bond_list are only performed in
> bond_init()/bond_uninit(), so we can intoduce a separate read-write lock
> to synchronize bond list mutation.
>
> What's the benefits of this change?
>
> 1) All threads which call bonding_show_bonds() only wait when the
> registration or unregistration of bond device happens.
>
> 2) There are many other users of rtnl_mutex, so bonding_show_bonds()
> won't compete with them.
>
> In a word, this change reduces the lock contention of rtnl_mutex.
>
> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
> ---
> drivers/net/bonding/bond_main.c | 4 ++++
> drivers/net/bonding/bond_sysfs.c | 6 ++++--
> include/net/bonding.h | 3 +++
> 3 files changed, 11 insertions(+), 2 deletions(-)
Reader-writer locks are slower than spin locks and should be discouraged.
Would it be possible to use RCU here instead?
^ permalink raw reply
* [PATCH net] bonding: stop the device in bond_setup_by_slave()
From: Eric Dumazet @ 2023-11-09 18:01 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Jay Vosburgh, Andy Gospodarek, netdev, eric.dumazet, Eric Dumazet,
syzbot
Commit 9eed321cde22 ("net: lapbether: only support ethernet devices")
has been able to keep syzbot away from net/lapb, until today.
In the following splat [1], the issue is that a lapbether device has
been created on a bonding device without members. Then adding a non
ARPHRD_ETHER member forced the bonding master to change its type.
The fix is to make sure we call dev_close() in bond_setup_by_slave()
so that the potential linked lapbether devices (or any other devices
having assumptions on the physical device) are removed.
A similar bug has been addressed in commit 40baec225765
("bonding: fix panic on non-ARPHRD_ETHER enslave failure")
[1]
skbuff: skb_under_panic: text:ffff800089508810 len:44 put:40 head:ffff0000c78e7c00 data:ffff0000c78e7bea tail:0x16 end:0x140 dev:bond0
kernel BUG at net/core/skbuff.c:192 !
Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 6007 Comm: syz-executor383 Not tainted 6.6.0-rc3-syzkaller-gbf6547d8715b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : skb_panic net/core/skbuff.c:188 [inline]
pc : skb_under_panic+0x13c/0x140 net/core/skbuff.c:202
lr : skb_panic net/core/skbuff.c:188 [inline]
lr : skb_under_panic+0x13c/0x140 net/core/skbuff.c:202
sp : ffff800096a06aa0
x29: ffff800096a06ab0 x28: ffff800096a06ba0 x27: dfff800000000000
x26: ffff0000ce9b9b50 x25: 0000000000000016 x24: ffff0000c78e7bea
x23: ffff0000c78e7c00 x22: 000000000000002c x21: 0000000000000140
x20: 0000000000000028 x19: ffff800089508810 x18: ffff800096a06100
x17: 0000000000000000 x16: ffff80008a629a3c x15: 0000000000000001
x14: 1fffe00036837a32 x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000201 x10: 0000000000000000 x9 : cb50b496c519aa00
x8 : cb50b496c519aa00 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff800096a063b8 x4 : ffff80008e280f80 x3 : ffff8000805ad11c
x2 : 0000000000000001 x1 : 0000000100000201 x0 : 0000000000000086
Call trace:
skb_panic net/core/skbuff.c:188 [inline]
skb_under_panic+0x13c/0x140 net/core/skbuff.c:202
skb_push+0xf0/0x108 net/core/skbuff.c:2446
ip6gre_header+0xbc/0x738 net/ipv6/ip6_gre.c:1384
dev_hard_header include/linux/netdevice.h:3136 [inline]
lapbeth_data_transmit+0x1c4/0x298 drivers/net/wan/lapbether.c:257
lapb_data_transmit+0x8c/0xb0 net/lapb/lapb_iface.c:447
lapb_transmit_buffer+0x178/0x204 net/lapb/lapb_out.c:149
lapb_send_control+0x220/0x320 net/lapb/lapb_subr.c:251
__lapb_disconnect_request+0x9c/0x17c net/lapb/lapb_iface.c:326
lapb_device_event+0x288/0x4e0 net/lapb/lapb_iface.c:492
notifier_call_chain+0x1a4/0x510 kernel/notifier.c:93
raw_notifier_call_chain+0x3c/0x50 kernel/notifier.c:461
call_netdevice_notifiers_info net/core/dev.c:1970 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
call_netdevice_notifiers net/core/dev.c:2022 [inline]
__dev_close_many+0x1b8/0x3c4 net/core/dev.c:1508
dev_close_many+0x1e0/0x470 net/core/dev.c:1559
dev_close+0x174/0x250 net/core/dev.c:1585
lapbeth_device_event+0x2e4/0x958 drivers/net/wan/lapbether.c:466
notifier_call_chain+0x1a4/0x510 kernel/notifier.c:93
raw_notifier_call_chain+0x3c/0x50 kernel/notifier.c:461
call_netdevice_notifiers_info net/core/dev.c:1970 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
call_netdevice_notifiers net/core/dev.c:2022 [inline]
__dev_close_many+0x1b8/0x3c4 net/core/dev.c:1508
dev_close_many+0x1e0/0x470 net/core/dev.c:1559
dev_close+0x174/0x250 net/core/dev.c:1585
bond_enslave+0x2298/0x30cc drivers/net/bonding/bond_main.c:2332
bond_do_ioctl+0x268/0xc64 drivers/net/bonding/bond_main.c:4539
dev_ifsioc+0x754/0x9ac
dev_ioctl+0x4d8/0xd34 net/core/dev_ioctl.c:786
sock_do_ioctl+0x1d4/0x2d0 net/socket.c:1217
sock_ioctl+0x4e8/0x834 net/socket.c:1322
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591
Code: aa1803e6 aa1903e7 a90023f5 94785b8b (d4210000)
Fixes: 872254dd6b1f ("net/bonding: Enable bonding to enslave non ARPHRD_ETHER")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/bonding/bond_main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 51d47eda1c873debda6da094377bcb3367a78f6e..8e6cc0e133b7f19afccd3ecf44bea5ceacb393b1 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1500,6 +1500,10 @@ static void bond_compute_features(struct bonding *bond)
static void bond_setup_by_slave(struct net_device *bond_dev,
struct net_device *slave_dev)
{
+ bool was_up = !!(bond_dev->flags & IFF_UP);
+
+ dev_close(bond_dev);
+
bond_dev->header_ops = slave_dev->header_ops;
bond_dev->type = slave_dev->type;
@@ -1514,6 +1518,8 @@ static void bond_setup_by_slave(struct net_device *bond_dev,
bond_dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST);
bond_dev->flags |= (IFF_POINTOPOINT | IFF_NOARP);
}
+ if (was_up)
+ dev_open(bond_dev, NULL);
}
/* On bonding slaves other than the currently active slave, suppress
--
2.42.0.869.gea05f2083d-goog
^ permalink raw reply related
* Re: [PATCH bpf-next v5 00/13] xsk: TX metadata
From: Alexei Starovoitov @ 2023-11-09 18:03 UTC (permalink / raw)
To: Stanislav Fomichev
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Hao Luo, Jiri Olsa, Jakub Kicinski,
Toke Høiland-Jørgensen, Willem de Bruijn, David Ahern,
Karlsson, Magnus, Björn Töpel, Fijalkowski, Maciej,
Jesper Dangaard Brouer, Song, Yoong Siang, Network Development,
xdp-hints
In-Reply-To: <20231102225837.1141915-1-sdf@google.com>
On Thu, Nov 2, 2023 at 3:58 PM Stanislav Fomichev <sdf@google.com> wrote:
>
> This series implements initial TX metadata (offloads) for AF_XDP.
> See patch #2 for the main implementation and mlx5/stmmac ones for the
> example on how to consume the metadata on the device side.
>
> Starting with two types of offloads:
> - request TX timestamp (and write it back into the metadata area)
> - request TX checksum offload
>
> Changes since v4:
> - remove 'render-max: true' from spec (Jakub)
> - move xsk_tx_metadata_ops into include/net/xdp_sock.h (Jakub)
> - christmas tree in netdev_nl_dev_fill (Jakub)
> - fix > vs >= when dumping masks in samples (Jakub)
> - switch to 8-byte alignment for tx metadata length (Jakub)
> - spelling fixes in the doc (Magnus)
> - deny metadata length >= 256 (Magnus)
> - validate metadata flags and deny unknown ones (Jakub)
> - move XDP_TX_METADATA_CHECKSUM_SW into umem config flag (Jakub)
> - don't print timestamps twice in xdp_hw_metadata (Song)
> - rename anonymous xsk_tx_metadata member into request (Alexei)
> - add comment to xsk_tx_metadata (Alexei)
>
> I've separated new bits that need a closer review into separate patches:
> - xsk_tx_metadata flags validation:
> - xsk: Validate xsk_tx_metadata flags
> - new umem flag for sw tx csum calculation (instead of per-packet flag)
> - xsk: Add option to calculate TX checksum in SW
Stan,
new xdp_metadata is failing on s390. See BPF CI:
verify_xsk_metadata:FAIL:csum unexpected csum: actual 29212 != expected 7282
Other than this I think the patchset is good to go.
Pls fix and respin.
^ permalink raw reply
* Re: [PATCH] boning: use a read-write lock in bonding_show_bonds()
From: Eric Dumazet @ 2023-11-09 18:03 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Haifeng Xu, j.vosburgh, andy, davem, kuba, pabeni, netdev,
linux-kernel
In-Reply-To: <20231109095502.5a03bfd5@hermes.local>
On Thu, Nov 9, 2023 at 6:55 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
> Reader-writer locks are slower than spin locks and should be discouraged.
> Would it be possible to use RCU here instead?
I doubt there is a case for repeatedly reading this file ?
This 'lock' is only for slow paths, it doesn't really matter what it is.
^ permalink raw reply
* Re: [PATCH net 3/3] dpll: fix register pin with unregistered parent pin
From: Jiri Pirko @ 2023-11-09 18:04 UTC (permalink / raw)
To: Kubalewski, Arkadiusz
Cc: Vadim Fedorenko, netdev@vger.kernel.org, Michalik, Michal,
Olech, Milena, pabeni@redhat.com, kuba@kernel.org
In-Reply-To: <DM6PR11MB4657C6C1B094DD7B429A22469BAFA@DM6PR11MB4657.namprd11.prod.outlook.com>
Thu, Nov 09, 2023 at 05:02:48PM CET, arkadiusz.kubalewski@intel.com wrote:
>>From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
>>Sent: Thursday, November 9, 2023 11:56 AM
>>To: Kubalewski, Arkadiusz <arkadiusz.kubalewski@intel.com>; Jiri Pirko
>>
>>On 09/11/2023 09:59, Kubalewski, Arkadiusz wrote:
>>>> From: Jiri Pirko <jiri@resnulli.us>
>>>> Sent: Wednesday, November 8, 2023 4:08 PM
>>>>
>>>> Wed, Nov 08, 2023 at 11:32:26AM CET, arkadiusz.kubalewski@intel.com
>>>> wrote:
>>>>> In case of multiple kernel module instances using the same dpll device:
>>>>> if only one registers dpll device, then only that one can register
>>>>
>>>> They why you don't register in multiple instances? See mlx5 for a
>>>> reference.
>>>>
>>>
>>> Every registration requires ops, but for our case only PF0 is able to
>>> control dpll pins and device, thus only this can provide ops.
>>> Basically without PF0, dpll is not able to be controlled, as well
>>> as directly connected pins.
>>>
>>But why do you need other pins then, if FP0 doesn't exist?
>>
>
>In general we don't need them at that point, but this is a corner case,
>where users for some reason decided to unbind PF 0, and I treat this state
>as temporary, where dpll/pins controllability is temporarily broken.
So resolve this broken situation internally in the driver, registering
things only in case PF0 is present. Some simple notification infra would
do. Don't drag this into the subsystem internals.
>
>The dpll at that point is not registered, all the direct pins are also
>not registered, thus not available to the users.
>
>When I do dump at that point there are still 3 pins present, one for each
>PF, although they are all zombies - no parents as their parent pins are not
>registered (as the other patch [1/3] prevents dump of pin parent if the
>parent is not registered). Maybe we can remove the REGISTERED mark for all
>the muxed pins, if all their parents have been unregistered, so they won't
>be visible to the user at all. Will try to POC that.
>
>>>>
>>>>> directly connected pins with a dpll device. If unregistered parent
>>>>> determines if the muxed pin can be register with it or not, it forces
>>>>> serialized driver load order - first the driver instance which
>>>>> registers the direct pins needs to be loaded, then the other instances
>>>>> could register muxed type pins.
>>>>>
>>>>> Allow registration of a pin with a parent even if the parent was not
>>>>> yet registered, thus allow ability for unserialized driver instance
>>>>
>>>> Weird.
>>>>
>>>
>>> Yeah, this is issue only for MUX/parent pin part, couldn't find better
>>> way, but it doesn't seem to break things around..
>>>
>>
>>I just wonder how do you see the registration procedure? How can parent
>>pin exist if it's not registered? I believe you cannot get it through
>>DPLL API, then the only possible way is to create it within the same
>>driver code, which can be simply re-arranged. Am I wrong here?
>>
>
>By "parent exist" I mean the parent pin exist in the dpll subsystem
>(allocated on pins xa), but it doesn't mean it is available to the users,
>as it might not be registered with a dpll device.
>
>We have this 2 step init approach:
>1. dpll_pin_get(..) -> allocate new pin or increase reference if exist
>2.1. dpll_pin_register(..) -> register with a dpll device
>2.2. dpll_pin_on_pin_register -> register with a parent pin
>
>Basically:
>- PF 0 does 1 & 2.1 for all the direct inputs, and steps: 1 & 2.2 for its
> recovery clock pin,
>- other PF's only do step 1 for the direct input pins (as they must get
> reference to those in order to register recovery clock pin with them),
> and steps: 1 & 2.2 for their recovery clock pin.
>
>
>Thank you!
>Arkadiusz
>
>>> Thank you!
>>> Arkadiusz
>>>
>>>>
>>>>> load order.
>>>>> Do not WARN_ON notification for unregistered pin, which can be invoked
>>>>> for described case, instead just return error.
>>>>>
>>>>> Fixes: 9431063ad323 ("dpll: core: Add DPLL framework base functions")
>>>>> Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base
>>>>> functions")
>>>>> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
>>>>> ---
>>>>> drivers/dpll/dpll_core.c | 4 ----
>>>>> drivers/dpll/dpll_netlink.c | 2 +-
>>>>> 2 files changed, 1 insertion(+), 5 deletions(-)
>>>>>
>>>>> diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index
>>>>> 4077b562ba3b..ae884b92d68c 100644
>>>>> --- a/drivers/dpll/dpll_core.c
>>>>> +++ b/drivers/dpll/dpll_core.c
>>>>> @@ -28,8 +28,6 @@ static u32 dpll_xa_id;
>>>>> WARN_ON_ONCE(!xa_get_mark(&dpll_device_xa, (d)->id, DPLL_REGISTERED))
>>>>> #define ASSERT_DPLL_NOT_REGISTERED(d) \
>>>>> WARN_ON_ONCE(xa_get_mark(&dpll_device_xa, (d)->id, DPLL_REGISTERED))
>>>>> -#define ASSERT_PIN_REGISTERED(p) \
>>>>> - WARN_ON_ONCE(!xa_get_mark(&dpll_pin_xa, (p)->id, DPLL_REGISTERED))
>>>>>
>>>>> struct dpll_device_registration {
>>>>> struct list_head list;
>>>>> @@ -641,8 +639,6 @@ int dpll_pin_on_pin_register(struct dpll_pin
>>>>>*parent,
>>>> struct dpll_pin *pin,
>>>>> WARN_ON(!ops->state_on_pin_get) ||
>>>>> WARN_ON(!ops->direction_get))
>>>>> return -EINVAL;
>>>>> - if (ASSERT_PIN_REGISTERED(parent))
>>>>> - return -EINVAL;
>>>>>
>>>>> mutex_lock(&dpll_lock);
>>>>> ret = dpll_xa_ref_pin_add(&pin->parent_refs, parent, ops, priv); diff
>>>>> --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c index
>>>>> 963bbbbe6660..ff430f43304f 100644
>>>>> --- a/drivers/dpll/dpll_netlink.c
>>>>> +++ b/drivers/dpll/dpll_netlink.c
>>>>> @@ -558,7 +558,7 @@ dpll_pin_event_send(enum dpll_cmd event, struct
>>>> dpll_pin *pin)
>>>>> int ret = -ENOMEM;
>>>>> void *hdr;
>>>>>
>>>>> - if (WARN_ON(!xa_get_mark(&dpll_pin_xa, pin->id, DPLL_REGISTERED)))
>>>>> + if (!xa_get_mark(&dpll_pin_xa, pin->id, DPLL_REGISTERED))
>>>>> return -ENODEV;
>>>>>
>>>>> msg = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
>>>>> --
>>>>> 2.38.1
>>>>>
>>
>
^ permalink raw reply
* Re: [PATCH net 2/3] dpll: fix pin dump crash for rebound module
From: Jiri Pirko @ 2023-11-09 18:06 UTC (permalink / raw)
To: Kubalewski, Arkadiusz
Cc: netdev@vger.kernel.org, vadim.fedorenko@linux.dev,
Michalik, Michal, Olech, Milena, pabeni@redhat.com,
kuba@kernel.org
In-Reply-To: <DM6PR11MB46571D4C776B0B1888F943569BAFA@DM6PR11MB4657.namprd11.prod.outlook.com>
Thu, Nov 09, 2023 at 05:30:20PM CET, arkadiusz.kubalewski@intel.com wrote:
>>From: Jiri Pirko <jiri@resnulli.us>
>>Sent: Thursday, November 9, 2023 2:19 PM
>>
>>Thu, Nov 09, 2023 at 01:20:48PM CET, arkadiusz.kubalewski@intel.com wrote:
>>>>From: Jiri Pirko <jiri@resnulli.us>
>>>>Sent: Wednesday, November 8, 2023 3:30 PM
>>>>
>>>>Wed, Nov 08, 2023 at 11:32:25AM CET, arkadiusz.kubalewski@intel.com
>>>>wrote:
>>>>>When a kernel module is unbound but the pin resources were not entirely
>>>>>freed (other kernel module instance have had kept the reference to that
>>>>>pin), and kernel module is again bound, the pin properties would not be
>>>>>updated (the properties are only assigned when memory for the pin is
>>>>>allocated), prop pointer still points to the kernel module memory of
>>>>>the kernel module which was deallocated on the unbind.
>>>>>
>>>>>If the pin dump is invoked in this state, the result is a kernel crash.
>>>>>Prevent the crash by storing persistent pin properties in dpll
>>>>>subsystem,
>>>>>copy the content from the kernel module when pin is allocated, instead
>>>>>of
>>>>>using memory of the kernel module.
>>>>>
>>>>>Fixes: 9431063ad323 ("dpll: core: Add DPLL framework base functions")
>>>>>Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base functions")
>>>>>Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
>>>>>---
>>>>> drivers/dpll/dpll_core.c | 4 ++--
>>>>> drivers/dpll/dpll_core.h | 4 ++--
>>>>> drivers/dpll/dpll_netlink.c | 28 ++++++++++++++--------------
>>>>> 3 files changed, 18 insertions(+), 18 deletions(-)
>>>>>
>>>>>diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
>>>>>index 3568149b9562..4077b562ba3b 100644
>>>>>--- a/drivers/dpll/dpll_core.c
>>>>>+++ b/drivers/dpll/dpll_core.c
>>>>>@@ -442,7 +442,7 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct
>>>>>module *module,
>>>>> ret = -EINVAL;
>>>>> goto err;
>>>>> }
>>>>>- pin->prop = prop;
>>>>>+ memcpy(&pin->prop, prop, sizeof(pin->prop));
>>>>
>>>>Odd, you don't care about the pointer within this structure?
>>>>
>>>
>>>Well, true. Need a fix.
>>>Wondering if copying idea is better than just assigning prop pointer on
>>>each call to dpll_pin_get(..) function (when pin already exists)?
>>
>>Not sure what do you mean. Examples please.
>>
>
>Sure,
>
>Basically this change:
>
>diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
>index ae884b92d68c..06b72d5877c3 100644
>--- a/drivers/dpll/dpll_core.c
>+++ b/drivers/dpll/dpll_core.c
>@@ -483,6 +483,7 @@ dpll_pin_get(u64 clock_id, u32 pin_idx, struct module *module,
> pos->pin_idx == pin_idx &&
> pos->module == module) {
> ret = pos;
>+ pos->prop = prop;
> refcount_inc(&ret->refcount);
> break;
> }
>
>would replace whole of this patch changes, although seems a bit hacky.
Or event better, as I suggested in the other patch reply, resolve this
internally in the driver registering things only when they are valid.
Much better then to hack anything in dpll core.
>
>Thank you!
>Arkadiusz
>
>>
>>>
>>>Thank you!
>>>Arkadiusz
>>>
>>>>
>>>>> refcount_set(&pin->refcount, 1);
>>>>> xa_init_flags(&pin->dpll_refs, XA_FLAGS_ALLOC);
>>>>> xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC);
>>>>>@@ -634,7 +634,7 @@ int dpll_pin_on_pin_register(struct dpll_pin
>>>>>*parent,
>>>>>struct dpll_pin *pin,
>>>>> unsigned long i, stop;
>>>>> int ret;
>>>>>
>>>>>- if (WARN_ON(parent->prop->type != DPLL_PIN_TYPE_MUX))
>>>>>+ if (WARN_ON(parent->prop.type != DPLL_PIN_TYPE_MUX))
>>>>> return -EINVAL;
>>>>>
>>>>> if (WARN_ON(!ops) ||
>>>>>diff --git a/drivers/dpll/dpll_core.h b/drivers/dpll/dpll_core.h
>>>>>index 5585873c5c1b..717f715015c7 100644
>>>>>--- a/drivers/dpll/dpll_core.h
>>>>>+++ b/drivers/dpll/dpll_core.h
>>>>>@@ -44,7 +44,7 @@ struct dpll_device {
>>>>> * @module: module of creator
>>>>> * @dpll_refs: hold referencees to dplls pin was registered
>>>>>with
>>>>> * @parent_refs: hold references to parent pins pin was registered
>>>>>with
>>>>>- * @prop: pointer to pin properties given by registerer
>>>>>+ * @prop: pin properties copied from the registerer
>>>>> * @rclk_dev_name: holds name of device when pin can recover clock
>>>>>from it
>>>>> * @refcount: refcount
>>>>> **/
>>>>>@@ -55,7 +55,7 @@ struct dpll_pin {
>>>>> struct module *module;
>>>>> struct xarray dpll_refs;
>>>>> struct xarray parent_refs;
>>>>>- const struct dpll_pin_properties *prop;
>>>>>+ struct dpll_pin_properties prop;
>>>>> refcount_t refcount;
>>>>> };
>>>>>
>>>>>diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
>>>>>index 93fc6c4b8a78..963bbbbe6660 100644
>>>>>--- a/drivers/dpll/dpll_netlink.c
>>>>>+++ b/drivers/dpll/dpll_netlink.c
>>>>>@@ -278,17 +278,17 @@ dpll_msg_add_pin_freq(struct sk_buff *msg, struct
>>>>>dpll_pin *pin,
>>>>> if (nla_put_64bit(msg, DPLL_A_PIN_FREQUENCY, sizeof(freq), &freq,
>>>>> DPLL_A_PIN_PAD))
>>>>> return -EMSGSIZE;
>>>>>- for (fs = 0; fs < pin->prop->freq_supported_num; fs++) {
>>>>>+ for (fs = 0; fs < pin->prop.freq_supported_num; fs++) {
>>>>> nest = nla_nest_start(msg, DPLL_A_PIN_FREQUENCY_SUPPORTED);
>>>>> if (!nest)
>>>>> return -EMSGSIZE;
>>>>>- freq = pin->prop->freq_supported[fs].min;
>>>>>+ freq = pin->prop.freq_supported[fs].min;
>>>>> if (nla_put_64bit(msg, DPLL_A_PIN_FREQUENCY_MIN, sizeof(freq),
>>>>> &freq, DPLL_A_PIN_PAD)) {
>>>>> nla_nest_cancel(msg, nest);
>>>>> return -EMSGSIZE;
>>>>> }
>>>>>- freq = pin->prop->freq_supported[fs].max;
>>>>>+ freq = pin->prop.freq_supported[fs].max;
>>>>> if (nla_put_64bit(msg, DPLL_A_PIN_FREQUENCY_MAX, sizeof(freq),
>>>>> &freq, DPLL_A_PIN_PAD)) {
>>>>> nla_nest_cancel(msg, nest);
>>>>>@@ -304,9 +304,9 @@ static bool dpll_pin_is_freq_supported(struct
>>>>>dpll_pin
>>>>>*pin, u32 freq)
>>>>> {
>>>>> int fs;
>>>>>
>>>>>- for (fs = 0; fs < pin->prop->freq_supported_num; fs++)
>>>>>- if (freq >= pin->prop->freq_supported[fs].min &&
>>>>>- freq <= pin->prop->freq_supported[fs].max)
>>>>>+ for (fs = 0; fs < pin->prop.freq_supported_num; fs++)
>>>>>+ if (freq >= pin->prop.freq_supported[fs].min &&
>>>>>+ freq <= pin->prop.freq_supported[fs].max)
>>>>> return true;
>>>>> return false;
>>>>> }
>>>>>@@ -403,7 +403,7 @@ static int
>>>>> dpll_cmd_pin_get_one(struct sk_buff *msg, struct dpll_pin *pin,
>>>>> struct netlink_ext_ack *extack)
>>>>> {
>>>>>- const struct dpll_pin_properties *prop = pin->prop;
>>>>>+ const struct dpll_pin_properties *prop = &pin->prop;
>>>>> struct dpll_pin_ref *ref;
>>>>> int ret;
>>>>>
>>>>>@@ -696,7 +696,7 @@ dpll_pin_on_pin_state_set(struct dpll_pin *pin, u32
>>>>>parent_idx,
>>>>> int ret;
>>>>>
>>>>> if (!(DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE &
>>>>>- pin->prop->capabilities)) {
>>>>>+ pin->prop.capabilities)) {
>>>>> NL_SET_ERR_MSG(extack, "state changing is not allowed");
>>>>> return -EOPNOTSUPP;
>>>>> }
>>>>>@@ -732,7 +732,7 @@ dpll_pin_state_set(struct dpll_device *dpll, struct
>>>>>dpll_pin *pin,
>>>>> int ret;
>>>>>
>>>>> if (!(DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE &
>>>>>- pin->prop->capabilities)) {
>>>>>+ pin->prop.capabilities)) {
>>>>> NL_SET_ERR_MSG(extack, "state changing is not allowed");
>>>>> return -EOPNOTSUPP;
>>>>> }
>>>>>@@ -759,7 +759,7 @@ dpll_pin_prio_set(struct dpll_device *dpll, struct
>>>>>dpll_pin *pin,
>>>>> int ret;
>>>>>
>>>>> if (!(DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE &
>>>>>- pin->prop->capabilities)) {
>>>>>+ pin->prop.capabilities)) {
>>>>> NL_SET_ERR_MSG(extack, "prio changing is not allowed");
>>>>> return -EOPNOTSUPP;
>>>>> }
>>>>>@@ -787,7 +787,7 @@ dpll_pin_direction_set(struct dpll_pin *pin, struct
>>>>>dpll_device *dpll,
>>>>> int ret;
>>>>>
>>>>> if (!(DPLL_PIN_CAPABILITIES_DIRECTION_CAN_CHANGE &
>>>>>- pin->prop->capabilities)) {
>>>>>+ pin->prop.capabilities)) {
>>>>> NL_SET_ERR_MSG(extack, "direction changing is not allowed");
>>>>> return -EOPNOTSUPP;
>>>>> }
>>>>>@@ -817,8 +817,8 @@ dpll_pin_phase_adj_set(struct dpll_pin *pin, struct
>>>>>nlattr *phase_adj_attr,
>>>>> int ret;
>>>>>
>>>>> phase_adj = nla_get_s32(phase_adj_attr);
>>>>>- if (phase_adj > pin->prop->phase_range.max ||
>>>>>- phase_adj < pin->prop->phase_range.min) {
>>>>>+ if (phase_adj > pin->prop.phase_range.max ||
>>>>>+ phase_adj < pin->prop.phase_range.min) {
>>>>> NL_SET_ERR_MSG_ATTR(extack, phase_adj_attr,
>>>>> "phase adjust value not supported");
>>>>> return -EINVAL;
>>>>>@@ -999,7 +999,7 @@ dpll_pin_find(u64 clock_id, struct nlattr
>>>>>*mod_name_attr,
>>>>> unsigned long i;
>>>>>
>>>>> xa_for_each_marked(&dpll_pin_xa, i, pin, DPLL_REGISTERED) {
>>>>>- prop = pin->prop;
>>>>>+ prop = &pin->prop;
>>>>> cid_match = clock_id ? pin->clock_id == clock_id : true;
>>>>> mod_match = mod_name_attr && module_name(pin->module) ?
>>>>> !nla_strcmp(mod_name_attr,
>>>>>--
>>>>>2.38.1
>>>>>
>>>
^ permalink raw reply
* Re: [PATCH net 0/3] dpll: fix unordered unbind/bind registerer issues
From: Jiri Pirko @ 2023-11-09 18:07 UTC (permalink / raw)
To: Kubalewski, Arkadiusz
Cc: Vadim Fedorenko, netdev@vger.kernel.org, Michalik, Michal,
Olech, Milena, pabeni@redhat.com, kuba@kernel.org
In-Reply-To: <DM6PR11MB465721130A49C22D77E42A799BAFA@DM6PR11MB4657.namprd11.prod.outlook.com>
Thu, Nov 09, 2023 at 06:20:14PM CET, arkadiusz.kubalewski@intel.com wrote:
>>From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
>>Sent: Thursday, November 9, 2023 11:51 AM
>>
>>On 08/11/2023 10:32, Arkadiusz Kubalewski wrote:
>>> Fix issues when performing unordered unbind/bind of a kernel modules
>>> which are using a dpll device with DPLL_PIN_TYPE_MUX pins.
>>> Currently only serialized bind/unbind of such use case works, fix
>>> the issues and allow for unserialized kernel module bind order.
>>>
>>> The issues are observed on the ice driver, i.e.,
>>>
>>> $ echo 0000:af:00.0 > /sys/bus/pci/drivers/ice/unbind
>>> $ echo 0000:af:00.1 > /sys/bus/pci/drivers/ice/unbind
>>>
>>> results in:
>>>
>>> ice 0000:af:00.0: Removed PTP clock
>>> BUG: kernel NULL pointer dereference, address: 0000000000000010
>>> PF: supervisor read access in kernel mode
>>> PF: error_code(0x0000) - not-present page
>>> PGD 0 P4D 0
>>> Oops: 0000 [#1] PREEMPT SMP PTI
>>> CPU: 7 PID: 71848 Comm: bash Kdump: loaded Not tainted 6.6.0-rc5_next-
>>>queue_19th-Oct-2023-01625-g039e5d15e451 #1
>>> Hardware name: Intel Corporation S2600STB/S2600STB, BIOS
>>>SE5C620.86B.02.01.0008.031920191559 03/19/2019
>>> RIP: 0010:ice_dpll_rclk_state_on_pin_get+0x2f/0x90 [ice]
>>> Code: 41 57 4d 89 cf 41 56 41 55 4d 89 c5 41 54 55 48 89 f5 53 4c 8b 66
>>>08 48 89 cb 4d 8d b4 24 f0 49 00 00 4c 89 f7 e8 71 ec 1f c5 <0f> b6 5b 10
>>>41 0f b6 84 24 30 4b 00 00 29 c3 41 0f b6 84 24 28 4b
>>> RSP: 0018:ffffc902b179fb60 EFLAGS: 00010246
>>> RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
>>> RDX: ffff8882c1398000 RSI: ffff888c7435cc60 RDI: ffff888c7435cb90
>>> RBP: ffff888c7435cc60 R08: ffffc902b179fbb0 R09: 0000000000000000
>>> R10: ffff888ef1fc8050 R11: fffffffffff82700 R12: ffff888c743581a0
>>> R13: ffffc902b179fbb0 R14: ffff888c7435cb90 R15: 0000000000000000
>>> FS: 00007fdc7dae0740(0000) GS:ffff888c105c0000(0000)
>>knlGS:0000000000000000
>>> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>>> CR2: 0000000000000010 CR3: 0000000132c24002 CR4: 00000000007706e0
>>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>>> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
>>> PKRU: 55555554
>>> Call Trace:
>>> <TASK>
>>> ? __die+0x20/0x70
>>> ? page_fault_oops+0x76/0x170
>>> ? exc_page_fault+0x65/0x150
>>> ? asm_exc_page_fault+0x22/0x30
>>> ? ice_dpll_rclk_state_on_pin_get+0x2f/0x90 [ice]
>>> ? __pfx_ice_dpll_rclk_state_on_pin_get+0x10/0x10 [ice]
>>> dpll_msg_add_pin_parents+0x142/0x1d0
>>> dpll_pin_event_send+0x7d/0x150
>>> dpll_pin_on_pin_unregister+0x3f/0x100
>>> ice_dpll_deinit_pins+0xa1/0x230 [ice]
>>> ice_dpll_deinit+0x29/0xe0 [ice]
>>> ice_remove+0xcd/0x200 [ice]
>>> pci_device_remove+0x33/0xa0
>>> device_release_driver_internal+0x193/0x200
>>> unbind_store+0x9d/0xb0
>>> kernfs_fop_write_iter+0x128/0x1c0
>>> vfs_write+0x2bb/0x3e0
>>> ksys_write+0x5f/0xe0
>>> do_syscall_64+0x59/0x90
>>> ? filp_close+0x1b/0x30
>>> ? do_dup2+0x7d/0xd0
>>> ? syscall_exit_work+0x103/0x130
>>> ? syscall_exit_to_user_mode+0x22/0x40
>>> ? do_syscall_64+0x69/0x90
>>> ? syscall_exit_work+0x103/0x130
>>> ? syscall_exit_to_user_mode+0x22/0x40
>>> ? do_syscall_64+0x69/0x90
>>> entry_SYSCALL_64_after_hwframe+0x6e/0xd8
>>> RIP: 0033:0x7fdc7d93eb97
>>> Code: 0b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e
>>fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0
>>ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
>>> RSP: 002b:00007fff2aa91028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
>>> RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007fdc7d93eb97
>>> RDX: 000000000000000d RSI: 00005644814ec9b0 RDI: 0000000000000001
>>> RBP: 00005644814ec9b0 R08: 0000000000000000 R09: 00007fdc7d9b14e0
>>> R10: 00007fdc7d9b13e0 R11: 0000000000000246 R12: 000000000000000d
>>> R13: 00007fdc7d9fb780 R14: 000000000000000d R15: 00007fdc7d9f69e0
>>> </TASK>
>>> Modules linked in: uinput vfio_pci vfio_pci_core vfio_iommu_type1 vfio
>>>irqbypass ixgbevf snd_seq_dummy snd_hrtimer snd_seq snd_timer
>>>snd_seq_device snd soundcore overlay qrtr rfkill vfat fat xfs libcrc32c
>>>rpcrdma sunrpc rdma_ucm ib_srpt ib_isert iscsi_target_mod target_core_mod
>>>ib_iser libiscsi scsi_transport_iscsi rdma_cm iw_cm ib_cm intel_rapl_msr
>>>intel_rapl_common intel_uncore_frequency intel_uncore_frequency_common
>>>isst_if_common skx_edac nfit libnvdimm ipmi_ssif x86_pkg_temp_thermal
>>>intel_powerclamp coretemp irdma rapl intel_cstate ib_uverbs iTCO_wdt
>>>iTCO_vendor_support acpi_ipmi intel_uncore mei_me ipmi_si pcspkr i2c_i801
>>>ib_core mei ipmi_devintf intel_pch_thermal ioatdma i2c_smbus
>>>ipmi_msghandler lpc_ich joydev acpi_power_meter acpi_pad ext4 mbcache jbd2
>>>sd_mod t10_pi sg ast i2c_algo_bit drm_shmem_helper drm_kms_helper ice
>>>crct10dif_pclmul ixgbe crc32_pclmul drm crc32c_intel ahci i40e libahci
>>>ghash_clmulni_intel libata mdio dca gnss wmi fuse [last unloaded: iavf]
>>> CR2: 0000000000000010
>>>
>>> Arkadiusz Kubalewski (3):
>>> dpll: fix pin dump crash after module unbind
>>> dpll: fix pin dump crash for rebound module
>>> dpll: fix register pin with unregistered parent pin
>>>
>>> drivers/dpll/dpll_core.c | 8 ++------
>>> drivers/dpll/dpll_core.h | 4 ++--
>>> drivers/dpll/dpll_netlink.c | 37 ++++++++++++++++++++++---------------
>>> 3 files changed, 26 insertions(+), 23 deletions(-)
>>>
>>
>>
>>I still don't get how can we end up with unregistered pin. And shouldn't
>>drivers do unregister of dpll/pin during release procedure? I thought it
>>was kind of agreement we reached while developing the subsystem.
>>
>
>It's definitely not about ending up with unregistered pins.
>
>Usually the driver is loaded for PF0, PF1, PF2, PF3 and unloaded in opposite
>order: PF3, PF2, PF1, PF0. And this is working without any issues.
Please fix this in the driver.
>
>Above crash is caused because of unordered driver unload, where dpll subsystem
>tries to notify muxed pin was deleted, but at that time the parent is already
>gone, thus data points to memory which is no longer available, thus crash
>happens when trying to dump pin parents.
>
>This series fixes all issues I could find connected to the situation where
>muxed-pins are trying to access their parents, when parent registerer was removed
>in the meantime.
>
>Thank you!
>Arkadiusz
^ permalink raw reply
* Re: [PATCH bpf-next v5 00/13] xsk: TX metadata
From: Stanislav Fomichev @ 2023-11-09 18:07 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Hao Luo, Jiri Olsa, Jakub Kicinski,
Toke Høiland-Jørgensen, Willem de Bruijn, David Ahern,
Karlsson, Magnus, Björn Töpel, Fijalkowski, Maciej,
Jesper Dangaard Brouer, Song, Yoong Siang, Network Development,
xdp-hints
In-Reply-To: <CAADnVQLTkhYMXxDsJ4jB5d7SnQ_Z51j9YT65TcdiXNg5DOO_Fg@mail.gmail.com>
On Thu, Nov 9, 2023 at 10:03 AM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Thu, Nov 2, 2023 at 3:58 PM Stanislav Fomichev <sdf@google.com> wrote:
> >
> > This series implements initial TX metadata (offloads) for AF_XDP.
> > See patch #2 for the main implementation and mlx5/stmmac ones for the
> > example on how to consume the metadata on the device side.
> >
> > Starting with two types of offloads:
> > - request TX timestamp (and write it back into the metadata area)
> > - request TX checksum offload
> >
> > Changes since v4:
> > - remove 'render-max: true' from spec (Jakub)
> > - move xsk_tx_metadata_ops into include/net/xdp_sock.h (Jakub)
> > - christmas tree in netdev_nl_dev_fill (Jakub)
> > - fix > vs >= when dumping masks in samples (Jakub)
> > - switch to 8-byte alignment for tx metadata length (Jakub)
> > - spelling fixes in the doc (Magnus)
> > - deny metadata length >= 256 (Magnus)
> > - validate metadata flags and deny unknown ones (Jakub)
> > - move XDP_TX_METADATA_CHECKSUM_SW into umem config flag (Jakub)
> > - don't print timestamps twice in xdp_hw_metadata (Song)
> > - rename anonymous xsk_tx_metadata member into request (Alexei)
> > - add comment to xsk_tx_metadata (Alexei)
> >
> > I've separated new bits that need a closer review into separate patches:
> > - xsk_tx_metadata flags validation:
> > - xsk: Validate xsk_tx_metadata flags
> > - new umem flag for sw tx csum calculation (instead of per-packet flag)
> > - xsk: Add option to calculate TX checksum in SW
>
> Stan,
>
> new xdp_metadata is failing on s390. See BPF CI:
>
> verify_xsk_metadata:FAIL:csum unexpected csum: actual 29212 != expected 7282
>
> Other than this I think the patchset is good to go.
> Pls fix and respin.
Oh, thanks for catching this, probably some endianness issues? Will take a look!
^ permalink raw reply
* [PATCH net-next v2 1/1] ptp: clockmatrix: support 32-bit address space
From: Min Li @ 2023-11-09 18:13 UTC (permalink / raw)
To: richardcochran, lee; +Cc: linux-kernel, netdev, Min Li
From: Min Li <min.li.xe@renesas.com>
We used to assume 0x2010xxxx address. Now that
we need to access 0x2011xxxx address, we need
to support read/write the whole 32-bit address space.
Signed-off-by: Min Li <min.li.xe@renesas.com>
---
- Drop MAX_ABS_WRITE_PHASE_PICOSECONDS advised by Rahul
drivers/ptp/ptp_clockmatrix.c | 61 ++--
drivers/ptp/ptp_clockmatrix.h | 32 +-
include/linux/mfd/idt8a340_reg.h | 542 ++++++++++++++++---------------
3 files changed, 328 insertions(+), 307 deletions(-)
diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c
index f6f9d4adce04..ff316aebff45 100644
--- a/drivers/ptp/ptp_clockmatrix.c
+++ b/drivers/ptp/ptp_clockmatrix.c
@@ -41,7 +41,7 @@ module_param(firmware, charp, 0);
static int _idtcm_adjfine(struct idtcm_channel *channel, long scaled_ppm);
static inline int idtcm_read(struct idtcm *idtcm,
- u16 module,
+ u32 module,
u16 regaddr,
u8 *buf,
u16 count)
@@ -50,7 +50,7 @@ static inline int idtcm_read(struct idtcm *idtcm,
}
static inline int idtcm_write(struct idtcm *idtcm,
- u16 module,
+ u32 module,
u16 regaddr,
u8 *buf,
u16 count)
@@ -62,7 +62,8 @@ static int contains_full_configuration(struct idtcm *idtcm,
const struct firmware *fw)
{
struct idtcm_fwrc *rec = (struct idtcm_fwrc *)fw->data;
- u16 scratch = IDTCM_FW_REG(idtcm->fw_ver, V520, SCRATCH);
+ u16 scratch = SCSR_ADDR(IDTCM_FW_REG(idtcm->fw_ver, V520, SCRATCH));
+ u16 gpio_control = SCSR_ADDR(GPIO_USER_CONTROL);
s32 full_count;
s32 count = 0;
u16 regaddr;
@@ -70,8 +71,8 @@ static int contains_full_configuration(struct idtcm *idtcm,
s32 len;
/* 4 bytes skipped every 0x80 */
- full_count = (scratch - GPIO_USER_CONTROL) -
- ((scratch >> 7) - (GPIO_USER_CONTROL >> 7)) * 4;
+ full_count = (scratch - gpio_control) -
+ ((scratch >> 7) - (gpio_control >> 7)) * 4;
/* If the firmware contains 'full configuration' SM_RESET can be used
* to ensure proper configuration.
@@ -88,7 +89,7 @@ static int contains_full_configuration(struct idtcm *idtcm,
rec++;
/* Top (status registers) and bottom are read-only */
- if (regaddr < GPIO_USER_CONTROL || regaddr >= scratch)
+ if (regaddr < gpio_control || regaddr >= scratch)
continue;
/* Page size 128, last 4 bytes of page skipped */
@@ -506,8 +507,8 @@ static int _sync_pll_output(struct idtcm *idtcm,
{
int err;
u8 val;
- u16 sync_ctrl0;
- u16 sync_ctrl1;
+ u32 sync_ctrl0;
+ u32 sync_ctrl1;
u8 temp;
if (qn == 0 && qn_plus_1 == 0)
@@ -576,21 +577,21 @@ static int _sync_pll_output(struct idtcm *idtcm,
/* PLL5 can have OUT8 as second additional output. */
if (pll == 5 && qn_plus_1 != 0) {
- err = idtcm_read(idtcm, 0, HW_Q8_CTRL_SPARE,
+ err = idtcm_read(idtcm, HW_Q8_CTRL_SPARE, 0,
&temp, sizeof(temp));
if (err)
return err;
temp &= ~(Q9_TO_Q8_SYNC_TRIG);
- err = idtcm_write(idtcm, 0, HW_Q8_CTRL_SPARE,
+ err = idtcm_write(idtcm, HW_Q8_CTRL_SPARE, 0,
&temp, sizeof(temp));
if (err)
return err;
temp |= Q9_TO_Q8_SYNC_TRIG;
- err = idtcm_write(idtcm, 0, HW_Q8_CTRL_SPARE,
+ err = idtcm_write(idtcm, HW_Q8_CTRL_SPARE, 0,
&temp, sizeof(temp));
if (err)
return err;
@@ -598,21 +599,21 @@ static int _sync_pll_output(struct idtcm *idtcm,
/* PLL6 can have OUT11 as second additional output. */
if (pll == 6 && qn_plus_1 != 0) {
- err = idtcm_read(idtcm, 0, HW_Q11_CTRL_SPARE,
+ err = idtcm_read(idtcm, HW_Q11_CTRL_SPARE, 0,
&temp, sizeof(temp));
if (err)
return err;
temp &= ~(Q10_TO_Q11_SYNC_TRIG);
- err = idtcm_write(idtcm, 0, HW_Q11_CTRL_SPARE,
+ err = idtcm_write(idtcm, HW_Q11_CTRL_SPARE, 0,
&temp, sizeof(temp));
if (err)
return err;
temp |= Q10_TO_Q11_SYNC_TRIG;
- err = idtcm_write(idtcm, 0, HW_Q11_CTRL_SPARE,
+ err = idtcm_write(idtcm, HW_Q11_CTRL_SPARE, 0,
&temp, sizeof(temp));
if (err)
return err;
@@ -637,7 +638,7 @@ static int idtcm_sync_pps_output(struct idtcm_channel *channel)
u8 temp;
u16 output_mask = channel->output_mask;
- err = idtcm_read(idtcm, 0, HW_Q8_CTRL_SPARE,
+ err = idtcm_read(idtcm, HW_Q8_CTRL_SPARE, 0,
&temp, sizeof(temp));
if (err)
return err;
@@ -646,7 +647,7 @@ static int idtcm_sync_pps_output(struct idtcm_channel *channel)
Q9_TO_Q8_FANOUT_AND_CLOCK_SYNC_ENABLE_MASK)
out8_mux = 1;
- err = idtcm_read(idtcm, 0, HW_Q11_CTRL_SPARE,
+ err = idtcm_read(idtcm, HW_Q11_CTRL_SPARE, 0,
&temp, sizeof(temp));
if (err)
return err;
@@ -1303,14 +1304,14 @@ static int idtcm_load_firmware(struct idtcm *idtcm,
err = 0;
/* Top (status registers) and bottom are read-only */
- if (regaddr < GPIO_USER_CONTROL || regaddr >= scratch)
+ if (regaddr < SCSR_ADDR(GPIO_USER_CONTROL) || regaddr >= scratch)
continue;
/* Page size 128, last 4 bytes of page skipped */
if ((loaddr > 0x7b && loaddr <= 0x7f) || loaddr > 0xfb)
continue;
- err = idtcm_write(idtcm, regaddr, 0, &val, sizeof(val));
+ err = idtcm_write(idtcm, SCSR_BASE, regaddr, &val, sizeof(val));
}
if (err)
@@ -1395,6 +1396,20 @@ static int idtcm_set_pll_mode(struct idtcm_channel *channel,
struct idtcm *idtcm = channel->idtcm;
int err;
u8 dpll_mode;
+ u8 timeout = 0;
+
+ /* Setup WF/WP timer for phase pull-in to work correctly */
+ err = idtcm_write(idtcm, channel->dpll_n, DPLL_WF_TIMER,
+ &timeout, sizeof(timeout));
+ if (err)
+ return err;
+
+ if (mode == PLL_MODE_WRITE_PHASE)
+ timeout = 160;
+ err = idtcm_write(idtcm, channel->dpll_n, DPLL_WP_TIMER,
+ &timeout, sizeof(timeout));
+ if (err)
+ return err;
err = idtcm_read(idtcm, channel->dpll_n,
IDTCM_FW_REG(idtcm->fw_ver, V520, DPLL_MODE),
@@ -1705,10 +1720,14 @@ static s32 idtcm_getmaxphase(struct ptp_clock_info *ptp __always_unused)
}
/*
- * Internal function for implementing support for write phase offset
+ * Maximum absolute value for write phase offset in picoseconds
*
* @channel: channel
* @delta_ns: delta in nanoseconds
+ *
+ * Destination signed register is 32-bit register in resolution of 50ps
+ *
+ * 0x7fffffff * 50 = 2147483647 * 50 = 107374182350
*/
static int _idtcm_adjphase(struct idtcm_channel *channel, s32 delta_ns)
{
@@ -1717,6 +1736,7 @@ static int _idtcm_adjphase(struct idtcm_channel *channel, s32 delta_ns)
u8 i;
u8 buf[4] = {0};
s32 phase_50ps;
+ s64 offset_ps;
if (channel->mode != PTP_PLL_MODE_WRITE_PHASE) {
err = channel->configure_write_phase(channel);
@@ -1724,7 +1744,8 @@ static int _idtcm_adjphase(struct idtcm_channel *channel, s32 delta_ns)
return err;
}
- phase_50ps = div_s64((s64)delta_ns * 1000, 50);
+ offset_ps = (s64)delta_ns * 1000;
+ phase_50ps = div_s64(offset_ps, 50);
for (i = 0; i < 4; i++) {
buf[i] = phase_50ps & 0xff;
diff --git a/drivers/ptp/ptp_clockmatrix.h b/drivers/ptp/ptp_clockmatrix.h
index 7c17c4f7f573..ad39dc6decdf 100644
--- a/drivers/ptp/ptp_clockmatrix.h
+++ b/drivers/ptp/ptp_clockmatrix.h
@@ -54,21 +54,9 @@
#define LOCK_TIMEOUT_MS (2000)
#define LOCK_POLL_INTERVAL_MS (10)
-#define IDTCM_MAX_WRITE_COUNT (512)
-
#define PHASE_PULL_IN_MAX_PPB (144000)
#define PHASE_PULL_IN_MIN_THRESHOLD_NS (2)
-/*
- * Return register address based on passed in firmware version
- */
-#define IDTCM_FW_REG(FW, VER, REG) (((FW) < (VER)) ? (REG) : (REG##_##VER))
-enum fw_version {
- V_DEFAULT = 0,
- V487 = 1,
- V520 = 2,
-};
-
/* PTP PLL Mode */
enum ptp_pll_mode {
PTP_PLL_MODE_MIN = 0,
@@ -84,16 +72,16 @@ struct idtcm_channel {
struct ptp_clock_info caps;
struct ptp_clock *ptp_clock;
struct idtcm *idtcm;
- u16 dpll_phase;
- u16 dpll_freq;
- u16 dpll_n;
- u16 dpll_ctrl_n;
- u16 dpll_phase_pull_in;
- u16 tod_read_primary;
- u16 tod_read_secondary;
- u16 tod_write;
- u16 tod_n;
- u16 hw_dpll_n;
+ u32 dpll_phase;
+ u32 dpll_freq;
+ u32 dpll_n;
+ u32 dpll_ctrl_n;
+ u32 dpll_phase_pull_in;
+ u32 tod_read_primary;
+ u32 tod_read_secondary;
+ u32 tod_write;
+ u32 tod_n;
+ u32 hw_dpll_n;
u8 sync_src;
enum ptp_pll_mode mode;
int (*configure_write_frequency)(struct idtcm_channel *channel);
diff --git a/include/linux/mfd/idt8a340_reg.h b/include/linux/mfd/idt8a340_reg.h
index 0c706085c205..b680a0eb5f68 100644
--- a/include/linux/mfd/idt8a340_reg.h
+++ b/include/linux/mfd/idt8a340_reg.h
@@ -7,20 +7,20 @@
#ifndef HAVE_IDT8A340_REG
#define HAVE_IDT8A340_REG
-#define PAGE_ADDR_BASE 0x0000
-#define PAGE_ADDR 0x00fc
+#define SCSR_BASE 0x20100000
+#define SCSR_ADDR(x) ((x) & 0xffff)
-#define HW_REVISION 0x8180
+#define HW_REVISION 0x20108180
#define REV_ID 0x007a
-#define HW_DPLL_0 (0x8a00)
-#define HW_DPLL_1 (0x8b00)
-#define HW_DPLL_2 (0x8c00)
-#define HW_DPLL_3 (0x8d00)
-#define HW_DPLL_4 (0x8e00)
-#define HW_DPLL_5 (0x8f00)
-#define HW_DPLL_6 (0x9000)
-#define HW_DPLL_7 (0x9100)
+#define HW_DPLL_0 (0x20108a00)
+#define HW_DPLL_1 (0x20108b00)
+#define HW_DPLL_2 (0x20108c00)
+#define HW_DPLL_3 (0x20108d00)
+#define HW_DPLL_4 (0x20108e00)
+#define HW_DPLL_5 (0x20108f00)
+#define HW_DPLL_6 (0x20109000)
+#define HW_DPLL_7 (0x20109100)
#define HW_DPLL_TOD_SW_TRIG_ADDR__0 (0x080)
#define HW_DPLL_TOD_CTRL_1 (0x089)
@@ -28,22 +28,22 @@
#define HW_DPLL_TOD_OVR__0 (0x098)
#define HW_DPLL_TOD_OUT_0__0 (0x0B0)
-#define HW_Q0_Q1_CH_SYNC_CTRL_0 (0xa740)
-#define HW_Q0_Q1_CH_SYNC_CTRL_1 (0xa741)
-#define HW_Q2_Q3_CH_SYNC_CTRL_0 (0xa742)
-#define HW_Q2_Q3_CH_SYNC_CTRL_1 (0xa743)
-#define HW_Q4_Q5_CH_SYNC_CTRL_0 (0xa744)
-#define HW_Q4_Q5_CH_SYNC_CTRL_1 (0xa745)
-#define HW_Q6_Q7_CH_SYNC_CTRL_0 (0xa746)
-#define HW_Q6_Q7_CH_SYNC_CTRL_1 (0xa747)
-#define HW_Q8_CH_SYNC_CTRL_0 (0xa748)
-#define HW_Q8_CH_SYNC_CTRL_1 (0xa749)
-#define HW_Q9_CH_SYNC_CTRL_0 (0xa74a)
-#define HW_Q9_CH_SYNC_CTRL_1 (0xa74b)
-#define HW_Q10_CH_SYNC_CTRL_0 (0xa74c)
-#define HW_Q10_CH_SYNC_CTRL_1 (0xa74d)
-#define HW_Q11_CH_SYNC_CTRL_0 (0xa74e)
-#define HW_Q11_CH_SYNC_CTRL_1 (0xa74f)
+#define HW_Q0_Q1_CH_SYNC_CTRL_0 (0x2010a740)
+#define HW_Q0_Q1_CH_SYNC_CTRL_1 (0x2010a741)
+#define HW_Q2_Q3_CH_SYNC_CTRL_0 (0x2010a742)
+#define HW_Q2_Q3_CH_SYNC_CTRL_1 (0x2010a743)
+#define HW_Q4_Q5_CH_SYNC_CTRL_0 (0x2010a744)
+#define HW_Q4_Q5_CH_SYNC_CTRL_1 (0x2010a745)
+#define HW_Q6_Q7_CH_SYNC_CTRL_0 (0x2010a746)
+#define HW_Q6_Q7_CH_SYNC_CTRL_1 (0x2010a747)
+#define HW_Q8_CH_SYNC_CTRL_0 (0x2010a748)
+#define HW_Q8_CH_SYNC_CTRL_1 (0x2010a749)
+#define HW_Q9_CH_SYNC_CTRL_0 (0x2010a74a)
+#define HW_Q9_CH_SYNC_CTRL_1 (0x2010a74b)
+#define HW_Q10_CH_SYNC_CTRL_0 (0x2010a74c)
+#define HW_Q10_CH_SYNC_CTRL_1 (0x2010a74d)
+#define HW_Q11_CH_SYNC_CTRL_0 (0x2010a74e)
+#define HW_Q11_CH_SYNC_CTRL_1 (0x2010a74f)
#define SYNC_SOURCE_DPLL0_TOD_PPS 0x14
#define SYNC_SOURCE_DPLL1_TOD_PPS 0x15
@@ -58,8 +58,8 @@
#define SYNCTRL1_Q1_DIV_SYNC_TRIG BIT(1)
#define SYNCTRL1_Q0_DIV_SYNC_TRIG BIT(0)
-#define HW_Q8_CTRL_SPARE (0xa7d4)
-#define HW_Q11_CTRL_SPARE (0xa7ec)
+#define HW_Q8_CTRL_SPARE (0x2010a7d4)
+#define HW_Q11_CTRL_SPARE (0x2010a7ec)
/**
* Select FOD5 as sync_trigger for Q8 divider.
@@ -95,12 +95,12 @@
*/
#define Q10_TO_Q11_FANOUT_AND_CLOCK_SYNC_ENABLE_MASK (BIT(0) | BIT(2))
-#define RESET_CTRL 0xc000
+#define RESET_CTRL 0x2010c000
#define SM_RESET 0x0012
#define SM_RESET_V520 0x0013
#define SM_RESET_CMD 0x5A
-#define GENERAL_STATUS 0xc014
+#define GENERAL_STATUS 0x2010c014
#define BOOT_STATUS 0x0000
#define HW_REV_ID 0x000A
#define BOND_ID 0x000B
@@ -115,7 +115,7 @@
#define PRODUCT_ID 0x001e
#define OTP_SCSR_CONFIG_SELECT 0x0022
-#define STATUS 0xc03c
+#define STATUS 0x2010c03c
#define DPLL0_STATUS 0x0018
#define DPLL1_STATUS 0x0019
#define DPLL2_STATUS 0x001a
@@ -138,60 +138,62 @@
#define USER_GPIO0_TO_7_STATUS 0x008a
#define USER_GPIO8_TO_15_STATUS 0x008b
-#define GPIO_USER_CONTROL 0xc160
+#define GPIO_USER_CONTROL 0x2010c160
#define GPIO0_TO_7_OUT 0x0000
#define GPIO8_TO_15_OUT 0x0001
#define GPIO0_TO_7_OUT_V520 0x0002
#define GPIO8_TO_15_OUT_V520 0x0003
-#define STICKY_STATUS_CLEAR 0xc164
-
-#define GPIO_TOD_NOTIFICATION_CLEAR 0xc16c
-
-#define ALERT_CFG 0xc188
-
-#define SYS_DPLL_XO 0xc194
-
-#define SYS_APLL 0xc19c
-
-#define INPUT_0 0xc1b0
-#define INPUT_1 0xc1c0
-#define INPUT_2 0xc1d0
-#define INPUT_3 0xc200
-#define INPUT_4 0xc210
-#define INPUT_5 0xc220
-#define INPUT_6 0xc230
-#define INPUT_7 0xc240
-#define INPUT_8 0xc250
-#define INPUT_9 0xc260
-#define INPUT_10 0xc280
-#define INPUT_11 0xc290
-#define INPUT_12 0xc2a0
-#define INPUT_13 0xc2b0
-#define INPUT_14 0xc2c0
-#define INPUT_15 0xc2d0
-
-#define REF_MON_0 0xc2e0
-#define REF_MON_1 0xc2ec
-#define REF_MON_2 0xc300
-#define REF_MON_3 0xc30c
-#define REF_MON_4 0xc318
-#define REF_MON_5 0xc324
-#define REF_MON_6 0xc330
-#define REF_MON_7 0xc33c
-#define REF_MON_8 0xc348
-#define REF_MON_9 0xc354
-#define REF_MON_10 0xc360
-#define REF_MON_11 0xc36c
-#define REF_MON_12 0xc380
-#define REF_MON_13 0xc38c
-#define REF_MON_14 0xc398
-#define REF_MON_15 0xc3a4
-
-#define DPLL_0 0xc3b0
+#define STICKY_STATUS_CLEAR 0x2010c164
+
+#define GPIO_TOD_NOTIFICATION_CLEAR 0x2010c16c
+
+#define ALERT_CFG 0x2010c188
+
+#define SYS_DPLL_XO 0x2010c194
+
+#define SYS_APLL 0x2010c19c
+
+#define INPUT_0 0x2010c1b0
+#define INPUT_1 0x2010c1c0
+#define INPUT_2 0x2010c1d0
+#define INPUT_3 0x2010c200
+#define INPUT_4 0x2010c210
+#define INPUT_5 0x2010c220
+#define INPUT_6 0x2010c230
+#define INPUT_7 0x2010c240
+#define INPUT_8 0x2010c250
+#define INPUT_9 0x2010c260
+#define INPUT_10 0x2010c280
+#define INPUT_11 0x2010c290
+#define INPUT_12 0x2010c2a0
+#define INPUT_13 0x2010c2b0
+#define INPUT_14 0x2010c2c0
+#define INPUT_15 0x2010c2d0
+
+#define REF_MON_0 0x2010c2e0
+#define REF_MON_1 0x2010c2ec
+#define REF_MON_2 0x2010c300
+#define REF_MON_3 0x2010c30c
+#define REF_MON_4 0x2010c318
+#define REF_MON_5 0x2010c324
+#define REF_MON_6 0x2010c330
+#define REF_MON_7 0x2010c33c
+#define REF_MON_8 0x2010c348
+#define REF_MON_9 0x2010c354
+#define REF_MON_10 0x2010c360
+#define REF_MON_11 0x2010c36c
+#define REF_MON_12 0x2010c380
+#define REF_MON_13 0x2010c38c
+#define REF_MON_14 0x2010c398
+#define REF_MON_15 0x2010c3a4
+
+#define DPLL_0 0x2010c3b0
#define DPLL_CTRL_REG_0 0x0002
#define DPLL_CTRL_REG_1 0x0003
#define DPLL_CTRL_REG_2 0x0004
+#define DPLL_WF_TIMER 0x002c
+#define DPLL_WP_TIMER 0x002e
#define DPLL_TOD_SYNC_CFG 0x0031
#define DPLL_COMBO_SLAVE_CFG_0 0x0032
#define DPLL_COMBO_SLAVE_CFG_1 0x0033
@@ -200,69 +202,69 @@
#define DPLL_PHASE_MEASUREMENT_CFG 0x0036
#define DPLL_MODE 0x0037
#define DPLL_MODE_V520 0x003B
-#define DPLL_1 0xc400
-#define DPLL_2 0xc438
-#define DPLL_2_V520 0xc43c
-#define DPLL_3 0xc480
-#define DPLL_4 0xc4b8
-#define DPLL_4_V520 0xc4bc
-#define DPLL_5 0xc500
-#define DPLL_6 0xc538
-#define DPLL_6_V520 0xc53c
-#define DPLL_7 0xc580
-#define SYS_DPLL 0xc5b8
-#define SYS_DPLL_V520 0xc5bc
-
-#define DPLL_CTRL_0 0xc600
+#define DPLL_1 0x2010c400
+#define DPLL_2 0x2010c438
+#define DPLL_2_V520 0x2010c43c
+#define DPLL_3 0x2010c480
+#define DPLL_4 0x2010c4b8
+#define DPLL_4_V520 0x2010c4bc
+#define DPLL_5 0x2010c500
+#define DPLL_6 0x2010c538
+#define DPLL_6_V520 0x2010c53c
+#define DPLL_7 0x2010c580
+#define SYS_DPLL 0x2010c5b8
+#define SYS_DPLL_V520 0x2010c5bc
+
+#define DPLL_CTRL_0 0x2010c600
#define DPLL_CTRL_DPLL_MANU_REF_CFG 0x0001
#define DPLL_CTRL_DPLL_FOD_FREQ 0x001c
#define DPLL_CTRL_COMBO_MASTER_CFG 0x003a
-#define DPLL_CTRL_1 0xc63c
-#define DPLL_CTRL_2 0xc680
-#define DPLL_CTRL_3 0xc6bc
-#define DPLL_CTRL_4 0xc700
-#define DPLL_CTRL_5 0xc73c
-#define DPLL_CTRL_6 0xc780
-#define DPLL_CTRL_7 0xc7bc
-#define SYS_DPLL_CTRL 0xc800
-
-#define DPLL_PHASE_0 0xc818
+#define DPLL_CTRL_1 0x2010c63c
+#define DPLL_CTRL_2 0x2010c680
+#define DPLL_CTRL_3 0x2010c6bc
+#define DPLL_CTRL_4 0x2010c700
+#define DPLL_CTRL_5 0x2010c73c
+#define DPLL_CTRL_6 0x2010c780
+#define DPLL_CTRL_7 0x2010c7bc
+#define SYS_DPLL_CTRL 0x2010c800
+
+#define DPLL_PHASE_0 0x2010c818
/* Signed 42-bit FFO in units of 2^(-53) */
#define DPLL_WR_PHASE 0x0000
-#define DPLL_PHASE_1 0xc81c
-#define DPLL_PHASE_2 0xc820
-#define DPLL_PHASE_3 0xc824
-#define DPLL_PHASE_4 0xc828
-#define DPLL_PHASE_5 0xc82c
-#define DPLL_PHASE_6 0xc830
-#define DPLL_PHASE_7 0xc834
-
-#define DPLL_FREQ_0 0xc838
+#define DPLL_PHASE_1 0x2010c81c
+#define DPLL_PHASE_2 0x2010c820
+#define DPLL_PHASE_3 0x2010c824
+#define DPLL_PHASE_4 0x2010c828
+#define DPLL_PHASE_5 0x2010c82c
+#define DPLL_PHASE_6 0x2010c830
+#define DPLL_PHASE_7 0x2010c834
+
+#define DPLL_FREQ_0 0x2010c838
/* Signed 42-bit FFO in units of 2^(-53) */
#define DPLL_WR_FREQ 0x0000
-#define DPLL_FREQ_1 0xc840
-#define DPLL_FREQ_2 0xc848
-#define DPLL_FREQ_3 0xc850
-#define DPLL_FREQ_4 0xc858
-#define DPLL_FREQ_5 0xc860
-#define DPLL_FREQ_6 0xc868
-#define DPLL_FREQ_7 0xc870
-
-#define DPLL_PHASE_PULL_IN_0 0xc880
+#define DPLL_FREQ_1 0x2010c840
+#define DPLL_FREQ_2 0x2010c848
+#define DPLL_FREQ_3 0x2010c850
+#define DPLL_FREQ_4 0x2010c858
+#define DPLL_FREQ_5 0x2010c860
+#define DPLL_FREQ_6 0x2010c868
+#define DPLL_FREQ_7 0x2010c870
+
+#define DPLL_PHASE_PULL_IN_0 0x2010c880
#define PULL_IN_OFFSET 0x0000 /* Signed 32 bit */
#define PULL_IN_SLOPE_LIMIT 0x0004 /* Unsigned 24 bit */
#define PULL_IN_CTRL 0x0007
-#define DPLL_PHASE_PULL_IN_1 0xc888
-#define DPLL_PHASE_PULL_IN_2 0xc890
-#define DPLL_PHASE_PULL_IN_3 0xc898
-#define DPLL_PHASE_PULL_IN_4 0xc8a0
-#define DPLL_PHASE_PULL_IN_5 0xc8a8
-#define DPLL_PHASE_PULL_IN_6 0xc8b0
-#define DPLL_PHASE_PULL_IN_7 0xc8b8
-
-#define GPIO_CFG 0xc8c0
+#define DPLL_PHASE_PULL_IN_1 0x2010c888
+#define DPLL_PHASE_PULL_IN_2 0x2010c890
+#define DPLL_PHASE_PULL_IN_3 0x2010c898
+#define DPLL_PHASE_PULL_IN_4 0x2010c8a0
+#define DPLL_PHASE_PULL_IN_5 0x2010c8a8
+#define DPLL_PHASE_PULL_IN_6 0x2010c8b0
+#define DPLL_PHASE_PULL_IN_7 0x2010c8b8
+
+#define GPIO_CFG 0x2010c8c0
#define GPIO_CFG_GBL 0x0000
-#define GPIO_0 0xc8c2
+#define GPIO_0 0x2010c8c2
#define GPIO_DCO_INC_DEC 0x0000
#define GPIO_OUT_CTRL_0 0x0001
#define GPIO_OUT_CTRL_1 0x0002
@@ -281,25 +283,25 @@
#define GPIO_TOD_NOTIFICATION_CFG 0x000f
#define GPIO_CTRL 0x0010
#define GPIO_CTRL_V520 0x0011
-#define GPIO_1 0xc8d4
-#define GPIO_2 0xc8e6
-#define GPIO_3 0xc900
-#define GPIO_4 0xc912
-#define GPIO_5 0xc924
-#define GPIO_6 0xc936
-#define GPIO_7 0xc948
-#define GPIO_8 0xc95a
-#define GPIO_9 0xc980
-#define GPIO_10 0xc992
-#define GPIO_11 0xc9a4
-#define GPIO_12 0xc9b6
-#define GPIO_13 0xc9c8
-#define GPIO_14 0xc9da
-#define GPIO_15 0xca00
-
-#define OUT_DIV_MUX 0xca12
-#define OUTPUT_0 0xca14
-#define OUTPUT_0_V520 0xca20
+#define GPIO_1 0x2010c8d4
+#define GPIO_2 0x2010c8e6
+#define GPIO_3 0x2010c900
+#define GPIO_4 0x2010c912
+#define GPIO_5 0x2010c924
+#define GPIO_6 0x2010c936
+#define GPIO_7 0x2010c948
+#define GPIO_8 0x2010c95a
+#define GPIO_9 0x2010c980
+#define GPIO_10 0x2010c992
+#define GPIO_11 0x2010c9a4
+#define GPIO_12 0x2010c9b6
+#define GPIO_13 0x2010c9c8
+#define GPIO_14 0x2010c9da
+#define GPIO_15 0x2010ca00
+
+#define OUT_DIV_MUX 0x2010ca12
+#define OUTPUT_0 0x2010ca14
+#define OUTPUT_0_V520 0x2010ca20
/* FOD frequency output divider value */
#define OUT_DIV 0x0000
#define OUT_DUTY_CYCLE_HIGH 0x0004
@@ -307,88 +309,88 @@
#define OUT_CTRL_1 0x0009
/* Phase adjustment in FOD cycles */
#define OUT_PHASE_ADJ 0x000c
-#define OUTPUT_1 0xca24
-#define OUTPUT_1_V520 0xca30
-#define OUTPUT_2 0xca34
-#define OUTPUT_2_V520 0xca40
-#define OUTPUT_3 0xca44
-#define OUTPUT_3_V520 0xca50
-#define OUTPUT_4 0xca54
-#define OUTPUT_4_V520 0xca60
-#define OUTPUT_5 0xca64
-#define OUTPUT_5_V520 0xca80
-#define OUTPUT_6 0xca80
-#define OUTPUT_6_V520 0xca90
-#define OUTPUT_7 0xca90
-#define OUTPUT_7_V520 0xcaa0
-#define OUTPUT_8 0xcaa0
-#define OUTPUT_8_V520 0xcab0
-#define OUTPUT_9 0xcab0
-#define OUTPUT_9_V520 0xcac0
-#define OUTPUT_10 0xcac0
-#define OUTPUT_10_V520 0xcad0
-#define OUTPUT_11 0xcad0
-#define OUTPUT_11_V520 0xcae0
-
-#define SERIAL 0xcae0
-#define SERIAL_V520 0xcaf0
-
-#define PWM_ENCODER_0 0xcb00
-#define PWM_ENCODER_1 0xcb08
-#define PWM_ENCODER_2 0xcb10
-#define PWM_ENCODER_3 0xcb18
-#define PWM_ENCODER_4 0xcb20
-#define PWM_ENCODER_5 0xcb28
-#define PWM_ENCODER_6 0xcb30
-#define PWM_ENCODER_7 0xcb38
-#define PWM_DECODER_0 0xcb40
-#define PWM_DECODER_1 0xcb48
-#define PWM_DECODER_1_V520 0xcb4a
-#define PWM_DECODER_2 0xcb50
-#define PWM_DECODER_2_V520 0xcb54
-#define PWM_DECODER_3 0xcb58
-#define PWM_DECODER_3_V520 0xcb5e
-#define PWM_DECODER_4 0xcb60
-#define PWM_DECODER_4_V520 0xcb68
-#define PWM_DECODER_5 0xcb68
-#define PWM_DECODER_5_V520 0xcb80
-#define PWM_DECODER_6 0xcb70
-#define PWM_DECODER_6_V520 0xcb8a
-#define PWM_DECODER_7 0xcb80
-#define PWM_DECODER_7_V520 0xcb94
-#define PWM_DECODER_8 0xcb88
-#define PWM_DECODER_8_V520 0xcb9e
-#define PWM_DECODER_9 0xcb90
-#define PWM_DECODER_9_V520 0xcba8
-#define PWM_DECODER_10 0xcb98
-#define PWM_DECODER_10_V520 0xcbb2
-#define PWM_DECODER_11 0xcba0
-#define PWM_DECODER_11_V520 0xcbbc
-#define PWM_DECODER_12 0xcba8
-#define PWM_DECODER_12_V520 0xcbc6
-#define PWM_DECODER_13 0xcbb0
-#define PWM_DECODER_13_V520 0xcbd0
-#define PWM_DECODER_14 0xcbb8
-#define PWM_DECODER_14_V520 0xcbda
-#define PWM_DECODER_15 0xcbc0
-#define PWM_DECODER_15_V520 0xcbe4
-#define PWM_USER_DATA 0xcbc8
-#define PWM_USER_DATA_V520 0xcbf0
-
-#define TOD_0 0xcbcc
-#define TOD_0_V520 0xcc00
+#define OUTPUT_1 0x2010ca24
+#define OUTPUT_1_V520 0x2010ca30
+#define OUTPUT_2 0x2010ca34
+#define OUTPUT_2_V520 0x2010ca40
+#define OUTPUT_3 0x2010ca44
+#define OUTPUT_3_V520 0x2010ca50
+#define OUTPUT_4 0x2010ca54
+#define OUTPUT_4_V520 0x2010ca60
+#define OUTPUT_5 0x2010ca64
+#define OUTPUT_5_V520 0x2010ca80
+#define OUTPUT_6 0x2010ca80
+#define OUTPUT_6_V520 0x2010ca90
+#define OUTPUT_7 0x2010ca90
+#define OUTPUT_7_V520 0x2010caa0
+#define OUTPUT_8 0x2010caa0
+#define OUTPUT_8_V520 0x2010cab0
+#define OUTPUT_9 0x2010cab0
+#define OUTPUT_9_V520 0x2010cac0
+#define OUTPUT_10 0x2010cac0
+#define OUTPUT_10_V520 0x2010cad0
+#define OUTPUT_11 0x2010cad0
+#define OUTPUT_11_V520 0x2010cae0
+
+#define SERIAL 0x2010cae0
+#define SERIAL_V520 0x2010caf0
+
+#define PWM_ENCODER_0 0x2010cb00
+#define PWM_ENCODER_1 0x2010cb08
+#define PWM_ENCODER_2 0x2010cb10
+#define PWM_ENCODER_3 0x2010cb18
+#define PWM_ENCODER_4 0x2010cb20
+#define PWM_ENCODER_5 0x2010cb28
+#define PWM_ENCODER_6 0x2010cb30
+#define PWM_ENCODER_7 0x2010cb38
+#define PWM_DECODER_0 0x2010cb40
+#define PWM_DECODER_1 0x2010cb48
+#define PWM_DECODER_1_V520 0x2010cb4a
+#define PWM_DECODER_2 0x2010cb50
+#define PWM_DECODER_2_V520 0x2010cb54
+#define PWM_DECODER_3 0x2010cb58
+#define PWM_DECODER_3_V520 0x2010cb5e
+#define PWM_DECODER_4 0x2010cb60
+#define PWM_DECODER_4_V520 0x2010cb68
+#define PWM_DECODER_5 0x2010cb68
+#define PWM_DECODER_5_V520 0x2010cb80
+#define PWM_DECODER_6 0x2010cb70
+#define PWM_DECODER_6_V520 0x2010cb8a
+#define PWM_DECODER_7 0x2010cb80
+#define PWM_DECODER_7_V520 0x2010cb94
+#define PWM_DECODER_8 0x2010cb88
+#define PWM_DECODER_8_V520 0x2010cb9e
+#define PWM_DECODER_9 0x2010cb90
+#define PWM_DECODER_9_V520 0x2010cba8
+#define PWM_DECODER_10 0x2010cb98
+#define PWM_DECODER_10_V520 0x2010cbb2
+#define PWM_DECODER_11 0x2010cba0
+#define PWM_DECODER_11_V520 0x2010cbbc
+#define PWM_DECODER_12 0x2010cba8
+#define PWM_DECODER_12_V520 0x2010cbc6
+#define PWM_DECODER_13 0x2010cbb0
+#define PWM_DECODER_13_V520 0x2010cbd0
+#define PWM_DECODER_14 0x2010cbb8
+#define PWM_DECODER_14_V520 0x2010cbda
+#define PWM_DECODER_15 0x2010cbc0
+#define PWM_DECODER_15_V520 0x2010cbe4
+#define PWM_USER_DATA 0x2010cbc8
+#define PWM_USER_DATA_V520 0x2010cbf0
+
+#define TOD_0 0x2010cbcc
+#define TOD_0_V520 0x2010cc00
/* Enable TOD counter, output channel sync and even-PPS mode */
#define TOD_CFG 0x0000
#define TOD_CFG_V520 0x0001
-#define TOD_1 0xcbce
-#define TOD_1_V520 0xcc02
-#define TOD_2 0xcbd0
-#define TOD_2_V520 0xcc04
-#define TOD_3 0xcbd2
-#define TOD_3_V520 0xcc06
-
-#define TOD_WRITE_0 0xcc00
-#define TOD_WRITE_0_V520 0xcc10
+#define TOD_1 0x2010cbce
+#define TOD_1_V520 0x2010cc02
+#define TOD_2 0x2010cbd0
+#define TOD_2_V520 0x2010cc04
+#define TOD_3 0x2010cbd2
+#define TOD_3_V520 0x2010cc06
+
+#define TOD_WRITE_0 0x2010cc00
+#define TOD_WRITE_0_V520 0x2010cc10
/* 8-bit subns, 32-bit ns, 48-bit seconds */
#define TOD_WRITE 0x0000
/* Counter increments after TOD write is completed */
@@ -397,15 +399,15 @@
#define TOD_WRITE_SELECT_CFG_0 0x000d
/* TOD write trigger selection */
#define TOD_WRITE_CMD 0x000f
-#define TOD_WRITE_1 0xcc10
-#define TOD_WRITE_1_V520 0xcc20
-#define TOD_WRITE_2 0xcc20
-#define TOD_WRITE_2_V520 0xcc30
-#define TOD_WRITE_3 0xcc30
-#define TOD_WRITE_3_V520 0xcc40
-
-#define TOD_READ_PRIMARY_0 0xcc40
-#define TOD_READ_PRIMARY_0_V520 0xcc50
+#define TOD_WRITE_1 0x2010cc10
+#define TOD_WRITE_1_V520 0x2010cc20
+#define TOD_WRITE_2 0x2010cc20
+#define TOD_WRITE_2_V520 0x2010cc30
+#define TOD_WRITE_3 0x2010cc30
+#define TOD_WRITE_3_V520 0x2010cc40
+
+#define TOD_READ_PRIMARY_0 0x2010cc40
+#define TOD_READ_PRIMARY_0_V520 0x2010cc50
/* 8-bit subns, 32-bit ns, 48-bit seconds */
#define TOD_READ_PRIMARY_BASE 0x0000
/* Counter increments after TOD write is completed */
@@ -415,15 +417,15 @@
/* Read trigger selection */
#define TOD_READ_PRIMARY_CMD 0x000e
#define TOD_READ_PRIMARY_CMD_V520 0x000f
-#define TOD_READ_PRIMARY_1 0xcc50
-#define TOD_READ_PRIMARY_1_V520 0xcc60
-#define TOD_READ_PRIMARY_2 0xcc60
-#define TOD_READ_PRIMARY_2_V520 0xcc80
-#define TOD_READ_PRIMARY_3 0xcc80
-#define TOD_READ_PRIMARY_3_V520 0xcc90
-
-#define TOD_READ_SECONDARY_0 0xcc90
-#define TOD_READ_SECONDARY_0_V520 0xcca0
+#define TOD_READ_PRIMARY_1 0x2010cc50
+#define TOD_READ_PRIMARY_1_V520 0x2010cc60
+#define TOD_READ_PRIMARY_2 0x2010cc60
+#define TOD_READ_PRIMARY_2_V520 0x2010cc80
+#define TOD_READ_PRIMARY_3 0x2010cc80
+#define TOD_READ_PRIMARY_3_V520 0x2010cc90
+
+#define TOD_READ_SECONDARY_0 0x2010cc90
+#define TOD_READ_SECONDARY_0_V520 0x2010cca0
/* 8-bit subns, 32-bit ns, 48-bit seconds */
#define TOD_READ_SECONDARY_BASE 0x0000
/* Counter increments after TOD write is completed */
@@ -434,30 +436,30 @@
#define TOD_READ_SECONDARY_CMD 0x000e
#define TOD_READ_SECONDARY_CMD_V520 0x000f
-#define TOD_READ_SECONDARY_1 0xcca0
-#define TOD_READ_SECONDARY_1_V520 0xccb0
-#define TOD_READ_SECONDARY_2 0xccb0
-#define TOD_READ_SECONDARY_2_V520 0xccc0
-#define TOD_READ_SECONDARY_3 0xccc0
-#define TOD_READ_SECONDARY_3_V520 0xccd0
+#define TOD_READ_SECONDARY_1 0x2010cca0
+#define TOD_READ_SECONDARY_1_V520 0x2010ccb0
+#define TOD_READ_SECONDARY_2 0x2010ccb0
+#define TOD_READ_SECONDARY_2_V520 0x2010ccc0
+#define TOD_READ_SECONDARY_3 0x2010ccc0
+#define TOD_READ_SECONDARY_3_V520 0x2010ccd0
-#define OUTPUT_TDC_CFG 0xccd0
-#define OUTPUT_TDC_CFG_V520 0xcce0
-#define OUTPUT_TDC_0 0xcd00
-#define OUTPUT_TDC_1 0xcd08
-#define OUTPUT_TDC_2 0xcd10
-#define OUTPUT_TDC_3 0xcd18
-#define INPUT_TDC 0xcd20
+#define OUTPUT_TDC_CFG 0x2010ccd0
+#define OUTPUT_TDC_CFG_V520 0x2010cce0
+#define OUTPUT_TDC_0 0x2010cd00
+#define OUTPUT_TDC_1 0x2010cd08
+#define OUTPUT_TDC_2 0x2010cd10
+#define OUTPUT_TDC_3 0x2010cd18
+#define INPUT_TDC 0x2010cd20
-#define SCRATCH 0xcf50
-#define SCRATCH_V520 0xcf4c
+#define SCRATCH 0x2010cf50
+#define SCRATCH_V520 0x2010cf4c
-#define EEPROM 0xcf68
-#define EEPROM_V520 0xcf64
+#define EEPROM 0x2010cf68
+#define EEPROM_V520 0x2010cf64
-#define OTP 0xcf70
+#define OTP 0x2010cf70
-#define BYTE 0xcf80
+#define BYTE 0x2010cf80
/* Bit definitions for the MAJ_REL register */
#define MAJOR_SHIFT (1)
@@ -665,6 +667,16 @@
#define DPLL_STATE_MASK (0xf)
#define DPLL_STATE_SHIFT (0x0)
+/*
+ * Return register address based on passed in firmware version
+ */
+#define IDTCM_FW_REG(FW, VER, REG) (((FW) < (VER)) ? (REG) : (REG##_##VER))
+enum fw_version {
+ V_DEFAULT = 0,
+ V487 = 1,
+ V520 = 2,
+};
+
/* Values of DPLL_N.DPLL_MODE.PLL_MODE */
enum pll_mode {
PLL_MODE_MIN = 0,
--
2.39.2
^ permalink raw reply related
* Re: [GIT PULL v2] Networking for 6.7
From: Alexei Starovoitov @ 2023-11-09 18:18 UTC (permalink / raw)
To: Yonghong Song
Cc: Kirill A. Shutemov, Hou Tao, Jakub Kicinski, Alexei Starovoitov,
Linus Torvalds, David S. Miller, Network Development, LKML,
Paolo Abeni
In-Reply-To: <11e2e744-4bc7-45b1-aaca-298b5e4ee281@linux.dev>
On Thu, Nov 9, 2023 at 10:09 AM Yonghong Song <yonghong.song@linux.dev> wrote:
>
>
> On 11/9/23 8:14 AM, Kirill A. Shutemov wrote:
> > On Thu, Nov 09, 2023 at 08:01:39AM -0800, Alexei Starovoitov wrote:
> >> On Thu, Nov 9, 2023 at 7:49 AM Kirill A. Shutemov <kirill@shutemov.name> wrote:
> >>> On Tue, Oct 31, 2023 at 02:09:48PM -0700, Jakub Kicinski wrote:
> >>>> bpf: Add support for non-fix-size percpu mem allocation
> >>> Recent changes in BPF increased per-CPU memory consumption a lot.
> >>>
> >>> On virtual machine with 288 CPUs, per-CPU consumtion increased from 111 MB
> >>> to 969 MB, or 8.7x.
> >>>
> >>> I've bisected it to the commit 41a5db8d8161 ("bpf: Add support for
> >>> non-fix-size percpu mem allocation"), which part of the pull request.
> >> Hmm. This is unexpected. Thank you for reporting.
> >>
> >> How did you measure this 111 MB vs 969 MB ?
> >> Pls share the steps to reproduce.
> > Boot VMM with 288 (qemu-system-x86_64 -smp 288) and check Percpu: field of
> > /proc/meminfo.
>
> I did some experiments with my VM. My VM currently supports up to 255 cpus,
> so I tried 4/32/252 number of cpus. For a particular number of cpus, two
> experiments are done:
> (1). bpf-percpu-mem-prefill
> (2). no-bpf-percpu-mem-prefill
>
> For 4 cpu:
> bpf-percpu-mem-prefill:
> Percpu: 2000 kB
> no-bpf-percpu-mem-prefill:
> Percpu: 1808 kB
>
> bpf-percpu-mem-prefill percpu cost: (2000 - 1808)/4 KB = 48KB
>
> For 32 cpus:
> bpf-percpu-mem-prefill:
> Percpu: 25344 kB
> no-bpf-percpu-mem-prefill:
> Percpu: 14464 kB
>
> bpf-percpu-mem-prefill percpu cost: (25344 - 14464)/4 KB = 340KB
>
> For 252 cpus:
> bpf-percpu-mem-prefill:
> Percpu: 230912 kB
> no-bpf-percpu-mem-prefill:
> Percpu: 57856 kB
>
> bpf-percpu-mem-prefill percpu cost: (230912 - 57856)/4 KB = 686KB
>
> I am not able to reproduce the dramatic number from 111 MB to 969 MB.
> My number with 252 cpus is from ~58MB to ~231MB.
Even 231MB is way too much. We shouldn't be allocating that much.
Let's switch to on-demand allocation. Only when bpf progs that
user per-cpu are loaded.
^ permalink raw reply
* Re: [GIT PULL v2] Networking for 6.7
From: Yonghong Song @ 2023-11-09 18:09 UTC (permalink / raw)
To: Kirill A. Shutemov, Alexei Starovoitov
Cc: Hou Tao, Jakub Kicinski, Alexei Starovoitov, Linus Torvalds,
David S. Miller, Network Development, LKML, Paolo Abeni,
yonghong.song
In-Reply-To: <20231109161406.lol2mjhr47dhd42q@box.shutemov.name>
On 11/9/23 8:14 AM, Kirill A. Shutemov wrote:
> On Thu, Nov 09, 2023 at 08:01:39AM -0800, Alexei Starovoitov wrote:
>> On Thu, Nov 9, 2023 at 7:49 AM Kirill A. Shutemov <kirill@shutemov.name> wrote:
>>> On Tue, Oct 31, 2023 at 02:09:48PM -0700, Jakub Kicinski wrote:
>>>> bpf: Add support for non-fix-size percpu mem allocation
>>> Recent changes in BPF increased per-CPU memory consumption a lot.
>>>
>>> On virtual machine with 288 CPUs, per-CPU consumtion increased from 111 MB
>>> to 969 MB, or 8.7x.
>>>
>>> I've bisected it to the commit 41a5db8d8161 ("bpf: Add support for
>>> non-fix-size percpu mem allocation"), which part of the pull request.
>> Hmm. This is unexpected. Thank you for reporting.
>>
>> How did you measure this 111 MB vs 969 MB ?
>> Pls share the steps to reproduce.
> Boot VMM with 288 (qemu-system-x86_64 -smp 288) and check Percpu: field of
> /proc/meminfo.
I did some experiments with my VM. My VM currently supports up to 255 cpus,
so I tried 4/32/252 number of cpus. For a particular number of cpus, two
experiments are done:
(1). bpf-percpu-mem-prefill
(2). no-bpf-percpu-mem-prefill
For 4 cpu:
bpf-percpu-mem-prefill:
Percpu: 2000 kB
no-bpf-percpu-mem-prefill:
Percpu: 1808 kB
bpf-percpu-mem-prefill percpu cost: (2000 - 1808)/4 KB = 48KB
For 32 cpus:
bpf-percpu-mem-prefill:
Percpu: 25344 kB
no-bpf-percpu-mem-prefill:
Percpu: 14464 kB
bpf-percpu-mem-prefill percpu cost: (25344 - 14464)/4 KB = 340KB
For 252 cpus:
bpf-percpu-mem-prefill:
Percpu: 230912 kB
no-bpf-percpu-mem-prefill:
Percpu: 57856 kB
bpf-percpu-mem-prefill percpu cost: (230912 - 57856)/4 KB = 686KB
I am not able to reproduce the dramatic number from 111 MB to 969 MB.
My number with 252 cpus is from ~58MB to ~231MB.
I appears that percpu allocation cost goes up when the number of cpus
is increased.
I will continue to debug this. Thanks!
>
^ permalink raw reply
* Re: [PATCH] Documentation: Document the Netlink spec
From: Breno Leitao @ 2023-11-09 18:28 UTC (permalink / raw)
To: Donald Hunter; +Cc: corbet, linux-doc, netdev, kuba, pabeni, edumazet
In-Reply-To: <m2y1f8mjex.fsf@gmail.com>
On Wed, Nov 08, 2023 at 02:03:34PM +0000, Donald Hunter wrote:
> Breno Leitao <leitao@debian.org> writes:
>
> > This is a Sphinx extension that parses the Netlink YAML spec files
> > (Documentation/netlink/specs/), and generates a rst file to be
> > displayed into Documentation pages.
> >
> > Create a new Documentation/networking/netlink_spec page, and a sub-page
> > for each Netlink spec that needs to be documented, such as ethtool,
> > devlink, netdev, etc.
> >
> > Create a Sphinx directive extension that reads the YAML spec
> > (located under Documentation/netlink/specs), parses it and returns a RST
> > string that is inserted where the Sphinx directive was called.
>
> This is great! Looks like I need to fill in some missing docs in the
> specs I have contributed.
>
> I wonder if the generated .rst content can be adjusted to improve the
> resulting HTML.
>
> There are a couple of places where paragraph text is indented and I
> don't think it needs to be, e.g. the 'Summary' doc.
>
> A lot of the .rst content seems to be over-indented which causes
> blockquote tags to be generated in the HTML. That combined with a
> mixture of bullets and definition lists at the same indentation level
> seems to produce HTML with inconsistent indentation.
>
> I quickly hacked the diff below to see if it would improve the HTML
> rendering. I think the HTML has fewer odd constructs and the indentation
> seems better to my eye. My main aim was to ensure that for a given
> section, each indentation level uses the same construct, whether it be a
> definition list or a bullet list.
Thanks for the diff. That makes total sense and I will integrate it in
the updated version.
> It would be great to generate links from e.g. an attribute-set to its
> definition.
>
> Did you intentionally leave out the protocol values?
Yes. This could be done in a follow up patch if necessary.
>
> It looks like parse_entries will need to be extended to include the type
> information for struct members, similar to how attribute sets are shown.
> I'd be happy to look at this as a follow up patch, unless you get there
> first.
Awesome. That would be appreciate.
^ permalink raw reply
* Re: [PATCH net] ipvlan: add ipvlan_route_v6_outbound() helper
From: Willem de Bruijn @ 2023-11-09 18:28 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, netdev,
eric.dumazet, syzbot, Mahesh Bandewar, Willem de Bruijn
In-Reply-To: <20231109152241.3754521-1-edumazet@google.com>
On Thu, Nov 9, 2023 at 10:22 AM Eric Dumazet <edumazet@google.com> wrote:
>
> Inspired by syzbot reports using a stack of multiple ipvlan devices.
>
> Reduce stack size needed in ipvlan_process_v6_outbound() by moving
> the flowi6 struct used for the route lookup in an non inlined
> helper. ipvlan_route_v6_outbound() needs 120 bytes on the stack,
> immediately reclaimed.
>
> Also make sure ipvlan_process_v4_outbound() is not inlined.
>
> We might also have to lower MAX_NEST_DEV, because only syzbot uses
> setups with more than four stacked devices.
>
> BUG: TASK stack guard page was hit at ffffc9000e803ff8 (stack is ffffc9000e804000..ffffc9000e808000)
> stack guard page: 0000 [#1] SMP KASAN
> CPU: 0 PID: 13442 Comm: syz-executor.4 Not tainted 6.1.52-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
> RIP: 0010:kasan_check_range+0x4/0x2a0 mm/kasan/generic.c:188
> Code: 48 01 c6 48 89 c7 e8 db 4e c1 03 31 c0 5d c3 cc 0f 0b eb 02 0f 0b b8 ea ff ff ff 5d c3 cc 00 00 cc cc 00 00 cc cc 55 48 89 e5 <41> 57 41 56 41 55 41 54 53 b0 01 48 85 f6 0f 84 a4 01 00 00 48 89
> RSP: 0018:ffffc9000e804000 EFLAGS: 00010246
> RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff817e5bf2
> RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff887c6568
> RBP: ffffc9000e804000 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff92001d0080c
> R13: dffffc0000000000 R14: ffffffff87e6b100 R15: 0000000000000000
> FS: 00007fd0c55826c0(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: ffffc9000e803ff8 CR3: 0000000170ef7000 CR4: 00000000003506f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
> <#DF>
> </#DF>
> <TASK>
> [<ffffffff81f281d1>] __kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31
> [<ffffffff817e5bf2>] instrument_atomic_read include/linux/instrumented.h:72 [inline]
> [<ffffffff817e5bf2>] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
> [<ffffffff817e5bf2>] cpumask_test_cpu include/linux/cpumask.h:506 [inline]
> [<ffffffff817e5bf2>] cpu_online include/linux/cpumask.h:1092 [inline]
> [<ffffffff817e5bf2>] trace_lock_acquire include/trace/events/lock.h:24 [inline]
> [<ffffffff817e5bf2>] lock_acquire+0xe2/0x590 kernel/locking/lockdep.c:5632
> [<ffffffff8563221e>] rcu_lock_acquire+0x2e/0x40 include/linux/rcupdate.h:306
> [<ffffffff8561464d>] rcu_read_lock include/linux/rcupdate.h:747 [inline]
> [<ffffffff8561464d>] ip6_pol_route+0x15d/0x1440 net/ipv6/route.c:2221
> [<ffffffff85618120>] ip6_pol_route_output+0x50/0x80 net/ipv6/route.c:2606
> [<ffffffff856f65b5>] pol_lookup_func include/net/ip6_fib.h:584 [inline]
> [<ffffffff856f65b5>] fib6_rule_lookup+0x265/0x620 net/ipv6/fib6_rules.c:116
> [<ffffffff85618009>] ip6_route_output_flags_noref+0x2d9/0x3a0 net/ipv6/route.c:2638
> [<ffffffff8561821a>] ip6_route_output_flags+0xca/0x340 net/ipv6/route.c:2651
> [<ffffffff838bd5a3>] ip6_route_output include/net/ip6_route.h:100 [inline]
> [<ffffffff838bd5a3>] ipvlan_process_v6_outbound drivers/net/ipvlan/ipvlan_core.c:473 [inline]
> [<ffffffff838bd5a3>] ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:529 [inline]
> [<ffffffff838bd5a3>] ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline]
> [<ffffffff838bd5a3>] ipvlan_queue_xmit+0xc33/0x1be0 drivers/net/ipvlan/ipvlan_core.c:677
> [<ffffffff838c2909>] ipvlan_start_xmit+0x49/0x100 drivers/net/ipvlan/ipvlan_main.c:229
> [<ffffffff84d03900>] netdev_start_xmit include/linux/netdevice.h:4966 [inline]
> [<ffffffff84d03900>] xmit_one net/core/dev.c:3644 [inline]
> [<ffffffff84d03900>] dev_hard_start_xmit+0x320/0x980 net/core/dev.c:3660
> [<ffffffff84d080e2>] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324
> [<ffffffff855ce4cd>] dev_queue_xmit include/linux/netdevice.h:3067 [inline]
> [<ffffffff855ce4cd>] neigh_hh_output include/net/neighbour.h:529 [inline]
> [<ffffffff855ce4cd>] neigh_output include/net/neighbour.h:543 [inline]
> [<ffffffff855ce4cd>] ip6_finish_output2+0x160d/0x1ae0 net/ipv6/ip6_output.c:139
> [<ffffffff855b8616>] __ip6_finish_output net/ipv6/ip6_output.c:200 [inline]
> [<ffffffff855b8616>] ip6_finish_output+0x6c6/0xb10 net/ipv6/ip6_output.c:211
> [<ffffffff855b7e3c>] NF_HOOK_COND include/linux/netfilter.h:298 [inline]
> [<ffffffff855b7e3c>] ip6_output+0x2bc/0x3d0 net/ipv6/ip6_output.c:232
> [<ffffffff8575d27f>] dst_output include/net/dst.h:444 [inline]
> [<ffffffff8575d27f>] ip6_local_out+0x10f/0x140 net/ipv6/output_core.c:161
> [<ffffffff838bdae4>] ipvlan_process_v6_outbound drivers/net/ipvlan/ipvlan_core.c:483 [inline]
> [<ffffffff838bdae4>] ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:529 [inline]
> [<ffffffff838bdae4>] ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline]
> [<ffffffff838bdae4>] ipvlan_queue_xmit+0x1174/0x1be0 drivers/net/ipvlan/ipvlan_core.c:677
> [<ffffffff838c2909>] ipvlan_start_xmit+0x49/0x100 drivers/net/ipvlan/ipvlan_main.c:229
> [<ffffffff84d03900>] netdev_start_xmit include/linux/netdevice.h:4966 [inline]
> [<ffffffff84d03900>] xmit_one net/core/dev.c:3644 [inline]
> [<ffffffff84d03900>] dev_hard_start_xmit+0x320/0x980 net/core/dev.c:3660
> [<ffffffff84d080e2>] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324
> [<ffffffff855ce4cd>] dev_queue_xmit include/linux/netdevice.h:3067 [inline]
> [<ffffffff855ce4cd>] neigh_hh_output include/net/neighbour.h:529 [inline]
> [<ffffffff855ce4cd>] neigh_output include/net/neighbour.h:543 [inline]
> [<ffffffff855ce4cd>] ip6_finish_output2+0x160d/0x1ae0 net/ipv6/ip6_output.c:139
> [<ffffffff855b8616>] __ip6_finish_output net/ipv6/ip6_output.c:200 [inline]
> [<ffffffff855b8616>] ip6_finish_output+0x6c6/0xb10 net/ipv6/ip6_output.c:211
> [<ffffffff855b7e3c>] NF_HOOK_COND include/linux/netfilter.h:298 [inline]
> [<ffffffff855b7e3c>] ip6_output+0x2bc/0x3d0 net/ipv6/ip6_output.c:232
> [<ffffffff8575d27f>] dst_output include/net/dst.h:444 [inline]
> [<ffffffff8575d27f>] ip6_local_out+0x10f/0x140 net/ipv6/output_core.c:161
> [<ffffffff838bdae4>] ipvlan_process_v6_outbound drivers/net/ipvlan/ipvlan_core.c:483 [inline]
> [<ffffffff838bdae4>] ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:529 [inline]
> [<ffffffff838bdae4>] ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline]
> [<ffffffff838bdae4>] ipvlan_queue_xmit+0x1174/0x1be0 drivers/net/ipvlan/ipvlan_core.c:677
> [<ffffffff838c2909>] ipvlan_start_xmit+0x49/0x100 drivers/net/ipvlan/ipvlan_main.c:229
> [<ffffffff84d03900>] netdev_start_xmit include/linux/netdevice.h:4966 [inline]
> [<ffffffff84d03900>] xmit_one net/core/dev.c:3644 [inline]
> [<ffffffff84d03900>] dev_hard_start_xmit+0x320/0x980 net/core/dev.c:3660
> [<ffffffff84d080e2>] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324
> [<ffffffff855ce4cd>] dev_queue_xmit include/linux/netdevice.h:3067 [inline]
> [<ffffffff855ce4cd>] neigh_hh_output include/net/neighbour.h:529 [inline]
> [<ffffffff855ce4cd>] neigh_output include/net/neighbour.h:543 [inline]
> [<ffffffff855ce4cd>] ip6_finish_output2+0x160d/0x1ae0 net/ipv6/ip6_output.c:139
> [<ffffffff855b8616>] __ip6_finish_output net/ipv6/ip6_output.c:200 [inline]
> [<ffffffff855b8616>] ip6_finish_output+0x6c6/0xb10 net/ipv6/ip6_output.c:211
> [<ffffffff855b7e3c>] NF_HOOK_COND include/linux/netfilter.h:298 [inline]
> [<ffffffff855b7e3c>] ip6_output+0x2bc/0x3d0 net/ipv6/ip6_output.c:232
> [<ffffffff8575d27f>] dst_output include/net/dst.h:444 [inline]
> [<ffffffff8575d27f>] ip6_local_out+0x10f/0x140 net/ipv6/output_core.c:161
> [<ffffffff838bdae4>] ipvlan_process_v6_outbound drivers/net/ipvlan/ipvlan_core.c:483 [inline]
> [<ffffffff838bdae4>] ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:529 [inline]
> [<ffffffff838bdae4>] ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline]
> [<ffffffff838bdae4>] ipvlan_queue_xmit+0x1174/0x1be0 drivers/net/ipvlan/ipvlan_core.c:677
> [<ffffffff838c2909>] ipvlan_start_xmit+0x49/0x100 drivers/net/ipvlan/ipvlan_main.c:229
> [<ffffffff84d03900>] netdev_start_xmit include/linux/netdevice.h:4966 [inline]
> [<ffffffff84d03900>] xmit_one net/core/dev.c:3644 [inline]
> [<ffffffff84d03900>] dev_hard_start_xmit+0x320/0x980 net/core/dev.c:3660
> [<ffffffff84d080e2>] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324
> [<ffffffff855ce4cd>] dev_queue_xmit include/linux/netdevice.h:3067 [inline]
> [<ffffffff855ce4cd>] neigh_hh_output include/net/neighbour.h:529 [inline]
> [<ffffffff855ce4cd>] neigh_output include/net/neighbour.h:543 [inline]
> [<ffffffff855ce4cd>] ip6_finish_output2+0x160d/0x1ae0 net/ipv6/ip6_output.c:139
> [<ffffffff855b8616>] __ip6_finish_output net/ipv6/ip6_output.c:200 [inline]
> [<ffffffff855b8616>] ip6_finish_output+0x6c6/0xb10 net/ipv6/ip6_output.c:211
> [<ffffffff855b7e3c>] NF_HOOK_COND include/linux/netfilter.h:298 [inline]
> [<ffffffff855b7e3c>] ip6_output+0x2bc/0x3d0 net/ipv6/ip6_output.c:232
> [<ffffffff8575d27f>] dst_output include/net/dst.h:444 [inline]
> [<ffffffff8575d27f>] ip6_local_out+0x10f/0x140 net/ipv6/output_core.c:161
> [<ffffffff838bdae4>] ipvlan_process_v6_outbound drivers/net/ipvlan/ipvlan_core.c:483 [inline]
> [<ffffffff838bdae4>] ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:529 [inline]
> [<ffffffff838bdae4>] ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline]
> [<ffffffff838bdae4>] ipvlan_queue_xmit+0x1174/0x1be0 drivers/net/ipvlan/ipvlan_core.c:677
> [<ffffffff838c2909>] ipvlan_start_xmit+0x49/0x100 drivers/net/ipvlan/ipvlan_main.c:229
> [<ffffffff84d03900>] netdev_start_xmit include/linux/netdevice.h:4966 [inline]
> [<ffffffff84d03900>] xmit_one net/core/dev.c:3644 [inline]
> [<ffffffff84d03900>] dev_hard_start_xmit+0x320/0x980 net/core/dev.c:3660
> [<ffffffff84d080e2>] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324
> [<ffffffff84d4a65e>] dev_queue_xmit include/linux/netdevice.h:3067 [inline]
> [<ffffffff84d4a65e>] neigh_resolve_output+0x64e/0x750 net/core/neighbour.c:1560
> [<ffffffff855ce503>] neigh_output include/net/neighbour.h:545 [inline]
> [<ffffffff855ce503>] ip6_finish_output2+0x1643/0x1ae0 net/ipv6/ip6_output.c:139
> [<ffffffff855b8616>] __ip6_finish_output net/ipv6/ip6_output.c:200 [inline]
> [<ffffffff855b8616>] ip6_finish_output+0x6c6/0xb10 net/ipv6/ip6_output.c:211
> [<ffffffff855b7e3c>] NF_HOOK_COND include/linux/netfilter.h:298 [inline]
> [<ffffffff855b7e3c>] ip6_output+0x2bc/0x3d0 net/ipv6/ip6_output.c:232
> [<ffffffff855b9ce4>] dst_output include/net/dst.h:444 [inline]
> [<ffffffff855b9ce4>] NF_HOOK include/linux/netfilter.h:309 [inline]
> [<ffffffff855b9ce4>] ip6_xmit+0x11a4/0x1b20 net/ipv6/ip6_output.c:352
> [<ffffffff8597984e>] sctp_v6_xmit+0x9ae/0x1230 net/sctp/ipv6.c:250
> [<ffffffff8594623e>] sctp_packet_transmit+0x25de/0x2bc0 net/sctp/output.c:653
> [<ffffffff858f5142>] sctp_packet_singleton+0x202/0x310 net/sctp/outqueue.c:783
> [<ffffffff858ea411>] sctp_outq_flush_ctrl net/sctp/outqueue.c:914 [inline]
> [<ffffffff858ea411>] sctp_outq_flush+0x661/0x3d40 net/sctp/outqueue.c:1212
> [<ffffffff858f02f9>] sctp_outq_uncork+0x79/0xb0 net/sctp/outqueue.c:764
> [<ffffffff8589f060>] sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline]
> [<ffffffff8589f060>] sctp_do_sm+0x55c0/0x5c30 net/sctp/sm_sideeffect.c:1170
> [<ffffffff85941567>] sctp_primitive_ASSOCIATE+0x97/0xc0 net/sctp/primitive.c:73
> [<ffffffff859408b2>] sctp_sendmsg_to_asoc+0xf62/0x17b0 net/sctp/socket.c:1839
> [<ffffffff85910b5e>] sctp_sendmsg+0x212e/0x33b0 net/sctp/socket.c:2029
> [<ffffffff8544d559>] inet_sendmsg+0x149/0x310 net/ipv4/af_inet.c:849
> [<ffffffff84c6c4d2>] sock_sendmsg_nosec net/socket.c:716 [inline]
> [<ffffffff84c6c4d2>] sock_sendmsg net/socket.c:736 [inline]
> [<ffffffff84c6c4d2>] ____sys_sendmsg+0x572/0x8c0 net/socket.c:2504
> [<ffffffff84c6ca91>] ___sys_sendmsg net/socket.c:2558 [inline]
> [<ffffffff84c6ca91>] __sys_sendmsg+0x271/0x360 net/socket.c:2587
> [<ffffffff84c6cbff>] __do_sys_sendmsg net/socket.c:2596 [inline]
> [<ffffffff84c6cbff>] __se_sys_sendmsg net/socket.c:2594 [inline]
> [<ffffffff84c6cbff>] __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2594
> [<ffffffff85b32553>] do_syscall_x64 arch/x86/entry/common.c:51 [inline]
> [<ffffffff85b32553>] do_syscall_64+0x53/0x80 arch/x86/entry/common.c:84
> [<ffffffff85c00087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
>
> Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Mahesh Bandewar <maheshb@google.com>
> Cc: Willem de Bruijn <willemb@google.com>
> ---
> drivers/net/ipvlan/ipvlan_core.c | 41 +++++++++++++++++++-------------
> 1 file changed, 25 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
> index 21e9cac7312186380fa60de11f0a9178080b74b0..2d5b021b4ea6053eeb055a76fa4c7d9380cd2a53 100644
> --- a/drivers/net/ipvlan/ipvlan_core.c
> +++ b/drivers/net/ipvlan/ipvlan_core.c
> @@ -411,7 +411,7 @@ struct ipvl_addr *ipvlan_addr_lookup(struct ipvl_port *port, void *lyr3h,
> return addr;
> }
>
> -static int ipvlan_process_v4_outbound(struct sk_buff *skb)
> +static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb)
> {
> const struct iphdr *ip4h = ip_hdr(skb);
> struct net_device *dev = skb->dev;
> @@ -453,13 +453,11 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb)
> }
>
> #if IS_ENABLED(CONFIG_IPV6)
> -static int ipvlan_process_v6_outbound(struct sk_buff *skb)
> +
> +static noinline_for_stack int
> +ipvlan_route_v6_outbound(struct net_device *dev, struct sk_buff *skb)
> {
> const struct ipv6hdr *ip6h = ipv6_hdr(skb);
> - struct net_device *dev = skb->dev;
> - struct net *net = dev_net(dev);
> - struct dst_entry *dst;
> - int err, ret = NET_XMIT_DROP;
> struct flowi6 fl6 = {
> .flowi6_oif = dev->ifindex,
> .daddr = ip6h->daddr,
> @@ -469,27 +467,38 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
> .flowi6_mark = skb->mark,
> .flowi6_proto = ip6h->nexthdr,
> };
> + struct dst_entry *dst;
> + int err;
>
> - dst = ip6_route_output(net, NULL, &fl6);
> - if (dst->error) {
> - ret = dst->error;
> + dst = ip6_route_output(dev_net(dev), NULL, &fl6);
> + err = dst->error;
> + if (err) {
> dst_release(dst);
> - goto err;
> + return err;
> }
> skb_dst_set(skb, dst);
> + return 0;
> +}
> +
> +static int ipvlan_process_v6_outbound(struct sk_buff *skb)
> +{
> + struct net_device *dev = skb->dev;
> + int err, ret = NET_XMIT_DROP;
> +
> + err = ipvlan_route_v6_outbound(dev, skb);
> + if (unlikely(err)) {
> + DEV_STATS_INC(dev, tx_errors);
> + kfree_skb(skb);
> + return err;
Do you think that it is an oversight that this function mixes a return
of NET_XMIT_DROP/NET_XMIT_SUCCESS with returning the error code
received from deep in the routing stack?
Either way, this patch preserves that existing behavior, so
Reviewed-by: Willem de Bruijn <willemb@google.com>
> + }
>
> memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
>
> - err = ip6_local_out(net, skb->sk, skb);
> + err = ip6_local_out(dev_net(dev), skb->sk, skb);
> if (unlikely(net_xmit_eval(err)))
> DEV_STATS_INC(dev, tx_errors);
> else
> ret = NET_XMIT_SUCCESS;
> - goto out;
> -err:
> - DEV_STATS_INC(dev, tx_errors);
> - kfree_skb(skb);
> -out:
> return ret;
> }
> #else
> --
> 2.42.0.869.gea05f2083d-goog
>
>
^ permalink raw reply
* Re: [PATCH net] ipvlan: add ipvlan_route_v6_outbound() helper
From: Eric Dumazet @ 2023-11-09 18:31 UTC (permalink / raw)
To: Willem de Bruijn
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, netdev,
eric.dumazet, syzbot, Mahesh Bandewar, Willem de Bruijn
In-Reply-To: <CAF=yD-KjqkVJ7G_=EpKNRcdvbTujf6E4p1S_mTVQNBt9enOs2w@mail.gmail.com>
On Thu, Nov 9, 2023 at 7:29 PM Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
> Do you think that it is an oversight that this function mixes a return
> of NET_XMIT_DROP/NET_XMIT_SUCCESS with returning the error code
> received from deep in the routing stack?
>
> Either way, this patch preserves that existing behavior, so
>
> Reviewed-by: Willem de Bruijn <willemb@google.com>
I saw this indeed, and chose to leave this as is to ease code review.
We might send a stand alone patch to return NET_XMIT_DROP instead.
Thanks for the review !
^ permalink raw reply
* Re: [GIT PULL v2] Networking for 6.7
From: Yonghong Song @ 2023-11-09 18:41 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Kirill A. Shutemov, Hou Tao, Jakub Kicinski, Alexei Starovoitov,
Linus Torvalds, David S. Miller, Network Development, LKML,
Paolo Abeni
In-Reply-To: <CAADnVQJtc6JJZMXuZ0M5_0A3=N-TJuYO2vMofJmK6KLhWrBAPg@mail.gmail.com>
On 11/9/23 10:18 AM, Alexei Starovoitov wrote:
> On Thu, Nov 9, 2023 at 10:09 AM Yonghong Song <yonghong.song@linux.dev> wrote:
>>
>> On 11/9/23 8:14 AM, Kirill A. Shutemov wrote:
>>> On Thu, Nov 09, 2023 at 08:01:39AM -0800, Alexei Starovoitov wrote:
>>>> On Thu, Nov 9, 2023 at 7:49 AM Kirill A. Shutemov <kirill@shutemov.name> wrote:
>>>>> On Tue, Oct 31, 2023 at 02:09:48PM -0700, Jakub Kicinski wrote:
>>>>>> bpf: Add support for non-fix-size percpu mem allocation
>>>>> Recent changes in BPF increased per-CPU memory consumption a lot.
>>>>>
>>>>> On virtual machine with 288 CPUs, per-CPU consumtion increased from 111 MB
>>>>> to 969 MB, or 8.7x.
>>>>>
>>>>> I've bisected it to the commit 41a5db8d8161 ("bpf: Add support for
>>>>> non-fix-size percpu mem allocation"), which part of the pull request.
>>>> Hmm. This is unexpected. Thank you for reporting.
>>>>
>>>> How did you measure this 111 MB vs 969 MB ?
>>>> Pls share the steps to reproduce.
>>> Boot VMM with 288 (qemu-system-x86_64 -smp 288) and check Percpu: field of
>>> /proc/meminfo.
>> I did some experiments with my VM. My VM currently supports up to 255 cpus,
>> so I tried 4/32/252 number of cpus. For a particular number of cpus, two
>> experiments are done:
>> (1). bpf-percpu-mem-prefill
>> (2). no-bpf-percpu-mem-prefill
>>
>> For 4 cpu:
>> bpf-percpu-mem-prefill:
>> Percpu: 2000 kB
>> no-bpf-percpu-mem-prefill:
>> Percpu: 1808 kB
>>
>> bpf-percpu-mem-prefill percpu cost: (2000 - 1808)/4 KB = 48KB
>>
>> For 32 cpus:
>> bpf-percpu-mem-prefill:
>> Percpu: 25344 kB
>> no-bpf-percpu-mem-prefill:
>> Percpu: 14464 kB
>>
>> bpf-percpu-mem-prefill percpu cost: (25344 - 14464)/4 KB = 340KB
>>
>> For 252 cpus:
>> bpf-percpu-mem-prefill:
>> Percpu: 230912 kB
>> no-bpf-percpu-mem-prefill:
>> Percpu: 57856 kB
>>
>> bpf-percpu-mem-prefill percpu cost: (230912 - 57856)/4 KB = 686KB
>>
>> I am not able to reproduce the dramatic number from 111 MB to 969 MB.
>> My number with 252 cpus is from ~58MB to ~231MB.
> Even 231MB is way too much. We shouldn't be allocating that much.
> Let's switch to on-demand allocation. Only when bpf progs that
> user per-cpu are loaded.
Sounds good. Will craft a patch for this.
^ permalink raw reply
* Re: [PATCH bpf-next v2] net, xdp: allow metadata > 32
From: Alexei Starovoitov @ 2023-11-09 19:19 UTC (permalink / raw)
To: Larysa Zaremba
Cc: Alexander Lobakin, bpf, Network Development, Alexei Starovoitov,
Daniel Borkmann, David S. Miller, Jakub Kicinski,
Jesper Dangaard Brouer, Eric Dumazet, Magnus Karlsson,
Willem de Bruijn, Yunsheng Lin, Maciej Fijalkowski,
John Fastabend
In-Reply-To: <ZUUE8lH+EbuRNI16@lzaremba-mobl.ger.corp.intel.com>
On Fri, Nov 3, 2023 at 7:35 AM Larysa Zaremba <larysa.zaremba@intel.com> wrote:
>
> On Fri, Nov 03, 2023 at 03:03:14PM +0100, Alexander Lobakin wrote:
> > From: Larysa Zaremba <larysa.zaremba@intel.com>
> > Date: Tue, 31 Oct 2023 18:57:37 +0100
> >
> > It doesn't have "From: Alexa..." here, so that you'll be the author once
> > this is applied. Is this intended? ^.^
> >
>
> No, I should probably resend.
CI is failing as well.
Make sure to test your patches.
test_xdp_context_error:FAIL:bpf_prog_test_run unexpected success: 0
^ permalink raw reply
* Re: [PATCH net] bonding: stop the device in bond_setup_by_slave()
From: Jay Vosburgh @ 2023-11-09 20:26 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Andy Gospodarek,
netdev, eric.dumazet, syzbot
In-Reply-To: <20231109180102.4085183-1-edumazet@google.com>
Eric Dumazet <edumazet@google.com> wrote:
>Commit 9eed321cde22 ("net: lapbether: only support ethernet devices")
>has been able to keep syzbot away from net/lapb, until today.
>
>In the following splat [1], the issue is that a lapbether device has
>been created on a bonding device without members. Then adding a non
>ARPHRD_ETHER member forced the bonding master to change its type.
>
>The fix is to make sure we call dev_close() in bond_setup_by_slave()
>so that the potential linked lapbether devices (or any other devices
>having assumptions on the physical device) are removed.
>
>A similar bug has been addressed in commit 40baec225765
>("bonding: fix panic on non-ARPHRD_ETHER enslave failure")
>
>[1]
>skbuff: skb_under_panic: text:ffff800089508810 len:44 put:40 head:ffff0000c78e7c00 data:ffff0000c78e7bea tail:0x16 end:0x140 dev:bond0
>kernel BUG at net/core/skbuff.c:192 !
>Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
>Modules linked in:
>CPU: 0 PID: 6007 Comm: syz-executor383 Not tainted 6.6.0-rc3-syzkaller-gbf6547d8715b #0
>Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
>pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>pc : skb_panic net/core/skbuff.c:188 [inline]
>pc : skb_under_panic+0x13c/0x140 net/core/skbuff.c:202
>lr : skb_panic net/core/skbuff.c:188 [inline]
>lr : skb_under_panic+0x13c/0x140 net/core/skbuff.c:202
>sp : ffff800096a06aa0
>x29: ffff800096a06ab0 x28: ffff800096a06ba0 x27: dfff800000000000
>x26: ffff0000ce9b9b50 x25: 0000000000000016 x24: ffff0000c78e7bea
>x23: ffff0000c78e7c00 x22: 000000000000002c x21: 0000000000000140
>x20: 0000000000000028 x19: ffff800089508810 x18: ffff800096a06100
>x17: 0000000000000000 x16: ffff80008a629a3c x15: 0000000000000001
>x14: 1fffe00036837a32 x13: 0000000000000000 x12: 0000000000000000
>x11: 0000000000000201 x10: 0000000000000000 x9 : cb50b496c519aa00
>x8 : cb50b496c519aa00 x7 : 0000000000000001 x6 : 0000000000000001
>x5 : ffff800096a063b8 x4 : ffff80008e280f80 x3 : ffff8000805ad11c
>x2 : 0000000000000001 x1 : 0000000100000201 x0 : 0000000000000086
>Call trace:
>skb_panic net/core/skbuff.c:188 [inline]
>skb_under_panic+0x13c/0x140 net/core/skbuff.c:202
>skb_push+0xf0/0x108 net/core/skbuff.c:2446
>ip6gre_header+0xbc/0x738 net/ipv6/ip6_gre.c:1384
>dev_hard_header include/linux/netdevice.h:3136 [inline]
>lapbeth_data_transmit+0x1c4/0x298 drivers/net/wan/lapbether.c:257
>lapb_data_transmit+0x8c/0xb0 net/lapb/lapb_iface.c:447
>lapb_transmit_buffer+0x178/0x204 net/lapb/lapb_out.c:149
>lapb_send_control+0x220/0x320 net/lapb/lapb_subr.c:251
>__lapb_disconnect_request+0x9c/0x17c net/lapb/lapb_iface.c:326
>lapb_device_event+0x288/0x4e0 net/lapb/lapb_iface.c:492
>notifier_call_chain+0x1a4/0x510 kernel/notifier.c:93
>raw_notifier_call_chain+0x3c/0x50 kernel/notifier.c:461
>call_netdevice_notifiers_info net/core/dev.c:1970 [inline]
>call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
>call_netdevice_notifiers net/core/dev.c:2022 [inline]
>__dev_close_many+0x1b8/0x3c4 net/core/dev.c:1508
>dev_close_many+0x1e0/0x470 net/core/dev.c:1559
>dev_close+0x174/0x250 net/core/dev.c:1585
>lapbeth_device_event+0x2e4/0x958 drivers/net/wan/lapbether.c:466
>notifier_call_chain+0x1a4/0x510 kernel/notifier.c:93
>raw_notifier_call_chain+0x3c/0x50 kernel/notifier.c:461
>call_netdevice_notifiers_info net/core/dev.c:1970 [inline]
>call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
>call_netdevice_notifiers net/core/dev.c:2022 [inline]
>__dev_close_many+0x1b8/0x3c4 net/core/dev.c:1508
>dev_close_many+0x1e0/0x470 net/core/dev.c:1559
>dev_close+0x174/0x250 net/core/dev.c:1585
>bond_enslave+0x2298/0x30cc drivers/net/bonding/bond_main.c:2332
>bond_do_ioctl+0x268/0xc64 drivers/net/bonding/bond_main.c:4539
>dev_ifsioc+0x754/0x9ac
>dev_ioctl+0x4d8/0xd34 net/core/dev_ioctl.c:786
>sock_do_ioctl+0x1d4/0x2d0 net/socket.c:1217
>sock_ioctl+0x4e8/0x834 net/socket.c:1322
>vfs_ioctl fs/ioctl.c:51 [inline]
>__do_sys_ioctl fs/ioctl.c:871 [inline]
>__se_sys_ioctl fs/ioctl.c:857 [inline]
>__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857
>__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
>invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
>el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
>do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
>el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
>el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
>el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591
>Code: aa1803e6 aa1903e7 a90023f5 94785b8b (d4210000)
>
>Fixes: 872254dd6b1f ("net/bonding: Enable bonding to enslave non ARPHRD_ETHER")
>Reported-by: syzbot <syzkaller@googlegroups.com>
>Signed-off-by: Eric Dumazet <edumazet@google.com>
I was initially worred that the close / open dance was on the
regular path, but it's only for the non-ARPHRD_ETHER case. That's
really for Infiniband IPoIB, and I'm not sure that there is anything
that can be stacked atop an IPoIB bond.
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
-J
>---
> drivers/net/bonding/bond_main.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 51d47eda1c873debda6da094377bcb3367a78f6e..8e6cc0e133b7f19afccd3ecf44bea5ceacb393b1 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1500,6 +1500,10 @@ static void bond_compute_features(struct bonding *bond)
> static void bond_setup_by_slave(struct net_device *bond_dev,
> struct net_device *slave_dev)
> {
>+ bool was_up = !!(bond_dev->flags & IFF_UP);
>+
>+ dev_close(bond_dev);
>+
> bond_dev->header_ops = slave_dev->header_ops;
>
> bond_dev->type = slave_dev->type;
>@@ -1514,6 +1518,8 @@ static void bond_setup_by_slave(struct net_device *bond_dev,
> bond_dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST);
> bond_dev->flags |= (IFF_POINTOPOINT | IFF_NOARP);
> }
>+ if (was_up)
>+ dev_open(bond_dev, NULL);
> }
>
> /* On bonding slaves other than the currently active slave, suppress
>--
>2.42.0.869.gea05f2083d-goog
---
-Jay Vosburgh, jay.vosburgh@canonical.com
^ permalink raw reply
* [PATCH net v2] ncsi: Revert NCSI link loss/gain commit
From: Johnathan Mantey @ 2023-11-09 20:51 UTC (permalink / raw)
To: netdev; +Cc: sam, edumazet, kuba, pabeni, johnathanx.mantey, linux-kernel
The NCSI commit
ncsi: Propagate carrier gain/loss events to the NCSI controller
introduced unwanted behavior.
The intent for the commit was to be able to detect carrier loss/gain
for just the NIC connected to the BMC. The unwanted effect is a
carrier loss for auxiliary paths also causes the BMC to lose
carrier. The BMC never regains carrier despite the secondary NIC
regaining a link.
This change, when merged, needs to be backported to stable kernels.
5.4-stable, 5.10-stable, 5.15-stable, 6.1-stable, 6.5-stable
Fixes: 3780bb29311e ncsi: Propagate carrier gain/loss events to the
CC: stable@vger.kernel.org
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
---
net/ncsi/ncsi-aen.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/net/ncsi/ncsi-aen.c b/net/ncsi/ncsi-aen.c
index f8854bff286c..62fb1031763d 100644
--- a/net/ncsi/ncsi-aen.c
+++ b/net/ncsi/ncsi-aen.c
@@ -89,11 +89,6 @@ static int ncsi_aen_handler_lsc(struct ncsi_dev_priv *ndp,
if ((had_link == has_link) || chained)
return 0;
- if (had_link)
- netif_carrier_off(ndp->ndev.dev);
- else
- netif_carrier_on(ndp->ndev.dev);
-
if (!ndp->multi_package && !nc->package->multi_channel) {
if (had_link) {
ndp->flags |= NCSI_DEV_RESHUFFLE;
--
2.41.0
^ permalink raw reply related
* [GIT PULL] Networking for v6.7-rc1
From: Jakub Kicinski @ 2023-11-09 21:00 UTC (permalink / raw)
To: torvalds; +Cc: kuba, davem, netdev, linux-kernel, pabeni
Hi Linus!
The following changes since commit ff269e2cd5adce4ae14f883fc9c8803bc43ee1e9:
Merge tag 'net-next-6.7-followup' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next (2023-11-01 16:33:20 -1000)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git net-6.7-rc1
for you to fetch changes up to 83b9dda8afa4e968d9cce253f390b01c0612a2a5:
net: ti: icss-iep: fix setting counter value (2023-11-09 13:15:40 +0100)
----------------------------------------------------------------
Including fixes from netfilter and bpf.
Current release - regressions:
- sched: fix SKB_NOT_DROPPED_YET splat under debug config
Current release - new code bugs:
- tcp: fix usec timestamps with TCP fastopen
- tcp_sigpool: fix some off by one bugs
- tcp: fix possible out-of-bounds reads in tcp_hash_fail()
- tcp: fix SYN option room calculation for TCP-AO
- bpf: fix compilation error without CGROUPS
- ptp:
- ptp_read() should not release queue
- fix tsevqs corruption
Previous releases - regressions:
- llc: verify mac len before reading mac header
Previous releases - always broken:
- bpf:
- fix check_stack_write_fixed_off() to correctly spill imm
- fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END
- check map->usercnt after timer->timer is assigned
- dsa: lan9303: consequently nested-lock physical MDIO
- dccp/tcp: call security_inet_conn_request() after setting IP addr
- tg3: fix the TX ring stall due to incorrect full ring handling
- phylink: initialize carrier state at creation
- ice: fix direction of VF rules in switchdev mode
Misc:
- fill in a bunch of missing MODULE_DESCRIPTION()s, more to come
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
----------------------------------------------------------------
Alex Pakhunov (1):
tg3: Fix the TX ring stall
Alexander Sverdlin (1):
net: dsa: lan9303: consequently nested-lock physical MDIO
Alexei Starovoitov (3):
Merge branch 'bpf-fix-incorrect-immediate-spill'
Merge branch 'relax-allowlist-for-open-coded-css_task-iter'
Merge branch 'bpf-fix-precision-tracking-for-bpf_alu-bpf_to_be-bpf_end'
Andrew Lunn (3):
net: phy: fill in missing MODULE_DESCRIPTION()s
net: mdio: fill in missing MODULE_DESCRIPTION()s
net: ethtool: Fix documentation of ethtool_sprintf()
Andrii Nakryiko (1):
selftests/bpf: fix test_maps' use of bpf_map_create_opts
Aniruddha Paul (1):
ice: Fix VF-VF filter rules in switchdev mode
Björn Töpel (1):
selftests/bpf: Fix broken build where char is unsigned
Chuyi Zhou (5):
bpf: Relax allowlist for css_task iter
selftests/bpf: Add tests for css_task iter combining with cgroup iter
selftests/bpf: Add test for using css_task iter in sleepable progs
bpf: Let verifier consider {task,cgroup} is trusted in bpf_iter_reg
selftests/bpf: get trusted cgrp from bpf_iter__cgroup directly
D. Wythe (3):
net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT
net/smc: allow cdc msg send rather than drop it with NULL sndbuf_desc
net/smc: put sk reference if close work was canceled
Dan Carpenter (2):
hsr: Prevent use after free in prp_create_tagged_frame()
net/tcp_sigpool: Fix some off by one bugs
Dave Ertman (1):
ice: Fix SRIOV LAG disable on non-compliant aggregate
Dave Marchevsky (2):
bpf: Add __bpf_kfunc_{start,end}_defs macros
bpf: Add __bpf_hook_{start,end} macros
David Howells (1):
rxrpc: Fix two connection reaping bugs
David S. Miller (2):
Merge branch 'smc-fixes'
Merge branch 'vsock-fixes'
Diogo Ivo (1):
net: ti: icss-iep: fix setting counter value
Edward Adam Davis (2):
ptp: ptp_read should not release queue
ptp: fix corrupted list in ptp_open
Eric Dumazet (5):
inet: shrink struct flowi_common
tcp: fix fastopen code vs usec TS
net/tcp: fix possible out-of-bounds reads in tcp_hash_fail()
idpf: fix potential use-after-free in idpf_tso()
net_sched: sch_fq: better validate TCA_FQ_WEIGHTS and TCA_FQ_PRIOMAP
Filippo Storniolo (4):
vsock/virtio: remove socket from connected/bound list on shutdown
test/vsock fix: add missing check on socket creation
test/vsock: refactor vsock_accept
test/vsock: add dobule bind connect test
Florian Westphal (3):
netfilter: add missing module descriptions
ipvs: add missing module descriptions
netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses
Furong Xu (1):
net: stmmac: xgmac: Enable support for multiple Flexible PPS outputs
Geetha sowjanya (1):
octeontx2-pf: Free pending and dropped SQEs
George Shuklin (1):
tg3: power down device only on SYSTEM_POWER_OFF
Gerd Bayer (1):
net/smc: fix documentation of buffer sizes
Hangbin Liu (1):
selftests: pmtu.sh: fix result checking
Hao Sun (2):
bpf: Fix check_stack_write_fixed_off() to correctly spill imm
selftests/bpf: Add test for immediate spilled to stack
Heiner Kallweit (1):
r8169: respect userspace disabling IFF_MULTICAST
Hou Tao (1):
bpf: Check map->usercnt after timer->timer is assigned
Ivan Vecera (2):
i40e: Do not call devlink_port_type_clear()
i40e: Fix devlink port unregistering
Jakub Kicinski (10):
Merge branch 'net-sched-fill-in-missing-module_descriptions-for-net-sched'
Merge branch 'add-missing-module_descriptions'
tools: ynl-gen: don't touch the output file if content is the same
netlink: fill in missing MODULE_DESCRIPTION()
nfsd: regenerate user space parsers after ynl-gen changes
Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Merge tag 'nf-23-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
net: kcm: fill in MODULE_DESCRIPTION()
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Jamal Hadi Salim (1):
net, sched: Fix SKB_NOT_DROPPED_YET splat under debug config
Jian Shen (1):
net: page_pool: add missing free_percpu when page_pool_init fail
Jiri Pirko (1):
netlink: specs: devlink: add forgotten port function caps enum values
Klaus Kudielka (1):
net: phylink: initialize carrier state at creation
Kuan-Wei Chiu (1):
s390/qeth: Fix typo 'weed' in comment
Kuniyuki Iwashima (3):
dccp: Call security_inet_conn_request() after setting IPv4 addresses.
dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses.
tcp: Fix SYN option room calculation for TCP-AO.
Linus Walleij (1):
net: xscale: Drop unused PHY number
Maciej Żenczykowski (1):
netfilter: xt_recent: fix (increase) ipv6 literal buffer length
Manu Bretelle (1):
selftests/bpf: fix test_bpffs
Marcin Szycik (1):
ice: Fix VF-VF direction matching in drop rule in switchdev
Martin KaFai Lau (1):
Merge branch 'Let BPF verifier consider {task,cgroup} is trusted in bpf_iter_reg'
Matthieu Baerts (1):
bpf: fix compilation error without CGROUPS
Michal Schmidt (1):
ice: lag: in RCU, use atomic allocation
Nathan Chancellor (1):
tcp: Fix -Wc23-extensions in tcp_options_write()
NeilBrown (1):
Fix termination state for idr_for_each_entry_ul()
Pablo Neira Ayuso (1):
netfilter: nf_tables: remove catchall element in GC sync path
Paolo Abeni (1):
Merge branch 'dccp-tcp-relocate-security_inet_conn_request'
Patrick Thompson (1):
net: r8169: Disable multicast filter for RTL8168H and RTL8107E
Philipp Stanner (1):
drivers/net/ppp: use standard array-copy-function
Ratheesh Kannoth (2):
octeontx2-pf: Fix error codes
octeontx2-pf: Fix holes in error code
Ronald Wahl (1):
net: ethernet: ti: am65-cpsw: rx_pause/tx_pause controls wrong direction
Shigeru Yoshida (2):
tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING
virtio/vsock: Fix uninit-value in virtio_transport_recv_pkt()
Shung-Hsi Yu (2):
bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END
selftests/bpf: precision tracking test for BPF_NEG and BPF_END
Victor Nogueira (3):
net: sched: Fill in MODULE_DESCRIPTION for act_gate
net: sched: Fill in missing MODULE_DESCRIPTION for classifiers
net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs
Vlad Buslov (1):
net/sched: act_ct: Always fill offloading tuple iifidx
Vladimir Oltean (1):
net: enetc: shorten enetc_setup_xdp_prog() error message to fit NETLINK_MAX_FMTMSG_LEN
Willem de Bruijn (1):
llc: verify mac len before reading mac header
Documentation/bpf/kfuncs.rst | 6 +-
Documentation/netlink/specs/devlink.yaml | 4 +
Documentation/networking/smc-sysctl.rst | 6 +-
drivers/net/dsa/lan9303_mdio.c | 4 +-
drivers/net/ethernet/broadcom/tg3.c | 56 +++++++---
drivers/net/ethernet/freescale/enetc/enetc.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_devlink.c | 1 -
drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +-
drivers/net/ethernet/intel/ice/ice_lag.c | 18 ++--
drivers/net/ethernet/intel/ice/ice_tc_lib.c | 114 +++++++++++++++-----
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 6 +-
.../ethernet/marvell/octeontx2/nic/otx2_common.c | 15 +--
.../ethernet/marvell/octeontx2/nic/otx2_common.h | 1 +
.../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 81 ++++++++------
.../ethernet/marvell/octeontx2/nic/otx2_struct.h | 34 +++---
.../net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 42 ++++++++
drivers/net/ethernet/realtek/r8169_main.c | 6 +-
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 2 +-
.../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 14 ++-
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 4 +-
drivers/net/ethernet/ti/icssg/icss_iep.c | 2 +-
drivers/net/ethernet/xscale/ixp4xx_eth.c | 3 +-
drivers/net/mdio/acpi_mdio.c | 1 +
drivers/net/mdio/fwnode_mdio.c | 1 +
drivers/net/mdio/mdio-aspeed.c | 1 +
drivers/net/mdio/mdio-bitbang.c | 1 +
drivers/net/mdio/of_mdio.c | 1 +
drivers/net/phy/bcm-phy-ptp.c | 1 +
drivers/net/phy/bcm87xx.c | 1 +
drivers/net/phy/phylink.c | 2 +
drivers/net/phy/sfp.c | 1 +
drivers/net/ppp/ppp_generic.c | 4 +-
drivers/ptp/ptp_chardev.c | 23 ++--
drivers/ptp/ptp_clock.c | 8 +-
drivers/ptp/ptp_private.h | 1 +
drivers/s390/net/qeth_core_main.c | 2 +-
include/linux/btf.h | 11 ++
include/linux/ethtool.h | 4 +-
include/linux/idr.h | 6 +-
include/linux/tcp.h | 2 +-
include/net/flow.h | 2 +-
include/net/netfilter/nf_conntrack_act_ct.h | 34 +++---
include/net/tcp_ao.h | 13 +--
include/uapi/linux/nfsd_netlink.h | 6 +-
kernel/bpf/bpf_iter.c | 6 +-
kernel/bpf/cgroup_iter.c | 8 +-
kernel/bpf/cpumask.c | 6 +-
kernel/bpf/helpers.c | 39 ++++---
kernel/bpf/map_iter.c | 6 +-
kernel/bpf/task_iter.c | 24 ++---
kernel/bpf/verifier.c | 33 ++++--
kernel/cgroup/rstat.c | 9 +-
kernel/trace/bpf_trace.c | 6 +-
net/bpf/test_run.c | 7 +-
net/bridge/netfilter/ebtable_broute.c | 1 +
net/bridge/netfilter/ebtable_filter.c | 1 +
net/bridge/netfilter/ebtable_nat.c | 1 +
net/bridge/netfilter/ebtables.c | 1 +
net/bridge/netfilter/nf_conntrack_bridge.c | 1 +
net/core/filter.c | 13 +--
net/core/page_pool.c | 6 +-
net/core/xdp.c | 6 +-
net/dccp/ipv4.c | 6 +-
net/dccp/ipv6.c | 6 +-
net/devlink/netlink_gen.c | 2 +-
net/hsr/hsr_forward.c | 4 +-
net/ipv4/fou_bpf.c | 6 +-
net/ipv4/netfilter/iptable_nat.c | 1 +
net/ipv4/netfilter/iptable_raw.c | 1 +
net/ipv4/netfilter/nf_defrag_ipv4.c | 1 +
net/ipv4/netfilter/nf_reject_ipv4.c | 1 +
net/ipv4/syncookies.c | 2 +-
net/ipv4/tcp_ao.c | 5 +-
net/ipv4/tcp_input.c | 7 +-
net/ipv4/tcp_output.c | 72 +++++++------
net/ipv4/tcp_sigpool.c | 8 +-
net/ipv6/netfilter/ip6table_nat.c | 1 +
net/ipv6/netfilter/ip6table_raw.c | 1 +
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c | 1 +
net/ipv6/netfilter/nf_reject_ipv6.c | 1 +
net/ipv6/syncookies.c | 7 +-
net/kcm/kcmsock.c | 1 +
net/llc/llc_input.c | 10 +-
net/llc/llc_s_ac.c | 3 +
net/llc/llc_station.c | 3 +
net/netfilter/ipvs/ip_vs_core.c | 1 +
net/netfilter/ipvs/ip_vs_dh.c | 1 +
net/netfilter/ipvs/ip_vs_fo.c | 1 +
net/netfilter/ipvs/ip_vs_ftp.c | 1 +
net/netfilter/ipvs/ip_vs_lblc.c | 1 +
net/netfilter/ipvs/ip_vs_lblcr.c | 1 +
net/netfilter/ipvs/ip_vs_lc.c | 1 +
net/netfilter/ipvs/ip_vs_nq.c | 1 +
net/netfilter/ipvs/ip_vs_ovf.c | 1 +
net/netfilter/ipvs/ip_vs_pe_sip.c | 1 +
net/netfilter/ipvs/ip_vs_rr.c | 1 +
net/netfilter/ipvs/ip_vs_sed.c | 1 +
net/netfilter/ipvs/ip_vs_sh.c | 1 +
net/netfilter/ipvs/ip_vs_twos.c | 1 +
net/netfilter/ipvs/ip_vs_wlc.c | 1 +
net/netfilter/ipvs/ip_vs_wrr.c | 1 +
net/netfilter/nf_conntrack_bpf.c | 6 +-
net/netfilter/nf_conntrack_broadcast.c | 1 +
net/netfilter/nf_conntrack_netlink.c | 1 +
net/netfilter/nf_conntrack_proto.c | 1 +
net/netfilter/nf_nat_bpf.c | 6 +-
net/netfilter/nf_nat_core.c | 1 +
net/netfilter/nf_nat_redirect.c | 27 ++++-
net/netfilter/nf_tables_api.c | 23 +++-
net/netfilter/nfnetlink_osf.c | 1 +
net/netfilter/nft_chain_nat.c | 1 +
net/netfilter/nft_fib.c | 1 +
net/netfilter/nft_fwd_netdev.c | 1 +
net/netfilter/xt_recent.c | 2 +-
net/netlink/diag.c | 1 +
net/openvswitch/conntrack.c | 2 +-
net/rxrpc/conn_object.c | 2 +-
net/rxrpc/local_object.c | 2 +-
net/sched/act_api.c | 2 +-
net/sched/act_ct.c | 15 ++-
net/sched/act_gate.c | 1 +
net/sched/cls_api.c | 9 +-
net/sched/cls_basic.c | 1 +
net/sched/cls_cgroup.c | 1 +
net/sched/cls_fw.c | 1 +
net/sched/cls_route.c | 1 +
net/sched/cls_u32.c | 1 +
net/sched/sch_cbs.c | 1 +
net/sched/sch_choke.c | 1 +
net/sched/sch_drr.c | 1 +
net/sched/sch_etf.c | 1 +
net/sched/sch_ets.c | 1 +
net/sched/sch_fifo.c | 1 +
net/sched/sch_fq.c | 10 +-
net/sched/sch_gred.c | 1 +
net/sched/sch_hfsc.c | 1 +
net/sched/sch_htb.c | 1 +
net/sched/sch_ingress.c | 1 +
net/sched/sch_mqprio.c | 1 +
net/sched/sch_mqprio_lib.c | 1 +
net/sched/sch_multiq.c | 1 +
net/sched/sch_netem.c | 1 +
net/sched/sch_plug.c | 1 +
net/sched/sch_prio.c | 1 +
net/sched/sch_qfq.c | 1 +
net/sched/sch_red.c | 1 +
net/sched/sch_sfq.c | 1 +
net/sched/sch_skbprio.c | 1 +
net/sched/sch_taprio.c | 1 +
net/sched/sch_tbf.c | 1 +
net/sched/sch_teql.c | 1 +
net/smc/af_smc.c | 4 +-
net/smc/smc.h | 5 +
net/smc/smc_cdc.c | 11 +-
net/smc/smc_close.c | 5 +-
net/socket.c | 8 +-
net/tipc/netlink.c | 4 +-
net/vmw_vsock/virtio_transport_common.c | 18 +++-
net/xfrm/xfrm_interface_bpf.c | 6 +-
tools/net/ynl/generated/devlink-user.c | 2 +
tools/net/ynl/generated/nfsd-user.c | 120 +++++++++++++++++++--
tools/net/ynl/generated/nfsd-user.h | 44 +++++++-
tools/net/ynl/ynl-gen-c.py | 7 +-
.../selftests/bpf/bpf_testmod/bpf_testmod.c | 6 +-
.../selftests/bpf/map_tests/map_percpu_stats.c | 20 +---
.../testing/selftests/bpf/prog_tests/cgroup_iter.c | 33 ++++++
tools/testing/selftests/bpf/prog_tests/iters.c | 1 +
.../testing/selftests/bpf/prog_tests/test_bpffs.c | 11 +-
tools/testing/selftests/bpf/prog_tests/verifier.c | 2 +
tools/testing/selftests/bpf/progs/iters_css_task.c | 55 ++++++++++
.../selftests/bpf/progs/iters_task_failure.c | 4 +-
.../selftests/bpf/progs/verifier_precision.c | 93 ++++++++++++++++
tools/testing/selftests/bpf/verifier/bpf_st_mem.c | 32 ++++++
tools/testing/selftests/bpf/xdp_hw_metadata.c | 2 +-
tools/testing/selftests/net/pmtu.sh | 2 +-
tools/testing/vsock/util.c | 87 ++++++++++++---
tools/testing/vsock/util.h | 3 +
tools/testing/vsock/vsock_test.c | 50 +++++++++
178 files changed, 1242 insertions(+), 434 deletions(-)
create mode 100644 tools/testing/selftests/bpf/progs/verifier_precision.c
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox