* Re: [PATCH v5 0/3] adin: add support for clock output
From: Jakub Kicinski @ 2022-05-18 1:16 UTC (permalink / raw)
To: Josua Mayer; +Cc: netdev, alvaro.karsz
In-Reply-To: <20220517085143.3749-1-josua@solid-run.com>
On Tue, 17 May 2022 11:51:36 +0300 Josua Mayer wrote:
> This patch series adds support for configuring the two clock outputs of adin
> 1200 and 1300 PHYs. Certain network controllers require an external reference
> clock which can be provided by the PHY.
>
> One of the replies to v1 was asking why the common clock framework isn't used.
> Currently no PHY driver has implemented providing a clock to the network
> controller. Instead they rely on vendor extensions to make the appropriate
> configuration. For example ar8035 uses qca,clk-out-frequency - this patchset
> aimed to replicate the same functionality.
>
> Finally the 125MHz free-running clock is enabled in the device-tree for
> SolidRun i.MX6 SoMs, to support revisions 1.9 and later, where the original phy
> has been replaced with an adin 1300.
> To avoid introducing new warning messages during boot for SoMs before rev 1.9,
> the status field of the new phy node is disabled by default, and will be
> enabled by U-Boot on demand.
>
> Changes since v4:
> - removed recovered clock options
Acked-by: Jakub Kicinski <kuba@kernel.org>
Thanks!
^ permalink raw reply
* Re: [PATCH 12/12] RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter
From: kernel test robot @ 2022-05-18 1:14 UTC (permalink / raw)
To: longli, K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
Wei Liu, Dexuan Cui, David S. Miller, Jakub Kicinski, Paolo Abeni,
Jason Gunthorpe, Leon Romanovsky
Cc: llvm, kbuild-all, netdev, linux-hyperv, linux-kernel, linux-rdma,
Long Li
In-Reply-To: <1652778276-2986-13-git-send-email-longli@linuxonhyperv.com>
Hi,
I love your patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.18-rc7 next-20220517]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/longli-linuxonhyperv-com/Introduce-Microsoft-Azure-Network-Adapter-MANA-RDMA-driver/20220517-170632
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 42226c989789d8da4af1de0c31070c96726d990c
config: x86_64-randconfig-a002-20220516 (https://download.01.org/0day-ci/archive/20220518/202205180903.446J0L2Y-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 853fa8ee225edf2d0de94b0dcbd31bea916e825e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/f082dc68ab65c498c978d574e62413d50286b4f9
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review longli-linuxonhyperv-com/Introduce-Microsoft-Azure-Network-Adapter-MANA-RDMA-driver/20220517-170632
git checkout f082dc68ab65c498c978d574e62413d50286b4f9
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from <built-in>:1:
>> ./usr/include/rdma/mana-abi.h:12:10: fatal error: 'linux/mana/mana.h' file not found
#include <linux/mana/mana.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply
* Re: [PATCH net-next v2 1/9] net: skb: introduce __DEFINE_SKB_DROP_REASON() to simply the code
From: Jakub Kicinski @ 2022-05-18 1:14 UTC (permalink / raw)
To: menglong8.dong
Cc: edumazet, rostedt, mingo, davem, yoshfuji, dsahern, pabeni,
imagedong, kafai, talalahmad, keescook, dongli.zhang,
linux-kernel, netdev, Jiang Biao, Hao Peng
In-Reply-To: <20220517081008.294325-2-imagedong@tencent.com>
On Tue, 17 May 2022 16:10:00 +0800 menglong8.dong@gmail.com wrote:
> From: Menglong Dong <imagedong@tencent.com>
>
> It is annoying to add new skb drop reasons to 'enum skb_drop_reason'
> and TRACE_SKB_DROP_REASON in trace/event/skb.h, and it's easy to forget
> to add the new reasons we added to TRACE_SKB_DROP_REASON.
>
> TRACE_SKB_DROP_REASON is used to convert drop reason of type number
> to string. For now, the string we passed to user space is exactly the
> same as the name in 'enum skb_drop_reason' with a 'SKB_DROP_REASON_'
> prefix. So why not make them togather by define a macro?
>
> Therefore, introduce __DEFINE_SKB_DROP_REASON() and use it for 'enum
> skb_drop_reason' definition and string converting.
>
> Now, what should we with the document for the reasons? How about follow
> __BPF_FUNC_MAPPER() and make these document togather?
Hi, I know BPF does this but I really find the definition-by-macro
counter productive :(
kdoc will no longer work right because the parser will not see
the real values. cscope and other code indexers will struggle
to find definitions.
Did you investigate using auto-generation? Kernel already generates
a handful of headers. Maybe with a little script we could convert
the enum into the string thing at build time?
Also let's use this opportunity to move the enum to a standalone
header, it's getting huge.
Probably worth keeping this rework separate from the TCP patches.
Up to you which one you'd like to get done first.
^ permalink raw reply
* Re: [PATCH wpan-next v2 09/11] net: mac802154: Introduce a synchronous API for MLME commands
From: Alexander Aring @ 2022-05-18 1:14 UTC (permalink / raw)
To: Miquel Raynal
Cc: Alexander Aring, Stefan Schmidt, linux-wpan - ML, David S. Miller,
Jakub Kicinski, Paolo Abeni, Network Development, David Girault,
Romuald Despres, Frederic Blain, Nicolas Schodet,
Thomas Petazzoni
In-Reply-To: <20220517153045.73fda4ee@xps-13>
Hi,
On Tue, May 17, 2022 at 9:30 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
>
> aahringo@redhat.com wrote on Sun, 15 May 2022 19:03:53 -0400:
>
> > Hi,
> >
> > On Sun, May 15, 2022 at 6:28 PM Alexander Aring <aahringo@redhat.com> wrote:
> > >
> > > Hi,
> > >
> > > On Thu, May 12, 2022 at 10:34 AM Miquel Raynal
> > > <miquel.raynal@bootlin.com> wrote:
> > > >
> > > > This is the slow path, we need to wait for each command to be processed
> > > > before continuing so let's introduce an helper which does the
> > > > transmission and blocks until it gets notified of its asynchronous
> > > > completion. This helper is going to be used when introducing scan
> > > > support.
> > > >
> > > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > > > ---
> > > > net/mac802154/ieee802154_i.h | 1 +
> > > > net/mac802154/tx.c | 25 +++++++++++++++++++++++++
> > > > 2 files changed, 26 insertions(+)
> > > >
> > > > diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
> > > > index a057827fc48a..f8b374810a11 100644
> > > > --- a/net/mac802154/ieee802154_i.h
> > > > +++ b/net/mac802154/ieee802154_i.h
> > > > @@ -125,6 +125,7 @@ extern struct ieee802154_mlme_ops mac802154_mlme_wpan;
> > > > void ieee802154_rx(struct ieee802154_local *local, struct sk_buff *skb);
> > > > void ieee802154_xmit_sync_worker(struct work_struct *work);
> > > > int ieee802154_sync_and_hold_queue(struct ieee802154_local *local);
> > > > +int ieee802154_mlme_tx(struct ieee802154_local *local, struct sk_buff *skb);
> > > > netdev_tx_t
> > > > ieee802154_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev);
> > > > netdev_tx_t
> > > > diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
> > > > index 38f74b8b6740..ec8d872143ee 100644
> > > > --- a/net/mac802154/tx.c
> > > > +++ b/net/mac802154/tx.c
> > > > @@ -128,6 +128,31 @@ int ieee802154_sync_and_hold_queue(struct ieee802154_local *local)
> > > > return ieee802154_sync_queue(local);
> > > > }
> > > >
> > > > +int ieee802154_mlme_tx(struct ieee802154_local *local, struct sk_buff *skb)
> > > > +{
> > > > + int ret;
> > > > +
> > > > + /* Avoid possible calls to ->ndo_stop() when we asynchronously perform
> > > > + * MLME transmissions.
> > > > + */
> > > > + rtnl_lock();
> > >
> > > I think we should make an ASSERT_RTNL() here, the lock needs to be
> > > earlier than that over the whole MLME op. MLME can trigger more than
> >
> > not over the whole MLME_op, that's terrible to hold the rtnl lock so
> > long... so I think this is fine that some netdev call will interfere
> > with this transmission.
> > So forget about the ASSERT_RTNL() here, it's fine (I hope).
> >
> > > one message, the whole sync_hold/release queue should be earlier than
> > > that... in my opinion is it not right to allow other messages so far
> > > an MLME op is going on? I am not sure what the standard says to this,
> > > but I think it should be stopped the whole time? All those sequence
> >
> > Whereas the stop of the netdev queue makes sense for the whole mlme-op
> > (in my opinion).
>
> I might still implement an MLME pre/post helper and do the queue
> hold/release calls there, while only taking the rtnl from the _tx.
>
> And I might create an mlme_tx_one() which does the pre/post calls as
> well.
>
> Would something like this fit?
I think so, I've heard for some transceiver types a scan operation can
take hours... but I guess whoever triggers that scan in such an
environment knows that it has some "side-effects"...
- Alex
^ permalink raw reply
* Re: [PATCH net v2] NFC: nci: fix sleep in atomic context bugs caused by nci_skb_alloc
From: patchwork-bot+netdevbpf @ 2022-05-18 1:10 UTC (permalink / raw)
To: Duoming Zhou
Cc: linux-kernel, kuba, krzysztof.kozlowski, davem, edumazet, pabeni,
gregkh, alexander.deucher, broonie, netdev
In-Reply-To: <20220517012530.75714-1-duoming@zju.edu.cn>
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 17 May 2022 09:25:30 +0800 you wrote:
> There are sleep in atomic context bugs when the request to secure
> element of st-nci is timeout. The root cause is that nci_skb_alloc
> with GFP_KERNEL parameter is called in st_nci_se_wt_timeout which is
> a timer handler. The call paths that could trigger bugs are shown below:
>
> (interrupt context 1)
> st_nci_se_wt_timeout
> nci_hci_send_event
> nci_hci_send_data
> nci_skb_alloc(..., GFP_KERNEL) //may sleep
>
> [...]
Here is the summary with links:
- [net,v2] NFC: nci: fix sleep in atomic context bugs caused by nci_skb_alloc
https://git.kernel.org/netdev/net/c/23dd4581350d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* Re: [PATCHv2 net-next] dn_route: set rt neigh to blackhole_netdev instead of loopback_dev in ifdown
From: patchwork-bot+netdevbpf @ 2022-05-18 1:10 UTC (permalink / raw)
To: Xin Long; +Cc: netdev, davem, kuba, edumazet
In-Reply-To: <0cdf10e5a4af509024f08644919121fb71645bc2.1652751029.git.lucien.xin@gmail.com>
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 16 May 2022 21:30:29 -0400 you wrote:
> Like other places in ipv4/6 dst ifdown, change to use blackhole_netdev
> instead of pernet loopback_dev in dn dst ifdown.
>
> v1->v2:
> - remove the improper fixes tag as Eric noticed.
> - aim at net-next.
>
> [...]
Here is the summary with links:
- [PATCHv2,net-next] dn_route: set rt neigh to blackhole_netdev instead of loopback_dev in ifdown
https://git.kernel.org/netdev/net-next/c/9cc341286e99
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* Re: [PATCHv2 net-next] dn_route: set rt neigh to blackhole_netdev instead of loopback_dev in ifdown
From: Jakub Kicinski @ 2022-05-18 1:04 UTC (permalink / raw)
To: Xin Long; +Cc: network dev, davem, Eric Dumazet
In-Reply-To: <0cdf10e5a4af509024f08644919121fb71645bc2.1652751029.git.lucien.xin@gmail.com>
On Mon, 16 May 2022 21:30:29 -0400 Xin Long wrote:
> Like other places in ipv4/6 dst ifdown, change to use blackhole_netdev
> instead of pernet loopback_dev in dn dst ifdown.
>
> v1->v2:
> - remove the improper fixes tag as Eric noticed.
> - aim at net-next.
nit for future patches - now that we add links to the posting when
applying you can put the changelog under the --- delimiter.
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
^ permalink raw reply
* Re: [PATCH net v6 1/2] ptp: ptp_clockmatrix: Add PTP_CLK_REQ_EXTTS support
From: patchwork-bot+netdevbpf @ 2022-05-18 1:00 UTC (permalink / raw)
To: Min Li; +Cc: richardcochran, lee.jones, linux-kernel, netdev
In-Reply-To: <1652712427-14703-1-git-send-email-min.li.xe@renesas.com>
Hello:
This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 16 May 2022 10:47:06 -0400 you wrote:
> Use TOD_READ_SECONDARY for extts to keep TOD_READ_PRIMARY
> for gettime and settime exclusively. Before this change,
> TOD_READ_PRIMARY was used for both extts and gettime/settime,
> which would result in changing TOD read/write triggers between
> operations. Using TOD_READ_SECONDARY would make extts
> independent of gettime/settime operation
>
> [...]
Here is the summary with links:
- [net,v6,1/2] ptp: ptp_clockmatrix: Add PTP_CLK_REQ_EXTTS support
https://git.kernel.org/netdev/net-next/c/bec67592521e
- [net,v6,2/2] ptp: ptp_clockmatrix: return -EBUSY if phase pull-in is in progress
https://git.kernel.org/netdev/net-next/c/7c7dcd66c5e0
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 wpan-next v2 10/11] net: mac802154: Add a warning in the hot path
From: Alexander Aring @ 2022-05-18 0:59 UTC (permalink / raw)
To: Miquel Raynal
Cc: Alexander Aring, Stefan Schmidt, linux-wpan - ML, David S. Miller,
Jakub Kicinski, Paolo Abeni, Network Development, David Girault,
Romuald Despres, Frederic Blain, Nicolas Schodet,
Thomas Petazzoni
In-Reply-To: <20220517165259.52ddf6fc@xps-13>
Hi,
On Tue, May 17, 2022 at 10:53 AM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
>
>
> miquel.raynal@bootlin.com wrote on Tue, 17 May 2022 15:36:55 +0200:
>
> > aahringo@redhat.com wrote on Sun, 15 May 2022 18:30:15 -0400:
> >
> > > Hi,
> > >
> > > On Thu, May 12, 2022 at 10:34 AM Miquel Raynal
> > > <miquel.raynal@bootlin.com> wrote:
> > > >
> > > > We should never start a transmission after the queue has been stopped.
> > > >
> > > > But because it might work we don't kill the function here but rather
> > > > warn loudly the user that something is wrong.
> > > >
> > > > Set an atomic when the queue will remain stopped. Reset this atomic when
> > > > the queue actually gets restarded. Just check this atomic to know if the
> > > > transmission is legitimate, warn if it is not.
> > > >
> > > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > > > ---
> > > > include/net/cfg802154.h | 1 +
> > > > net/mac802154/tx.c | 16 +++++++++++++++-
> > > > net/mac802154/util.c | 1 +
> > > > 3 files changed, 17 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h
> > > > index 8b6326aa2d42..a1370e87233e 100644
> > > > --- a/include/net/cfg802154.h
> > > > +++ b/include/net/cfg802154.h
> > > > @@ -218,6 +218,7 @@ struct wpan_phy {
> > > > struct mutex queue_lock;
> > > > atomic_t ongoing_txs;
> > > > atomic_t hold_txs;
> > > > + atomic_t queue_stopped;
> > >
> > > Maybe some test_bit()/set_bit() is better there?
> >
> > What do you mean? Shall I change the atomic_t type of queue_stopped?
> > Isn't the atomic_t preferred in this situation?
>
> Actually I re-read the doc and that's right, a regular unsigned long
Which doc is that?
- Alex
^ permalink raw reply
* [PATCH v2 net] net: bridge: Clear offload_fwd_mark when passing frame up bridge interface.
From: Andrew Lunn @ 2022-05-18 0:58 UTC (permalink / raw)
To: netdev
Cc: Nikolay Aleksandrov, Ido Schimmel, Vladimir Oltean, bridge,
Andrew Lunn
It is possible to stack bridges on top of each other. Consider the
following which makes use of an Ethernet switch:
br1
/ \
/ \
/ \
br0.11 wlan0
|
br0
/ | \
p1 p2 p3
br0 is offloaded to the switch. Above br0 is a vlan interface, for
vlan 11. This vlan interface is then a slave of br1. br1 also has a
wireless interface as a slave. This setup trunks wireless lan traffic
over the copper network inside a VLAN.
A frame received on p1 which is passed up to the bridge has the
skb->offload_fwd_mark flag set to true, indicating that the switch has
dealt with forwarding the frame out ports p2 and p3 as needed. This
flag instructs the software bridge it does not need to pass the frame
back down again. However, the flag is not getting reset when the frame
is passed upwards. As a result br1 sees the flag, wrongly interprets
it, and fails to forward the frame to wlan0.
When passing a frame upwards, clear the flag. This is the Rx
equivalent of br_switchdev_frame_unmark() in br_dev_xmit().
Fixes: f1c2eddf4cb6 ("bridge: switchdev: Use an helper to clear forward mark")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
v2:
Extended the commit message with Ido obsersation of the equivelance of
br_dev_xmit().
Fixed up the comment.
This code has passed Ido test setup.
net/bridge/br_input.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 196417859c4a..68b3e850bcb9 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -39,6 +39,13 @@ static int br_pass_frame_up(struct sk_buff *skb)
dev_sw_netstats_rx_add(brdev, skb->len);
vg = br_vlan_group_rcu(br);
+
+ /* Reset the offload_fwd_mark because there could be a stacked
+ * bridge above, and it should not think this bridge it doing
+ * that bridge's work forwarding out its ports.
+ */
+ br_switchdev_frame_unmark(skb);
+
/* Bridge is just like any other port. Make sure the
* packet is allowed except in promisc mode when someone
* may be running packet capture.
--
2.36.0
^ permalink raw reply related
* Re: [PATCH wpan-next v3 10/11] net: mac802154: Add a warning in the hot path
From: Alexander Aring @ 2022-05-18 0:58 UTC (permalink / raw)
To: Miquel Raynal
Cc: Alexander Aring, Stefan Schmidt, linux-wpan - ML, David Girault,
Romuald Despres, Frederic Blain, Nicolas Schodet,
Thomas Petazzoni, David S. Miller, Jakub Kicinski, Paolo Abeni,
Network Development
In-Reply-To: <20220517163450.240299-11-miquel.raynal@bootlin.com>
Hi,
On Tue, May 17, 2022 at 12:35 PM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
>
> We should never start a transmission after the queue has been stopped.
>
> But because it might work we don't kill the function here but rather
> warn loudly the user that something is wrong.
>
> Set an atomic when the queue will remain stopped. Reset this atomic when
> the queue actually gets restarded. Just check this atomic to know if the
> transmission is legitimate, warn if it is not.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> include/net/cfg802154.h | 1 +
> net/mac802154/tx.c | 16 +++++++++++++++-
> net/mac802154/util.c | 1 +
> 3 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h
> index 8881b6126b58..f4e7b3fe7cf0 100644
> --- a/include/net/cfg802154.h
> +++ b/include/net/cfg802154.h
> @@ -218,6 +218,7 @@ struct wpan_phy {
> spinlock_t queue_lock;
> atomic_t ongoing_txs;
> atomic_t hold_txs;
> + unsigned long queue_stopped;
Can we name it something like state_flags (as phy state flags)? Pretty
sure there will be more coming, or internal_flags, no idea...
something_flags...
> wait_queue_head_t sync_txq;
>
> char priv[] __aligned(NETDEV_ALIGN);
> diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
> index 6cc4e5c7ba94..e36aca788ea2 100644
> --- a/net/mac802154/tx.c
> +++ b/net/mac802154/tx.c
> @@ -123,9 +123,13 @@ static int ieee802154_sync_queue(struct ieee802154_local *local)
>
> int ieee802154_sync_and_hold_queue(struct ieee802154_local *local)
> {
> + int ret;
> +
> ieee802154_hold_queue(local);
> + ret = ieee802154_sync_queue(local);
> + set_bit(0, &local->phy->queue_stopped);
>
Define the 0 as WPAN_PHY_STATE_QUEUE_STOPPED_BIT or something like
that, above wpan_phy.
- Alex
^ permalink raw reply
* Re: [PATCH] sfc/siena: fix driver suspend/resume methods
From: Jakub Kicinski @ 2022-05-18 0:55 UTC (permalink / raw)
To: Peng Wu
Cc: davem, edumazet, hkallweit1, bhelgaas, netdev, linux-kernel,
liwei391
In-Reply-To: <20220517012334.122677-1-wupeng58@huawei.com>
On Tue, 17 May 2022 01:23:34 +0000 Peng Wu wrote:
> Fix the missing pci_disable_device() before return
> from efx_pm_resume() in the error handling case.
>
> Meanwhile, drivers should do this:
> .resume()
> pci_enable_device()
> .suspend()
> pci_disable_device()
>
> Signed-off-by: Peng Wu <wupeng58@huawei.com>
Won't the remove function no disable the device, anyway?
If the patch is indeed needed please add a Fixes tag pointing to where
the buggy code was added and repost.
Also since this file is a copy of drivers/net/ethernet/sfc/efx.c
I'm not sure why you're only patching this instance but not the
original.
^ permalink raw reply
* Re: [PATCH wpan-next v3 11/11] net: mac802154: Add a warning in the slow path
From: Alexander Aring @ 2022-05-18 0:52 UTC (permalink / raw)
To: Miquel Raynal
Cc: Alexander Aring, Stefan Schmidt, linux-wpan - ML, David Girault,
Romuald Despres, Frederic Blain, Nicolas Schodet,
Thomas Petazzoni, David S. Miller, Jakub Kicinski, Paolo Abeni,
Network Development
In-Reply-To: <20220517163450.240299-12-miquel.raynal@bootlin.com>
Hi,
On Tue, May 17, 2022 at 12:35 PM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
>
> In order to be able to detect possible conflicts between the net
> interface core and the ieee802154 core, let's add a warning in the slow
> path: we want to be sure that whenever we start an asynchronous MLME
> transmission (which can be fully asynchronous) the net core somehow
> agrees that this transmission is possible, ie. the device was not
> stopped. Warning in this case would allow us to track down more easily
> possible issues with the MLME logic if we ever get reports.
>
> Unlike in the hot path, such a situation cannot be handled.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> net/mac802154/tx.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
> index e36aca788ea2..53a8be822e33 100644
> --- a/net/mac802154/tx.c
> +++ b/net/mac802154/tx.c
> @@ -132,6 +132,25 @@ int ieee802154_sync_and_hold_queue(struct ieee802154_local *local)
> return ret;
> }
>
> +static bool ieee802154_netif_is_down(struct ieee802154_local *local)
> +{
> + struct ieee802154_sub_if_data *sdata;
> + bool is_down = true;
> +
> + rcu_read_lock();
> + list_for_each_entry_rcu(sdata, &local->interfaces, list) {
> + if (!sdata->dev)
> + continue;
> +
> + is_down = !(sdata->dev->flags & IFF_UP);
> + if (is_down)
> + break;
I thought that the helper would be "netif_running()". It seems there
are multiple ways to check if an interface is up.
> + }
> + rcu_read_unlock();
> +
> + return is_down;
> +}
> +
> static int ieee802154_mlme_op_pre(struct ieee802154_local *local)
> {
> return ieee802154_sync_and_hold_queue(local);
> @@ -150,6 +169,12 @@ static int ieee802154_mlme_tx(struct ieee802154_local *local, struct sk_buff *sk
> if (!local->open_count)
> return -EBUSY;
>
> + /* Warn if the ieee802154 core thinks MLME frames can be sent while the
> + * net interface expects this cannot happen.
> + */
> + if (WARN_ON_ONCE(ieee802154_netif_is_down(local)))
> + return -EHOSTDOWN;
maybe also ENETDOWN? Also there is a missing rtnl_unlock().
- Alex
^ permalink raw reply
* Re: [PATCH net-next v2 4/5] net: dt-bindings: Introduce the Qualcomm IPQESS Ethernet controller
From: Rob Herring @ 2022-05-18 0:52 UTC (permalink / raw)
To: Maxime Chevallier
Cc: davem, netdev, linux-kernel, devicetree, thomas.petazzoni,
Andrew Lunn, Florian Fainelli, Heiner Kallweit, Russell King,
linux-arm-kernel, Vladimir Oltean, Luka Perkov, Robert Marko
In-Reply-To: <20220514150656.122108-5-maxime.chevallier@bootlin.com>
On Sat, May 14, 2022 at 05:06:55PM +0200, Maxime Chevallier wrote:
> Add the DT binding for the IPQESS Ethernet Controller. This is a simple
> controller, only requiring the phy-mode, interrupts, clocks, and
> possibly a MAC address setting.
>
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> ---
> V1->V2:
> - Fixed the example
> - Added reset and clocks
> - Removed generic ethernet attributes
>
> .../devicetree/bindings/net/qcom,ipqess.yaml | 104 ++++++++++++++++++
> 1 file changed, 104 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/qcom,ipqess.yaml
>
> diff --git a/Documentation/devicetree/bindings/net/qcom,ipqess.yaml b/Documentation/devicetree/bindings/net/qcom,ipqess.yaml
> new file mode 100644
> index 000000000000..ea0023509737
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/qcom,ipqess.yaml
> @@ -0,0 +1,104 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/qcom,ipqess.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm IPQ ESS EDMA Ethernet Controller
> +
> +maintainers:
> + - Maxime Chevallier <maxime.chevallier@bootlin.com>
> +
> +allOf:
> + - $ref: "ethernet-controller.yaml#"
> +
> +properties:
> + compatible:
> + const: qcom,ipq4019e-ess-edma
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + minItems: 2
> + maxItems: 32
> + description: One interrupt per tx and rx queue, with up to 16 queues.
> +
> + clocks:
> + maxItems: 1
> +
> + clock-names:
> + const: ess
Always kind of pointless to have a single *-names entry when it's just
the block name.
> +
> + resets:
> + maxItems: 1
> +
> + reset-names:
> + const: ess
ditto
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> + - clock-names
> + - resets
> + - phy-mode
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/qcom,gcc-ipq4019.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> + gmac: ethernet@c080000 {
> + compatible = "qcom,ipq4019-ess-edma";
> + reg = <0xc080000 0x8000>;
> + resets = <&gcc ESS_RESET>;
> + reset-names = "ess";
> + clocks = <&gcc GCC_ESS_CLK>;
> + clock-names = "ess";
> + interrupts = <GIC_SPI 65 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 66 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 67 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 68 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 69 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 70 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 71 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 72 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 73 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 74 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 75 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 76 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 77 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 78 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 79 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 80 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 240 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 241 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 242 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 243 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 244 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 245 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 246 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 247 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 248 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 249 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 250 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 251 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 252 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 253 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 254 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 255 IRQ_TYPE_EDGE_RISING>;
> +
> + phy-mode = "internal";
> + fixed-link {
> + speed = <1000>;
> + full-duplex;
> + pause;
> + asym-pause;
> + };
> + };
> +
> +...
> --
> 2.36.1
>
>
^ permalink raw reply
* Re: [PATCH] net: thunderx: remove null check after call container_of()
From: patchwork-bot+netdevbpf @ 2022-05-18 0:50 UTC (permalink / raw)
To: Haowen Bai
Cc: sgoutham, davem, edumazet, kuba, pabeni, linux-arm-kernel, netdev,
linux-kernel
In-Reply-To: <1652696212-17516-1-git-send-email-baihaowen@meizu.com>
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 16 May 2022 18:16:52 +0800 you wrote:
> container_of() will never return NULL, so remove useless code.
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
> drivers/net/ethernet/cavium/thunder/nicvf_main.c | 3 ---
> 1 file changed, 3 deletions(-)
Here is the summary with links:
- net: thunderx: remove null check after call container_of()
https://git.kernel.org/netdev/net-next/c/ab4d6357c95f
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 linux-next] net: smc911x: replace ternary operator with min()
From: patchwork-bot+netdevbpf @ 2022-05-18 0:50 UTC (permalink / raw)
To: Guo Zhengkui
Cc: davem, edumazet, kuba, pabeni, colin.king, jiasheng, netdev,
linux-kernel, zhengkui_guo
In-Reply-To: <20220516115627.66363-1-guozhengkui@vivo.com>
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 16 May 2022 19:56:25 +0800 you wrote:
> Fix the following coccicheck warning:
>
> drivers/net/ethernet/smsc/smc911x.c:483:20-22: WARNING opportunity for min()
>
> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
> ---
> drivers/net/ethernet/smsc/smc911x.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [linux-next] net: smc911x: replace ternary operator with min()
https://git.kernel.org/netdev/net-next/c/5ff0348b7f75
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 -next] net: ethernet: sunplus: add missing of_node_put() in spl2sw_mdio_init()
From: Jakub Kicinski @ 2022-05-18 0:47 UTC (permalink / raw)
To: Yang Yingliang, wellslutw; +Cc: linux-kernel, netdev, andrew, pabeni, davem
In-Reply-To: <20220516143734.1598316-1-yangyingliang@huawei.com>
On Mon, 16 May 2022 22:37:34 +0800 Yang Yingliang wrote:
> of_get_child_by_name() returns device node pointer with refcount
> incremented. The refcount should be decremented before returning
> from spl2sw_mdio_init().
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Please add a Fixes tag, even if the change in question is only in
linux-next.
Wells Lu, the expectation for networking maintainers is that you will
review patches for your driver without 24, max 48 hours (not counting
weekends). Please respond with feedback or Acked-by / Reviewed-by tags
now that your driver has been merged. Thanks.
^ permalink raw reply
* Re: [Patch] net: af_key: check encryption module availability consistency
From: Jakub Kicinski @ 2022-05-18 0:44 UTC (permalink / raw)
To: Thomas Bartschies; +Cc: netdev@vger.kernel.org
In-Reply-To: <20220516125730.4446D160219F3@cvk027.cvk.de>
On Mon, 16 May 2022 14:57:30 +0200 (CEST) Thomas Bartschies wrote:
> Since the recent introduction supporting the SM3 and SM4 hash algos for IPsec, the kernel
> produces invalid pfkey acquire messages, when these encryption modules are disabled. This
> happens because the availability of the algos wasn't checked in all necessary functions.
> This patch adds these checks.
>
> Signed-off-by: Thomas Bartschies <thomas.bartschies@cvk.de>
This has not made it into patchwork.
Did you put the list on BCC or something? If so how would people
on the list see replies to this patch?
Please repost it with appropriate To: and CC: lists.
To: davem@davemloft.net
CC: everyone from scripts/get_maintainer
^ permalink raw reply
* Re: [PATCH wpan-next v3 09/11] net: mac802154: Introduce a synchronous API for MLME commands
From: Alexander Aring @ 2022-05-18 0:41 UTC (permalink / raw)
To: Miquel Raynal
Cc: Alexander Aring, Stefan Schmidt, linux-wpan - ML, David Girault,
Romuald Despres, Frederic Blain, Nicolas Schodet,
Thomas Petazzoni, David S. Miller, Jakub Kicinski, Paolo Abeni,
Network Development
In-Reply-To: <20220517163450.240299-10-miquel.raynal@bootlin.com>
Hi,
On Tue, May 17, 2022 at 12:35 PM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
>
> This is the slow path, we need to wait for each command to be processed
> before continuing so let's introduce an helper which does the
> transmission and blocks until it gets notified of its asynchronous
> completion. This helper is going to be used when introducing scan
> support.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> net/mac802154/ieee802154_i.h | 1 +
> net/mac802154/tx.c | 46 ++++++++++++++++++++++++++++++++++++
> 2 files changed, 47 insertions(+)
>
> diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
> index a057827fc48a..b42c6ac789f5 100644
> --- a/net/mac802154/ieee802154_i.h
> +++ b/net/mac802154/ieee802154_i.h
> @@ -125,6 +125,7 @@ extern struct ieee802154_mlme_ops mac802154_mlme_wpan;
> void ieee802154_rx(struct ieee802154_local *local, struct sk_buff *skb);
> void ieee802154_xmit_sync_worker(struct work_struct *work);
> int ieee802154_sync_and_hold_queue(struct ieee802154_local *local);
> +int ieee802154_mlme_tx_one(struct ieee802154_local *local, struct sk_buff *skb);
> netdev_tx_t
> ieee802154_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev);
> netdev_tx_t
> diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
> index 38f74b8b6740..6cc4e5c7ba94 100644
> --- a/net/mac802154/tx.c
> +++ b/net/mac802154/tx.c
> @@ -128,6 +128,52 @@ int ieee802154_sync_and_hold_queue(struct ieee802154_local *local)
> return ieee802154_sync_queue(local);
> }
>
> +static int ieee802154_mlme_op_pre(struct ieee802154_local *local)
> +{
> + return ieee802154_sync_and_hold_queue(local);
> +}
> +
> +static int ieee802154_mlme_tx(struct ieee802154_local *local, struct sk_buff *skb)
> +{
> + int ret;
> +
> + /* Avoid possible calls to ->ndo_stop() when we asynchronously perform
> + * MLME transmissions.
> + */
> + rtnl_lock();
> +
> + /* Ensure the device was not stopped, otherwise error out */
> + if (!local->open_count)
> + return -EBUSY;
> +
No -EBUSY here, use ?-ENETDOWN?. You forgot rtnl_unlock() here.
- Alex
^ permalink raw reply
* Re: [PATCH] net/qla3xxx: Fix a test in ql_reset_work()
From: patchwork-bot+netdevbpf @ 2022-05-18 0:40 UTC (permalink / raw)
To: Christophe JAILLET
Cc: GR-Linux-NIC-Dev, davem, edumazet, kuba, pabeni, akpm, ron.mercer,
netdev, linux-kernel, kernel-janitors
In-Reply-To: <80e73e33f390001d9c0140ffa9baddf6466a41a2.1652637337.git.christophe.jaillet@wanadoo.fr>
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Sun, 15 May 2022 20:07:02 +0200 you wrote:
> test_bit() tests if one bit is set or not.
> Here the logic seems to check of bit QL_RESET_PER_SCSI (i.e. 4) OR bit
> QL_RESET_START (i.e. 3) is set.
>
> In fact, it checks if bit 7 (4 | 3 = 7) is set, that is to say
> QL_ADAPTER_UP.
>
> [...]
Here is the summary with links:
- net/qla3xxx: Fix a test in ql_reset_work()
https://git.kernel.org/netdev/net/c/5361448e45fa
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 v3 0/2] net/smc: send and write inline optimization for smc
From: patchwork-bot+netdevbpf @ 2022-05-18 0:40 UTC (permalink / raw)
To: Guangguan Wang
Cc: kgraul, davem, edumazet, kuba, pabeni, leon, tonylu, linux-s390,
netdev, linux-kernel
In-Reply-To: <20220516055137.51873-1-guangguan.wang@linux.alibaba.com>
Hello:
This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 16 May 2022 13:51:35 +0800 you wrote:
> Send cdc msgs and write data inline if qp has sufficent inline
> space, helps latency reducing.
>
> In my test environment, which are 2 VMs running on the same
> physical host and whose NICs(ConnectX-4Lx) are working on
> SR-IOV mode, qperf shows 0.4us-1.3us improvement in latency.
>
> [...]
Here is the summary with links:
- [net-next,v3,1/2] net/smc: send cdc msg inline if qp has sufficient inline space
https://git.kernel.org/netdev/net-next/c/b632eb069732
- [net-next,v3,2/2] net/smc: rdma write inline if qp has sufficient inline space
https://git.kernel.org/netdev/net-next/c/793a7df63071
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 -next] octeontx2-pf: Use memset_startat() helper in otx2_stop()
From: patchwork-bot+netdevbpf @ 2022-05-18 0:40 UTC (permalink / raw)
To: Xiu Jianfeng
Cc: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
netdev, linux-kernel
In-Reply-To: <20220516092337.131653-1-xiujianfeng@huawei.com>
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 16 May 2022 17:23:37 +0800 you wrote:
> Use memset_startat() helper to simplify the code, there is no functional
> change in this patch.
>
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
> ---
> drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Here is the summary with links:
- [-next] octeontx2-pf: Use memset_startat() helper in otx2_stop()
https://git.kernel.org/netdev/net-next/c/76e1e5df4b7c
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: unexport csum_and_copy_{from,to}_user
From: Michael Ellerman @ 2022-05-18 0:39 UTC (permalink / raw)
To: Al Viro, Christoph Hellwig
Cc: akpm, x86, linux-alpha, linux-m68k, linuxppc-dev, linux-kernel,
netdev
In-Reply-To: <YoQcNkB6R/E3vf51@zeniv-ca.linux.org.uk>
Al Viro <viro@zeniv.linux.org.uk> writes:
> On Thu, Apr 21, 2022 at 09:04:40AM +0200, Christoph Hellwig wrote:
>> csum_and_copy_from_user and csum_and_copy_to_user are exported by
>> a few architectures, but not actually used in modular code. Drop
>> the exports.
>>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Acked-by: Al Viro <viro@zeniv.linux.org.uk>
>
> Not sure which tree should it go through - Arnd's, perhaps?
It's already in akpm's tree:
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?h=mm-nonmm-stable&id=6308499b5e99c0c903fde2c605e41d9a86c4be6c
cheers
^ permalink raw reply
* Re: [PATCH wpan-next v3 05/11] net: mac802154: Bring the ability to hold the transmit queue
From: Alexander Aring @ 2022-05-18 0:37 UTC (permalink / raw)
To: Miquel Raynal
Cc: Alexander Aring, Stefan Schmidt, linux-wpan - ML, David Girault,
Romuald Despres, Frederic Blain, Nicolas Schodet,
Thomas Petazzoni, David S. Miller, Jakub Kicinski, Paolo Abeni,
Network Development
In-Reply-To: <20220517163450.240299-6-miquel.raynal@bootlin.com>
Hi,
On Tue, May 17, 2022 at 12:35 PM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
>
> Create a hold_txs atomic variable and increment/decrement it when
> relevant, ie. when we want to hold the queue or release it: currently
> all the "stopped" situations are suitable, but very soon we will more
> extensively use this feature for MLME purposes.
>
> Upon release, the atomic counter is decremented and checked. If it is
> back to 0, then the netif queue gets woken up. This makes the whole
> process fully transparent, provided that all the users of
> ieee802154_wake/stop_queue() now call ieee802154_hold/release_queue()
> instead.
>
> In no situation individual drivers should call any of these helpers
> manually in order to avoid messing with the counters. There are other
> functions more suited for this purpose which have been introduced, such
> as the _xmit_complete() and _xmit_error() helpers which will handle all
> that for them.
>
> One advantage is that, as no more drivers call the stop/wake helpers
> directly, we can safely stop exporting them and only declare the
> hold/release ones in a header only accessible to the core.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> include/net/cfg802154.h | 6 +++--
> include/net/mac802154.h | 27 -------------------
> net/ieee802154/core.c | 2 ++
> net/mac802154/cfg.c | 4 +--
> net/mac802154/ieee802154_i.h | 19 +++++++++++++
> net/mac802154/tx.c | 6 ++---
> net/mac802154/util.c | 52 +++++++++++++++++++++++++++++++-----
> 7 files changed, 75 insertions(+), 41 deletions(-)
>
> diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h
> index 473ebcb9b155..7a191418f258 100644
> --- a/include/net/cfg802154.h
> +++ b/include/net/cfg802154.h
> @@ -11,7 +11,7 @@
>
> #include <linux/ieee802154.h>
> #include <linux/netdevice.h>
> -#include <linux/mutex.h>
> +#include <linux/spinlock.h>
> #include <linux/bug.h>
>
> #include <net/nl802154.h>
> @@ -214,8 +214,10 @@ struct wpan_phy {
> /* the network namespace this phy lives in currently */
> possible_net_t _net;
>
> - /* Transmission monitoring */
> + /* Transmission monitoring and control */
> + spinlock_t queue_lock;
> atomic_t ongoing_txs;
> + atomic_t hold_txs;
>
> char priv[] __aligned(NETDEV_ALIGN);
> };
> diff --git a/include/net/mac802154.h b/include/net/mac802154.h
> index bdac0ddbdcdb..357d25ef627a 100644
> --- a/include/net/mac802154.h
> +++ b/include/net/mac802154.h
> @@ -460,33 +460,6 @@ void ieee802154_unregister_hw(struct ieee802154_hw *hw);
> */
> void ieee802154_rx_irqsafe(struct ieee802154_hw *hw, struct sk_buff *skb,
> u8 lqi);
> -/**
> - * ieee802154_wake_queue - wake ieee802154 queue
> - * @hw: pointer as obtained from ieee802154_alloc_hw().
> - *
> - * Tranceivers usually have either one transmit framebuffer or one framebuffer
> - * for both transmitting and receiving. Hence, the core currently only handles
> - * one frame at a time for each phy, which means we had to stop the queue to
> - * avoid new skb to come during the transmission. The queue then needs to be
> - * woken up after the operation.
> - *
> - * Drivers should use this function instead of netif_wake_queue.
> - */
> -void ieee802154_wake_queue(struct ieee802154_hw *hw);
> -
> -/**
> - * ieee802154_stop_queue - stop ieee802154 queue
> - * @hw: pointer as obtained from ieee802154_alloc_hw().
> - *
> - * Tranceivers usually have either one transmit framebuffer or one framebuffer
> - * for both transmitting and receiving. Hence, the core currently only handles
> - * one frame at a time for each phy, which means we need to tell upper layers to
> - * stop giving us new skbs while we are busy with the transmitted one. The queue
> - * must then be stopped before transmitting.
> - *
> - * Drivers should use this function instead of netif_stop_queue.
> - */
> -void ieee802154_stop_queue(struct ieee802154_hw *hw);
>
> /**
> * ieee802154_xmit_complete - frame transmission complete
> diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c
> index de259b5170ab..47a4de6df88b 100644
> --- a/net/ieee802154/core.c
> +++ b/net/ieee802154/core.c
> @@ -130,6 +130,8 @@ wpan_phy_new(const struct cfg802154_ops *ops, size_t priv_size)
>
> init_waitqueue_head(&rdev->dev_wait);
>
> + spin_lock_init(&rdev->wpan_phy.queue_lock);
> +
> return &rdev->wpan_phy;
> }
> EXPORT_SYMBOL(wpan_phy_new);
> diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c
> index 1e4a9f74ed43..b51100fd9e3f 100644
> --- a/net/mac802154/cfg.c
> +++ b/net/mac802154/cfg.c
> @@ -46,7 +46,7 @@ static int ieee802154_suspend(struct wpan_phy *wpan_phy)
> if (!local->open_count)
> goto suspend;
>
> - ieee802154_stop_queue(&local->hw);
> + ieee802154_hold_queue(local);
> synchronize_net();
>
> /* stop hardware - this must stop RX */
> @@ -72,7 +72,7 @@ static int ieee802154_resume(struct wpan_phy *wpan_phy)
> return ret;
>
> wake_up:
> - ieee802154_wake_queue(&local->hw);
> + ieee802154_release_queue(local);
> local->suspended = false;
> return 0;
> }
> diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
> index a8b7b9049f14..0c7ff9e0b632 100644
> --- a/net/mac802154/ieee802154_i.h
> +++ b/net/mac802154/ieee802154_i.h
> @@ -130,6 +130,25 @@ netdev_tx_t
> ieee802154_subif_start_xmit(struct sk_buff *skb, struct net_device *dev);
> enum hrtimer_restart ieee802154_xmit_ifs_timer(struct hrtimer *timer);
>
> +/**
> + * ieee802154_hold_queue - hold ieee802154 queue
> + * @local: main mac object
> + *
> + * Hold a queue by incrementing an atomic counter and requesting the netif
> + * queues to be stopped. The queues cannot be woken up while the counter has not
> + * been reset with as any ieee802154_release_queue() calls as needed.
> + */
> +void ieee802154_hold_queue(struct ieee802154_local *local);
> +
> +/**
> + * ieee802154_release_queue - release ieee802154 queue
> + * @local: main mac object
> + *
> + * Release a queue which is held by decrementing an atomic counter and wake it
> + * up only if the counter reaches 0.
> + */
> +void ieee802154_release_queue(struct ieee802154_local *local);
> +
> /* MIB callbacks */
> void mac802154_dev_set_page_channel(struct net_device *dev, u8 page, u8 chan);
>
> diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
> index 33f64ecd96c7..6a53c83cf039 100644
> --- a/net/mac802154/tx.c
> +++ b/net/mac802154/tx.c
> @@ -43,7 +43,7 @@ void ieee802154_xmit_sync_worker(struct work_struct *work)
>
> err_tx:
> /* Restart the netif queue on each sub_if_data object. */
> - ieee802154_wake_queue(&local->hw);
> + ieee802154_release_queue(local);
> atomic_dec(&local->phy->ongoing_txs);
> kfree_skb(skb);
> netdev_dbg(dev, "transmission failed\n");
> @@ -75,7 +75,7 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
> }
>
> /* Stop the netif queue on each sub_if_data object. */
> - ieee802154_stop_queue(&local->hw);
> + ieee802154_hold_queue(local);
> atomic_inc(&local->phy->ongoing_txs);
>
> /* Drivers should preferably implement the async callback. In some rare
> @@ -99,7 +99,7 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
> return NETDEV_TX_OK;
>
> err_wake_netif_queue:
> - ieee802154_wake_queue(&local->hw);
> + ieee802154_release_queue(local);
> atomic_dec(&local->phy->ongoing_txs);
> err_free_skb:
> kfree_skb(skb);
> diff --git a/net/mac802154/util.c b/net/mac802154/util.c
> index 76dc663e2af4..6176cc40df91 100644
> --- a/net/mac802154/util.c
> +++ b/net/mac802154/util.c
> @@ -13,7 +13,17 @@
> /* privid for wpan_phys to determine whether they belong to us or not */
> const void *const mac802154_wpan_phy_privid = &mac802154_wpan_phy_privid;
>
> -void ieee802154_wake_queue(struct ieee802154_hw *hw)
> +/**
> + * ieee802154_wake_queue - wake ieee802154 queue
> + * @local: main mac object
> + *
> + * Tranceivers usually have either one transmit framebuffer or one framebuffer
> + * for both transmitting and receiving. Hence, the core currently only handles
> + * one frame at a time for each phy, which means we had to stop the queue to
> + * avoid new skb to come during the transmission. The queue then needs to be
> + * woken up after the operation.
> + */
> +static void ieee802154_wake_queue(struct ieee802154_hw *hw)
> {
> struct ieee802154_local *local = hw_to_local(hw);
> struct ieee802154_sub_if_data *sdata;
> @@ -27,9 +37,18 @@ void ieee802154_wake_queue(struct ieee802154_hw *hw)
> }
> rcu_read_unlock();
> }
> -EXPORT_SYMBOL(ieee802154_wake_queue);
>
> -void ieee802154_stop_queue(struct ieee802154_hw *hw)
> +/**
> + * ieee802154_stop_queue - stop ieee802154 queue
> + * @local: main mac object
> + *
> + * Tranceivers usually have either one transmit framebuffer or one framebuffer
> + * for both transmitting and receiving. Hence, the core currently only handles
> + * one frame at a time for each phy, which means we need to tell upper layers to
> + * stop giving us new skbs while we are busy with the transmitted one. The queue
> + * must then be stopped before transmitting.
> + */
> +static void ieee802154_stop_queue(struct ieee802154_hw *hw)
> {
> struct ieee802154_local *local = hw_to_local(hw);
> struct ieee802154_sub_if_data *sdata;
> @@ -43,14 +62,33 @@ void ieee802154_stop_queue(struct ieee802154_hw *hw)
> }
> rcu_read_unlock();
> }
> -EXPORT_SYMBOL(ieee802154_stop_queue);
> +
> +void ieee802154_hold_queue(struct ieee802154_local *local)
> +{
> + unsigned long flags;
> +
> + spin_lock_irqsave(&local->phy->queue_lock, flags);
> + ieee802154_stop_queue(&local->hw);
> + atomic_inc(&local->phy->hold_txs);
> + spin_unlock_irqrestore(&local->phy->queue_lock, flags);
> +}
I think that works, but I would expect something like:
if (!atomic_fetch_inc(hold_txs))
ieee802154_stop_queue(&local->hw);
- Alex
^ permalink raw reply
* Re: [RFC net-next] dt-bindings: net: xilinx: document xilinx emaclite driver binding
From: Rob Herring @ 2022-05-18 0:32 UTC (permalink / raw)
To: Radhey Shyam Pandey
Cc: davem, edumazet, kuba, pabeni, krzysztof.kozlowski+dt,
harini.katakam, netdev, devicetree, linux-kernel, git
In-Reply-To: <1652373596-5994-1-git-send-email-radhey.shyam.pandey@xilinx.com>
On Thu, May 12, 2022 at 10:09:56PM +0530, Radhey Shyam Pandey wrote:
> Add basic description for the xilinx emaclite driver DT bindings.
>
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> ---
> .../bindings/net/xlnx,emaclite.yaml | 60 +++++++++++++++++++
> 1 file changed, 60 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/xlnx,emaclite.yaml
>
> diff --git a/Documentation/devicetree/bindings/net/xlnx,emaclite.yaml b/Documentation/devicetree/bindings/net/xlnx,emaclite.yaml
> new file mode 100644
> index 000000000000..a3e2a0e89b24
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/xlnx,emaclite.yaml
> @@ -0,0 +1,60 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/xlnx,emaclite.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Xilinx Emaclite Ethernet controller
> +
> +maintainers:
> + - Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> + - Harini Katakam <harini.katakam@xilinx.com>
> +
> +properties:
> + compatible:
> + enum:
> + - xlnx,opb-ethernetlite-1.01.a
> + - xlnx,opb-ethernetlite-1.01.b
> + - xlnx,xps-ethernetlite-1.00.a
> + - xlnx,xps-ethernetlite-2.00.a
> + - xlnx,xps-ethernetlite-2.01.a
> + - xlnx,xps-ethernetlite-3.00.a
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + phy-handle: true
> +
> + local-mac-address: true
> +
> + xlnx,tx-ping-pong:
> + type: boolean
> + description: hardware supports tx ping pong buffer.
> +
> + xlnx,rx-ping-pong:
> + type: boolean
> + description: hardware supports rx ping pong buffer.
Are these based on IP version or configuration of IP?
Rob
^ 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