* Re: [PATCH net-next] bridge: multicast to unicast
From: Johannes Berg @ 2017-01-09 12:15 UTC (permalink / raw)
To: M. Braun, Linus Lüssing
Cc: netdev, bridge, linux-wireless, linux-kernel, David S . Miller,
Felix Fietkau
In-Reply-To: <6f5ec9f1-800a-2bc4-2f41-9d803343bb22@fami-braun.de>
On Mon, 2017-01-09 at 12:44 +0100, M. Braun wrote:
> Am 09.01.2017 um 09:08 schrieb Johannes Berg:
> > Does it make sense to implement the two in separate layers though?
> >
> > Clearly, this part needs to be implemented in the bridge layer due
> > to
> > the snooping knowledge, but the code is very similar to what
> > mac80211
> > has now.
>
> Does the bridge always know about all stations connected?
>
> That is bridge fdb entries (need to) expire so the bridge might
> "forget" a still-connected station not sending but only consuming
> broadcast traffic.
>
> E.g. there is a television broadcast station here that receives a
> video stream (via wifi, udp packets) and then airs it (dvb-t) but (on
> its own) would not send any data packet on wifi (static ip, etc.).
Ok, that I don't know. Somehow if you address a unicast packet there
the bridge has to make a decision - so it really should know? Would it
query the port somehow to see if the device is behind it, if getting a
packet for a station it forgot about?
> An other reason to implement this in mac80211 initially was that
> mac80211 could encapsulate broacast/multicast ethernet packtes in
> unicast A-MSDU packets in a way, so that the receiver would still see
> process ethernet packets (after conversion) but have unicast wifi
> frames. This cannot be done in bridge easily but one might want to
> add this later to mac80211.
Yes, DMG would have to be done in mac80211, but that's a lot clearer
case too since it requires negotiation functionality etc.
johannes
^ permalink raw reply
* RE: [PATCH v2 net-next] net:add one common config ARCH_WANT_RELAX_ORDER to support relax ordering.
From: maowenan @ 2017-01-09 12:07 UTC (permalink / raw)
To: maowenan, netdev@vger.kernel.org, jeffrey.t.kirsher@intel.com,
alexander.duyck@gmail.com
Cc: Dingtianhong, weiyongjun (A)
In-Reply-To: <1483939954-9864-1-git-send-email-maowenan@huawei.com>
> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On Behalf Of Mao Wenan
> Sent: Monday, January 09, 2017 1:33 PM
> To: netdev@vger.kernel.org; jeffrey.t.kirsher@intel.com;
> alexander.duyck@gmail.com
> Subject: [PATCH v2 net-next] net:add one common config
> ARCH_WANT_RELAX_ORDER to support relax ordering.
>
> Relax ordering(RO) is one feature of 82599 NIC, to enable this feature can
> enhance the performance for some cpu architecure, such as SPARC and so on.
> Currently it only supports one special cpu architecture(SPARC) in 82599 driver
> to enable RO feature, this is not very common for other cpu architecture which
> really needs RO feature.
> This patch add one common config CONFIG_ARCH_WANT_RELAX_ORDER to
> set RO feature, and should define CONFIG_ARCH_WANT_RELAX_ORDER in
> sparc Kconfig firstly.
>
> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> ---
> arch/Kconfig | 3 +++
> arch/sparc/Kconfig | 1 +
> drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 2 +-
> 3 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/Kconfig b/arch/Kconfig index 99839c2..bd04eac 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -781,4 +781,7 @@ config VMAP_STACK
> the stack to map directly to the KASAN shadow map using a formula
> that is incorrect if the stack is in vmalloc space.
>
> +config ARCH_WANT_RELAX_ORDER
> + bool
> +
> source "kernel/gcov/Kconfig"
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index cf4034c..68ac5c7
> 100644
> --- a/arch/sparc/Kconfig
> +++ b/arch/sparc/Kconfig
> @@ -44,6 +44,7 @@ config SPARC
> select CPU_NO_EFFICIENT_FFS
> select HAVE_ARCH_HARDENED_USERCOPY
> select PROVE_LOCKING_SMALL if PROVE_LOCKING
> + select ARCH_WANT_RELAX_ORDER
>
> config SPARC32
> def_bool !64BIT
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> index 094e1d6..c38d50c 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> @@ -350,7 +350,7 @@ s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw)
> }
> IXGBE_WRITE_FLUSH(hw);
>
> -#ifndef CONFIG_SPARC
> +#ifndef CONFIG_ARCH_WANT_RELAX_ORDER
> /* Disable relaxed ordering */
> for (i = 0; i < hw->mac.max_tx_queues; i++) {
> u32 regval;
> --
> 2.7.0
>
Hi Alex, Is there any improvement for this patch?
@Jeff, do you have any comments about this patch?
^ permalink raw reply
* Re: [PATCH v2 7/7] uapi: export all headers under uapi directories
From: Russell King - ARM Linux @ 2017-01-09 12:01 UTC (permalink / raw)
To: Nicolas Dichtel
Cc: arnd-r2nGTMty4D4, linux-mips-6z/3iImG2C8G8FEW9MqTrA,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
linux-ia64-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA, airlied-cv59FeDIM0c,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
sparclinux-u79uwXL29TY76Z2rM5mHXA,
linux-arch-u79uwXL29TY76Z2rM5mHXA,
linux-s390-u79uwXL29TY76Z2rM5mHXA,
linux-am33-list-H+wXaHxf7aLQT0dZR+AlfA,
linux-c6x-dev-jPsnJVOj+W6hPH1hqNUYSQ,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-hexagon-u79uwXL29TY76Z2rM5mHXA,
linux-sh-u79uwXL29TY76Z2rM5mHXA, coreteam-Cap9r6Oaw4JrovVCs/uTlw,
fcoe-devel-s9riP+hp16TNLxjTenLetw,
xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b,
linux-snps-arc-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-media-u79uwXL29TY76Z2rM5mHXA,
uclinux-h8-devel-5NWGOfrQmneRv+LV9MX5uooqe+aC9MnS,
linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw,
linux-kbuild-u79uwXL29TY76Z2rM5mHXA,
adi-buildroot-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-raid-u79uwXL29TY76Z2rM5mHXA, lin
In-Reply-To: <1483695839-18660-8-git-send-email-nicolas.dichtel-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
On Fri, Jan 06, 2017 at 10:43:59AM +0100, Nicolas Dichtel wrote:
> diff --git a/arch/arm/include/uapi/asm/Kbuild b/arch/arm/include/uapi/asm/Kbuild
> index 46a76cd6acb6..607f702c2d62 100644
> --- a/arch/arm/include/uapi/asm/Kbuild
> +++ b/arch/arm/include/uapi/asm/Kbuild
> @@ -1,23 +1,6 @@
> # UAPI Header export list
> include include/uapi/asm-generic/Kbuild.asm
>
> -header-y += auxvec.h
> -header-y += byteorder.h
> -header-y += fcntl.h
> -header-y += hwcap.h
> -header-y += ioctls.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += perf_regs.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += signal.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += unistd.h
> genhdr-y += unistd-common.h
> genhdr-y += unistd-oabi.h
> genhdr-y += unistd-eabi.h
Acked-by: Russell King <rmk+kernel-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply
* Re: [PATCH v2 1/7] arm: put types.h in uapi
From: Russell King - ARM Linux @ 2017-01-09 12:00 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linuxppc-dev, linux-kbuild, linux-mips, alsa-devel, linux-ia64,
linux-doc, airlied, linux-fbdev, dri-devel, linux-mtd, sparclinux,
linux-arch, linux-s390, linux-am33-list, linux-c6x-dev,
linux-rdma, linux-hexagon, linux-sh, coreteam, fcoe-devel,
xen-devel, linux-snps-arc, linux-media, uclinux-h8-devel,
adi-buildroot-devel, linux-raid, linux-m68k
In-Reply-To: <1990589.0aJHWbJK4F@wuerfel>
On Mon, Jan 09, 2017 at 12:33:02PM +0100, Arnd Bergmann wrote:
> On Friday, January 6, 2017 10:43:53 AM CET Nicolas Dichtel wrote:
> >
> > diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
> > index a53cdb8f068c..c48fee3d7b3b 100644
> > --- a/arch/arm/include/asm/types.h
> > +++ b/arch/arm/include/asm/types.h
> > @@ -1,40 +1,6 @@
> > #ifndef _ASM_TYPES_H
> > #define _ASM_TYPES_H
> >
> > -#include <asm-generic/int-ll64.h>
> ...
> > -#define __UINTPTR_TYPE__ unsigned long
> > -#endif
> > +#include <uapi/asm/types.h>
> >
> > #endif /* _ASM_TYPES_H */
> >
>
> Moving the file is correct as far as I can tell, but the extra
> #include is not necessary here, as the kernel will automatically
> search both arch/arm/include/ and arch/arm/include/uapi/.
Indeed, I'd like to see the include/asm file gone.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply
* Outlook Security Team Micorosof
From: Devaraj Veerasamy, Dr @ 2017-01-09 11:21 UTC (permalink / raw)
To: "\"NO-REPLY@WEBMAIL.NET""
MICROSOFT OUTLOOK anmälan
Din e-rutan konto behöver vara verifiera nu för oegentligheter finns i din e-box-konto eller kommer att blockera. Klicka här<https://mrswangjuan17.wixsite.com/webaccess2017> för att verifiera din e-postkonto och fil i ditt korrekta användarnamn och lösenord omedelbart
Outlook Security Team Micorosof
Tack.
Copyright © 2017 MIcrosoft OUtlook . Inc . All rights reserved.
^ permalink raw reply
* Re: [PATCH net-next] bridge: multicast to unicast
From: M. Braun @ 2017-01-09 11:44 UTC (permalink / raw)
To: Johannes Berg, Linus Lüssing
Cc: netdev, bridge, linux-wireless, linux-kernel, David S . Miller,
Felix Fietkau
In-Reply-To: <1483949336.17582.3.camel@sipsolutions.net>
Am 09.01.2017 um 09:08 schrieb Johannes Berg:
> Does it make sense to implement the two in separate layers though?
>
> Clearly, this part needs to be implemented in the bridge layer due to
> the snooping knowledge, but the code is very similar to what mac80211
> has now.
Does the bridge always know about all stations connected?
That is bridge fdb entries (need to) expire so the bridge might "forget"
a still-connected station not sending but only consuming broadcast traffic.
E.g. there is a television broadcast station here that receives a video
stream (via wifi, udp packets) and then airs it (dvb-t) but (on its own)
would not send any data packet on wifi (static ip, etc.).
An other reason to implement this in mac80211 initially was that
mac80211 could encapsulate broacast/multicast ethernet packtes in
unicast A-MSDU packets in a way, so that the receiver would still see
process ethernet packets (after conversion) but have unicast wifi
frames. This cannot be done in bridge easily but one might want to add
this later to mac80211.
Michael
^ permalink raw reply
* Re: [PATCH v2 0/7] uapi: export all headers under uapi directories
From: Arnd Bergmann @ 2017-01-09 11:33 UTC (permalink / raw)
To: linuxppc-dev, linux-kbuild
Cc: linux-mips, alsa-devel, linux-ia64, linux-doc, airlied,
linux-fbdev, dri-devel, linux-mtd, sparclinux, linux-arch,
linux-s390, linux-am33-list, linux-c6x-dev, linux-rdma,
linux-hexagon, linux-sh, coreteam, fcoe-devel, xen-devel,
linux-snps-arc, linux-media, uclinux-h8-devel,
adi-buildroot-devel, linux-raid, linux-m68k, openrisc,
Nicolas Dichtel, linux-metag, linux-arm-kernel, li
In-Reply-To: <1483695839-18660-1-git-send-email-nicolas.dichtel@6wind.com>
On Friday, January 6, 2017 10:43:52 AM CET Nicolas Dichtel wrote:
> Here is the v2 of this series. The first 5 patches are just cleanup: some
> exported headers were still under a non-uapi directory.
Since this is meant as a cleanup, I commented on this to point out a cleaner
way to do the same.
> The patch 6 was spotted by code review: there is no in-tree user of this
> functionality.
> The last patch remove the use of header-y. Now all files under an uapi
> directory are exported.
Very nice!
> asm is a bit special, most of architectures export asm/<arch>/include/uapi/asm
> only, but there is two exceptions:
> - cris which exports arch/cris/include/uapi/arch-v[10|32];
This is interesting, though not your problem. Maybe someone who understands
cris better can comment on this: How is the decision made about which of
the arch/user.h headers gets used? I couldn't find that in the sources,
but it appears to be based on kernel compile-time settings, which is
wrong for user space header files that should be independent of the kernel
config.
> - tile which exports arch/tile/include/uapi/arch.
> Because I don't know if the output of 'make headers_install_all' can be changed,
> I introduce subdir-y in Kbuild file. The headers_install_all target copies all
> asm/<arch>/include/uapi/asm to usr/include/asm-<arch> but
> arch/cris/include/uapi/arch-v[10|32] and arch/tile/include/uapi/arch are not
> prefixed (they are put asis in usr/include/). If it's acceptable to modify the
> output of 'make headers_install_all' to export asm headers in
> usr/include/asm-<arch>/asm, then I could remove this new subdir-y and exports
> everything under arch/<arch>/include/uapi/.
I don't know if anyone still uses "make headers_install_all", I suspect
distros these days all use "make headers_install", so it probably
doesn't matter much.
In case of cris, it should be easy enough to move all the contents of the
uapi/arch-*/*.h headers into the respective uapi/asm/*.h headers, they
only seem to be referenced from there.
For tile, I suspect that would not work as the arch/*.h headers are
apparently defined as interfaces for both user space and kernel.
> Note also that exported files for asm are a mix of files listed by:
> - include/uapi/asm-generic/Kbuild.asm;
> - arch/x86/include/uapi/asm/Kbuild;
> - arch/x86/include/asm/Kbuild.
> This complicates a lot the processing (arch/x86/include/asm/Kbuild is also
> used by scripts/Makefile.asm-generic).
>
> This series has been tested with a 'make headers_install' on x86 and a
> 'make headers_install_all'. I've checked the result of both commands.
>
> This patch is built against linus tree. I don't know if it should be
> made against antoher tree.
The series should probably get merged through the kbuild tree, but testing
it on mainline is fine here.
Arnd
^ permalink raw reply
* Re: [PATCH v2 3/7] nios2: put setup.h in uapi
From: Arnd Bergmann @ 2017-01-09 11:33 UTC (permalink / raw)
To: linuxppc-dev, linux-kbuild
Cc: Nicolas Dichtel, linux-mips, alsa-devel, linux-ia64, linux-doc,
airlied, linux-fbdev, dri-devel, linux-mtd, sparclinux,
linux-arch, linux-s390, linux-am33-list, linux-c6x-dev,
linux-rdma, linux-hexagon, linux-sh, coreteam, fcoe-devel,
xen-devel, linux-snps-arc, linux-media, uclinux-h8-devel,
adi-buildroot-devel, linux-raid, linux-m68k, o
In-Reply-To: <1483695839-18660-4-git-send-email-nicolas.dichtel@6wind.com>
On Friday, January 6, 2017 10:43:55 AM CET Nicolas Dichtel wrote:
> diff --git a/arch/nios2/include/uapi/asm/setup.h b/arch/nios2/include/uapi/asm/setup.h
> new file mode 100644
> index 000000000000..8d8285997ba8
> --- /dev/null
> +++ b/arch/nios2/include/uapi/asm/setup.h
> @@ -0,0 +1,6 @@
> +#ifndef _UAPI_ASM_NIOS2_SETUP_H
> +#define _UAPI_ASM_NIOS2_SETUP_H
> +
> +#include <asm-generic/setup.h>
> +
> +#endif /* _UAPI_ASM_NIOS2_SETUP_H */
>
This one is only a redirect to an asm-generic header, so it can be
removed completely and replaced with a line in the
arch/nios2/include/uapi/asm/ file:
generic-y += setup.h
Arnd
^ permalink raw reply
* Re: [PATCH v2 1/7] arm: put types.h in uapi
From: Arnd Bergmann @ 2017-01-09 11:33 UTC (permalink / raw)
To: linuxppc-dev, linux-kbuild
Cc: linux-mips, alsa-devel, linux-ia64, linux-doc, airlied,
linux-fbdev, dri-devel, linux-mtd, sparclinux, linux-arch,
linux-s390, linux-am33-list, linux-c6x-dev, linux-rdma,
linux-hexagon, linux-sh, coreteam, fcoe-devel, xen-devel,
linux-snps-arc, linux-media, uclinux-h8-devel,
adi-buildroot-devel, linux-raid, linux-m68k, openrisc,
Nicolas Dichtel, linux-metag, linux-arm-kernel, li
In-Reply-To: <1483695839-18660-2-git-send-email-nicolas.dichtel@6wind.com>
On Friday, January 6, 2017 10:43:53 AM CET Nicolas Dichtel wrote:
>
> diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
> index a53cdb8f068c..c48fee3d7b3b 100644
> --- a/arch/arm/include/asm/types.h
> +++ b/arch/arm/include/asm/types.h
> @@ -1,40 +1,6 @@
> #ifndef _ASM_TYPES_H
> #define _ASM_TYPES_H
>
> -#include <asm-generic/int-ll64.h>
...
> -#define __UINTPTR_TYPE__ unsigned long
> -#endif
> +#include <uapi/asm/types.h>
>
> #endif /* _ASM_TYPES_H */
>
Moving the file is correct as far as I can tell, but the extra
#include is not necessary here, as the kernel will automatically
search both arch/arm/include/ and arch/arm/include/uapi/.
The same applies to patches 2 and 4.
Arnd
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply
* Re: pull-request: mac80211 2017-01-06
From: Johannes Berg @ 2017-01-09 11:17 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-wireless
In-Reply-To: <20170106.162725.481874783893198568.davem@davemloft.net>
On Fri, 2017-01-06 at 16:27 -0500, David Miller wrote:
> From: Johannes Berg <johannes@sipsolutions.net>
> Date: Fri, 6 Jan 2017 13:37:20 +0100
>
> > Here's another fix for something I noticed while reviewing the code
> in
> > a new suggested patch that added another netlink socket destroy
> path.
> >
> > Since the new patch would otherwise cause conflicts, it might be
> good
> > to pull net or Linus's next RC containing it into net-next, if you
> can.
> >
> > Please pull and let me know if there's any problem.
>
> Pulled,
Thanks :)
> I'll try to get this moving into net-next over the weekend.
> Remind me about this early next week if that ends up slipping through
> the cracks.
Actually, I just got the new version of the other patch and it turns
out that it's not necessary since the context for that new bit is small
enough to not have included the difference - so since you haven't done
that yet, no need to bother, sorry I didn't realize that earlier.
johannes
^ permalink raw reply
* Re: drivers/net/wireless/intel/iwlwifi/pcie/trans.c: 2 * suspicious code ?
From: Luca Coelho @ 2017-01-09 11:16 UTC (permalink / raw)
To: David Binderman, johannes.berg@intel.com,
emmanuel.grumbach@intel.com, linuxwifi@intel.com,
kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <VI1PR08MB1022D85586276BFDE1125B539C630@VI1PR08MB1022.eurprd08.prod.outlook.com>
On Fri, 2017-01-06 at 17:47 +0000, David Binderman wrote:
> Hello there,
Hi David,
> 1.
>
> drivers/net/wireless/intel/iwlwifi/pcie/trans.c:2039:14: warning: decrement of a boolean expression [-Wbool-operation]
>
> Source code is
>
> txq->block--;
>
> Maybe someone got a bool and a int mixed up ?
>
> 2.
>
> drivers/net/wireless/intel/iwlwifi/pcie/trans.c:2045:14: warning: increment of a boolean expression [-Wbool-operation]
>
> Duplicate a few lines further down.
Emmanuel has fixed this in our internal tree and I'll be sending it out
together with our normal upstreaming process.
Thanks for reporting!
^ permalink raw reply
* Re: SIOCSIWFREQ while in NL80211_IFTYPE_STATION
From: Johannes Berg @ 2017-01-09 11:05 UTC (permalink / raw)
To: Jorge Ramirez, netdev-u79uwXL29TY76Z2rM5mHXA, Daniel Lezcano
Cc: linux-wireless
In-Reply-To: <f8e8b557-3e7b-cc1a-c31a-91f9d754e683-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
On Thu, 2017-01-05 at 15:38 +0100, Jorge Ramirez wrote:
> do you mean this?
>
> [jramirez@igloo ~ (debian-qcom-dragonboard410c-16.09-local $)]$ git
> diff
> diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
> index a4e8af3..c56bac5 100644
> --- a/net/wireless/wext-sme.c
> +++ b/net/wireless/wext-sme.c
> @@ -106,30 +106,7 @@ int cfg80211_mgd_wext_siwfreq(struct net_device
> *dev,
> goto out;
> }
>
> -
> wdev->wext.connect.channel = chan;
> -
> - /*
> - * SSID is not set, we just want to switch monitor channel,
> - * this is really just backward compatibility, if the SSID
> - * is set then we use the channel to select the BSS to use
> - * to connect to instead. If we were connected on another
> - * channel we disconnected above and reconnect below.
> - */
> - if (chan && !wdev->wext.connect.ssid_len) {
> - struct cfg80211_chan_def chandef = {
> - .width = NL80211_CHAN_WIDTH_20_NOHT,
> - .center_freq1 = freq,
> - };
> -
> - chandef.chan = ieee80211_get_channel(&rdev->wiphy, freq);
> - if (chandef.chan)
> - err = cfg80211_set_monitor_channel(rdev,
> &chandef);
> - else
> - err = -EINVAL;
> - goto out;
> - }
> -
> err = cfg80211_mgd_wext_connect(rdev, wdev);
> out:
> wdev_unlock(wdev);
Yeah. Frankly, I don't even understand that comment anymore - if the
interface is in managed mode, why set the monitor channel, it's not
monitoring? And if it's not in managed mode we don't get here.
>
>
> I tested the change above: we can now modify the channel/frequency
> when
> the SSID is not set in managed mode.
> When the SSID is set however iwconfig does not report any error but
> channel/frequency doesn't change.
>
> if you think this is acceptable I can submit a patch
I think it looks fine, though writing the commit message may be tricky
:)
johannes
^ permalink raw reply
* Re: [stable 4.4.y] ppp: defer netns reference release for ppp channel
From: Guillaume Nault @ 2017-01-09 10:47 UTC (permalink / raw)
To: Simon Arlott; +Cc: netdev
In-Reply-To: <75ccacc3-a4b4-21ac-aae4-2c8968215738@simon.arlott.org.uk>
On Mon, Nov 21, 2016 at 09:12:15PM +0000, Simon Arlott wrote:
> Please apply the following patch to linux-stable 4.4.y:
>
> commit 205e1e255c479f3fd77446415706463b282f94e4
> ppp: defer netns reference release for ppp channel
>
> This is already present in 4.8.y and fixes an issue with ppp channels
> that would otherwise cause a BUG() in ppp_pernet while a global ppp
> mutex is held, preventing further ppp connections from being
> established.
>
FYI, this is now fixed in linux-4.4.y (patch entered v4.4.40).
Regards,
Guillaume
^ permalink raw reply
* Re: [RFC PATCH 2/4] page_pool: basic implementation of page_pool
From: Vlastimil Babka @ 2017-01-09 10:43 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: linux-mm, Alexander Duyck, willemdebruijn.kernel, netdev,
john.fastabend, Saeed Mahameed, bjorn.topel, Alexei Starovoitov,
Tariq Toukan, Mel Gorman
In-Reply-To: <20170104120055.7b277609@redhat.com>
On 01/04/2017 12:00 PM, Jesper Dangaard Brouer wrote:
>
> On Tue, 3 Jan 2017 17:07:49 +0100 Vlastimil Babka <vbabka@suse.cz> wrote:
>
>> On 12/20/2016 02:28 PM, Jesper Dangaard Brouer wrote:
>>> The focus in this patch is getting the API around page_pool figured out.
>>>
>>> The internal data structures for returning page_pool pages is not optimal.
>>> This implementation use ptr_ring for recycling, which is known not to scale
>>> in case of multiple remote CPUs releasing/returning pages.
>>
>> Just few very quick impressions...
>>
>>> A bulking interface into the page allocator is also left for later. (This
>>> requires cooperation will Mel Gorman, who just send me some PoC patches for this).
>>> ---
> [...]
>>> diff --git a/include/linux/mm.h b/include/linux/mm.h
>>> index 4424784ac374..11b4d8fb280b 100644
>>> --- a/include/linux/mm.h
>>> +++ b/include/linux/mm.h
> [...]
>>> @@ -765,6 +766,11 @@ static inline void put_page(struct page *page)
>>> {
>>> page = compound_head(page);
>>>
>>> + if (PagePool(page)) {
>>> + page_pool_put_page(page);
>>> + return;
>>> + }
>>
>> Can't say I'm thrilled about a new page flag and a test in put_page().
>
> In patch 4/4, I'm scaling this back. Avoiding to modify the inlined
> put_page(), by letting refcnt reach zero and catching pages belonging to
> a page_pool in __free_pages_ok() and free_hot_cold_page(). (Result
> in being more dependent on page-refcnt and loosing some performance).
>
> Still needing a new page flag, or some other method of identifying when
> a page belongs to a page_pool.
I see. I guess if all page pool pages were order>0 compound pages, you
could hook this to the existing compound_dtor functionality instead.
>> I don't know the full life cycle here, but isn't it that these pages
>> will be specifically allocated and used in page pool aware drivers,
>> so maybe they can be also specifically freed there without hooking to
>> the generic page refcount mechanism?
>
> Drivers are already manipulating refcnt, to "splitup" the page (to
> save memory) for storing more RX frames per page. Which is something
> the page_pool still need to support. (XDP can request one page per
> packet and gain the direct recycle optimization and instead waste mem).
>
> Notice, a page_pool aware driver doesn't handle the "free-side". Free
> happens when the packet/page is being consumed, spliced or transmitted
> out another non-page_pool-aware NIC driver. An interresting case is
> packet-page waiting for DMA TX completion (on another NIC), thus need
> to async-store info on page_pool and DMA-addr.
>
> Could extend the SKB (with a page_pool pointer)... BUT it defeats the
> purpose of avoiding to allocate the SKB. E.g. in the cases where XDP
> takes the route-decision and transmit/forward the "raw"-page (out
> another NIC or into a "raw" socket), then we don't have a meta-data
> structure to store this info in. Thus, this info is stored in struct
> page.
OK.
>>> + */
>>> struct address_space *mapping; /* If low bit clear, points to
>>> * inode address_space, or NULL.
>>> * If page mapped as anonymous
>>> @@ -63,6 +69,7 @@ struct page {
>>> union {
>>> pgoff_t index; /* Our offset within mapping. */
>>> void *freelist; /* sl[aou]b first free object */
>>> + dma_addr_t dma_addr; /* used by page_pool */
>>> /* page_deferred_list().prev -- second tail page */
>>> };
>>>
>>> @@ -117,6 +124,8 @@ struct page {
>>> * avoid collision and false-positive PageTail().
>>> */
>>> union {
>>> + /* XXX: Idea reuse lru list, in page_pool to align with PCP */
>>> +
>>> struct list_head lru; /* Pageout list, eg. active_list
>>> * protected by zone_lru_lock !
>>> * Can be used as a generic list
>
> Guess, I can move it here, as the page cannot be on the LRU-list, while
> being used (or VMA mapped). Right?
Well typically the VMA mapped pages are those on the LRU list (anonymous
or file). But I don't suppose you will want memory reclaim to free your
pages, so seems lru field should be reusable for you.
>>> @@ -189,6 +198,8 @@ struct page {
>>> #endif
>>> #endif
>>> struct kmem_cache *slab_cache; /* SL[AU]B: Pointer to slab */
>>> + /* XXX: Sure page_pool will have no users of "private"? */
>>> + struct page_pool *pool;
>>> };
>>>
>>> #ifdef CONFIG_MEMCG
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4] rfkill: Add rfkill-any LED trigger
From: Johannes Berg @ 2017-01-09 10:39 UTC (permalink / raw)
To: Michał Kępień
Cc: David S . Miller,
Михаил Кринкин,
linux-wireless, netdev, linux-kernel
In-Reply-To: <20170106192027.GA756@kmp-mobile.hq.kempniu.pl>
> > Looks better, but
> >
> > > +static struct work_struct rfkill_any_work;
> >
> > At least on module exit you need to cancel this work.
>
> It is cancelled in rfkill_any_led_trigger_unregister(). It seemed
> fitting to do it this way as rfkill_any_work is initialized in
> rfkill_any_led_trigger_register(). And if CONFIG_RFKILL_LEDS=n,
> rfkill_any_work is neither initialized nor scheduled, so we should be
> good as well. Am I missing something?
No, I just missed that, sorry.
Applied the patch now.
johannes
^ permalink raw reply
* Re: [PATCH RFC 3/4] dt-bindings: correct marvell orion MDIO binding document
From: Mark Rutland @ 2017-01-09 10:31 UTC (permalink / raw)
To: Russell King
Cc: Thomas Petazzoni, Andrew Lunn, Jason Cooper, devicetree, netdev,
Rob Herring, Gregory Clement, Marcin Wojtas, linux-arm-kernel,
Sebastian Hesselbarth
In-Reply-To: <E1cPpAk-0005uJ-TM@rmk-PC.armlinux.org.uk>
On Sat, Jan 07, 2017 at 11:28:30AM +0000, Russell King wrote:
> Correct the Marvell Orion MDIO binding document to properly reflect the
> cases where an interrupt is present. Augment the examples to show this.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
This looks fine to me.
Acked-by: Mark Rutland <mark.rutland@arm.com>
Mark.
> ---
> .../devicetree/bindings/net/marvell-orion-mdio.txt | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/marvell-orion-mdio.txt b/Documentation/devicetree/bindings/net/marvell-orion-mdio.txt
> index 9417e54c26c0..ca733ff68ab9 100644
> --- a/Documentation/devicetree/bindings/net/marvell-orion-mdio.txt
> +++ b/Documentation/devicetree/bindings/net/marvell-orion-mdio.txt
> @@ -7,7 +7,10 @@ interface.
>
> Required properties:
> - compatible: "marvell,orion-mdio"
> -- reg: address and length of the SMI register
> +- reg: address and length of the MDIO registers. When an interrupt is
> + not present, the length is the size of the SMI register (4 bytes)
> + otherwise it must be 0x84 bytes to cover the interrupt control
> + registers.
>
> Optional properties:
> - interrupts: interrupt line number for the SMI error/done interrupt
> @@ -17,7 +20,7 @@ The child nodes of the MDIO driver are the individual PHY devices
> connected to this MDIO bus. They must have a "reg" property given the
> PHY address on the MDIO bus.
>
> -Example at the SoC level:
> +Example at the SoC level without an interrupt property:
>
> mdio {
> #address-cells = <1>;
> @@ -26,6 +29,16 @@ mdio {
> reg = <0xd0072004 0x4>;
> };
>
> +Example with an interrupt property:
> +
> +mdio {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + compatible = "marvell,orion-mdio";
> + reg = <0xd0072004 0x84>;
> + interrupts = <30>;
> +};
> +
> And at the board level:
>
> mdio {
> --
> 2.7.4
>
^ permalink raw reply
* [PATCH net-next v2 2/2] net/sched: act_csum: compute crc32c on SCTP packets
From: Davide Caratti @ 2017-01-09 10:24 UTC (permalink / raw)
To: Jamal Hadi Salim, David S . Miller, Nicolas Dichtel; +Cc: netdev
In-Reply-To: <cover.1483957003.git.dcaratti@redhat.com>
modify act_csum to compute crc32c on IPv4/IPv6 packets having SCTP in
their payload, and extend UAPI definitions accordingly.
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
---
include/uapi/linux/tc_act/tc_csum.h | 3 ++-
net/sched/act_csum.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/tc_act/tc_csum.h b/include/uapi/linux/tc_act/tc_csum.h
index 8ac8041..a11bb35 100644
--- a/include/uapi/linux/tc_act/tc_csum.h
+++ b/include/uapi/linux/tc_act/tc_csum.h
@@ -21,7 +21,8 @@ enum {
TCA_CSUM_UPDATE_FLAG_IGMP = 4,
TCA_CSUM_UPDATE_FLAG_TCP = 8,
TCA_CSUM_UPDATE_FLAG_UDP = 16,
- TCA_CSUM_UPDATE_FLAG_UDPLITE = 32
+ TCA_CSUM_UPDATE_FLAG_UDPLITE = 32,
+ TCA_CSUM_UPDATE_FLAG_SCTP = 64,
};
struct tc_csum {
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c
index a0edd80..e978ccd4 100644
--- a/net/sched/act_csum.c
+++ b/net/sched/act_csum.c
@@ -30,6 +30,7 @@
#include <net/tcp.h>
#include <net/udp.h>
#include <net/ip6_checksum.h>
+#include <net/sctp/checksum.h>
#include <net/act_api.h>
@@ -322,6 +323,25 @@ static int tcf_csum_ipv6_udp(struct sk_buff *skb, unsigned int ihl,
return 1;
}
+static int tcf_csum_sctp(struct sk_buff *skb, unsigned int ihl,
+ unsigned int ipl)
+{
+ struct sctphdr *sctph;
+
+ if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_SCTP)
+ return 1;
+
+ sctph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*sctph));
+ if (!sctph)
+ return 0;
+
+ sctph->checksum = sctp_compute_cksum(skb,
+ skb_network_offset(skb) + ihl);
+ skb->ip_summed = CHECKSUM_NONE;
+
+ return 1;
+}
+
static int tcf_csum_ipv4(struct sk_buff *skb, u32 update_flags)
{
const struct iphdr *iph;
@@ -365,6 +385,11 @@ static int tcf_csum_ipv4(struct sk_buff *skb, u32 update_flags)
ntohs(iph->tot_len), 1))
goto fail;
break;
+ case IPPROTO_SCTP:
+ if ((update_flags & TCA_CSUM_UPDATE_FLAG_SCTP) &&
+ !tcf_csum_sctp(skb, iph->ihl * 4, ntohs(iph->tot_len)))
+ goto fail;
+ break;
}
if (update_flags & TCA_CSUM_UPDATE_FLAG_IPV4HDR) {
@@ -481,6 +506,11 @@ static int tcf_csum_ipv6(struct sk_buff *skb, u32 update_flags)
pl + sizeof(*ip6h), 1))
goto fail;
goto done;
+ case IPPROTO_SCTP:
+ if ((update_flags & TCA_CSUM_UPDATE_FLAG_SCTP) &&
+ !tcf_csum_sctp(skb, hl, pl + sizeof(*ip6h)))
+ goto fail;
+ goto done;
default:
goto ignore_skb;
}
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v2 1/2] net/sched: Kconfig: select LIBCRC32C if NET_ACT_CSUM is selected
From: Davide Caratti @ 2017-01-09 10:24 UTC (permalink / raw)
To: Jamal Hadi Salim, David S . Miller, Nicolas Dichtel; +Cc: netdev
In-Reply-To: <cover.1483957003.git.dcaratti@redhat.com>
LIBCRC32C is needed to compute crc32c on SCTP packets.
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
---
net/sched/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index 87956a7..a9aa38d 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -707,6 +707,7 @@ config NET_ACT_SKBEDIT
config NET_ACT_CSUM
tristate "Checksum Updating"
depends on NET_CLS_ACT && INET
+ select LIBCRC32C
---help---
Say Y here to update some common checksum after some direct
packet alterations.
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v2 0/2] net/sched: act_csum: add support for SCTP checksum
From: Davide Caratti @ 2017-01-09 10:24 UTC (permalink / raw)
To: Jamal Hadi Salim, David S . Miller, Nicolas Dichtel; +Cc: netdev
This series extends current act_csum functionality to allow computation of
SCTP checksums. Patch 1 ensures LIBCRC32C will be selected if NET_ACT_CSUM
is selected. Patch 2 extends act_csum to handle IPPROTO_SCTP protocol in
IPv4/IPv6 header, and eventually compute the CRC32c value.
v2:
- style fix in tc_csum.h
- avoid nested if statement in act_csum.c
Davide Caratti (2):
net/sched: Kconfig: select LIBCRC32C if NET_ACT_CSUM is selected
net/sched: act_csum: compute crc32c on SCTP packets
include/uapi/linux/tc_act/tc_csum.h | 3 ++-
net/sched/Kconfig | 1 +
net/sched/act_csum.c | 30 ++++++++++++++++++++++++++++++
3 files changed, 33 insertions(+), 1 deletion(-)
--
2.7.4
^ permalink raw reply
* [patch net-next 4/5] mlxsw: spectrum: Fix order of commands in port remove function
From: Jiri Pirko @ 2017-01-09 10:25 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, arkadis
In-Reply-To: <1483957548-3531-1-git-send-email-jiri@resnulli.us>
From: Yotam Gigi <yotamg@mellanox.com>
Fix the order of the free directives to match the port init function
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index f4b8ba2..1f4fdce 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -2431,8 +2431,8 @@ static void __mlxsw_sp_port_remove(struct mlxsw_sp *mlxsw_sp, u8 local_port)
mlxsw_sp_port_dcb_fini(mlxsw_sp_port);
mlxsw_sp_port_swid_set(mlxsw_sp_port, MLXSW_PORT_SWID_DISABLED_PORT);
mlxsw_sp_port_module_unmap(mlxsw_sp, mlxsw_sp_port->local_port);
- free_percpu(mlxsw_sp_port->pcpu_stats);
kfree(mlxsw_sp_port->hw_stats.cache);
+ free_percpu(mlxsw_sp_port->pcpu_stats);
kfree(mlxsw_sp_port->untagged_vlans);
kfree(mlxsw_sp_port->active_vlans);
WARN_ON_ONCE(!list_empty(&mlxsw_sp_port->vports_list));
--
2.7.4
^ permalink raw reply related
* [patch net-next 5/5] mlxsw: spectrum: Change ENOTSUPP to EOPNOTSUPP
From: Jiri Pirko @ 2017-01-09 10:25 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, arkadis
In-Reply-To: <1483957548-3531-1-git-send-email-jiri@resnulli.us>
From: Yotam Gigi <yotamg@mellanox.com>
As ENOTSUPP is specific to NFS, change the return error value to
EOPNOTSUPP in various places in the mlxsw driver.
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 1f4fdce..d0e803f 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1193,7 +1193,7 @@ mlxsw_sp_port_add_cls_matchall_mirror(struct mlxsw_sp_port *mlxsw_sp_port,
if (!mlxsw_sp_port_dev_check(to_dev)) {
netdev_err(mlxsw_sp_port->dev, "Cannot mirror to a non-spectrum port");
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
}
to_port = netdev_priv(to_dev);
@@ -1229,7 +1229,7 @@ static int mlxsw_sp_port_add_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
if (!tc_single_action(cls->exts)) {
netdev_err(mlxsw_sp_port->dev, "only singular actions are supported\n");
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
}
mall_tc_entry = kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL);
@@ -1309,7 +1309,7 @@ static int mlxsw_sp_setup_tc(struct net_device *dev, u32 handle,
}
}
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
}
static const struct net_device_ops mlxsw_sp_port_netdev_ops = {
@@ -1652,7 +1652,7 @@ mlxsw_sp_get_hw_stats_by_group(struct mlxsw_sp_port_hw_stats **p_hw_stats,
break;
default:
WARN_ON(1);
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
}
return 0;
}
--
2.7.4
^ permalink raw reply related
* [patch net-next 3/5] mlxsw: spectrum: Make the add_matchall_tc_entry symmetric
From: Jiri Pirko @ 2017-01-09 10:25 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, arkadis
In-Reply-To: <1483957548-3531-1-git-send-email-jiri@resnulli.us>
From: Yotam Gigi <yotamg@mellanox.com>
Currently, the mlxsw spectrum driver only supports offloading the matchall
classifier together with the mirred action. To allow more matchall tc
offloads, make the code symmetric so that it can be easily extended later
on for other actions.
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 91 ++++++++++++++------------
1 file changed, 48 insertions(+), 43 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 46c53a0..f4b8ba2 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1161,8 +1161,8 @@ static int mlxsw_sp_port_get_phys_port_name(struct net_device *dev, char *name,
}
static struct mlxsw_sp_port_mall_tc_entry *
-mlxsw_sp_port_mirror_entry_find(struct mlxsw_sp_port *port,
- unsigned long cookie) {
+mlxsw_sp_port_mall_tc_entry_find(struct mlxsw_sp_port *port,
+ unsigned long cookie) {
struct mlxsw_sp_port_mall_tc_entry *mall_tc_entry;
list_for_each_entry(mall_tc_entry, &port->mall_tc_list, list)
@@ -1174,17 +1174,15 @@ mlxsw_sp_port_mirror_entry_find(struct mlxsw_sp_port *port,
static int
mlxsw_sp_port_add_cls_matchall_mirror(struct mlxsw_sp_port *mlxsw_sp_port,
- struct tc_cls_matchall_offload *cls,
+ struct mlxsw_sp_port_mall_mirror_tc_entry *mirror,
const struct tc_action *a,
bool ingress)
{
- struct mlxsw_sp_port_mall_tc_entry *mall_tc_entry;
struct net *net = dev_net(mlxsw_sp_port->dev);
enum mlxsw_sp_span_type span_type;
struct mlxsw_sp_port *to_port;
struct net_device *to_dev;
int ifindex;
- int err;
ifindex = tcf_mirred_ifindex(a);
to_dev = __dev_get_by_index(net, ifindex);
@@ -1199,26 +1197,24 @@ mlxsw_sp_port_add_cls_matchall_mirror(struct mlxsw_sp_port *mlxsw_sp_port,
}
to_port = netdev_priv(to_dev);
- mall_tc_entry = kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL);
- if (!mall_tc_entry)
- return -ENOMEM;
-
- mall_tc_entry->cookie = cls->cookie;
- mall_tc_entry->type = MLXSW_SP_PORT_MALL_MIRROR;
- mall_tc_entry->mirror.to_local_port = to_port->local_port;
- mall_tc_entry->mirror.ingress = ingress;
- list_add_tail(&mall_tc_entry->list, &mlxsw_sp_port->mall_tc_list);
-
+ mirror->to_local_port = to_port->local_port;
+ mirror->ingress = ingress;
span_type = ingress ? MLXSW_SP_SPAN_INGRESS : MLXSW_SP_SPAN_EGRESS;
- err = mlxsw_sp_span_mirror_add(mlxsw_sp_port, to_port, span_type);
- if (err)
- goto err_mirror_add;
- return 0;
+ return mlxsw_sp_span_mirror_add(mlxsw_sp_port, to_port, span_type);
+}
-err_mirror_add:
- list_del(&mall_tc_entry->list);
- kfree(mall_tc_entry);
- return err;
+static void
+mlxsw_sp_port_del_cls_matchall_mirror(struct mlxsw_sp_port *mlxsw_sp_port,
+ struct mlxsw_sp_port_mall_mirror_tc_entry *mirror)
+{
+ struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
+ enum mlxsw_sp_span_type span_type;
+ struct mlxsw_sp_port *to_port;
+
+ to_port = mlxsw_sp->ports[mirror->to_local_port];
+ span_type = mirror->ingress ?
+ MLXSW_SP_SPAN_INGRESS : MLXSW_SP_SPAN_EGRESS;
+ mlxsw_sp_span_mirror_remove(mlxsw_sp_port, to_port, span_type);
}
static int mlxsw_sp_port_add_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
@@ -1226,6 +1222,7 @@ static int mlxsw_sp_port_add_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
struct tc_cls_matchall_offload *cls,
bool ingress)
{
+ struct mlxsw_sp_port_mall_tc_entry *mall_tc_entry;
const struct tc_action *a;
LIST_HEAD(actions);
int err;
@@ -1235,50 +1232,58 @@ static int mlxsw_sp_port_add_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
return -ENOTSUPP;
}
+ mall_tc_entry = kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL);
+ if (!mall_tc_entry)
+ return -ENOMEM;
+ mall_tc_entry->cookie = cls->cookie;
+
tcf_exts_to_list(cls->exts, &actions);
- list_for_each_entry(a, &actions, list) {
- if (!is_tcf_mirred_egress_mirror(a) ||
- protocol != htons(ETH_P_ALL)) {
- return -ENOTSUPP;
- }
+ a = list_first_entry(&actions, struct tc_action, list);
- err = mlxsw_sp_port_add_cls_matchall_mirror(mlxsw_sp_port, cls,
- a, ingress);
- if (err)
- return err;
+ if (is_tcf_mirred_egress_mirror(a) && protocol == htons(ETH_P_ALL)) {
+ struct mlxsw_sp_port_mall_mirror_tc_entry *mirror;
+
+ mall_tc_entry->type = MLXSW_SP_PORT_MALL_MIRROR;
+ mirror = &mall_tc_entry->mirror;
+ err = mlxsw_sp_port_add_cls_matchall_mirror(mlxsw_sp_port,
+ mirror, a, ingress);
+ } else {
+ err = -EOPNOTSUPP;
}
+ if (err)
+ goto err_add_action;
+
+ list_add_tail(&mall_tc_entry->list, &mlxsw_sp_port->mall_tc_list);
return 0;
+
+err_add_action:
+ kfree(mall_tc_entry);
+ return err;
}
static void mlxsw_sp_port_del_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
struct tc_cls_matchall_offload *cls)
{
- struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
struct mlxsw_sp_port_mall_tc_entry *mall_tc_entry;
- enum mlxsw_sp_span_type span_type;
- struct mlxsw_sp_port *to_port;
- mall_tc_entry = mlxsw_sp_port_mirror_entry_find(mlxsw_sp_port,
- cls->cookie);
+ mall_tc_entry = mlxsw_sp_port_mall_tc_entry_find(mlxsw_sp_port,
+ cls->cookie);
if (!mall_tc_entry) {
netdev_dbg(mlxsw_sp_port->dev, "tc entry not found on port\n");
return;
}
+ list_del(&mall_tc_entry->list);
switch (mall_tc_entry->type) {
case MLXSW_SP_PORT_MALL_MIRROR:
- to_port = mlxsw_sp->ports[mall_tc_entry->mirror.to_local_port];
- span_type = mall_tc_entry->mirror.ingress ?
- MLXSW_SP_SPAN_INGRESS : MLXSW_SP_SPAN_EGRESS;
-
- mlxsw_sp_span_mirror_remove(mlxsw_sp_port, to_port, span_type);
+ mlxsw_sp_port_del_cls_matchall_mirror(mlxsw_sp_port,
+ &mall_tc_entry->mirror);
break;
default:
WARN_ON(1);
}
- list_del(&mall_tc_entry->list);
kfree(mall_tc_entry);
}
--
2.7.4
^ permalink raw reply related
* [patch net-next 2/5] mlxsw: cmd: Fix API name comments for event-queues
From: Jiri Pirko @ 2017-01-09 10:25 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, arkadis
In-Reply-To: <1483957548-3531-1-git-send-email-jiri@resnulli.us>
From: Elad Raz <eladr@mellanox.com>
Probably some copy-paste error from "int_msix" that caused "int_" prefix to
appear in the comments for all "eq_" APIs.
Signed-off-by: Elad Raz <eladr@mellanox.com>
Acked-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/cmd.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/cmd.h b/drivers/net/ethernet/mellanox/mlxsw/cmd.h
index 56e19b0..a1b4842 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/cmd.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/cmd.h
@@ -1132,12 +1132,12 @@ static inline int mlxsw_cmd_sw2hw_eq(struct mlxsw_core *mlxsw_core,
*/
MLXSW_ITEM32(cmd_mbox, sw2hw_eq, int_msix, 0x00, 24, 1);
-/* cmd_mbox_sw2hw_eq_int_oi
+/* cmd_mbox_sw2hw_eq_oi
* When set, overrun ignore is enabled.
*/
MLXSW_ITEM32(cmd_mbox, sw2hw_eq, oi, 0x00, 12, 1);
-/* cmd_mbox_sw2hw_eq_int_st
+/* cmd_mbox_sw2hw_eq_st
* Event delivery state machine
* 0x0 - FIRED
* 0x1 - ARMED (Request for Notification)
@@ -1146,19 +1146,19 @@ MLXSW_ITEM32(cmd_mbox, sw2hw_eq, oi, 0x00, 12, 1);
*/
MLXSW_ITEM32(cmd_mbox, sw2hw_eq, st, 0x00, 8, 2);
-/* cmd_mbox_sw2hw_eq_int_log_eq_size
+/* cmd_mbox_sw2hw_eq_log_eq_size
* Log (base 2) of the EQ size (in entries).
*/
MLXSW_ITEM32(cmd_mbox, sw2hw_eq, log_eq_size, 0x00, 0, 4);
-/* cmd_mbox_sw2hw_eq_int_producer_counter
+/* cmd_mbox_sw2hw_eq_producer_counter
* Producer Counter. The counter is incremented for each EQE that is written
* by the HW to the EQ.
* Maintained by HW (valid for the QUERY_EQ command only)
*/
MLXSW_ITEM32(cmd_mbox, sw2hw_eq, producer_counter, 0x04, 0, 16);
-/* cmd_mbox_sw2hw_eq_int_pa
+/* cmd_mbox_sw2hw_eq_pa
* Physical Address.
*/
MLXSW_ITEM64_INDEXED(cmd_mbox, sw2hw_eq, pa, 0x10, 11, 53, 0x08, 0x00, true);
--
2.7.4
^ permalink raw reply related
* [patch net-next 1/5] mlxsw: Fix mlxsw_i2c_write return value
From: Jiri Pirko @ 2017-01-09 10:25 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, arkadis
In-Reply-To: <1483957548-3531-1-git-send-email-jiri@resnulli.us>
From: Elad Raz <eladr@mellanox.com>
The "err" variable is been checked, return always 0.
Signed-off-by: Elad Raz <eladr@mellanox.com>
Acked-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c
index e50c8db..12c3a44 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c
@@ -338,7 +338,7 @@ mlxsw_i2c_write(struct device *dev, size_t in_mbox_size, u8 *in_mbox, int num,
return -EIO;
}
- return err > 0 ? 0 : err;
+ return 0;
}
/* Routine executes I2C command. */
--
2.7.4
^ permalink raw reply related
* [patch net-next 0/5] mlxsw: small driver update
From: Jiri Pirko @ 2017-01-09 10:25 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, arkadis
From: Jiri Pirko <jiri@mellanox.com>
This patchset contains various small "non-net" fixes and enhancements.
Elad Raz (2):
mlxsw: Fix mlxsw_i2c_write return value
mlxsw: cmd: Fix API name comments for event-queues
Yotam Gigi (3):
mlxsw: spectrum: Make the add_matchall_tc_entry symmetric
mlxsw: spectrum: Fix order of commands in port remove function
mlxsw: spectrum: Change ENOTSUPP to EOPNOTSUPP
drivers/net/ethernet/mellanox/mlxsw/cmd.h | 10 +--
drivers/net/ethernet/mellanox/mlxsw/i2c.c | 2 +-
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 101 +++++++++++++------------
3 files changed, 59 insertions(+), 54 deletions(-)
--
2.7.4
^ 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