* [PATCH 1/5] staging: fsl-dpaa2/ethsw: remove unused structure
From: Ioana Ciornei @ 2019-07-29 16:11 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: netdev, davem, andrew, f.fainelli, jiri, Ioana Ciornei
In-Reply-To: <1564416712-16946-1-git-send-email-ioana.ciornei@nxp.com>
The dpsw_cfg structure is only used when creating a new dpsw DPAA2
object. In the DPAA2 architecture, objects are created at boot time by
the firmware or dynamically from userspace while drivers on the fsl-mc
bus only configure those objects.
Remove the structure since it's of no use.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
drivers/staging/fsl-dpaa2/ethsw/dpsw.h | 31 -------------------------------
1 file changed, 31 deletions(-)
diff --git a/drivers/staging/fsl-dpaa2/ethsw/dpsw.h b/drivers/staging/fsl-dpaa2/ethsw/dpsw.h
index 25635259ce44..0d9330e01915 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/dpsw.h
+++ b/drivers/staging/fsl-dpaa2/ethsw/dpsw.h
@@ -75,37 +75,6 @@ enum dpsw_component_type {
DPSW_COMPONENT_TYPE_S_VLAN
};
-/**
- * struct dpsw_cfg - DPSW configuration
- * @num_ifs: Number of external and internal interfaces
- * @adv: Advanced parameters; default is all zeros;
- * use this structure to change default settings
- * @adv.options: Enable/Disable DPSW features (bitmap)
- * @adv.max_vlans: Maximum Number of VLAN's; 0 - indicates default 16
- * @adv.max_meters_per_if: Number of meters per interface
- * @adv.max_fdbs: Maximum Number of FDB's; 0 - indicates default 16
- * @adv.max_fdb_entries: Number of FDB entries for default FDB table;
- * 0 - indicates default 1024 entries.
- * @adv.fdb_aging_time: Default FDB aging time for default FDB table;
- * 0 - indicates default 300 seconds
- * @adv.max_fdb_mc_groups: Number of multicast groups in each FDB table;
- * 0 - indicates default 32
- * @adv.component_type: Indicates the component type of this bridge
- */
-struct dpsw_cfg {
- u16 num_ifs;
- struct {
- u64 options;
- u16 max_vlans;
- u8 max_meters_per_if;
- u8 max_fdbs;
- u16 max_fdb_entries;
- u16 fdb_aging_time;
- u16 max_fdb_mc_groups;
- enum dpsw_component_type component_type;
- } adv;
-};
-
int dpsw_enable(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token);
--
1.9.1
^ permalink raw reply related
* [PATCH 0/5] staging: fsl-dpaa2/ethsw: add the .ndo_fdb_dump callback
From: Ioana Ciornei @ 2019-07-29 16:11 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: netdev, davem, andrew, f.fainelli, jiri, Ioana Ciornei
This patch set adds some features and small fixes in the
FDB table manipulation area.
First of all, we implement the .ndo_fdb_dump netdev callback so that all
offloaded FDB entries, either static or learnt, are available to the user.
This is necessary because the DPAA2 switch does not emit interrupts when a
new FDB is learnt or deleted, thus we are not able to keep the software
bridge state and the HW in sync by calling the switchdev notifiers.
The patch set also adds the .ndo_fdb_[add|del] callbacks in order to
facilitate adding FDB entries not associated with any master device.
One interesting thing that I observed is that when adding an FDB entry
associated with a bridge (ie using the 'master' keywork appended to the
bridge command) and then dumping the FDB entries, there will be duplicates
of the same entry: one listed by the bridge device and one by the
driver's .ndo_fdb_dump).
It raises the question whether this is the expected behavior or not.
Another concern is regarding the correct/desired machanism for drivers to
signal errors back to switchdev on adding or deleting an FDB entry.
In the switchdev documentation, there is a TODO in the place of this topic.
Ioana Ciornei (5):
staging: fsl-dpaa2/ethsw: remove unused structure
staging: fsl-dpaa2/ethsw: notify switchdev of offloaded entry
staging: fsl-dpaa2/ethsw: add .ndo_fdb_dump callback
staging: fsl-dpaa2/ethsw: check added_by_user flag
staging: fsl-dpaa2/ethsw: add .ndo_fdb[add|del] callbacks
drivers/staging/fsl-dpaa2/ethsw/TODO | 1 -
drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h | 15 ++-
drivers/staging/fsl-dpaa2/ethsw/dpsw.c | 51 +++++++++
drivers/staging/fsl-dpaa2/ethsw/dpsw.h | 56 ++++-----
drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 178 ++++++++++++++++++++++++++++-
5 files changed, 265 insertions(+), 36 deletions(-)
--
1.9.1
^ permalink raw reply
* Re: [PATCH net-next v3 2/4] enetc: Add mdio bus driver for the PCIe MDIO endpoint
From: Andrew Lunn @ 2019-07-29 15:35 UTC (permalink / raw)
To: Claudiu Manoil
Cc: David S . Miller, Rob Herring, Li Yang, alexandru.marginean,
netdev, devicetree, linux-arm-kernel, linux-kernel
In-Reply-To: <1564394627-3810-3-git-send-email-claudiu.manoil@nxp.com>
> + hw->port = pci_iomap(pdev, 0, 0);
> + if (!bus->priv) {
hw->port ??
Andrew
^ permalink raw reply
* Re: [PATCH net-next v3 4/4] arm64: dts: fsl: ls1028a: Enable eth port1 on the ls1028a QDS board
From: Andrew Lunn @ 2019-07-29 15:37 UTC (permalink / raw)
To: Claudiu Manoil
Cc: David S . Miller, Rob Herring, Li Yang, alexandru.marginean,
netdev, devicetree, linux-arm-kernel, linux-kernel
In-Reply-To: <1564394627-3810-5-git-send-email-claudiu.manoil@nxp.com>
On Mon, Jul 29, 2019 at 01:03:47PM +0300, Claudiu Manoil wrote:
> LS1028a has one Ethernet management interface. On the QDS board, the
> MDIO signals are multiplexed to either on-board AR8035 PHY device or
> to 4 PCIe slots allowing for SGMII cards.
> To enable the Ethernet ENETC Port 1, which can only be connected to a
> RGMII PHY, the multiplexer needs to be configured to route the MDIO to
> the AR8035 PHY. The MDIO/MDC routing is controlled by bits 7:4 of FPGA
> board config register 0x54, and value 0 selects the on-board RGMII PHY.
> The FPGA board config registers are accessible on the i2c bus, at address
> 0x66.
>
> The PF3 MDIO PCIe integrated endpoint device allows for centralized access
> to the MDIO bus. Add the corresponding devicetree node and set it to be
> the MDIO bus parent.
>
> Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
> Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
* Re: [PATCH net-next v3 3/4] dt-bindings: net: fsl: enetc: Add bindings for the central MDIO PCIe endpoint
From: Andrew Lunn @ 2019-07-29 15:36 UTC (permalink / raw)
To: Claudiu Manoil
Cc: David S . Miller, Rob Herring, Li Yang, alexandru.marginean,
netdev, devicetree, linux-arm-kernel, linux-kernel
In-Reply-To: <1564394627-3810-4-git-send-email-claudiu.manoil@nxp.com>
On Mon, Jul 29, 2019 at 01:03:46PM +0300, Claudiu Manoil wrote:
> The on-chip PCIe root complex that integrates the ENETC ethernet
> controllers also integrates a PCIe endpoint for the MDIO controller
> providing for centralized control of the ENETC mdio bus.
> Add bindings for this "central" MDIO Integrated PCIe Endpoint.
>
> Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
* [PULL] vhost,virtio: cleanups and fixes
From: Michael S. Tsirkin @ 2019-07-29 16:16 UTC (permalink / raw)
To: Linus Torvalds
Cc: kvm, virtualization, netdev, linux-kernel, eric.auger,
jean-philippe, jroedel, mst, namit, wei.w.wang
The following changes since commit 5f9e832c137075045d15cd6899ab0505cfb2ca4b:
Linus 5.3-rc1 (2019-07-21 14:05:38 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus
for you to fetch changes up to 73f628ec9e6bcc45b77c53fe6d0c0ec55eaf82af:
vhost: disable metadata prefetch optimization (2019-07-26 07:49:29 -0400)
----------------------------------------------------------------
virtio, vhost: bugfixes
Fixes in the iommu and balloon devices.
Disable the meta-data optimization for now - I hope we can get it fixed
shortly, but there's no point in making users suffer crashes while we
are working on that.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
----------------------------------------------------------------
Jean-Philippe Brucker (1):
iommu/virtio: Update to most recent specification
Michael S. Tsirkin (2):
balloon: fix up comments
vhost: disable metadata prefetch optimization
Wei Wang (1):
mm/balloon_compaction: avoid duplicate page removal
drivers/iommu/virtio-iommu.c | 40 ++++++++++++++++-------
drivers/vhost/vhost.h | 2 +-
include/uapi/linux/virtio_iommu.h | 32 ++++++++++--------
mm/balloon_compaction.c | 69 +++++++++++++++++++++++----------------
4 files changed, 89 insertions(+), 54 deletions(-)
^ permalink raw reply
* Re: [PATCH bpf-next v5 3/6] xdp: Add devmap_hash map type for looking up devices by hashed index
From: Jesper Dangaard Brouer @ 2019-07-29 16:16 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: Daniel Borkmann, Alexei Starovoitov, netdev, David Miller,
Jakub Kicinski, Björn Töpel, Yonghong Song, brouer
In-Reply-To: <156415721483.13581.2247227362994997536.stgit@alrua-x1>
On Fri, 26 Jul 2019 18:06:55 +0200
Toke Høiland-Jørgensen <toke@redhat.com> wrote:
> From: Toke Høiland-Jørgensen <toke@redhat.com>
>
> A common pattern when using xdp_redirect_map() is to create a device map
> where the lookup key is simply ifindex. Because device maps are arrays,
> this leaves holes in the map, and the map has to be sized to fit the
> largest ifindex, regardless of how many devices actually are actually
> needed in the map.
>
> This patch adds a second type of device map where the key is looked up
> using a hashmap, instead of being used as an array index. This allows maps
> to be densely packed, so they can be smaller.
>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
> Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
[...]
> +static inline struct hlist_head *dev_map_index_hash(struct bpf_dtab *dtab,
> + int idx)
> +{
> + return &dtab->dev_index_head[idx & (dtab->n_buckets - 1)];
> +}
I was about to complain about, that you are not using a pre-calculated
MASK value, instead of doing the -1 operation each time. But I looked
at the ASM code, and the LEA operation used does the -1 operation in
the same instruction, so I guess this makes no performance difference.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: [PATCH bpf-next v5 4/6] tools/include/uapi: Add devmap_hash BPF map type
From: Jesper Dangaard Brouer @ 2019-07-29 16:16 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: Daniel Borkmann, Alexei Starovoitov, netdev, David Miller,
Jakub Kicinski, Björn Töpel, Yonghong Song, brouer
In-Reply-To: <156415721611.13581.17123668393574840124.stgit@alrua-x1>
On Fri, 26 Jul 2019 18:06:56 +0200
Toke Høiland-Jørgensen <toke@redhat.com> wrote:
> From: Toke Høiland-Jørgensen <toke@redhat.com>
>
> This adds the devmap_hash BPF map type to the uapi headers in tools/.
>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
> Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: [PATCH bpf-next v5 5/6] tools/libbpf_probes: Add new devmap_hash type
From: Jesper Dangaard Brouer @ 2019-07-29 16:17 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: Daniel Borkmann, Alexei Starovoitov, netdev, David Miller,
Jakub Kicinski, Björn Töpel, Yonghong Song, brouer
In-Reply-To: <156415721733.13581.17824535343536163675.stgit@alrua-x1>
On Fri, 26 Jul 2019 18:06:57 +0200
Toke Høiland-Jørgensen <toke@redhat.com> wrote:
> From: Toke Høiland-Jørgensen <toke@redhat.com>
>
> This adds the definition for BPF_MAP_TYPE_DEVMAP_HASH to libbpf_probes.c in
> tools/lib/bpf.
>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
> Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: [PATCH bpf-next v5 6/6] tools: Add definitions for devmap_hash map type
From: Jesper Dangaard Brouer @ 2019-07-29 16:17 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: Daniel Borkmann, Alexei Starovoitov, netdev, David Miller,
Jakub Kicinski, Björn Töpel, Yonghong Song, brouer
In-Reply-To: <156415721858.13581.13229682989409553007.stgit@alrua-x1>
On Fri, 26 Jul 2019 18:06:58 +0200
Toke Høiland-Jørgensen <toke@redhat.com> wrote:
> From: Toke Høiland-Jørgensen <toke@redhat.com>
>
> This adds selftest and bpftool updates for the devmap_hash map type.
>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
From: Stefano Garzarella @ 2019-07-29 16:19 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: netdev, linux-kernel, Stefan Hajnoczi, David S. Miller,
virtualization, Jason Wang, kvm
In-Reply-To: <20190729114302-mutt-send-email-mst@kernel.org>
On Mon, Jul 29, 2019 at 11:49:02AM -0400, Michael S. Tsirkin wrote:
> On Mon, Jul 29, 2019 at 05:36:56PM +0200, Stefano Garzarella wrote:
> > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote:
> > > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote:
> > > > Since virtio-vsock was introduced, the buffers filled by the host
> > > > and pushed to the guest using the vring, are directly queued in
> > > > a per-socket list. These buffers are preallocated by the guest
> > > > with a fixed size (4 KB).
> > > >
> > > > The maximum amount of memory used by each socket should be
> > > > controlled by the credit mechanism.
> > > > The default credit available per-socket is 256 KB, but if we use
> > > > only 1 byte per packet, the guest can queue up to 262144 of 4 KB
> > > > buffers, using up to 1 GB of memory per-socket. In addition, the
> > > > guest will continue to fill the vring with new 4 KB free buffers
> > > > to avoid starvation of other sockets.
> > > >
> > > > This patch mitigates this issue copying the payload of small
> > > > packets (< 128 bytes) into the buffer of last packet queued, in
> > > > order to avoid wasting memory.
> > > >
> > > > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > > Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> > >
> > > This is good enough for net-next, but for net I think we
> > > should figure out how to address the issue completely.
> > > Can we make the accounting precise? What happens to
> > > performance if we do?
> > >
> >
> > In order to do more precise accounting maybe we can use the buffer size,
> > instead of payload size when we update the credit available.
> > In this way, the credit available for each socket will reflect the memory
> > actually used.
> >
> > I should check better, because I'm not sure what happen if the peer sees
> > 1KB of space available, then it sends 1KB of payload (using a 4KB
> > buffer).
> >
> > The other option is to copy each packet in a new buffer like I did in
> > the v2 [2], but this forces us to make a copy for each packet that does
> > not fill the entire buffer, perhaps too expensive.
> >
> > [2] https://patchwork.kernel.org/patch/10938741/
> >
> >
> > Thanks,
> > Stefano
>
> Interesting. You are right, and at some level the protocol forces copies.
>
> We could try to detect that the actual memory is getting close to
> admin limits and force copies on queued packets after the fact.
> Is that practical?
Yes, I think it is doable!
We can decrease the credit available with the buffer size queued, and
when the buffer size of packet to queue is bigger than the credit
available, we can copy it.
>
> And yes we can extend the credit accounting to include buffer size.
> That's a protocol change but maybe it makes sense.
Since we send to the other peer the credit available, maybe this
change can be backwards compatible (I'll check better this).
Thanks,
Stefano
^ permalink raw reply
* Re: [PATCH 0/5] staging: fsl-dpaa2/ethsw: add the .ndo_fdb_dump callback
From: Andrew Lunn @ 2019-07-29 16:35 UTC (permalink / raw)
To: Ioana Ciornei; +Cc: gregkh, linux-kernel, netdev, davem, f.fainelli, jiri
In-Reply-To: <1564416712-16946-1-git-send-email-ioana.ciornei@nxp.com>
On Mon, Jul 29, 2019 at 07:11:47PM +0300, Ioana Ciornei wrote:
> This patch set adds some features and small fixes in the
> FDB table manipulation area.
>
> First of all, we implement the .ndo_fdb_dump netdev callback so that all
> offloaded FDB entries, either static or learnt, are available to the user.
> This is necessary because the DPAA2 switch does not emit interrupts when a
> new FDB is learnt or deleted, thus we are not able to keep the software
> bridge state and the HW in sync by calling the switchdev notifiers.
>
> The patch set also adds the .ndo_fdb_[add|del] callbacks in order to
> facilitate adding FDB entries not associated with any master device.
>
> One interesting thing that I observed is that when adding an FDB entry
> associated with a bridge (ie using the 'master' keywork appended to the
> bridge command) and then dumping the FDB entries, there will be duplicates
> of the same entry: one listed by the bridge device and one by the
> driver's .ndo_fdb_dump).
> It raises the question whether this is the expected behavior or not.
DSA devices are the same, they don't provide an interrupt when a new
entry is added by the hardware. So we can have two entries, or just
the SW bridge entry, or just the HW entry, depending on ageing.
> Another concern is regarding the correct/desired machanism for drivers to
> signal errors back to switchdev on adding or deleting an FDB entry.
> In the switchdev documentation, there is a TODO in the place of this topic.
It used to be a two state prepare/commit transaction, but that was
changed a while back.
Maybe the DSA core code can give you ideas?
Andrew
^ permalink raw reply
* Re: [PATCH net-next] MAINTAINERS: Remove mailing-list entry for XDP (eXpress Data Path)
From: Jakub Kicinski @ 2019-07-29 16:37 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: xdp-newbies, netdev, bpf, ast, daniel, davem, john.fastabend
In-Reply-To: <156440259790.6123.1563221733550893420.stgit@carbon>
On Mon, 29 Jul 2019 14:16:37 +0200, Jesper Dangaard Brouer wrote:
> This removes the mailing list xdp-newbies@vger.kernel.org from the XDP
> kernel maintainers entry.
>
> Being in the kernel MAINTAINERS file successfully caused the list to
> receive kbuild bot warnings, syzbot reports and sometimes developer
> patches. The level of details in these messages, doesn't match the
> target audience of the XDP-newbies list. This is based on a survey on
> the mailing list, where 73% voted for removal from MAINTAINERS file.
>
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
^ permalink raw reply
* Re: [PATCH] net: ehea: Mark expected switch fall-through
From: Kees Cook @ 2019-07-29 16:38 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Douglas Miller, David S. Miller, netdev, linux-kernel,
Stephen Rothwell
In-Reply-To: <20190729003009.GA25425@embeddedor>
On Sun, Jul 28, 2019 at 07:30:09PM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warning:
>
> drivers/net/ethernet/ibm/ehea/ehea_main.c: In function 'ehea_mem_notifier':
> include/linux/printk.h:311:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
> printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/ibm/ehea/ehea_main.c:3253:3: note: in expansion of macro 'pr_info'
> pr_info("memory offlining canceled");
> ^~~~~~~
> drivers/net/ethernet/ibm/ehea/ehea_main.c:3256:2: note: here
> case MEM_ONLINE:
> ^~~~
>
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
> index 4138a8480347..cca71ba7a74a 100644
> --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
> +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
> @@ -3251,7 +3251,7 @@ static int ehea_mem_notifier(struct notifier_block *nb,
> switch (action) {
> case MEM_CANCEL_OFFLINE:
> pr_info("memory offlining canceled");
> - /* Fall through: re-add canceled memory block */
> + /* Fall through - re-add canceled memory block */
>
> case MEM_ONLINE:
> pr_info("memory is going online");
> --
> 2.22.0
>
--
Kees Cook
^ permalink raw reply
* Re: [PATCH] arcnet: com90xx: Mark expected switch fall-throughs
From: David Miller @ 2019-07-29 16:38 UTC (permalink / raw)
To: gustavo; +Cc: m.grzeschik, netdev, linux-kernel, sfr, keescook
In-Reply-To: <20190729110953.GA3048@embeddedor>
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Mon, 29 Jul 2019 06:09:53 -0500
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings (Building: powerpc allyesconfig):
...
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied.
^ permalink raw reply
* Re: [PATCH] arcnet: com90io: Mark expected switch fall-throughs
From: David Miller @ 2019-07-29 16:39 UTC (permalink / raw)
To: gustavo; +Cc: m.grzeschik, netdev, linux-kernel, sfr, keescook
In-Reply-To: <20190729111320.GA3193@embeddedor>
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Mon, 29 Jul 2019 06:13:20 -0500
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings (Building: powerpc allyesconfig):
...
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net: spider_net: Mark expected switch fall-through
From: Kees Cook @ 2019-07-29 16:39 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Ishizaki Kou, David S. Miller, netdev, linux-kernel,
Stephen Rothwell
In-Reply-To: <20190729003251.GA25556@embeddedor>
On Sun, Jul 28, 2019 at 07:32:51PM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warning:
>
> drivers/net/ethernet/toshiba/spider_net.c: In function 'spider_net_release_tx_chain':
> drivers/net/ethernet/toshiba/spider_net.c:783:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> if (!brutal) {
> ^
> drivers/net/ethernet/toshiba/spider_net.c:792:3: note: here
> case SPIDER_NET_DESCR_RESPONSE_ERROR:
> ^~~~
>
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> drivers/net/ethernet/toshiba/spider_net.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/toshiba/spider_net.c b/drivers/net/ethernet/toshiba/spider_net.c
> index 5b196ebfed49..0f346761a2b2 100644
> --- a/drivers/net/ethernet/toshiba/spider_net.c
> +++ b/drivers/net/ethernet/toshiba/spider_net.c
> @@ -788,6 +788,7 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
> /* fallthrough, if we release the descriptors
> * brutally (then we don't care about
> * SPIDER_NET_DESCR_CARDOWNED) */
> + /* Fall through */
>
> case SPIDER_NET_DESCR_RESPONSE_ERROR:
> case SPIDER_NET_DESCR_PROTECTION_ERROR:
> --
> 2.22.0
>
--
Kees Cook
^ permalink raw reply
* Re: [PATCH] arcnet: arc-rimi: Mark expected switch fall-throughs
From: David Miller @ 2019-07-29 16:39 UTC (permalink / raw)
To: gustavo; +Cc: m.grzeschik, netdev, linux-kernel, sfr, keescook
In-Reply-To: <20190729111550.GA3327@embeddedor>
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Mon, 29 Jul 2019 06:15:50 -0500
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings (Building: powerpc allyesconfig):
...
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] MAINTAINERS: Remove mailing-list entry for XDP (eXpress Data Path)
From: David Miller @ 2019-07-29 16:39 UTC (permalink / raw)
To: brouer
Cc: xdp-newbies, netdev, bpf, ast, daniel, jakub.kicinski,
john.fastabend
In-Reply-To: <156440259790.6123.1563221733550893420.stgit@carbon>
From: Jesper Dangaard Brouer <brouer@redhat.com>
Date: Mon, 29 Jul 2019 14:16:37 +0200
> This removes the mailing list xdp-newbies@vger.kernel.org from the XDP
> kernel maintainers entry.
>
> Being in the kernel MAINTAINERS file successfully caused the list to
> receive kbuild bot warnings, syzbot reports and sometimes developer
> patches. The level of details in these messages, doesn't match the
> target audience of the XDP-newbies list. This is based on a survey on
> the mailing list, where 73% voted for removal from MAINTAINERS file.
>
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
I'll apply this to 'net', thanks Jesper.
^ permalink raw reply
* Re: [PATCH] net/af_iucv: mark expected switch fall-throughs
From: Kees Cook @ 2019-07-29 16:39 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Julian Wiedmann, Ursula Braun, David S. Miller, linux-s390,
netdev, linux-kernel, Geert Uytterhoeven
In-Reply-To: <20190729145947.GA9494@embeddedor>
On Mon, Jul 29, 2019 at 09:59:47AM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> net/iucv/af_iucv.c: warning: this statement may fall
> through [-Wimplicit-fallthrough=]: => 537:3, 519:6, 2246:6, 510:6
>
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> net/iucv/af_iucv.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
> index 09e1694b6d34..ebb62a4ebe30 100644
> --- a/net/iucv/af_iucv.c
> +++ b/net/iucv/af_iucv.c
> @@ -512,7 +512,9 @@ static void iucv_sock_close(struct sock *sk)
> sk->sk_state = IUCV_DISCONN;
> sk->sk_state_change(sk);
> }
> - case IUCV_DISCONN: /* fall through */
> + /* fall through */
> +
> + case IUCV_DISCONN:
> sk->sk_state = IUCV_CLOSING;
> sk->sk_state_change(sk);
>
> @@ -525,8 +527,9 @@ static void iucv_sock_close(struct sock *sk)
> iucv_sock_in_state(sk, IUCV_CLOSED, 0),
> timeo);
> }
> + /* fall through */
>
> - case IUCV_CLOSING: /* fall through */
> + case IUCV_CLOSING:
> sk->sk_state = IUCV_CLOSED;
> sk->sk_state_change(sk);
>
> @@ -535,8 +538,9 @@ static void iucv_sock_close(struct sock *sk)
>
> skb_queue_purge(&iucv->send_skb_q);
> skb_queue_purge(&iucv->backlog_skb_q);
> + /* fall through */
>
> - default: /* fall through */
> + default:
> iucv_sever_path(sk, 1);
> }
>
> @@ -2247,10 +2251,10 @@ static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev,
> kfree_skb(skb);
> break;
> }
> - /* fall through and receive non-zero length data */
> + /* fall through - and receive non-zero length data */
> case (AF_IUCV_FLAG_SHT):
> /* shutdown request */
> - /* fall through and receive zero length data */
> + /* fall through - and receive zero length data */
> case 0:
> /* plain data frame */
> IUCV_SKB_CB(skb)->class = trans_hdr->iucv_hdr.class;
> --
> 2.22.0
>
--
Kees Cook
^ permalink raw reply
* Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
From: Stefano Garzarella @ 2019-07-29 16:41 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: netdev, linux-kernel, Stefan Hajnoczi, David S. Miller,
virtualization, Jason Wang, kvm
In-Reply-To: <20190729115904-mutt-send-email-mst@kernel.org>
On Mon, Jul 29, 2019 at 12:01:37PM -0400, Michael S. Tsirkin wrote:
> On Mon, Jul 29, 2019 at 05:36:56PM +0200, Stefano Garzarella wrote:
> > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote:
> > > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote:
> > > > Since virtio-vsock was introduced, the buffers filled by the host
> > > > and pushed to the guest using the vring, are directly queued in
> > > > a per-socket list. These buffers are preallocated by the guest
> > > > with a fixed size (4 KB).
> > > >
> > > > The maximum amount of memory used by each socket should be
> > > > controlled by the credit mechanism.
> > > > The default credit available per-socket is 256 KB, but if we use
> > > > only 1 byte per packet, the guest can queue up to 262144 of 4 KB
> > > > buffers, using up to 1 GB of memory per-socket. In addition, the
> > > > guest will continue to fill the vring with new 4 KB free buffers
> > > > to avoid starvation of other sockets.
> > > >
> > > > This patch mitigates this issue copying the payload of small
> > > > packets (< 128 bytes) into the buffer of last packet queued, in
> > > > order to avoid wasting memory.
> > > >
> > > > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > > Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> > >
> > > This is good enough for net-next, but for net I think we
> > > should figure out how to address the issue completely.
> > > Can we make the accounting precise? What happens to
> > > performance if we do?
> > >
> >
> > In order to do more precise accounting maybe we can use the buffer size,
> > instead of payload size when we update the credit available.
> > In this way, the credit available for each socket will reflect the memory
> > actually used.
> >
> > I should check better, because I'm not sure what happen if the peer sees
> > 1KB of space available, then it sends 1KB of payload (using a 4KB
> > buffer).
> > The other option is to copy each packet in a new buffer like I did in
> > the v2 [2], but this forces us to make a copy for each packet that does
> > not fill the entire buffer, perhaps too expensive.
> >
> > [2] https://patchwork.kernel.org/patch/10938741/
> >
>
> So one thing we can easily do is to under-report the
> available credit. E.g. if we copy up to 256bytes,
> then report just 256bytes for every buffer in the queue.
>
Ehm sorry, I got lost :(
Can you explain better?
Thanks,
Stefano
^ permalink raw reply
* Re: [PATCH] isdn: hfcsusb: Fix mISDN driver crash caused by transfer buffer on the stack
From: David Miller @ 2019-07-29 16:46 UTC (permalink / raw)
To: juliana.rodrigueiro; +Cc: isdn, netdev
In-Reply-To: <2635856.so0i2TFZOM@rocinante.m.i2n>
From: Juliana Rodrigueiro <juliana.rodrigueiro@intra2net.com>
Date: Mon, 29 Jul 2019 10:20:56 +0200
> @@ -1705,12 +1705,22 @@ static int
> setup_hfcsusb(struct hfcsusb *hw)
> {
> u_char b;
> + int ret;
> + void *dmabuf = kmalloc(sizeof(u_char), GFP_KERNEL);
Please order these local variable declarations from longest to shortest line.
Thank you.
^ permalink raw reply
* Re: [PATCH v3] net: sched: Fix a possible null-pointer dereference in dequeue_func()
From: David Miller @ 2019-07-29 16:47 UTC (permalink / raw)
To: baijiaju1990; +Cc: jhs, xiyou.wangcong, jiri, netdev, linux-kernel
In-Reply-To: <20190729082433.28981-1-baijiaju1990@gmail.com>
From: Jia-Ju Bai <baijiaju1990@gmail.com>
Date: Mon, 29 Jul 2019 16:24:33 +0800
> In dequeue_func(), there is an if statement on line 74 to check whether
> skb is NULL:
> if (skb)
>
> When skb is NULL, it is used on line 77:
> prefetch(&skb->end);
>
> Thus, a possible null-pointer dereference may occur.
>
> To fix this bug, skb->end is used when skb is not NULL.
>
> This bug is found by a static analysis tool STCheck written by us.
>
> Fixes: 76e3cc126bb2 ("codel: Controlled Delay AQM")
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Applied and queued up for -stable.
^ permalink raw reply
* Re: [PATCH] net: ag71xx: use resource_size for the ioremap size
From: David Miller @ 2019-07-29 16:48 UTC (permalink / raw)
To: dingxiang; +Cc: jcliburn, chris.snook, netdev, linux-kernel
In-Reply-To: <1564390882-28002-1-git-send-email-dingxiang@cmss.chinamobile.com>
From: Ding Xiang <dingxiang@cmss.chinamobile.com>
Date: Mon, 29 Jul 2019 17:01:22 +0800
> use resource_size to calcuate ioremap size and make
> the code simpler.
>
> Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
Applied to net-next.
^ permalink raw reply
* Re: [PATCH net v2] net: bridge: delete local fdb on device init failure
From: David Miller @ 2019-07-29 16:50 UTC (permalink / raw)
To: nikolay; +Cc: netdev, roopa, bridge, syzbot+88533dc8b582309bf3ee
In-Reply-To: <20190729092841.4260-1-nikolay@cumulusnetworks.com>
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Mon, 29 Jul 2019 12:28:41 +0300
> On initialization failure we have to delete the local fdb which was
> inserted due to the default pvid creation. This problem has been present
> since the inception of default_pvid. Note that currently there are 2 cases:
> 1) in br_dev_init() when br_multicast_init() fails
> 2) if register_netdevice() fails after calling ndo_init()
>
> This patch takes care of both since br_vlan_flush() is called on both
> occasions. Also the new fdb delete would be a no-op on normal bridge
> device destruction since the local fdb would've been already flushed by
> br_dev_delete(). This is not an issue for ports since nbp_vlan_init() is
> called last when adding a port thus nothing can fail after it.
>
> Reported-by: syzbot+88533dc8b582309bf3ee@syzkaller.appspotmail.com
> Fixes: 5be5a2df40f0 ("bridge: Add filtering support for default_pvid")
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> ---
> v2: reworded the commit message and comment so they're not plural, we're
> talking about a single bridge local fdb added on the init vlan creation
> of the default pvid
>
> Tested with the provided reproducer and can no longer trigger the leak.
> Also tested the br_multicast_init() failure manually by making it always
> return an error.
Applied and queued up for -stable, thank you.
^ 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