* [net-next v1] bpf: add bpf_ktime_get_real_ns helper
From: xiangxia.m.yue @ 2022-04-20 12:23 UTC (permalink / raw)
To: netdev, bpf
Cc: Tonghao Zhang, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Jiri Olsa, Dave Marchevsky,
Kuniyuki Iwashima, Joanne Koong, Geliang Tang, David S. Miller,
Jakub Kicinski, Eric Dumazet
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
This patch introduce a new bpf_ktime_get_real_ns helper, which may
help us to measure the skb latency in the ingress/forwarding path:
HW/SW[1] -> ip_rcv/tcp_rcv_established -> tcp_recvmsg_locked/tcp_update_recv_tstamps
* Insert BPF kprobe into ip_rcv/tcp_rcv_established invoking this helper.
Then we can inspect how long time elapsed since HW/SW.
* If inserting BPF kprobe tcp_update_recv_tstamps invoked by tcp_recvmsg,
we can measure how much latency skb in tcp receive queue. The reason for
this can be application fetch the TCP messages too late.
[1]:
- HW drivers may set skb_hwtstamps(skb)->hwtstamp
- SW __netif_receive_skb_core set skb->tstamp with ktime_get_real()
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Dave Marchevsky <davemarchevsky@fb.com>
Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Cc: Joanne Koong <joannekoong@fb.com>
Cc: Geliang Tang <geliang.tang@suse.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
include/uapi/linux/bpf.h | 13 +++++++++++++
kernel/bpf/core.c | 1 +
kernel/bpf/helpers.c | 14 ++++++++++++++
tools/include/uapi/linux/bpf.h | 13 +++++++++++++
4 files changed, 41 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index d14b10b85e51..2565c587fe1b 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -5143,6 +5143,18 @@ union bpf_attr {
* The **hash_algo** is returned on success,
* **-EOPNOTSUP** if the hash calculation failed or **-EINVAL** if
* invalid arguments are passed.
+ *
+ * u64 bpf_ktime_get_real_ns(void)
+ * Description
+ * Return a fine-grained version of the real (i.e., wall-clock) time,
+ * in nanoseconds. This clock is affected by discontinuous jumps in
+ * the system time (e.g., if the system administrator manually changes
+ * the clock), and by the incremental adjustments performed by adjtime(3)
+ * and NTP.
+ * See: **clock_gettime**\ (**CLOCK_REALTIME**)
+ * Return
+ * Current *ktime*.
+ *
*/
#define __BPF_FUNC_MAPPER(FN) \
FN(unspec), \
@@ -5339,6 +5351,7 @@ union bpf_attr {
FN(copy_from_user_task), \
FN(skb_set_tstamp), \
FN(ima_file_hash), \
+ FN(ktime_get_real_ns), \
/* */
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 13e9dbeeedf3..acdf538b1dcd 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -2627,6 +2627,7 @@ const struct bpf_func_proto bpf_get_prandom_u32_proto __weak;
const struct bpf_func_proto bpf_get_smp_processor_id_proto __weak;
const struct bpf_func_proto bpf_get_numa_node_id_proto __weak;
const struct bpf_func_proto bpf_ktime_get_ns_proto __weak;
+const struct bpf_func_proto bpf_ktime_get_real_ns_proto __weak;
const struct bpf_func_proto bpf_ktime_get_boot_ns_proto __weak;
const struct bpf_func_proto bpf_ktime_get_coarse_ns_proto __weak;
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index 315053ef6a75..d38548ed292f 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -159,6 +159,18 @@ const struct bpf_func_proto bpf_ktime_get_ns_proto = {
.ret_type = RET_INTEGER,
};
+BPF_CALL_0(bpf_ktime_get_real_ns)
+{
+ /* NMI safe access to clock realtime. */
+ return ktime_get_real_fast_ns();
+}
+
+const struct bpf_func_proto bpf_ktime_get_real_ns_proto = {
+ .func = bpf_ktime_get_real_ns,
+ .gpl_only = false,
+ .ret_type = RET_INTEGER,
+};
+
BPF_CALL_0(bpf_ktime_get_boot_ns)
{
/* NMI safe access to clock boottime */
@@ -1410,6 +1422,8 @@ bpf_base_func_proto(enum bpf_func_id func_id)
return &bpf_ktime_get_ns_proto;
case BPF_FUNC_ktime_get_boot_ns:
return &bpf_ktime_get_boot_ns_proto;
+ case BPF_FUNC_ktime_get_real_ns:
+ return &bpf_ktime_get_real_ns_proto;
case BPF_FUNC_ringbuf_output:
return &bpf_ringbuf_output_proto;
case BPF_FUNC_ringbuf_reserve:
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index d14b10b85e51..2565c587fe1b 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -5143,6 +5143,18 @@ union bpf_attr {
* The **hash_algo** is returned on success,
* **-EOPNOTSUP** if the hash calculation failed or **-EINVAL** if
* invalid arguments are passed.
+ *
+ * u64 bpf_ktime_get_real_ns(void)
+ * Description
+ * Return a fine-grained version of the real (i.e., wall-clock) time,
+ * in nanoseconds. This clock is affected by discontinuous jumps in
+ * the system time (e.g., if the system administrator manually changes
+ * the clock), and by the incremental adjustments performed by adjtime(3)
+ * and NTP.
+ * See: **clock_gettime**\ (**CLOCK_REALTIME**)
+ * Return
+ * Current *ktime*.
+ *
*/
#define __BPF_FUNC_MAPPER(FN) \
FN(unspec), \
@@ -5339,6 +5351,7 @@ union bpf_attr {
FN(copy_from_user_task), \
FN(skb_set_tstamp), \
FN(ima_file_hash), \
+ FN(ktime_get_real_ns), \
/* */
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
--
2.27.0
^ permalink raw reply related
* Re: [PATCH] wfx: use container_of() to get vif
From: Kalle Valo @ 2022-04-20 11:57 UTC (permalink / raw)
To: Jaehee Park
Cc: Jérôme Pouiller, David S. Miller, Jakub Kicinski,
Paolo Abeni, linux-wireless, netdev, linux-kernel, linux-staging,
outreachy, Stefano Brivio
In-Reply-To: <20220418035110.GA937332@jaehee-ThinkPad-X1-Extreme>
Jaehee Park <jhpark1013@gmail.com> writes:
> Currently, upon virtual interface creation, wfx_add_interface() stores
> a reference to the corresponding struct ieee80211_vif in private data,
> for later usage. This is not needed when using the container_of
> construct. This construct already has all the info it needs to retrieve
> the reference to the corresponding struct from the offset that is
> already available, inherent in container_of(), between its type and
> member inputs (struct ieee80211_vif and drv_priv, respectively).
> Remove vif (which was previously storing the reference to the struct
> ieee80211_vif) from the struct wfx_vif, define a function
> wvif_to_vif(wvif) for container_of(), and replace all wvif->vif with
> the newly defined container_of construct.
>
> Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
[...]
> +static inline struct ieee80211_vif *wvif_to_vif(struct wfx_vif *wvif)
> +{
> + return container_of((void *)wvif, struct ieee80211_vif, drv_priv);
> +}
Why the void pointer cast? Avoid casts as much possible.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH bpf-next v2 5/6] bpf, arm64: bpf trampoline for arm64
From: KP Singh @ 2022-04-20 11:42 UTC (permalink / raw)
To: Xu Kuohai
Cc: Andrii Nakryiko, bpf, linux-arm-kernel, open list, Networking,
open list:KERNEL SELFTEST FRAMEWORK, Catalin Marinas, Will Deacon,
Steven Rostedt, Ingo Molnar, Daniel Borkmann, Alexei Starovoitov,
Zi Shen Lim, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
Yonghong Song, John Fastabend, David S . Miller,
Hideaki YOSHIFUJI, David Ahern, Thomas Gleixner, Borislav Petkov,
Dave Hansen, X86 ML, hpa, Shuah Khan, Mark Rutland,
Ard Biesheuvel, Pasha Tatashin, Peter Collingbourne, Daniel Kiss,
Sudeep Holla, Steven Price, Marc Zyngier, Mark Brown,
Kumar Kartikeya Dwivedi, Delyan Kratunov
In-Reply-To: <82e7faec-7f0c-573f-4945-de7072744dcb@huawei.com>
On Wed, Apr 20, 2022 at 9:44 AM Xu Kuohai <xukuohai@huawei.com> wrote:
>
> On 4/16/2022 9:57 AM, Xu Kuohai wrote:
> > On 4/16/2022 1:12 AM, Andrii Nakryiko wrote:
> >> On Thu, Apr 14, 2022 at 9:10 AM Xu Kuohai <xukuohai@huawei.com> wrote:
> >>>
> >>> Add bpf trampoline support for arm64. Most of the logic is the same as
> >>> x86.
> >>>
> >>> fentry before bpf trampoline hooked:
> >>> mov x9, x30
> >>> nop
> >>>
> >>> fentry after bpf trampoline hooked:
> >>> mov x9, x30
> >>> bl <bpf_trampoline>
> >>>
> >>> Tested on qemu, result:
> >>> #55 fentry_fexit:OK
> >>> #56 fentry_test:OK
> >>> #58 fexit_sleep:OK
> >>> #59 fexit_stress:OK
> >>> #60 fexit_test:OK
> >>> #67 get_func_args_test:OK
> >>> #68 get_func_ip_test:OK
> >>> #101 modify_return:OK
> >>>
> >>> Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
> >>> Acked-by: Song Liu <songliubraving@fb.com>
> >>> ---
> >>
> >> Can you please also take a look at [0], which is an ongoing work to
> >> add support for BPF cookie to BPF trampoline-based BPF programs. It's
> >> very close to being done, so it would be good if you can implement
> >> that at the same time.
> >
> > OK, I'll take a look and try to implemnt it.
>
> already implemented, but there are some conflicts between these two
> series, will send v3 after trampoline cookie are merged.
Awesome work, Thanks for doing this!
^ permalink raw reply
* Re: [PATCH 2/2] net: macb: In ZynqMP initialization make SGMII phy configuration optional
From: Michal Simek @ 2022-04-20 11:17 UTC (permalink / raw)
To: Radhey Shyam Pandey, davem, kuba, pabeni, robh+dt, krzk+dt,
nicolas.ferre, claudiu.beznea
Cc: netdev, devicetree, linux-kernel, harinik, git
In-Reply-To: <1650452590-32948-3-git-send-email-radhey.shyam.pandey@xilinx.com>
On 4/20/22 13:03, Radhey Shyam Pandey wrote:
> In the macb binding documentation "phys" is an optional property. Make
> implementation in line with it. This change allows the traditional flow
> in which first stage bootloader does PS-GT configuration to work along
> with newer use cases in which PS-GT configuration is managed by the
> phy-zynqmp driver.
>
> It fixes below macb probe failure when macb DT node doesn't have SGMII
> phys handle.
> "macb ff0b0000.ethernet: error -ENODEV: failed to get PS-GTR PHY"
>
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> ---
> drivers/net/ethernet/cadence/macb_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index a5140d4d3baf..6434e74c04f1 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4588,7 +4588,7 @@ static int zynqmp_init(struct platform_device *pdev)
>
> if (bp->phy_interface == PHY_INTERFACE_MODE_SGMII) {
> /* Ensure PS-GTR PHY device used in SGMII mode is ready */
> - bp->sgmii_phy = devm_phy_get(&pdev->dev, "sgmii-phy");
> + bp->sgmii_phy = devm_phy_optional_get(&pdev->dev, NULL);
>
> if (IS_ERR(bp->sgmii_phy)) {
> ret = PTR_ERR(bp->sgmii_phy);
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Thanks,
Michal
^ permalink raw reply
* [PATCH] net: dsa: Add missing of_node_put() in dsa_port_link_register_of
From: Miaoqian Lin @ 2022-04-20 11:04 UTC (permalink / raw)
To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Vladimir Oltean,
David S. Miller, Jakub Kicinski, Paolo Abeni, Russell King,
netdev, linux-kernel
Cc: linmq006
The device_node pointer is returned by of_parse_phandle() with refcount
incremented. We should use of_node_put() on it when done.
of_node_put() will check for NULL value.
Fixes: a20f997010c4 ("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
net/dsa/port.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/dsa/port.c b/net/dsa/port.c
index 32d472a82241..cdc56ba11f52 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -1620,8 +1620,10 @@ int dsa_port_link_register_of(struct dsa_port *dp)
if (ds->ops->phylink_mac_link_down)
ds->ops->phylink_mac_link_down(ds, port,
MLO_AN_FIXED, PHY_INTERFACE_MODE_NA);
+ of_node_put(phy_np);
return dsa_port_phylink_register(dp);
}
+ of_node_put(phy_np);
return 0;
}
--
2.17.1
^ permalink raw reply related
* [PATCH 2/2] net: macb: In ZynqMP initialization make SGMII phy configuration optional
From: Radhey Shyam Pandey @ 2022-04-20 11:03 UTC (permalink / raw)
To: davem, kuba, pabeni, robh+dt, krzk+dt, nicolas.ferre,
claudiu.beznea
Cc: netdev, devicetree, linux-kernel, michals, harinik, git,
Radhey Shyam Pandey
In-Reply-To: <1650452590-32948-1-git-send-email-radhey.shyam.pandey@xilinx.com>
In the macb binding documentation "phys" is an optional property. Make
implementation in line with it. This change allows the traditional flow
in which first stage bootloader does PS-GT configuration to work along
with newer use cases in which PS-GT configuration is managed by the
phy-zynqmp driver.
It fixes below macb probe failure when macb DT node doesn't have SGMII
phys handle.
"macb ff0b0000.ethernet: error -ENODEV: failed to get PS-GTR PHY"
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
---
drivers/net/ethernet/cadence/macb_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index a5140d4d3baf..6434e74c04f1 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4588,7 +4588,7 @@ static int zynqmp_init(struct platform_device *pdev)
if (bp->phy_interface == PHY_INTERFACE_MODE_SGMII) {
/* Ensure PS-GTR PHY device used in SGMII mode is ready */
- bp->sgmii_phy = devm_phy_get(&pdev->dev, "sgmii-phy");
+ bp->sgmii_phy = devm_phy_optional_get(&pdev->dev, NULL);
if (IS_ERR(bp->sgmii_phy)) {
ret = PTR_ERR(bp->sgmii_phy);
--
2.7.4
^ permalink raw reply related
* [PATCH 1/2] dt-bindings: net: cdns,macb: Drop phy-names property for ZynqMP SGMII PHY
From: Radhey Shyam Pandey @ 2022-04-20 11:03 UTC (permalink / raw)
To: davem, kuba, pabeni, robh+dt, krzk+dt, nicolas.ferre,
claudiu.beznea
Cc: netdev, devicetree, linux-kernel, michals, harinik, git,
Radhey Shyam Pandey
In-Reply-To: <1650452590-32948-1-git-send-email-radhey.shyam.pandey@xilinx.com>
In zynqmp SGMII initialization, there is a single PHY so remove phy-names
property as there is no real need of having it.
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
---
Note: For this change taken reference from upstream commit (8a917813cc74)
phy: Allow a NULL phy name for devm_phy_get().
https://lore.kernel.org/r/20210414135525.3535787-1-robh@kernel.org
---
Documentation/devicetree/bindings/net/cdns,macb.yaml | 8 --------
1 file changed, 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml
index 6cd3d853dcba..e5b628736930 100644
--- a/Documentation/devicetree/bindings/net/cdns,macb.yaml
+++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml
@@ -84,13 +84,6 @@ properties:
phys:
maxItems: 1
- phy-names:
- const: sgmii-phy
- description:
- Required with ZynqMP SoC when in SGMII mode.
- Should reference PS-GTR generic PHY device for this controller
- instance. See ZynqMP example.
-
resets:
maxItems: 1
description:
@@ -204,7 +197,6 @@ examples:
reset-names = "gem1_rst";
status = "okay";
phy-mode = "sgmii";
- phy-names = "sgmii-phy";
phys = <&psgtr 1 PHY_TYPE_SGMII 1 1>;
fixed-link {
speed = <1000>;
--
2.7.4
^ permalink raw reply related
* [PATCH 0/2] net: macb: Make ZynqMP SGMII phy configuration optional
From: Radhey Shyam Pandey @ 2022-04-20 11:03 UTC (permalink / raw)
To: davem, kuba, pabeni, robh+dt, krzk+dt, nicolas.ferre,
claudiu.beznea
Cc: netdev, devicetree, linux-kernel, michals, harinik, git,
Radhey Shyam Pandey
This patchset drop phy-names property from MACB node and also make
SGMII Phy configuration optional. The motivation for this change
is to support traditional usescase in which first stage bootloader
does PS-GT configuration, and should still be supported in macb
driver.
Radhey Shyam Pandey (2):
dt-bindings: net: cdns,macb: Drop phy-names property for ZynqMP SGMII
PHY
net: macb: In ZynqMP initialization make SGMII phy configuration
optional
Documentation/devicetree/bindings/net/cdns,macb.yaml | 8 --------
drivers/net/ethernet/cadence/macb_main.c | 2 +-
2 files changed, 1 insertion(+), 9 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH] nfc: MAINTAINERS: add Bug entry
From: Krzysztof Kozlowski @ 2022-04-20 10:46 UTC (permalink / raw)
To: Krzysztof Kozlowski, David S. Miller, Jakub Kicinski, Paolo Abeni,
linux-nfc, netdev, linux-kernel
Add a Bug section, indicating preferred mailing method for bug reports,
to NFC Subsystem entry.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 2d746723306a..1786cbdd43a2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13842,6 +13842,7 @@ M: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
L: linux-nfc@lists.01.org (subscribers-only)
L: netdev@vger.kernel.org
S: Maintained
+B: mailto:linux-nfc@lists.01.org
F: Documentation/devicetree/bindings/net/nfc/
F: drivers/nfc/
F: include/linux/platform_data/nfcmrvl.h
--
2.32.0
^ permalink raw reply related
* Re: [Intel-wired-lan] [PATCH 1/2] Fix race in igc_xdp_xmit_zc
From: Alexander Lobakin @ 2022-04-20 10:37 UTC (permalink / raw)
To: Jeff Evanson
Cc: Alexander Lobakin, Jesse Brandeburg, Tony Nguyen, David S. Miller,
Jakub Kicinski, Alexei Starovoitov, Daniel Borkmann,
Jesper Dangaard Brouer, John Fastabend, intel-wired-lan, netdev,
linux-kernel, bpf
In-Reply-To: <20220415210421.11217-1-jeff.evanson@qsc.com>
From: Jeff Evanson <jeff.evanson@gmail.com>
Date: Fri, 15 Apr 2022 15:04:21 -0600
> in igc_xdp_xmit_zc, initialize next_to_use while holding the netif_tx_lock
> to prevent racing with other users of the tx ring
>
> Signed-off-by: Jeff Evanson <jeff.evanson@qsc.com>
> ---
> drivers/net/ethernet/intel/igc/igc_main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index 1c00ee310c19..a36a18c84aeb 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -2598,7 +2598,7 @@ static void igc_xdp_xmit_zc(struct igc_ring *ring)
> struct netdev_queue *nq = txring_txq(ring);
> union igc_adv_tx_desc *tx_desc = NULL;
> int cpu = smp_processor_id();
> - u16 ntu = ring->next_to_use;
> + u16 ntu;
Please don't break the RCT (reverse christmas tree) style here. You
should move it to the bottom of the declaration block, ideally
combine it with the declaration of @budget as they're both u16s.
> struct xdp_desc xdp_desc;
> u16 budget;
>
> @@ -2607,6 +2607,8 @@ static void igc_xdp_xmit_zc(struct igc_ring *ring)
>
> __netif_tx_lock(nq, cpu);
>
> + ntu = ring->next_to_use;
> +
There's no need for this empty newline I believe.
> budget = igc_desc_unused(ring);
>
> while (xsk_tx_peek_desc(pool, &xdp_desc) && budget--) {
> --
> 2.17.1
Thanks,
Al
^ permalink raw reply
* Re: [PATCH net-next 01/17] can: rx-offload: rename can_rx_offload_queue_sorted() -> can_rx_offload_queue_timestamp()
From: patchwork-bot+netdevbpf @ 2022-04-20 10:30 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: netdev, davem, kuba, linux-can, kernel
In-Reply-To: <20220419152554.2925353-2-mkl@pengutronix.de>
Hello:
This series was applied to netdev/net-next.git (master)
by Marc Kleine-Budde <mkl@pengutronix.de>:
On Tue, 19 Apr 2022 17:25:38 +0200 you wrote:
> This patch renames the function can_rx_offload_queue_sorted() to
> can_rx_offload_queue_timestamp(). This better describes what the
> function does, it adds a newly RX'ed skb to the sorted queue by its
> timestamp.
>
> Link: https://lore.kernel.org/all/20220417194327.2699059-1-mkl@pengutronix.de
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>
> [...]
Here is the summary with links:
- [net-next,01/17] can: rx-offload: rename can_rx_offload_queue_sorted() -> can_rx_offload_queue_timestamp()
https://git.kernel.org/netdev/net-next/c/eb38c2053b67
- [net-next,02/17] can: bittiming: can_calc_bittiming(): prefer small bit rate pre-scalers over larger ones
https://git.kernel.org/netdev/net-next/c/85d4eb2a3dfe
- [net-next,03/17] can: Fix Links to Technologic Systems web resources
https://git.kernel.org/netdev/net-next/c/20c7258980e0
- [net-next,04/17] can: mscan: mpc5xxx_can: Prepare cleanup of powerpc's asm/prom.h
https://git.kernel.org/netdev/net-next/c/bb75e352d7ac
- [net-next,05/17] can: flexcan: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
https://git.kernel.org/netdev/net-next/c/e6ec83790593
- [net-next,06/17] MAINTAINERS: rectify entry for XILINX CAN DRIVER
https://git.kernel.org/netdev/net-next/c/badea4fc7025
- [net-next,07/17] can: xilinx_can: mark bit timing constants as const
https://git.kernel.org/netdev/net-next/c/ae38fda02996
- [net-next,08/17] dt-bindings: can: renesas,rcar-canfd: document r8a77961 support
https://git.kernel.org/netdev/net-next/c/44b6b105dd24
- [net-next,09/17] dt-binding: can: mcp251xfd: add binding information for mcp251863
https://git.kernel.org/netdev/net-next/c/621119764850
- [net-next,10/17] can: mcp251xfd: add support for mcp251863
https://git.kernel.org/netdev/net-next/c/c6f2a617a0a8
- [net-next,11/17] dt-bindings: vendor-prefix: add prefix for the Czech Technical University in Prague.
https://git.kernel.org/netdev/net-next/c/fb23e43a0a9c
- [net-next,12/17] dt-bindings: net: can: binding for CTU CAN FD open-source IP core.
https://git.kernel.org/netdev/net-next/c/1da9d6e35b6b
- [net-next,13/17] can: ctucanfd: add support for CTU CAN FD open-source IP core - bus independent part.
https://git.kernel.org/netdev/net-next/c/2dcb8e8782d8
- [net-next,14/17] can: ctucanfd: CTU CAN FD open-source IP core - PCI bus support.
https://git.kernel.org/netdev/net-next/c/792a5b678e81
- [net-next,15/17] can: ctucanfd: CTU CAN FD open-source IP core - platform/SoC support.
https://git.kernel.org/netdev/net-next/c/e8f0c23a2415
- [net-next,16/17] docs: ctucanfd: CTU CAN FD open-source IP core documentation.
https://git.kernel.org/netdev/net-next/c/c3a0addefbde
- [net-next,17/17] MAINTAINERS: Add maintainers for CTU CAN FD IP core driver
https://git.kernel.org/netdev/net-next/c/cfdb2f365cb9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* Re: [PATCH net-next v4 0/5] net/sched: flower: match on the number of vlan tags
From: patchwork-bot+netdevbpf @ 2022-04-20 10:20 UTC (permalink / raw)
To: Boris Sukholitko
Cc: netdev, davem, kuba, jhs, xiyou.wangcong, jiri, gustavoars,
vladimir.oltean, edumazet, zhangkaiheb, komachi.yoshiki, pabeni,
ilya.lifshits
In-Reply-To: <20220419081434.5192-1-boris.sukholitko@broadcom.com>
Hello:
This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Tue, 19 Apr 2022 11:14:29 +0300 you wrote:
> Hi,
>
> Our customers in the fiber telecom world have network configurations
> where they would like to control their traffic according to the number
> of tags appearing in the packet.
>
> For example, TR247 GPON conformance test suite specification mostly
> talks about untagged, single, double tagged packets and gives lax
> guidelines on the vlan protocol vs. number of vlan tags.
>
> [...]
Here is the summary with links:
- [net-next,v4,1/5] net/sched: flower: Helper function for vlan ethtype checks
https://git.kernel.org/netdev/net-next/c/285ba06b0edb
- [net-next,v4,2/5] net/sched: flower: Reduce identation after is_key_vlan refactoring
https://git.kernel.org/netdev/net-next/c/6ee59e554d33
- [net-next,v4,3/5] flow_dissector: Add number of vlan tags dissector
https://git.kernel.org/netdev/net-next/c/34951fcf26c5
- [net-next,v4,4/5] net/sched: flower: Add number of vlan tags filter
https://git.kernel.org/netdev/net-next/c/b40003128226
- [net-next,v4,5/5] net/sched: flower: Consider the number of tags for vlan filters
https://git.kernel.org/netdev/net-next/c/99fdb22bc5e9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* Re: [PATCH v2 net] net: stmmac: Use readl_poll_timeout_atomic() in atomic state
From: patchwork-bot+netdevbpf @ 2022-04-20 10:20 UTC (permalink / raw)
To: Kevin Hao
Cc: netdev, peppe.cavallaro, alexandre.torgue, joabreu, davem, kuba,
pabeni, mcoquelin.stm32, zhengdejin5, linux-stm32,
linux-arm-kernel
In-Reply-To: <20220419084226.38340-1-haokexin@gmail.com>
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Tue, 19 Apr 2022 16:42:26 +0800 you wrote:
> The init_systime() may be invoked in atomic state. We have observed the
> following call trace when running "phc_ctl /dev/ptp0 set" on a Intel
> Agilex board.
> BUG: sleeping function called from invalid context at drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c:74
> in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 381, name: phc_ctl
> preempt_count: 1, expected: 0
> RCU nest depth: 0, expected: 0
> Preemption disabled at:
> [<ffff80000892ef78>] stmmac_set_time+0x34/0x8c
> CPU: 2 PID: 381 Comm: phc_ctl Not tainted 5.18.0-rc2-next-20220414-yocto-standard+ #567
> Hardware name: SoCFPGA Agilex SoCDK (DT)
> Call trace:
> dump_backtrace.part.0+0xc4/0xd0
> show_stack+0x24/0x40
> dump_stack_lvl+0x7c/0xa0
> dump_stack+0x18/0x34
> __might_resched+0x154/0x1c0
> __might_sleep+0x58/0x90
> init_systime+0x78/0x120
> stmmac_set_time+0x64/0x8c
> ptp_clock_settime+0x60/0x9c
> pc_clock_settime+0x6c/0xc0
> __arm64_sys_clock_settime+0x88/0xf0
> invoke_syscall+0x5c/0x130
> el0_svc_common.constprop.0+0x4c/0x100
> do_el0_svc+0x7c/0xa0
> el0_svc+0x58/0xcc
> el0t_64_sync_handler+0xa4/0x130
> el0t_64_sync+0x18c/0x190
>
> [...]
Here is the summary with links:
- [v2,net] net: stmmac: Use readl_poll_timeout_atomic() in atomic state
https://git.kernel.org/netdev/net/c/234901de2bc6
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* [PATCH net] net/mlx5: use kvfree() for kvzalloc() in mlx5_ct_fs_smfs_matcher_create
From: Ziyang Xuan @ 2022-04-20 10:36 UTC (permalink / raw)
To: saeedm, leon, davem, kuba, pabeni, paulb, netdev, linux-rdma
The memory of spec is allocated with kvzalloc(), the corresponding
release function should not be kfree(), use kvfree() instead.
Generated by: scripts/coccinelle/api/kfree_mismatch.cocci
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c
index 59988e24b704..b979826f3f6c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c
@@ -100,7 +100,7 @@ mlx5_ct_fs_smfs_matcher_create(struct mlx5_ct_fs *fs, struct mlx5dr_table *tbl,
spec->match_criteria_enable = MLX5_MATCH_MISC_PARAMETERS_2 | MLX5_MATCH_OUTER_HEADERS;
dr_matcher = mlx5_smfs_matcher_create(tbl, priority, spec);
- kfree(spec);
+ kvfree(spec);
if (!dr_matcher)
return ERR_PTR(-EINVAL);
--
2.25.1
^ permalink raw reply related
* Re: [PATCH] wwan_hwsim: Avoid flush_scheduled_work() usage
From: Tetsuo Handa @ 2022-04-20 10:17 UTC (permalink / raw)
To: Loic Poulain
Cc: Sergey Ryazanov, Johannes Berg, David S. Miller, Jakub Kicinski,
Paolo Abeni, Network Development
In-Reply-To: <CAMZdPi_uieGNWyGAAywBz2Utg0iW1jGUTWzUbj3SmsZ+-iDTfQ@mail.gmail.com>
On 2022/04/20 18:53, Loic Poulain wrote:
>> @@ -506,9 +507,15 @@ static int __init wwan_hwsim_init(void)
>> if (wwan_hwsim_devsnum < 0 || wwan_hwsim_devsnum > 128)
>> return -EINVAL;
>>
>> + wwan_wq = alloc_workqueue("wwan_wq", 0, 0);
>> + if (!wwan_wq)
>> + return -ENOMEM;
>> +
>> wwan_hwsim_class = class_create(THIS_MODULE, "wwan_hwsim");
>> - if (IS_ERR(wwan_hwsim_class))
>> + if (IS_ERR(wwan_hwsim_class)) {
>> + destroy_workqueue(wwan_wq);
>> return PTR_ERR(wwan_hwsim_class);
>> + }
>>
>> wwan_hwsim_debugfs_topdir = debugfs_create_dir("wwan_hwsim", NULL);
>> wwan_hwsim_debugfs_devcreate =
>> @@ -524,6 +531,7 @@ static int __init wwan_hwsim_init(void)
>>
>> err_clean_devs:
Do you want
debugfs_remove(wwan_hwsim_debugfs_devcreate);
here (as a separate patch)?
>> wwan_hwsim_free_devs();
>> + destroy_workqueue(wwan_wq);
>> debugfs_remove(wwan_hwsim_debugfs_topdir);
>> class_destroy(wwan_hwsim_class);
>>
>> @@ -534,7 +542,7 @@ static void __exit wwan_hwsim_exit(void)
>> {
>> debugfs_remove(wwan_hwsim_debugfs_devcreate); /* Avoid new devs */
>> wwan_hwsim_free_devs();
>> - flush_scheduled_work(); /* Wait deletion works completion */
>> + destroy_workqueue(wwan_wq); /* Wait deletion works completion */
>
> Wouldn't it be simpler to just remove the flush call. It Looks like
> all ports have been removed at that point, and all works cancelled,
> right?
I guess that this flush_scheduled_work() is for waiting for schedule_work(&dev->del_work) from
wwan_hwsim_debugfs_devdestroy_write(). That is, if wwan_hwsim_debugfs_devdestroy_write() already
scheduled this work, wwan_hwsim_dev_del() from wwan_hwsim_dev_del_work() might be still in progress
even after wwan_hwsim_dev_del() from wwan_hwsim_free_devs() from wwan_hwsim_exit() returned.
^ permalink raw reply
* Re: [PATCH net v2 1/2] dt-bindings: net: dsa: realtek: cleanup compatible strings
From: patchwork-bot+netdevbpf @ 2022-04-20 10:10 UTC (permalink / raw)
To: Luiz Angelo Daros de Luca
Cc: netdev, linus.walleij, alsi, andrew, vivien.didelot, f.fainelli,
olteanv, davem, kuba, pabeni, robh+dt, krzk+dt, arinc.unal,
devicetree
In-Reply-To: <20220418233558.13541-1-luizluca@gmail.com>
Hello:
This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Mon, 18 Apr 2022 20:35:57 -0300 you wrote:
> Compatible strings are used to help the driver find the chip ID/version
> register for each chip family. After that, the driver can setup the
> switch accordingly. Keep only the first supported model for each family
> as a compatible string and reference other chip models in the
> description.
>
> The removed compatible strings have never been used in a released kernel.
>
> [...]
Here is the summary with links:
- [net,v2,1/2] dt-bindings: net: dsa: realtek: cleanup compatible strings
https://git.kernel.org/netdev/net-next/c/6f2d04ccae9b
- [net,v2,2/2] net: dsa: realtek: remove realtek,rtl8367s string
https://git.kernel.org/netdev/net-next/c/fcd30c96af95
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* Re: [PATCH] ar5523: Use kzalloc instead of kmalloc/memset
From: patchwork-bot+netdevbpf @ 2022-04-20 10:10 UTC (permalink / raw)
To: Haowen Bai
Cc: pontus.fuchs, kvalo, davem, kuba, pabeni, linux-wireless, netdev,
linux-kernel
In-Reply-To: <1650332252-4994-1-git-send-email-baihaowen@meizu.com>
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Tue, 19 Apr 2022 09:37:31 +0800 you wrote:
> Use kzalloc rather than duplicating its implementation, which
> makes code simple and easy to understand.
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
> drivers/net/wireless/ath/ar5523/ar5523.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Here is the summary with links:
- ar5523: Use kzalloc instead of kmalloc/memset
https://git.kernel.org/netdev/net-next/c/e63dd4123507
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* Re: [PATCH net] net: sched: act_mirred: Reset ct info when mirror/redirect skb
From: Hangbin Liu @ 2022-04-20 10:07 UTC (permalink / raw)
To: Marcelo Ricardo Leitner
Cc: Eyal Birger, netdev, jhs, xiyou.wangcong, jiri, davem, kuba,
ahleihel, dcaratti, aconole, roid, Shmulik Ladkani
In-Reply-To: <CAHsH6GvoDr5qOKsvvuShfHFi4CsCfaC-pUbxTE6OfYWhgTf9bg@mail.gmail.com>
On Tue, Apr 19, 2022 at 09:14:38PM +0300, Eyal Birger wrote:
> >
> > I guess I can understand why the reproducer triggers it, but I fail to
> > see the actual use case you have behind it. Can you please elaborate
> > on it?
>
> One use case we use mirred egress->ingress redirect for is when we want to
> reroute a packet after applying some change to the packet which would affect
> its routing. for example consider a bpf program running on tc ingress (after
> mirred) setting the skb->mark based on some criteria.
>
> So you have something like:
>
> packet routed to dummy device based on some criteria ->
> mirred redirect to ingress ->
> classification by ebpf logic at tc ingress ->
> packet routed again
>
> We have a setup where DNAT is performed before this flow in that case the
> ebpf logic needs to see the packet after the NAT.
Hi Marcelo,
Thanks for taking care of this. Would you help following up this issue as
you are more familiar with net sched?
Thanks
Hangbin
^ permalink raw reply
* Re: [PATCH] driver: usb: nullify dangling pointer in cdc_ncm_free
From: Johan Hovold @ 2022-04-20 10:06 UTC (permalink / raw)
To: Oliver Neukum
Cc: Andy Shevchenko, Oleksij Rempel, Dongliang Mu, Oliver Neukum,
David S. Miller, Jakub Kicinski, Paolo Abeni, Dongliang Mu,
syzbot+eabbf2aaa999cc507108, USB, netdev,
Linux Kernel Mailing List
In-Reply-To: <aef0c568-e088-b897-f8ec-f22cfef124f6@suse.com>
On Wed, Apr 20, 2022 at 11:45:49AM +0200, Oliver Neukum wrote:
> >> - if (dev->driver_info->unbind)
> >> - dev->driver_info->unbind(dev, intf);
> >> + if (dev->driver_info->disable)
> >> + dev->driver_info->disable(dev, intf);
> >>
> >> net = dev->net;
> >> unregister_netdev (net);
> >> @@ -1651,6 +1651,9 @@ void usbnet_disconnect (struct usb_interface *intf)
> >>
> >> usb_scuttle_anchored_urbs(&dev->deferred);
> >>
> >> + if (dev->driver_info->unbind)
> >> + dev->driver_info->unbind (dev, intf);
> >> +
> >> usb_kill_urb(dev->interrupt);
> > Don't you need to quiesce all I/O, including stopping the interrupt URB,
> > before unbind?
> If I do that, how do I prevent people from relaunching the URB between
> kill and unbind? Do I need to poison it?
You could, but it would seem you have bigger problems if something can
submit the URB after having deregistered the netdev.
Looks like the URB should already have been stopped by
usbnet_status_stop() so that the usb_kill_urb() above is (or should be)
a noop.
Johan
^ permalink raw reply
* Re: [PATCH net-next v5 0/3] net: atlantic: Add XDP support
From: patchwork-bot+netdevbpf @ 2022-04-20 10:00 UTC (permalink / raw)
To: Taehee Yoo
Cc: davem, kuba, pabeni, netdev, irusskikh, ast, daniel, hawk,
john.fastabend, andrii, kafai, songliubraving, yhs, kpsingh, bpf
In-Reply-To: <20220417101247.13544-1-ap420073@gmail.com>
Hello:
This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Sun, 17 Apr 2022 10:12:44 +0000 you wrote:
> This patchset is to make atlantic to support multi-buffer XDP.
>
> The first patch implement control plane of xdp.
> The aq_xdp(), callback of .xdp_bpf is added.
>
> The second patch implements data plane of xdp.
> XDP_TX, XDP_DROP, and XDP_PASS is supported.
> __aq_ring_xdp_clean() is added to receive and execute xdp program.
> aq_nic_xmit_xdpf() is added to send packet by XDP.
>
> [...]
Here is the summary with links:
- [net-next,v5,1/3] net: atlantic: Implement xdp control plane
https://git.kernel.org/netdev/net-next/c/0d14657f4083
- [net-next,v5,2/3] net: atlantic: Implement xdp data plane
https://git.kernel.org/netdev/net-next/c/26efaef759a1
- [net-next,v5,3/3] net: atlantic: Implement .ndo_xdp_xmit handler
https://git.kernel.org/netdev/net-next/c/45638f013a63
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* Re: [PATCH V2 net-next 0/9] net: hns3: updates for -next
From: patchwork-bot+netdevbpf @ 2022-04-20 10:00 UTC (permalink / raw)
To: Guangbin Huang; +Cc: davem, kuba, netdev, linux-kernel, lipeng321, chenhao288
In-Reply-To: <20220419032709.15408-1-huangguangbin2@huawei.com>
Hello:
This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Tue, 19 Apr 2022 11:27:00 +0800 you wrote:
> This series includes some updates for the HNS3 ethernet driver.
>
> Change logs:
> V1 -> V2:
> - Fix failed to apply to net-next problem.
>
> Hao Chen (3):
> net: hns3: refactor hns3_set_ringparam()
> net: hns3: add log for setting tx spare buf size
> net: hns3: remove unnecessary line wrap for hns3_set_tunable
>
> [...]
Here is the summary with links:
- [V2,net-next,1/9] net: hns3: add ethtool parameter check for CQE/EQE mode
https://git.kernel.org/netdev/net-next/c/286c61e72797
- [V2,net-next,2/9] net: hns3: refactor hns3_set_ringparam()
https://git.kernel.org/netdev/net-next/c/07fdc163ac88
- [V2,net-next,3/9] net: hns3: refine the definition for struct hclge_pf_to_vf_msg
https://git.kernel.org/netdev/net-next/c/6fde96df0447
- [V2,net-next,4/9] net: hns3: add failure logs in hclge_set_vport_mtu
https://git.kernel.org/netdev/net-next/c/bcc7a98f0d3c
- [V2,net-next,5/9] net: hns3: add log for setting tx spare buf size
https://git.kernel.org/netdev/net-next/c/2373b35c24ff
- [V2,net-next,6/9] net: hns3: update the comment of function hclgevf_get_mbx_resp
https://git.kernel.org/netdev/net-next/c/2e0f53887011
- [V2,net-next,7/9] net: hns3: fix the wrong words in comments
https://git.kernel.org/netdev/net-next/c/9c657cbc2c15
- [V2,net-next,8/9] net: hns3: replace magic value by HCLGE_RING_REG_OFFSET
https://git.kernel.org/netdev/net-next/c/350cb4409246
- [V2,net-next,9/9] net: hns3: remove unnecessary line wrap for hns3_set_tunable
https://git.kernel.org/netdev/net-next/c/29c17cb67271
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* Re: [RFCv6 PATCH net-next 02/19] net: replace general features macroes with global netdev_features variables
From: shenjian (K) @ 2022-04-20 9:54 UTC (permalink / raw)
To: Alexander Lobakin
Cc: davem, kuba, andrew, ecree.xilinx, hkallweit1, saeed, leon,
netdev, linuxarm, lipeng321
In-Reply-To: <20220419144944.1665016-1-alexandr.lobakin@intel.com>
在 2022/4/19 22:49, Alexander Lobakin 写道:
> From: Jian Shen <shenjian15@huawei.com>
> Date: Tue, 19 Apr 2022 10:21:49 +0800
>
>> There are many netdev_features bits group used in kernel. The definition
>> will be illegal when using feature bit more than 64. Replace these macroes
>> with global netdev_features variables, initialize them when netdev module
>> init.
>>
>> Signed-off-by: Jian Shen <shenjian15@huawei.com>
>> ---
>> drivers/net/wireguard/device.c | 10 +-
>> include/linux/netdev_features.h | 102 +++++++++-----
>> net/core/Makefile | 2 +-
>> net/core/dev.c | 87 ++++++++++++
>> net/core/netdev_features.c | 241 ++++++++++++++++++++++++++++++++
>> 5 files changed, 400 insertions(+), 42 deletions(-)
>> create mode 100644 net/core/netdev_features.c
>>
> --- 8< ---
>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 4d6b57752eee..85bb418e8ef1 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -146,6 +146,7 @@
>> #include <linux/sctp.h>
>> #include <net/udp_tunnel.h>
>> #include <linux/net_namespace.h>
>> +#include <linux/netdev_features_helper.h>
>> #include <linux/indirect_call_wrapper.h>
>> #include <net/devlink.h>
>> #include <linux/pm_runtime.h>
>> @@ -11255,6 +11256,90 @@ static struct pernet_operations __net_initdata default_device_ops = {
>> .exit_batch = default_device_exit_batch,
>> };
>>
>> +static void netdev_features_init(void)
> It is an initialization function, so it must be marked as __init.
right, I will add it, thanks!
>> +{
>> + netdev_features_t features;
>> +
>> + netdev_features_set_array(&netif_f_never_change_feature_set,
>> + &netdev_never_change_features);
>> +
>> + netdev_features_set_array(&netif_f_gso_feature_set_mask,
> I'm not sure it does make sense to have an empty newline between
> each call. I'd leave newlines only between the "regular" blocks
> and the "multi-call" blocks, I mean, stuff like VLAN, GSO and
> @netdev_ethtool_features.
At first, I added empty newline per call for the it used three lines.
Now the new call just use two lines, I will remove some unnecessary
blank lines.
Thanks!
>> + &netdev_gso_features_mask);
>> +
>> + netdev_features_set_array(&netif_f_ip_csum_feature_set,
>> + &netdev_ip_csum_features);
>> +
>> + netdev_features_set_array(&netif_f_csum_feature_set_mask,
>> + &netdev_csum_features_mask);
>> +
>> + netdev_features_set_array(&netif_f_general_tso_feature_set,
>> + &netdev_general_tso_features);
>> +
>> + netdev_features_set_array(&netif_f_all_tso_feature_set,
>> + &netdev_all_tso_features);
>> +
>> + netdev_features_set_array(&netif_f_tso_ecn_feature_set,
>> + &netdev_tso_ecn_features);
>> +
>> + netdev_features_set_array(&netif_f_all_fcoe_feature_set,
>> + &netdev_all_fcoe_features);
>> +
>> + netdev_features_set_array(&netif_f_gso_soft_feature_set,
>> + &netdev_gso_software_features);
>> +
>> + netdev_features_set_array(&netif_f_one_for_all_feature_set,
>> + &netdev_one_for_all_features);
>> +
>> + netdev_features_set_array(&netif_f_all_for_all_feature_set,
>> + &netdev_all_for_all_features);
>> +
>> + netdev_features_set_array(&netif_f_upper_disables_feature_set,
>> + &netdev_upper_disable_features);
>> +
>> + netdev_features_set_array(&netif_f_soft_feature_set,
>> + &netdev_soft_features);
>> +
>> + netdev_features_set_array(&netif_f_soft_off_feature_set,
>> + &netdev_soft_off_features);
>> +
>> + netdev_features_set_array(&netif_f_rx_vlan_feature_set,
>> + &netdev_rx_vlan_features);
>> +
>> + netdev_features_set_array(&netif_f_tx_vlan_feature_set,
>> + &netdev_tx_vlan_features);
>> +
>> + netdev_features_set_array(&netif_f_vlan_filter_feature_set,
>> + &netdev_vlan_filter_features);
>> +
>> + netdev_all_vlan_features = netdev_rx_vlan_features;
>> + netdev_features_set(&netdev_all_vlan_features, netdev_tx_vlan_features);
>> + netdev_features_set(&netdev_all_vlan_features,
>> + netdev_vlan_filter_features);
>> +
>> + netdev_features_set_array(&netif_f_ctag_vlan_feature_set,
>> + &netdev_ctag_vlan_features);
>> +
>> + netdev_features_set_array(&netif_f_stag_vlan_feature_set,
>> + &netdev_stag_vlan_features);
>> +
>> + netdev_features_set_array(&netif_f_gso_encap_feature_set,
>> + &netdev_gso_encap_all_features);
>> +
>> + netdev_features_set_array(&netif_f_xfrm_feature_set,
>> + &netdev_xfrm_features);
>> +
>> + netdev_features_set_array(&netif_f_tls_feature_set,
>> + &netdev_tls_features);
>> +
>> + netdev_csum_gso_features_mask =
>> + netdev_features_or(netdev_gso_software_features,
>> + netdev_csum_features_mask);
>> +
>> + netdev_features_fill(&features);
>> + netdev_ethtool_features =
>> + netdev_features_andnot(features, netdev_never_change_features);
>> +}
>> +
>> /*
>> * Initialize the DEV module. At boot time this walks the device list and
>> * unhooks any devices that fail to initialise (normally hardware not
> --- 8< ---
>
>> --
>> 2.33.0
> Thanks,
> Al
>
> .
>
^ permalink raw reply
* Re: [PATCH] wwan_hwsim: Avoid flush_scheduled_work() usage
From: Loic Poulain @ 2022-04-20 9:53 UTC (permalink / raw)
To: Tetsuo Handa
Cc: Sergey Ryazanov, Johannes Berg, David S. Miller, Jakub Kicinski,
Paolo Abeni, Network Development
In-Reply-To: <0bc6443a-dbac-70ab-bf99-9a439e35f3ef@I-love.SAKURA.ne.jp>
Hi Tetsuo, Sergey,
On Wed, 20 Apr 2022 at 04:22, Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
>
> Flushing system-wide workqueues is dangerous and will be forbidden.
> Replace system_wq with local wwan_wq.
>
> Link: https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Could you add a 'Fixes' tag?
> ---
> Note: This patch is only compile tested. By the way, don't you want to call
> debugfs_remove(wwan_hwsim_debugfs_devcreate) at err_clean_devs label in
> wwan_hwsim_init() like wwan_hwsim_exit() does, for debugfs_create_file("devcreate")
> is called before "goto err_clean_devs" happens?
>
> drivers/net/wwan/wwan_hwsim.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wwan/wwan_hwsim.c b/drivers/net/wwan/wwan_hwsim.c
> index 5b62cf3b3c42..2136319f588f 100644
> --- a/drivers/net/wwan/wwan_hwsim.c
> +++ b/drivers/net/wwan/wwan_hwsim.c
> @@ -33,6 +33,7 @@ static struct dentry *wwan_hwsim_debugfs_devcreate;
> static DEFINE_SPINLOCK(wwan_hwsim_devs_lock);
> static LIST_HEAD(wwan_hwsim_devs);
> static unsigned int wwan_hwsim_dev_idx;
> +static struct workqueue_struct *wwan_wq;
>
> struct wwan_hwsim_dev {
> struct list_head list;
> @@ -371,7 +372,7 @@ static ssize_t wwan_hwsim_debugfs_portdestroy_write(struct file *file,
> * waiting this callback to finish in the debugfs_remove() call. So,
> * use workqueue.
> */
> - schedule_work(&port->del_work);
> + queue_work(wwan_wq, &port->del_work);
>
> return count;
> }
> @@ -416,7 +417,7 @@ static ssize_t wwan_hwsim_debugfs_devdestroy_write(struct file *file,
> * waiting this callback to finish in the debugfs_remove() call. So,
> * use workqueue.
> */
> - schedule_work(&dev->del_work);
> + queue_work(wwan_wq, &dev->del_work);
>
> return count;
> }
> @@ -506,9 +507,15 @@ static int __init wwan_hwsim_init(void)
> if (wwan_hwsim_devsnum < 0 || wwan_hwsim_devsnum > 128)
> return -EINVAL;
>
> + wwan_wq = alloc_workqueue("wwan_wq", 0, 0);
> + if (!wwan_wq)
> + return -ENOMEM;
> +
> wwan_hwsim_class = class_create(THIS_MODULE, "wwan_hwsim");
> - if (IS_ERR(wwan_hwsim_class))
> + if (IS_ERR(wwan_hwsim_class)) {
> + destroy_workqueue(wwan_wq);
> return PTR_ERR(wwan_hwsim_class);
> + }
>
> wwan_hwsim_debugfs_topdir = debugfs_create_dir("wwan_hwsim", NULL);
> wwan_hwsim_debugfs_devcreate =
> @@ -524,6 +531,7 @@ static int __init wwan_hwsim_init(void)
>
> err_clean_devs:
> wwan_hwsim_free_devs();
> + destroy_workqueue(wwan_wq);
> debugfs_remove(wwan_hwsim_debugfs_topdir);
> class_destroy(wwan_hwsim_class);
>
> @@ -534,7 +542,7 @@ static void __exit wwan_hwsim_exit(void)
> {
> debugfs_remove(wwan_hwsim_debugfs_devcreate); /* Avoid new devs */
> wwan_hwsim_free_devs();
> - flush_scheduled_work(); /* Wait deletion works completion */
> + destroy_workqueue(wwan_wq); /* Wait deletion works completion */
Wouldn't it be simpler to just remove the flush call. It Looks like
all ports have been removed at that point, and all works cancelled,
right?
> debugfs_remove(wwan_hwsim_debugfs_topdir);
> class_destroy(wwan_hwsim_class);
> }
> --
> 2.32.0
Regards,
Loic
^ permalink raw reply
* Re: [PATCH] driver: usb: nullify dangling pointer in cdc_ncm_free
From: Oliver Neukum @ 2022-04-20 9:45 UTC (permalink / raw)
To: Johan Hovold, Oliver Neukum
Cc: Andy Shevchenko, Oleksij Rempel, Dongliang Mu, Oliver Neukum,
David S. Miller, Jakub Kicinski, Paolo Abeni, Dongliang Mu,
syzbot+eabbf2aaa999cc507108, USB, netdev,
Linux Kernel Mailing List
In-Reply-To: <Yl+utFmKEgILDFr5@hovoldconsulting.com>
On 20.04.22 08:56, Johan Hovold wrote:
>
>>
>> @@ -1214,7 +1214,7 @@ static const struct driver_info hawking_uf200_info = {
>> static const struct driver_info ax88772_info = {
>> .description = "ASIX AX88772 USB 2.0 Ethernet",
>> .bind = ax88772_bind,
>> - .unbind = ax88772_unbind,
>> + .unbind = ax88772_disable,
> These should all be
>
> .disable = ...
Thanks, noted.
>
> but you probably need to split the callback and keep unbind as well for
> the actual clean up (freeing resources etc).
That is the driver the problematic commit was requested for.
I am looking into it.
>
>> - if (dev->driver_info->unbind)
>> - dev->driver_info->unbind(dev, intf);
>> + if (dev->driver_info->disable)
>> + dev->driver_info->disable(dev, intf);
>>
>> net = dev->net;
>> unregister_netdev (net);
>> @@ -1651,6 +1651,9 @@ void usbnet_disconnect (struct usb_interface *intf)
>>
>> usb_scuttle_anchored_urbs(&dev->deferred);
>>
>> + if (dev->driver_info->unbind)
>> + dev->driver_info->unbind (dev, intf);
>> +
>> usb_kill_urb(dev->interrupt);
> Don't you need to quiesce all I/O, including stopping the interrupt URB,
> before unbind?
If I do that, how do I prevent people from relaunching the URB between
kill and unbind? Do I need to poison it?
Regards
Oliver
^ permalink raw reply
* Re: [PATCH net-next 0/6] DSA cross-chip notifier cleanups
From: patchwork-bot+netdevbpf @ 2022-04-20 9:40 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, kuba, davem, pabeni, f.fainelli, andrew, vivien.didelot,
olteanv
In-Reply-To: <20220415154626.345767-1-vladimir.oltean@nxp.com>
Hello:
This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Fri, 15 Apr 2022 18:46:20 +0300 you wrote:
> This patch set makes the following improvements:
>
> - Cross-chip notifiers pass a switch index, port index, sometimes tree
> index, all as integers. Sometimes we need to recover the struct
> dsa_port based on those integers. That recovery involves traversing a
> list. By passing directly a pointer to the struct dsa_port we can
> avoid that, and the indices passed previously can still be obtained
> from the passed struct dsa_port.
>
> [...]
Here is the summary with links:
- [net-next,1/6] net: dsa: move reset of VLAN filtering to dsa_port_switchdev_unsync_attrs
https://git.kernel.org/netdev/net-next/c/8e9e678e4758
- [net-next,2/6] net: dsa: make cross-chip notifiers more efficient for host events
https://git.kernel.org/netdev/net-next/c/726816a129cb
- [net-next,3/6] net: dsa: use dsa_tree_for_each_user_port in dsa_slave_change_mtu
https://git.kernel.org/netdev/net-next/c/b2033a05a719
- [net-next,4/6] net: dsa: avoid one dsa_to_port() in dsa_slave_change_mtu
https://git.kernel.org/netdev/net-next/c/cf1c39d3b3a5
- [net-next,5/6] net: dsa: drop dsa_slave_priv from dsa_slave_change_mtu
https://git.kernel.org/netdev/net-next/c/4715029fa7e9
- [net-next,6/6] net: dsa: don't emit targeted cross-chip notifiers for MTU change
https://git.kernel.org/netdev/net-next/c/be6ff9665d64
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ 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