* [PATCH 5/6] staging: rtl: Use existing define with polynomial
From: Krzysztof Kozlowski @ 2018-07-17 16:05 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Maxime Coquelin, Alexandre Torgue,
Tom Lendacky, Siva Reddy Kallam, Prashant Sreedharan,
Michael Chan, Fugang Duan, Pantelis Antoniou, Vitaly Bordug,
Jose Abreu, Larry Finger, Florian Schilhabel, Greg Kroah-Hartman,
Thomas Gleixner, linux-kernel, linux-crypto, linux-arm-kernel,
netdev, linuxppc-dev, devel
Cc: Krzysztof Kozlowski
In-Reply-To: <20180717160541.3843-1-krzk@kernel.org>
Do not define again the polynomial but use header with existing define.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
Not tested
It would be nice to get some testing. Only generic lib/crc, bunzip, xz_crc32
and Freescale's Ethernet driver were tested on HW. Rest got just different
builds.
drivers/staging/rtl8712/rtl871x_security.c | 5 ++---
drivers/staging/rtl8723bs/core/rtw_security.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c
index 7bc74d7d8a3a..1075eacdb441 100644
--- a/drivers/staging/rtl8712/rtl871x_security.c
+++ b/drivers/staging/rtl8712/rtl871x_security.c
@@ -40,6 +40,7 @@
#include <linux/uaccess.h>
#include <asm/byteorder.h>
#include <linux/atomic.h>
+#include <linux/crc32poly.h>
#include <linux/semaphore.h>
#include "osdep_service.h"
@@ -49,8 +50,6 @@
/* =====WEP related===== */
-#define CRC32_POLY 0x04c11db7
-
struct arc4context {
u32 x;
u32 y;
@@ -135,7 +134,7 @@ static void crc32_init(void)
for (i = 0; i < 256; ++i) {
k = crc32_reverseBit((u8)i);
for (c = ((u32)k) << 24, j = 8; j > 0; --j)
- c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY : (c << 1);
+ c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY_BE : (c << 1);
p1 = (u8 *)&crc32_table[i];
p1[0] = crc32_reverseBit(p[3]);
p1[1] = crc32_reverseBit(p[2]);
diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index 612277a555d2..6c8ac9e86c9f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -6,6 +6,7 @@
******************************************************************************/
#define _RTW_SECURITY_C_
+#include <linux/crc32poly.h>
#include <drv_types.h>
#include <rtw_debug.h>
@@ -87,8 +88,6 @@ const char *security_type_str(u8 value)
/* WEP related ===== */
-#define CRC32_POLY 0x04c11db7
-
struct arc4context {
u32 x;
u32 y;
@@ -178,7 +177,7 @@ static void crc32_init(void)
for (i = 0; i < 256; ++i) {
k = crc32_reverseBit((u8)i);
for (c = ((u32)k) << 24, j = 8; j > 0; --j) {
- c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY : (c << 1);
+ c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY_BE : (c << 1);
}
p1 = (u8 *)&crc32_table[i];
--
2.14.1
^ permalink raw reply related
* [PATCH 6/6] lib: Use existing define with polynomial
From: Krzysztof Kozlowski @ 2018-07-17 16:05 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Maxime Coquelin, Alexandre Torgue,
Tom Lendacky, Siva Reddy Kallam, Prashant Sreedharan,
Michael Chan, Fugang Duan, Pantelis Antoniou, Vitaly Bordug,
Jose Abreu, Larry Finger, Florian Schilhabel, Greg Kroah-Hartman,
Thomas Gleixner, linux-kernel, linux-crypto, linux-arm-kern
Cc: Krzysztof Kozlowski
In-Reply-To: <20180717160541.3843-1-krzk@kernel.org>
Do not define again the polynomial but use header with existing define.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
lib/decompress_bunzip2.c | 3 ++-
lib/xz/xz_crc32.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/decompress_bunzip2.c b/lib/decompress_bunzip2.c
index 0234361b24b8..7c4932eed748 100644
--- a/lib/decompress_bunzip2.c
+++ b/lib/decompress_bunzip2.c
@@ -51,6 +51,7 @@
#endif /* STATIC */
#include <linux/decompress/mm.h>
+#include <linux/crc32poly.h>
#ifndef INT_MAX
#define INT_MAX 0x7fffffff
@@ -654,7 +655,7 @@ static int INIT start_bunzip(struct bunzip_data **bdp, void *inbuf, long len,
for (i = 0; i < 256; i++) {
c = i << 24;
for (j = 8; j; j--)
- c = c&0x80000000 ? (c << 1)^0x04c11db7 : (c << 1);
+ c = c&0x80000000 ? (c << 1)^(CRC32_POLY_BE) : (c << 1);
bd->crc32Table[i] = c;
}
diff --git a/lib/xz/xz_crc32.c b/lib/xz/xz_crc32.c
index 34532d14fd4c..25a5d87e2e4c 100644
--- a/lib/xz/xz_crc32.c
+++ b/lib/xz/xz_crc32.c
@@ -15,6 +15,7 @@
* but they are bigger and use more memory for the lookup table.
*/
+#include <linux/crc32poly.h>
#include "xz_private.h"
/*
@@ -29,7 +30,7 @@ STATIC_RW_DATA uint32_t xz_crc32_table[256];
XZ_EXTERN void xz_crc32_init(void)
{
- const uint32_t poly = 0xEDB88320;
+ const uint32_t poly = CRC32_POLY_LE;
uint32_t i;
uint32_t j;
--
2.14.1
^ permalink raw reply related
* Re: [PATCH v2 nf-next 2/2] netfilter: fix IPV6=m CONNTRACK=y link failure
From: Pablo Neira Ayuso @ 2018-07-17 15:36 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel, netdev
In-Reply-To: <20180713142754.23349-2-fw@strlen.de>
On Fri, Jul 13, 2018 at 04:27:54PM +0200, Florian Westphal wrote:
> IPV6=m
> DEFRAG_IPV6=m
> CONNTRACK=y yields:
>
> net/netfilter/nf_conntrack_proto.o: In function `nf_ct_netns_do_get':
> net/netfilter/nf_conntrack_proto.c:802: undefined reference to `nf_defrag_ipv6_enable'
> net/netfilter/nf_conntrack_proto.o:(.rodata+0x640): undefined reference to `nf_conntrack_l4proto_icmpv6'
>
> After previous patch, DEFRAG_IPV6 and IPV6 are no longer retain any
> dependencies, so we can tell Kconfig DEFRAG_IPV6 needs to be built-in as
> well, this resolves missing nf_defrag_ipv6_enable.
>
> Second error can be fixed via makefile, just make sure conntrack_proto_ipv6
> is part of conntrack module.
>
> based on earlier patch from Arnd Bergmann.
>
> Fixes: 66c524acfb5186 ("netfilter: conntrack: remove l3proto abstraction")
Squashed into this original patch.
^ permalink raw reply
* [PATCH net-next 0/7] net: Support Wake-on-LAN using filters
From: Florian Fainelli @ 2018-07-17 15:36 UTC (permalink / raw)
To: netdev; +Cc: Florian Fainelli, linville, davem, andrew, vivien.didelot
Hi all,
This patch series adds support for allowing Wake-on-LAN to wake-up the
system using configurable filters. This is particular useful in the context
of Android where wake on MDNS is a requirement.
We support this by using the bcm_sf2 Compact Field Processor (CFP) which
supports matching packets and tagging them with an unique identifier
(Classification ID) that is added in each packet being matched through the use
of Broadcom tags. The SYSTEMPORT MAC attached to that switch is then used to
match that unique identifier and trigger a system wake-up event.
Last patch is the ethtool modifications to support that feature.
Example:
ethtool --config-nfc gphy flow-type udp4 src-ip 192.168.1.1 dst-ip 192.168.1.32 \
src-port 1234 dst-port 5678 action 64
Added rule with ID 1
ethtool -s gphy wol f filters 0x2
To wake up the device:
nc -vz -u -p 1234 -s 192.168.1.1 192.168.1.32 5678
Florian Fainelli (7):
net: dsa: bcm_sf2: Allow targeting CPU ports for CFP rules
net: dsa: bcm_sf2: Disable learning while in WoL
net: systemport: Do not re-configure upon WoL interrupt
net: systemport: Create helper to set MPD
ethtool: Add WAKE_FILTER bitmask
net: systemport: Add support for WAKE_FILTER
net: dsa: bcm_sf2: Support WAKE_FILTER
drivers/net/dsa/bcm_sf2.c | 14 +++-
drivers/net/dsa/bcm_sf2_cfp.c | 3 +-
drivers/net/dsa/bcm_sf2_regs.h | 2 +
drivers/net/ethernet/broadcom/bcmsysport.c | 129 ++++++++++++++++++++++++-----
drivers/net/ethernet/broadcom/bcmsysport.h | 14 +++-
include/uapi/linux/ethtool.h | 3 +-
6 files changed, 138 insertions(+), 27 deletions(-)
--
2.14.1
^ permalink raw reply
* [PATCH ethtool] ethtool: Add support for WAKE_FILTER
From: Florian Fainelli @ 2018-07-17 15:36 UTC (permalink / raw)
To: netdev; +Cc: Florian Fainelli, linville, davem, andrew, vivien.didelot
In-Reply-To: <20180717153645.7500-1-f.fainelli@gmail.com>
Allow re-purposing the wol->sopass storage area to specify a bitmask of filters
(programmed previously via ethtool::rxnfc) to be used as wake-up patterns.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
ethtool-copy.h | 1 +
ethtool.c | 35 ++++++++++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/ethtool-copy.h b/ethtool-copy.h
index 8cc61e9ab40b..dbfaca15dca5 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -1628,6 +1628,7 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
#define WAKE_ARP (1 << 4)
#define WAKE_MAGIC (1 << 5)
#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
+#define WAKE_FILTER (1 << 7)
/* L2-L4 network traffic flow types */
#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
diff --git a/ethtool.c b/ethtool.c
index fb93ae898312..322fc8d98ee5 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -931,6 +931,9 @@ static int parse_wolopts(char *optstr, u32 *data)
case 's':
*data |= WAKE_MAGICSECURE;
break;
+ case 'f':
+ *data |= WAKE_FILTER;
+ break;
case 'd':
*data = 0;
break;
@@ -964,6 +967,8 @@ static char *unparse_wolopts(int wolopts)
*p++ = 'g';
if (wolopts & WAKE_MAGICSECURE)
*p++ = 's';
+ if (wolopts & WAKE_FILTER)
+ *p++ = 'f';
} else {
*p = 'd';
}
@@ -989,6 +994,21 @@ static int dump_wol(struct ethtool_wolinfo *wol)
fprintf(stdout, "\n");
}
+ if (wol->supported & WAKE_FILTER) {
+ int i, j;
+ int delim = 0;
+ fprintf(stdout, " Filter(s) enabled: ");
+ for (i = 0; i < SOPASS_MAX; i++) {
+ for (j = 0; j < 8; j++) {
+ if (wol->sopass[i] & (1 << j)) {
+ fprintf(stdout, "%s%d", delim?",":"", i * 8 + j);
+ delim=1;
+ }
+ }
+ }
+ fprintf(stdout, "\n");
+ }
+
return 0;
}
@@ -2897,6 +2917,16 @@ static int do_sset(struct cmd_context *ctx)
exit_bad_args();
get_mac_addr(argp[i], sopass_wanted);
sopass_change = 1;
+ } else if (!strcmp(argp[i], "filters")) {
+ gwol_changed = 1;
+ i++;
+ if (i >= argc)
+ exit_bad_args();
+ if (parse_hex_u32_bitmap(argp[i],
+ SOPASS_MAX * 8,
+ (unsigned int *)sopass_wanted))
+ exit_bad_args();
+ sopass_change = 1;
} else if (!strcmp(argp[i], "msglvl")) {
i++;
if (i >= argc)
@@ -3112,8 +3142,10 @@ static int do_sset(struct cmd_context *ctx)
if (err < 0) {
if (wol_change)
fprintf(stderr, " not setting wol\n");
- if (sopass_change)
+ if (sopass_change & wol.wolopts & WAKE_MAGICSECURE)
fprintf(stderr, " not setting sopass\n");
+ if (sopass_change & wol.wolopts & WAKE_FILTER)
+ fprintf(stderr, " not setting filters\n");
}
}
@@ -5066,6 +5098,7 @@ static const struct option {
" [ xcvr internal|external ]\n"
" [ wol p|u|m|b|a|g|s|d... ]\n"
" [ sopass %x:%x:%x:%x:%x:%x ]\n"
+ " [ filters %x ]\n"
" [ msglvl %d | msglvl type on|off ... ]\n" },
{ "-a|--show-pause", 1, do_gpause, "Show pause options" },
{ "-A|--pause", 1, do_spause, "Set pause options",
--
2.14.1
^ permalink raw reply related
* [PATCH net-next 1/7] net: dsa: bcm_sf2: Allow targeting CPU ports for CFP rules
From: Florian Fainelli @ 2018-07-17 15:36 UTC (permalink / raw)
To: netdev; +Cc: Florian Fainelli, linville, davem, andrew, vivien.didelot
In-Reply-To: <20180717153645.7500-1-f.fainelli@gmail.com>
ds->enabled_port_mask only contains a bitmask of user-facing enabled
ports, we also need to allow programming CFP rules that target CPU ports
(e.g: ports 5 and 8).
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2_cfp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c
index b89acaee12d4..1a2b4e16aa13 100644
--- a/drivers/net/dsa/bcm_sf2_cfp.c
+++ b/drivers/net/dsa/bcm_sf2_cfp.c
@@ -755,7 +755,8 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port,
port_num = fs->ring_cookie / SF2_NUM_EGRESS_QUEUES;
if (fs->ring_cookie == RX_CLS_FLOW_DISC ||
- !dsa_is_user_port(ds, port_num) ||
+ !(dsa_is_user_port(ds, port_num) ||
+ dsa_is_cpu_port(ds, port_num)) ||
port_num >= priv->hw_params.num_ports)
return -EINVAL;
/*
--
2.14.1
^ permalink raw reply related
* [PATCH net-next 2/7] net: dsa: bcm_sf2: Disable learning while in WoL
From: Florian Fainelli @ 2018-07-17 15:36 UTC (permalink / raw)
To: netdev; +Cc: Florian Fainelli, linville, davem, andrew, vivien.didelot
In-Reply-To: <20180717153645.7500-1-f.fainelli@gmail.com>
When we are in Wake-on-LAN, we operate with the host sofware not running
a network stack, so we want to the switch to flood packets in order to
cause a system wake-up when matching specific filters (unicast or
multicast). This was not necessary before since we supported Magic
Packet which are targeting a broadcast MAC address which the switch
already floods.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2.c | 12 +++++++++++-
drivers/net/dsa/bcm_sf2_regs.h | 2 ++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index ac96ff40d37e..e0066adcd2f3 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -166,6 +166,11 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,
reg &= ~P_TXQ_PSM_VDD(port);
core_writel(priv, reg, CORE_MEM_PSM_VDD_CTRL);
+ /* Enable learning */
+ reg = core_readl(priv, CORE_DIS_LEARN);
+ reg &= ~BIT(port);
+ core_writel(priv, reg, CORE_DIS_LEARN);
+
/* Enable Broadcom tags for that port if requested */
if (priv->brcm_tag_mask & BIT(port))
b53_brcm_hdr_setup(ds, port);
@@ -222,8 +227,13 @@ static void bcm_sf2_port_disable(struct dsa_switch *ds, int port,
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
u32 reg;
- if (priv->wol_ports_mask & (1 << port))
+ /* Disable learning while in WoL mode */
+ if (priv->wol_ports_mask & (1 << port)) {
+ reg = core_readl(priv, CORE_DIS_LEARN);
+ reg |= BIT(port);
+ core_writel(priv, reg, CORE_DIS_LEARN);
return;
+ }
if (port == priv->moca_port)
bcm_sf2_port_intr_disable(priv, port);
diff --git a/drivers/net/dsa/bcm_sf2_regs.h b/drivers/net/dsa/bcm_sf2_regs.h
index 3ccd5a865dcb..0a1e530d52b7 100644
--- a/drivers/net/dsa/bcm_sf2_regs.h
+++ b/drivers/net/dsa/bcm_sf2_regs.h
@@ -168,6 +168,8 @@ enum bcm_sf2_reg_offs {
#define CORE_SWITCH_CTRL 0x00088
#define MII_DUMB_FWDG_EN (1 << 6)
+#define CORE_DIS_LEARN 0x000f0
+
#define CORE_SFT_LRN_CTRL 0x000f8
#define SW_LEARN_CNTL(x) (1 << (x))
--
2.14.1
^ permalink raw reply related
* [PATCH net-next 3/7] net: systemport: Do not re-configure upon WoL interrupt
From: Florian Fainelli @ 2018-07-17 15:36 UTC (permalink / raw)
To: netdev; +Cc: Florian Fainelli, linville, davem, andrew, vivien.didelot
In-Reply-To: <20180717153645.7500-1-f.fainelli@gmail.com>
We already properly resume from Wake-on-LAN whether such a condition
occured or not, no need to process the WoL interrupt for functional
changes since that could race with other settings.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/bcmsysport.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index eb890c4b3b2d..f152826f3d06 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1102,10 +1102,8 @@ static irqreturn_t bcm_sysport_rx_isr(int irq, void *dev_id)
if (priv->irq0_stat & INTRL2_0_TX_RING_FULL)
bcm_sysport_tx_reclaim_all(priv);
- if (priv->irq0_stat & INTRL2_0_MPD) {
+ if (priv->irq0_stat & INTRL2_0_MPD)
netdev_info(priv->netdev, "Wake-on-LAN interrupt!\n");
- bcm_sysport_resume_from_wol(priv);
- }
if (!priv->is_lite)
goto out;
--
2.14.1
^ permalink raw reply related
* [PATCH net-next 4/7] net: systemport: Create helper to set MPD
From: Florian Fainelli @ 2018-07-17 15:36 UTC (permalink / raw)
To: netdev; +Cc: Florian Fainelli, linville, davem, andrew, vivien.didelot
In-Reply-To: <20180717153645.7500-1-f.fainelli@gmail.com>
Create a helper function to turn on/off MPD, this will be used to avoid
duplicating code as we are going to add additional types of wake-up
types.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/bcmsysport.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index f152826f3d06..511caec7030a 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1041,17 +1041,25 @@ static int bcm_sysport_poll(struct napi_struct *napi, int budget)
return work_done;
}
-static void bcm_sysport_resume_from_wol(struct bcm_sysport_priv *priv)
+static void mpd_enable_set(struct bcm_sysport_priv *priv, bool enable)
{
u32 reg;
+ reg = umac_readl(priv, UMAC_MPD_CTRL);
+ if (enable)
+ reg |= MPD_EN;
+ else
+ reg &= ~MPD_EN;
+ umac_writel(priv, reg, UMAC_MPD_CTRL);
+}
+
+static void bcm_sysport_resume_from_wol(struct bcm_sysport_priv *priv)
+{
/* Stop monitoring MPD interrupt */
intrl2_0_mask_set(priv, INTRL2_0_MPD);
/* Clear the MagicPacket detection logic */
- reg = umac_readl(priv, UMAC_MPD_CTRL);
- reg &= ~MPD_EN;
- umac_writel(priv, reg, UMAC_MPD_CTRL);
+ mpd_enable_set(priv, false);
netif_dbg(priv, wol, priv->netdev, "resumed from WOL\n");
}
@@ -2447,9 +2455,7 @@ static int bcm_sysport_suspend_to_wol(struct bcm_sysport_priv *priv)
/* Do not leave the UniMAC RBUF matching only MPD packets */
if (!timeout) {
- reg = umac_readl(priv, UMAC_MPD_CTRL);
- reg &= ~MPD_EN;
- umac_writel(priv, reg, UMAC_MPD_CTRL);
+ mpd_enable_set(priv, false);
netif_err(priv, wol, ndev, "failed to enter WOL mode\n");
return -ETIMEDOUT;
}
--
2.14.1
^ permalink raw reply related
* [PATCH net-next 5/7] ethtool: Add WAKE_FILTER bitmask
From: Florian Fainelli @ 2018-07-17 15:36 UTC (permalink / raw)
To: netdev; +Cc: Florian Fainelli, linville, davem, andrew, vivien.didelot
In-Reply-To: <20180717153645.7500-1-f.fainelli@gmail.com>
Add the ability to specify that a filter, programmed through
ethtool::rxnfc will be used as a wake-up source. sopass which is a
48-bit wide storage is used to indicate which filters (as bits) can be
used for wake-up.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
include/uapi/linux/ethtool.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 4ca65b56084f..59e35f0ca9eb 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -201,7 +201,7 @@ struct ethtool_drvinfo {
* @supported: Bitmask of %WAKE_* flags for supported Wake-On-Lan modes.
* Read-only.
* @wolopts: Bitmask of %WAKE_* flags for enabled Wake-On-Lan modes.
- * @sopass: SecureOn(tm) password; meaningful only if %WAKE_MAGICSECURE
+ * @sopass: SecureOn(tm) password; meaningful only if %WAKE_MAGICSECURE or %WAKE_FILTER
* is set in @wolopts.
*/
struct ethtool_wolinfo {
@@ -1634,6 +1634,7 @@ static inline int ethtool_validate_duplex(__u8 duplex)
#define WAKE_ARP (1 << 4)
#define WAKE_MAGIC (1 << 5)
#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
+#define WAKE_FILTER (1 << 7)
/* L2-L4 network traffic flow types */
#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
--
2.14.1
^ permalink raw reply related
* [PATCH net-next 6/7] net: systemport: Add support for WAKE_FILTER
From: Florian Fainelli @ 2018-07-17 15:36 UTC (permalink / raw)
To: netdev; +Cc: Florian Fainelli, linville, davem, andrew, vivien.didelot
In-Reply-To: <20180717153645.7500-1-f.fainelli@gmail.com>
The SYSTEMPORT MAC allows up to 8 filters to be programmed to wake-up
from LAN. Verify that we have up to 8 filters and program them to the
appropriate RXCHK entries to be matched (along with their masks).
We need to update the entry and exit to Wake-on-LAN mode to keep the
RXCHK engine running to match during suspend, but this is otherwise
fairly similar to Magic Packet detection.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/bcmsysport.c | 111 +++++++++++++++++++++++++----
drivers/net/ethernet/broadcom/bcmsysport.h | 14 +++-
2 files changed, 109 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 511caec7030a..8d7ce3df1080 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -521,25 +521,31 @@ static void bcm_sysport_get_wol(struct net_device *dev,
struct bcm_sysport_priv *priv = netdev_priv(dev);
u32 reg;
- wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE;
+ wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER;
wol->wolopts = priv->wolopts;
- if (!(priv->wolopts & WAKE_MAGICSECURE))
- return;
+ if (priv->wolopts & WAKE_MAGICSECURE) {
+ /* Return the programmed SecureOn password */
+ reg = umac_readl(priv, UMAC_PSW_MS);
+ put_unaligned_be16(reg, &wol->sopass[0]);
+ reg = umac_readl(priv, UMAC_PSW_LS);
+ put_unaligned_be32(reg, &wol->sopass[2]);
+ }
- /* Return the programmed SecureOn password */
- reg = umac_readl(priv, UMAC_PSW_MS);
- put_unaligned_be16(reg, &wol->sopass[0]);
- reg = umac_readl(priv, UMAC_PSW_LS);
- put_unaligned_be32(reg, &wol->sopass[2]);
+ if (priv->wolopts & WAKE_FILTER)
+ bitmap_copy((unsigned long *)wol->sopass, priv->filters,
+ WAKE_FILTER_BITS);
}
+
static int bcm_sysport_set_wol(struct net_device *dev,
struct ethtool_wolinfo *wol)
{
struct bcm_sysport_priv *priv = netdev_priv(dev);
struct device *kdev = &priv->pdev->dev;
- u32 supported = WAKE_MAGIC | WAKE_MAGICSECURE;
+ u32 supported = WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER;
+ unsigned int index, i = 0;
+ u32 reg;
if (!device_can_wakeup(kdev))
return -ENOTSUPP;
@@ -555,6 +561,32 @@ static int bcm_sysport_set_wol(struct net_device *dev,
UMAC_PSW_LS);
}
+ /* We support matching up to 8 filters only */
+ if (wol->wolopts & WAKE_FILTER) {
+ bitmap_copy(priv->filters, (unsigned long *)wol->sopass,
+ WAKE_FILTER_BITS);
+
+ if (bitmap_weight(priv->filters, WAKE_FILTER_BITS) >
+ RXCHK_BRCM_TAG_MAX) {
+ bitmap_zero(priv->filters, WAKE_FILTER_BITS);
+ return -ENOSPC;
+ }
+
+ if (bitmap_weight(priv->filters, WAKE_FILTER_BITS) == 0)
+ return -EINVAL;
+
+ for_each_set_bit(index, priv->filters, WAKE_FILTER_BITS) {
+ /* Write the index we want to match within the CID field */
+ reg = rxchk_readl(priv, RXCHK_BRCM_TAG(i));
+ reg &= ~(RXCHK_BRCM_TAG_CID_MASK <<
+ RXCHK_BRCM_TAG_CID_SHIFT);
+ reg |= index << RXCHK_BRCM_TAG_CID_SHIFT;
+ rxchk_writel(priv, reg, RXCHK_BRCM_TAG(i));
+ rxchk_writel(priv, 0xff00ffff, RXCHK_BRCM_TAG_MASK(i));
+ i++;
+ }
+ }
+
/* Flag the device and relevant IRQ as wakeup capable */
if (wol->wolopts) {
device_set_wakeup_enable(kdev, 1);
@@ -1043,7 +1075,7 @@ static int bcm_sysport_poll(struct napi_struct *napi, int budget)
static void mpd_enable_set(struct bcm_sysport_priv *priv, bool enable)
{
- u32 reg;
+ u32 reg, bit;
reg = umac_readl(priv, UMAC_MPD_CTRL);
if (enable)
@@ -1051,12 +1083,32 @@ static void mpd_enable_set(struct bcm_sysport_priv *priv, bool enable)
else
reg &= ~MPD_EN;
umac_writel(priv, reg, UMAC_MPD_CTRL);
+
+ if (priv->is_lite)
+ bit = RBUF_ACPI_EN_LITE;
+ else
+ bit = RBUF_ACPI_EN;
+
+ reg = rbuf_readl(priv, RBUF_CONTROL);
+ if (enable)
+ reg |= bit;
+ else
+ reg &= ~bit;
+ rbuf_writel(priv, reg, RBUF_CONTROL);
}
static void bcm_sysport_resume_from_wol(struct bcm_sysport_priv *priv)
{
+ u32 reg;
+
/* Stop monitoring MPD interrupt */
- intrl2_0_mask_set(priv, INTRL2_0_MPD);
+ intrl2_0_mask_set(priv, INTRL2_0_MPD | INTRL2_0_BRCM_MATCH_TAG);
+
+ /* Disable RXCHK, active filters and Broadcom tag matching */
+ reg = rxchk_readl(priv, RXCHK_CONTROL);
+ reg &= ~(RXCHK_BRCM_TAG_MATCH_MASK <<
+ RXCHK_BRCM_TAG_MATCH_SHIFT | RXCHK_EN | RXCHK_BRCM_TAG_EN);
+ rxchk_writel(priv, reg, RXCHK_CONTROL);
/* Clear the MagicPacket detection logic */
mpd_enable_set(priv, false);
@@ -1085,6 +1137,7 @@ static irqreturn_t bcm_sysport_rx_isr(int irq, void *dev_id)
struct bcm_sysport_priv *priv = netdev_priv(dev);
struct bcm_sysport_tx_ring *txr;
unsigned int ring, ring_bit;
+ u32 reg;
priv->irq0_stat = intrl2_0_readl(priv, INTRL2_CPU_STATUS) &
~intrl2_0_readl(priv, INTRL2_CPU_MASK_STATUS);
@@ -1111,7 +1164,14 @@ static irqreturn_t bcm_sysport_rx_isr(int irq, void *dev_id)
bcm_sysport_tx_reclaim_all(priv);
if (priv->irq0_stat & INTRL2_0_MPD)
- netdev_info(priv->netdev, "Wake-on-LAN interrupt!\n");
+ netdev_info(priv->netdev, "Wake-on-LAN (MPD) interrupt!\n");
+
+ if (priv->irq0_stat & INTRL2_0_BRCM_MATCH_TAG) {
+ reg = rxchk_readl(priv, RXCHK_BRCM_TAG_MATCH_STATUS) &
+ RXCHK_BRCM_TAG_MATCH_MASK;
+ netdev_info(priv->netdev,
+ "Wake-on-LAN (filters 0x%02x) interrupt!\n", reg);
+ }
if (!priv->is_lite)
goto out;
@@ -2434,16 +2494,39 @@ static int bcm_sysport_suspend_to_wol(struct bcm_sysport_priv *priv)
{
struct net_device *ndev = priv->netdev;
unsigned int timeout = 1000;
+ unsigned int index, i = 0;
u32 reg;
/* Password has already been programmed */
reg = umac_readl(priv, UMAC_MPD_CTRL);
- reg |= MPD_EN;
+ if (priv->wolopts & (WAKE_MAGIC | WAKE_MAGICSECURE))
+ reg |= MPD_EN;
reg &= ~PSW_EN;
if (priv->wolopts & WAKE_MAGICSECURE)
reg |= PSW_EN;
umac_writel(priv, reg, UMAC_MPD_CTRL);
+ if (priv->wolopts & WAKE_FILTER) {
+ /* Turn on ACPI matching to steal packets from RBUF */
+ reg = rbuf_readl(priv, RBUF_CONTROL);
+ if (priv->is_lite)
+ reg |= RBUF_ACPI_EN_LITE;
+ else
+ reg |= RBUF_ACPI_EN;
+ rbuf_writel(priv, reg, RBUF_CONTROL);
+
+ /* Enable RXCHK, active filters and Broadcom tag matching */
+ reg = rxchk_readl(priv, RXCHK_CONTROL);
+ reg &= ~(RXCHK_BRCM_TAG_MATCH_MASK <<
+ RXCHK_BRCM_TAG_MATCH_SHIFT);
+ for_each_set_bit(index, priv->filters, WAKE_FILTER_BITS) {
+ reg |= BIT(RXCHK_BRCM_TAG_MATCH_SHIFT + i);
+ i++;
+ }
+ reg |= RXCHK_EN | RXCHK_BRCM_TAG_EN;
+ rxchk_writel(priv, reg, RXCHK_CONTROL);
+ }
+
/* Make sure RBUF entered WoL mode as result */
do {
reg = rbuf_readl(priv, RBUF_STATUS);
@@ -2464,7 +2547,7 @@ static int bcm_sysport_suspend_to_wol(struct bcm_sysport_priv *priv)
umac_enable_set(priv, CMD_RX_EN, 1);
/* Enable the interrupt wake-up source */
- intrl2_0_mask_clear(priv, INTRL2_0_MPD);
+ intrl2_0_mask_clear(priv, INTRL2_0_MPD | INTRL2_0_BRCM_MATCH_TAG);
netif_dbg(priv, wol, ndev, "entered WOL mode\n");
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.h b/drivers/net/ethernet/broadcom/bcmsysport.h
index d6e5d0cbf3a3..6a64bd8cf787 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.h
+++ b/drivers/net/ethernet/broadcom/bcmsysport.h
@@ -11,6 +11,8 @@
#ifndef __BCM_SYSPORT_H
#define __BCM_SYSPORT_H
+#include <linux/bitmap.h>
+#include <linux/ethtool.h>
#include <linux/if_vlan.h>
#include <linux/net_dim.h>
@@ -155,14 +157,18 @@ struct bcm_rsb {
#define RXCHK_PARSE_AUTH (1 << 22)
#define RXCHK_BRCM_TAG0 0x04
-#define RXCHK_BRCM_TAG(i) ((i) * RXCHK_BRCM_TAG0)
+#define RXCHK_BRCM_TAG(i) ((i) * 0x4 + RXCHK_BRCM_TAG0)
#define RXCHK_BRCM_TAG0_MASK 0x24
-#define RXCHK_BRCM_TAG_MASK(i) ((i) * RXCHK_BRCM_TAG0_MASK)
+#define RXCHK_BRCM_TAG_MASK(i) ((i) * 0x4 + RXCHK_BRCM_TAG0_MASK)
#define RXCHK_BRCM_TAG_MATCH_STATUS 0x44
#define RXCHK_ETHERTYPE 0x48
#define RXCHK_BAD_CSUM_CNTR 0x4C
#define RXCHK_OTHER_DISC_CNTR 0x50
+#define RXCHK_BRCM_TAG_MAX 8
+#define RXCHK_BRCM_TAG_CID_SHIFT 16
+#define RXCHK_BRCM_TAG_CID_MASK 0xff
+
/* TXCHCK offsets and defines */
#define SYS_PORT_TXCHK_OFFSET 0x380
#define TXCHK_PKT_RDY_THRESH 0x00
@@ -185,6 +191,7 @@ struct bcm_rsb {
#define RBUF_RSB_SWAP0 (1 << 22)
#define RBUF_RSB_SWAP1 (1 << 23)
#define RBUF_ACPI_EN (1 << 23)
+#define RBUF_ACPI_EN_LITE (1 << 24)
#define RBUF_PKT_RDY_THRESH 0x04
@@ -524,6 +531,8 @@ struct dma_desc {
#define WORDS_PER_DESC (sizeof(struct dma_desc) / sizeof(u32))
+#define WAKE_FILTER_BITS (SOPASS_MAX * BITS_PER_BYTE)
+
/* Rx/Tx common counter group.*/
struct bcm_sysport_pkt_counters {
u32 cnt_64; /* RO Received/Transmited 64 bytes packet */
@@ -776,6 +785,7 @@ struct bcm_sysport_priv {
/* Ethtool */
u32 msg_enable;
+ DECLARE_BITMAP(filters, SOPASS_MAX * BITS_PER_BYTE);
struct bcm_sysport_stats64 stats64;
--
2.14.1
^ permalink raw reply related
* [PATCH net-next 7/7] net: dsa: bcm_sf2: Support WAKE_FILTER
From: Florian Fainelli @ 2018-07-17 15:36 UTC (permalink / raw)
To: netdev; +Cc: Florian Fainelli, linville, davem, andrew, vivien.didelot
In-Reply-To: <20180717153645.7500-1-f.fainelli@gmail.com>
Propagate wol->sopass when WAKE_FILTER is set since that contains the
bitmap of filters to be enabled for wake-up.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index e0066adcd2f3..ca562cf6ffd2 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -741,7 +741,7 @@ static void bcm_sf2_sw_get_wol(struct dsa_switch *ds, int port,
wol->supported = pwol.supported;
memset(&wol->sopass, 0, sizeof(wol->sopass));
- if (pwol.wolopts & WAKE_MAGICSECURE)
+ if (pwol.wolopts & (WAKE_MAGICSECURE | WAKE_FILTER))
memcpy(&wol->sopass, pwol.sopass, sizeof(wol->sopass));
if (priv->wol_ports_mask & (1 << port))
--
2.14.1
^ permalink raw reply related
* [PATCH] ipv6: fix useless rol32 call on hash
From: Colin King @ 2018-07-17 16:12 UTC (permalink / raw)
To: David S . Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The rol32 call is currently rotating hash but the rol'd value is
being discarded. I believe the current code is incorrect and hash
should be assigned the rotated value returned from rol32.
Thanks to David Lebrun for spotting this.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
include/net/ipv6.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 50eebccbf919..190015652168 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -843,7 +843,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
* to minimize possbility that any useful information to an
* attacker is leaked. Only lower 20 bits are relevant.
*/
- rol32(hash, 16);
+ hash = rol32(hash, 16);
flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK;
--
2.17.1
^ permalink raw reply related
* Re: [PATCH net-next] net: cavium: add missing PCI dependencies
From: Alexander Sverdlin @ 2018-07-17 15:38 UTC (permalink / raw)
To: Andrew Lunn, Arnd Bergmann
Cc: David S. Miller, Aleksey Makarov, Radoslaw Biernacki,
Felix Manlunas, Sunil Goutham, Vijaya Mohan Guvva, netdev,
linux-kernel
In-Reply-To: <20180717151141.GC16320@lunn.ch>
Hello Andrew,
On 17/07/18 17:11, Andrew Lunn wrote:
> FYI
>
> There is a 0-day email about mdio-thunder.c also failing. It looks
> like a missing PCI dependency as well, although i cannot find the
> patch which removed the existing dependency.
there were no such patch, some Ethernet driver not depending on PCI
forcefully selected MDIO_THUNDER. So this is only a side effect of the
first error.
--
Best regards,
Alexander Sverdlin.
^ permalink raw reply
* the editing
From: Ruby @ 2018-07-17 9:04 UTC (permalink / raw)
To: netdev
We have got a team of professional to do image editing service for you.
We have 20 image editors and on daily basis 2000 images can be processed.
If you want to check our quality of work please send us a photo with
instruction and we will work on it.
Our Services:
Photo cut out, masking, clipping path
Color, brightness and contrast correction
Beauty, Model retouching, skin retouching
Image cropping and resizing
Correcting the shape and size
We do unlimited revisions until you are satisfied with the work.
Thanks,
Ruby Young
^ permalink raw reply
* [PATCH net-next 0/3] net: Drop OF dependency for some Broadcom drivers
From: Florian Fainelli @ 2018-07-17 15:42 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
Hi David,
This patch series drops the CONFIG_OF dependency that some Broadcom drivers
had, this is no longer necessary and goes against allowing build testing
on more platforms.
Let me know if kbuild or your own builds somehow fail.
Florian Fainelli (3):
net: phy: Drop OF dependency for MDIO_BCM_UNIMAC
net: ethernet: broadcom: Drop dependency on OF
net: dsa: Drop OF dependency for BCM_SF2
drivers/net/dsa/Kconfig | 2 +-
drivers/net/ethernet/broadcom/Kconfig | 4 ++--
drivers/net/phy/Kconfig | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
--
2.14.1
^ permalink raw reply
* the editing
From: Ruby @ 2018-07-17 8:36 UTC (permalink / raw)
To: netdev
We have got a team of professional to do image editing service for you.
We have 20 image editors and on daily basis 2000 images can be processed.
If you want to check our quality of work please send us a photo with
instruction and we will work on it.
Our Services:
Photo cut out, masking, clipping path
Color, brightness and contrast correction
Beauty, Model retouching, skin retouching
Image cropping and resizing
Correcting the shape and size
We do unlimited revisions until you are satisfied with the work.
Thanks,
Ruby Young
^ permalink raw reply
* [PATCH net-next 1/3] net: phy: Drop OF dependency for MDIO_BCM_UNIMAC
From: Florian Fainelli @ 2018-07-17 15:42 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <20180717154206.17578-1-f.fainelli@gmail.com>
The driver builds fine even with CONFIG_OF=n since we now have stubs that are
provided.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index ceede09a2845..27718f64ba91 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -28,7 +28,7 @@ config MDIO_BCM_IPROC
config MDIO_BCM_UNIMAC
tristate "Broadcom UniMAC MDIO bus controller"
- depends on HAS_IOMEM && OF_MDIO
+ depends on HAS_IOMEM
help
This module provides a driver for the Broadcom UniMAC MDIO busses.
This hardware can be found in the Broadcom GENET Ethernet MAC
--
2.14.1
^ permalink raw reply related
* [PATCH net-next 2/3] net: ethernet: broadcom: Drop dependency on OF
From: Florian Fainelli @ 2018-07-17 15:42 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <20180717154206.17578-1-f.fainelli@gmail.com>
Both BCMGENET and SYSTEMPORT build just fine with CONFIG_OF=n, we do have a
dependency on HAS_IOMEM that was not being reflected for SYSTEMPORT so add
that.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index 4c3bfde6e8de..b7aa8ad96dfb 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -61,7 +61,7 @@ config BCM63XX_ENET
config BCMGENET
tristate "Broadcom GENET internal MAC support"
- depends on OF && HAS_IOMEM
+ depends on HAS_IOMEM
select MII
select PHYLIB
select FIXED_PHY
@@ -181,7 +181,7 @@ config BGMAC_PLATFORM
config SYSTEMPORT
tristate "Broadcom SYSTEMPORT internal MAC support"
- depends on OF
+ depends on HAS_IOMEM
depends on NET_DSA || !NET_DSA
select MII
select PHYLIB
--
2.14.1
^ permalink raw reply related
* [PATCH net-next 3/3] net: dsa: Drop OF dependency for BCM_SF2
From: Florian Fainelli @ 2018-07-17 15:42 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <20180717154206.17578-1-f.fainelli@gmail.com>
NET_DSA_BCM_SF2 does not need to depend on CONFIG_OF anymore since we have
stubs when that option is disabled.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
index 733653d8359a..549247966a70 100644
--- a/drivers/net/dsa/Kconfig
+++ b/drivers/net/dsa/Kconfig
@@ -5,7 +5,7 @@ source "drivers/net/dsa/b53/Kconfig"
config NET_DSA_BCM_SF2
tristate "Broadcom Starfighter 2 Ethernet switch support"
- depends on HAS_IOMEM && NET_DSA && OF_MDIO
+ depends on HAS_IOMEM && NET_DSA
select NET_DSA_TAG_BRCM
select FIXED_PHY
select BCM7XXX_PHY
--
2.14.1
^ permalink raw reply related
* Re: [PATCH net-next 0/7] net: Support Wake-on-LAN using filters
From: Andrew Lunn @ 2018-07-17 15:47 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, linville, davem, vivien.didelot
In-Reply-To: <20180717153645.7500-1-f.fainelli@gmail.com>
On Tue, Jul 17, 2018 at 08:36:37AM -0700, Florian Fainelli wrote:
> Hi all,
>
> This patch series adds support for allowing Wake-on-LAN to wake-up the
> system using configurable filters. This is particular useful in the context
> of Android where wake on MDNS is a requirement.
>
> We support this by using the bcm_sf2 Compact Field Processor (CFP) which
> supports matching packets and tagging them with an unique identifier
> (Classification ID) that is added in each packet being matched through the use
> of Broadcom tags. The SYSTEMPORT MAC attached to that switch is then used to
> match that unique identifier and trigger a system wake-up event.
>
> Last patch is the ethtool modifications to support that feature.
>
> Example:
>
> ethtool --config-nfc gphy flow-type udp4 src-ip 192.168.1.1 dst-ip 192.168.1.32 \
> src-port 1234 dst-port 5678 action 64
> Added rule with ID 1
Hi Florian
What is action 64?
> ethtool -s gphy wol f filters 0x2
What does this 0x2 represent?
These magic numbers are not so nice.
Andrew
^ permalink raw reply
* [PATCH] ipv6: sr: fix useless rol32 call on hash
From: Colin King @ 2018-07-17 15:52 UTC (permalink / raw)
To: David S . Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The rol32 call is currently rotating hash but the rol'd value is
being discarded. I believe the current code is incorrect and hash
should be assigned the rotated value returned from rol32.
Detected by CoverityScan, CID#1468411 ("Useless call")
Fixes: b5facfdba14c ("ipv6: sr: Compute flowlabel for outer IPv6 header of seg6 encap mode")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
net/ipv6/seg6_iptunnel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c
index 19ccf0dc996c..a8854dd3e9c5 100644
--- a/net/ipv6/seg6_iptunnel.c
+++ b/net/ipv6/seg6_iptunnel.c
@@ -101,7 +101,7 @@ static __be32 seg6_make_flowlabel(struct net *net, struct sk_buff *skb,
if (do_flowlabel > 0) {
hash = skb_get_hash(skb);
- rol32(hash, 16);
+ hash = rol32(hash, 16);
flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK;
} else if (!do_flowlabel && skb->protocol == htons(ETH_P_IPV6)) {
flowlabel = ip6_flowlabel(inner_hdr);
--
2.17.1
^ permalink raw reply related
* Re: [PATCH net-next 2/7] net: dsa: bcm_sf2: Disable learning while in WoL
From: Andrew Lunn @ 2018-07-17 15:54 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, linville, davem, vivien.didelot
In-Reply-To: <20180717153645.7500-4-f.fainelli@gmail.com>
On Tue, Jul 17, 2018 at 08:36:40AM -0700, Florian Fainelli wrote:
> When we are in Wake-on-LAN, we operate with the host sofware not running
> a network stack, so we want to the switch to flood packets
Hi Florian
Just to be sure...
By flood, you mean from a user port to the CPU. You don't mean
flooding between user ports.
Andrew
^ permalink raw reply
* Re: [PATCH net-next 2/7] net: dsa: bcm_sf2: Disable learning while in WoL
From: Florian Fainelli @ 2018-07-17 16:06 UTC (permalink / raw)
To: Andrew Lunn; +Cc: netdev, linville, davem, vivien.didelot
In-Reply-To: <20180717155444.GE968@lunn.ch>
On 07/17/2018 08:54 AM, Andrew Lunn wrote:
> On Tue, Jul 17, 2018 at 08:36:40AM -0700, Florian Fainelli wrote:
>> When we are in Wake-on-LAN, we operate with the host sofware not running
>> a network stack, so we want to the switch to flood packets
>
> Hi Florian
>
> Just to be sure...
>
> By flood, you mean from a user port to the CPU. You don't mean
> flooding between user ports.
Yes, flooding from an user-port to the CPU port, that is, behaving like
a fully unmanaged switch during WoL.
--
Florian
^ permalink raw reply
* Re: [PATCH net-next 0/7] net: Support Wake-on-LAN using filters
From: Florian Fainelli @ 2018-07-17 16:06 UTC (permalink / raw)
To: Andrew Lunn; +Cc: netdev, linville, davem, vivien.didelot
In-Reply-To: <20180717154702.GD968@lunn.ch>
On 07/17/2018 08:47 AM, Andrew Lunn wrote:
> On Tue, Jul 17, 2018 at 08:36:37AM -0700, Florian Fainelli wrote:
>> Hi all,
>>
>> This patch series adds support for allowing Wake-on-LAN to wake-up the
>> system using configurable filters. This is particular useful in the context
>> of Android where wake on MDNS is a requirement.
>>
>> We support this by using the bcm_sf2 Compact Field Processor (CFP) which
>> supports matching packets and tagging them with an unique identifier
>> (Classification ID) that is added in each packet being matched through the use
>> of Broadcom tags. The SYSTEMPORT MAC attached to that switch is then used to
>> match that unique identifier and trigger a system wake-up event.
>>
>> Last patch is the ethtool modifications to support that feature.
>>
>> Example:
>>
>> ethtool --config-nfc gphy flow-type udp4 src-ip 192.168.1.1 dst-ip 192.168.1.32 \
>> src-port 1234 dst-port 5678 action 64
>> Added rule with ID 1
>
> Hi Florian
>
> What is action 64?
There are 8 egress queues per port, and we want to target port 8 here.
Number of queues is discoverable through sysfs by scanning
/sys/class/net/gphy/queues/tx-*. CPU port number is fixed at 8, we don't
have a mechanism AFAICT to expose that to users, because, of course, we
don't expose the CPU port with DSA.
>
>> ethtool -s gphy wol f filters 0x2
>
> What does this 0x2 represent?
0x2 = bit 1 is set, which corresponds to the filter ID that was returned
from the previous ethtool::rxnfc command invocation. If ethtool
--config-nfc returned 3, then we would have used filters 0x8, etc.
--
Florian
^ 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