* Re: [PATCH net] ipv6: drop non loopback packets claiming to originate from ::1
From: David Miller @ 2017-04-17 19:09 UTC (permalink / raw)
To: fw; +Cc: netdev
In-Reply-To: <20170414182243.24506-1-fw@strlen.de>
From: Florian Westphal <fw@strlen.de>
Date: Fri, 14 Apr 2017 20:22:43 +0200
> We lack a saddr check for ::1. This causes security issues e.g. with acls
> permitting connections from ::1 because of assumption that these originate
> from local machine.
>
> Assuming a source address of ::1 is local seems reasonable.
> RFC4291 doesn't allow such a source address either, so drop such packets.
>
> Reported-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
Applied, thanks Florian.
^ permalink raw reply
* Re: [PATCH -next] net: phy: test the right variable in phy_write_mmd()
From: David Miller @ 2017-04-17 19:11 UTC (permalink / raw)
To: dan.carpenter; +Cc: andrew, rmk+kernel, f.fainelli, netdev, kernel-janitors
In-Reply-To: <20170414191041.GA27478@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 14 Apr 2017 22:10:41 +0300
> This is a copy and paste buglet. We meant to test for ->write_mmd but
> we test for ->read_mmd.
>
> Fixes: 1ee6b9bc6206 ("net: phy: make phy_(read|write)_mmd() generic MMD accessors")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied, thanks Dan.
^ permalink raw reply
* Re: [PATCH net-next 1/2] netvsc: fix RCU warning in get_stats
From: David Miller @ 2017-04-17 19:13 UTC (permalink / raw)
To: stephen; +Cc: netdev, sthemmin
In-Reply-To: <20170414214258.3367-1-sthemmin@microsoft.com>
Both patches applied but you may want to use more consistent
Subject line subsystem prefixes in the future.
^ permalink raw reply
* Re: [PATCH] net: natsemi: ns83820: add checks for dma mapping error
From: David Miller @ 2017-04-17 19:17 UTC (permalink / raw)
To: khoroshilov; +Cc: netdev, linux-kernel, ldv-project
In-Reply-To: <1492210250-17200-1-git-send-email-khoroshilov@ispras.ru>
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Sat, 15 Apr 2017 01:50:50 +0300
> @@ -1136,6 +1141,10 @@ static netdev_tx_t ns83820_hard_start_xmit(struct sk_buff *skb,
> if (nr_frags)
> len -= skb->data_len;
> buf = pci_map_single(dev->pci_dev, skb->data, len, PCI_DMA_TODEVICE);
> + if (pci_dma_mapping_error(dev->pci_dev, buf)) {
> + dev_kfree_skb_any(skb);
> + return NETDEV_TX_OK;
> + }
>
> first_desc = dev->tx_descs + (free_idx * DESC_SIZE);
>
You need to also add this check for the skb_map_dma_frag() calls below
this line, and therefore you'll need to add unwind on such a failure.
^ permalink raw reply
* [PATCH net-next v3] bonding: deliver link-local packets with skb->dev set to link that packets arrived on
From: Chonggang Li @ 2017-04-17 19:19 UTC (permalink / raw)
To: j.vosburgh, andy, vfalico, nikolay, edumazet, davem
Cc: netdev, Chonggang Li, Mahesh Bandewar, Maciej Żenczykowski,
Jay Vosburgh
Bonding driver changes the skb->dev to the bonding-master before
passing the packet to stack for further processing. This, however
does not make sense for the link-local packets and it loses "the
link info" once its skb->dev is changed to bonding-master. This
patch changes this behavior for link-local packets by not changing
the skb->dev to the bonding-master and maintaining it as it is,
i.e. the link on which the packet arrived.
Signed-off-by: Chonggang Li <chonggangli@google.com>
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
---
Changes in v2:
- Make the commit message more clearer.
Changes in v3:
- Fix a typo in commit message.
drivers/net/bonding/bond_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 01e4a69af421..6bd3b50faf48 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1176,6 +1176,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
}
}
+ /* don't change skb->dev for link-local packets */
+ if (is_link_local_ether_addr(eth_hdr(skb)->h_dest))
+ return RX_HANDLER_PASS;
if (bond_should_deliver_exact_match(skb, slave, bond))
return RX_HANDLER_EXACT;
--
2.12.2.762.g0e3151a226-goog
^ permalink raw reply related
* Re: [PATCH net-next] drivers: net: xgene-v2: Extend ethtool statistics
From: David Miller @ 2017-04-17 19:20 UTC (permalink / raw)
To: isubramanian; +Cc: netdev, linux-arm-kernel, patches, kchudgar
In-Reply-To: <1492213698-27813-1-git-send-email-isubramanian@apm.com>
From: Iyappan Subramanian <isubramanian@apm.com>
Date: Fri, 14 Apr 2017 16:48:18 -0700
> + XGE_EXTD_STAT(rx_byte_cntr, RBYT),
> + XGE_EXTD_STAT(rx_pkt_cntr, RPKT),
> + XGE_EXTD_STAT(rx_fcs_error_cntr, RFCS),
> + XGE_EXTD_STAT(rx_multicast_pkt_cntr, RMCA),
> + XGE_EXTD_STAT(rx_broadcast_pkt_cntr, RBCA),
Do not duplicate statistics already reported via xge_get_stats64().
^ permalink raw reply
* Re: [PATCH net-next v2] Add uid and cookie bpf helper to cg_skb_func_proto
From: David Miller @ 2017-04-17 19:22 UTC (permalink / raw)
To: chenbofeng.kernel; +Cc: netdev, lorenzo, willemb, fengc
In-Reply-To: <1492219526-2945-1-git-send-email-chenbofeng.kernel@gmail.com>
From: Chenbo Feng <chenbofeng.kernel@gmail.com>
Date: Fri, 14 Apr 2017 18:25:26 -0700
> From: Chenbo Feng <fengc@google.com>
>
> BPF helper functions get_socket_cookie and get_socket_uid can be
> used for network traffic classifications, among others. Expose
> them also to programs of type BPF_PROG_TYPE_CGROUP_SKB. As of
> commit 8f917bba0042 ("bpf: pass sk to helper functions") the
> required skb->sk function is available at both cgroup bpf ingress
> and egress hooks. With these two new helper, cg_skb_func_proto is
> effectively the same as sk_filter_func_proto.
>
> Change since V1:
> Instead of add the helper to cg_skb_func_proto, redirect the
> cg_skb_func_proto to sk_filter_func_proto since all helper function
> in sk_filter_func_proto are applicable to cg_skb_func_proto now.
>
> Signed-off-by: Chenbo Feng <fengc@google.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] gso: Validate assumption of frag_list segementation
From: David Miller @ 2017-04-17 19:32 UTC (permalink / raw)
To: ilant
Cc: netdev, alexander.h.duyck, eric.dumazet, steffen.klassert, borisp,
ilyal
In-Reply-To: <20170416080007.15990-1-ilant@mellanox.com>
From: <ilant@mellanox.com>
Date: Sun, 16 Apr 2017 11:00:07 +0300
> From: Ilan Tayari <ilant@mellanox.com>
>
> Commit 07b26c9454a2 ("gso: Support partial splitting at the frag_list
> pointer") assumes that all SKBs in a frag_list (except maybe the last
> one) contain the same amount of GSO payload.
>
> This assumption is not always correct, resulting in the following
> warning message in the log:
> skb_segment: too many frags
>
> For example, mlx5 driver in Striding RQ mode creates some RX SKBs with
> one frag, and some with 2 frags.
> After GRO, the frag_list SKBs end up having different amounts of payload.
> If this frag_list SKB is then forwarded, the aforementioned assumption
> is violated.
>
> Validate the assumption, and fall back to software GSO if it not true.
>
> Fixes: 07b26c9454a2 ("gso: Support partial splitting at the frag_list pointer")
> Signed-off-by: Ilan Tayari <ilant@mellanox.com>
> Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
> ---
Your commit message mentions a fixes tag which make this change seem
relevant for 'net', but your patch depends upon things in 'net-next'
and therefore only applies there.
I've added this change to net-next, but I want an explanation of why
this change is not targettting 'net' if it seems to fix a problem
there.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next 1/1] ipv6: sr: fix BUG due to headroom too small after SRH push
From: David Miller @ 2017-04-17 19:34 UTC (permalink / raw)
To: david.lebrun; +Cc: netdev
In-Reply-To: <20170416102714.11508-1-david.lebrun@uclouvain.be>
From: David Lebrun <david.lebrun@uclouvain.be>
Date: Sun, 16 Apr 2017 12:27:14 +0200
> When a locally generated packet receives an SRH with two or more segments,
> the remaining headroom is too small to push an ethernet header. This patch
> ensures that the headroom is large enough after SRH push.
>
> The BUG generated the following trace.
...
> Fixes: 19d5a26f5ef8de5dcb78799feaf404d717b1aac3 ("ipv6: sr: expand skb head only if necessary")
> Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next] net: rtnetlink: plumb extended ack to doit function
From: David Miller @ 2017-04-17 19:45 UTC (permalink / raw)
To: dsa; +Cc: netdev, jhs
In-Reply-To: <1492361304-6116-1-git-send-email-dsa@cumulusnetworks.com>
From: David Ahern <dsa@cumulusnetworks.com>
Date: Sun, 16 Apr 2017 09:48:24 -0700
> Add netlink_ext_ack arg to rtnl_doit_func. Pass extack arg to nlmsg_parse
> for doit functions that call it directly.
>
> This is the first step to using extended error reporting in rtnetlink.
> From here individual subsystems can be updated to set netlink_ext_ack as
> needed.
>
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Applied, thanks David.
^ permalink raw reply
* Re: [PATCH net-next v2] bonding: deliver link-local packets with skb->dev set to link that packets arrived on
From: David Miller @ 2017-04-17 19:46 UTC (permalink / raw)
To: chonggangli
Cc: j.vosburgh, andy, vfalico, nikolay, edumazet, netdev, maheshb,
maze
In-Reply-To: <20170416190218.57224-1-chonggangli@google.com>
From: Chonggang Li <chonggangli@google.com>
Date: Sun, 16 Apr 2017 12:02:18 -0700
> Bonding driver changes the skb->dev to the bonding-master before
> passing the packet to stack for further processing. This, however
> does not make sense for the link-local packets and it looses "the
> link info" once its skb->dev is changed to bonding-master. This
> patch changes this behavior for link-local packets by not changing
> the skb->dev to the bonding-master and maintaining it as it is,
> i.e. the link on which the packet arrived.
>
> Signed-off-by: Chonggang Li <chonggangli@google.com>
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
> ---
> Changes in v2:
> - Make the commit message more clearer.
Applied with "looses" type fixed.
^ permalink raw reply
* Re: [PATCH v3 net-next RFC] Generic XDP
From: David Miller @ 2017-04-17 19:49 UTC (permalink / raw)
To: brouer; +Cc: alexei.starovoitov, kubakici, netdev, xdp-newbies
In-Reply-To: <20170416222601.671f037c@redhat.com>
From: Jesper Dangaard Brouer <brouer@redhat.com>
Date: Sun, 16 Apr 2017 22:26:01 +0200
> The bpf tail-call use-case is a very good example of why the
> verifier cannot deduct the needed HEADROOM upfront.
This brings up a very interesting question for me.
I notice that tail calls are implemented by JITs largely by skipping
over the prologue of that destination program.
However, many JITs preload cached SKB values into fixed registers in
the prologue. But they only do this if the program being JITed needs
those values.
So how can it work properly if a program that does not need the SKB
values tail calls into one that does?
Daniel, Alexei?
^ permalink raw reply
* Re: [PATCH net 0/2] Two BPF fixes
From: David Miller @ 2017-04-17 19:52 UTC (permalink / raw)
To: daniel; +Cc: alexei.starovoitov, kubakici, netdev
In-Reply-To: <cover.1492390940.git.daniel@iogearbox.net>
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Mon, 17 Apr 2017 03:12:05 +0200
> The set fixes cb_access and xdp_adjust_head bits in struct bpf_prog,
> that are used for requirement checks on the program rather than f.e.
> heuristics. Thus, for tail calls, we cannot make any assumptions and
> are forced to set them.
Series applied, thanks.
Tail calls bring up all kinds of caching and assumption issues, see my
question in another thread about how register cached SKB parameters
are handled in JITs across tail calls.
^ permalink raw reply
* Re: [PATCH] net: cx89x0: move attribute declaration before struct keyword
From: David Miller @ 2017-04-17 20:09 UTC (permalink / raw)
To: stefan; +Cc: shc_work, jarod, netdev, linux-kernel
In-Reply-To: <20170417062032.22764-1-stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Sun, 16 Apr 2017 23:20:32 -0700
> The attribute declaration is typically before the definition. Move
> the __maybe_unused attribute declaration before the struct keyword.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
Well, I see if just as often after the variable name too:
net/irda/iriap.c:static const char *const ias_charset_types[] __maybe_unused = {
net/irda/irlap.c:static const char *const lap_reasons[] __maybe_unused = {
net/irda/irlap_event.c:static const char *const irlap_event[] __maybe_unused = {
net/irda/irlmp_event.c:static const char *const irlmp_event[] __maybe_unused = {
Or after the struct:
drivers/net/phy/ste10Xp.c:static struct mdio_device_id __maybe_unused ste10Xp_tbl[] = {
drivers/net/phy/teranetics.c:static struct mdio_device_id __maybe_unused teranetics_tbl[] = {
drivers/net/phy/vitesse.c:static struct mdio_device_id __maybe_unused vitesse_tbl[] = {
So unless we decide tree wide to do it in one order or another, such changes
are largely a waste of time.
Sorry I'm not applying this patch.
^ permalink raw reply
* Re: [PATCH v2] sh_eth: unmap DMA buffers when freeing rings
From: David Miller @ 2017-04-17 20:10 UTC (permalink / raw)
To: sergei.shtylyov; +Cc: netdev, linux-renesas-soc, horms
In-Reply-To: <20170417125532.826640693@cogentembedded.com>
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Mon, 17 Apr 2017 15:55:22 +0300
> The DMA API debugging (when enabled) causes:
>
> WARNING: CPU: 0 PID: 1445 at lib/dma-debug.c:519 add_dma_entry+0xe0/0x12c
> DMA-API: exceeded 7 overlapping mappings of cacheline 0x01b2974d
>
> to be printed after repeated initialization of the Ether device, e.g.
> suspend/resume or 'ifconfig' up/down. This is because DMA buffers mapped
> using dma_map_single() in sh_eth_ring_format() and sh_eth_start_xmit() are
> never unmapped. Resolve this problem by unmapping the buffers when freeing
> the descriptor rings; in order to do it right, we'd have to add an extra
> parameter to sh_eth_txfree() (we rename this function to sh_eth_tx_free(),
> while at it).
>
> Based on the commit a47b70ea86bd ("ravb: unmap descriptors when freeing
> rings").
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH v3 3/4] bluetooth: hci_uart: add LL protocol serdev driver support
From: Adam Ford @ 2017-04-17 20:11 UTC (permalink / raw)
To: Rob Herring
Cc: Marcel Holtmann, linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA, Johan Hedberg,
Gustavo Padovan, Satish Patel, Wei Xu, Eyal Reizer,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <20170413150353.7389-4-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
On Thu, Apr 13, 2017 at 10:03 AM, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> Turns out that the LL protocol and the TI-ST are the same thing AFAICT.
> The TI-ST adds firmware loading, GPIO control, and shared access for
> NFC, FM radio, etc. For now, we're only implementing what is needed for
> BT. This mirrors other drivers like BCM and Intel, but uses the new
> serdev bus.
>
> The firmware loading is greatly simplified by using existing
> infrastructure to send commands. It may be a bit slower than the
> original code using synchronous functions, but the real bottleneck is
> likely doing firmware load at 115.2kbps.
I am using pdata-quirks to drive my wl1283 Bluetooth on a DM3730. I
have the Bluetooth set to 3000000 baud in pdata quirks. Looking at
the binding, I don't see an option to set the baudrate. Is there (or
will there) be a way to set the baud rate of the Bluetooth?
adam
>
> Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
> Cc: Gustavo Padovan <gustavo-THi1TnShQwVAfugRpC6u6w@public.gmane.org>
> Cc: Johan Hedberg <johan.hedberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> ---
> v3:
> - rebase on bluetooth-next
> - Add explicit of.h include
> v2:
> - Use IS_ENABLED() to fix module build
>
> drivers/bluetooth/hci_ll.c | 262 ++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 261 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
> index 02692fe30279..485e8eb04542 100644
> --- a/drivers/bluetooth/hci_ll.c
> +++ b/drivers/bluetooth/hci_ll.c
> @@ -34,20 +34,24 @@
> #include <linux/sched.h>
> #include <linux/types.h>
> #include <linux/fcntl.h>
> +#include <linux/firmware.h>
> #include <linux/interrupt.h>
> #include <linux/ptrace.h>
> #include <linux/poll.h>
>
> #include <linux/slab.h>
> -#include <linux/tty.h>
> #include <linux/errno.h>
> #include <linux/string.h>
> #include <linux/signal.h>
> #include <linux/ioctl.h>
> +#include <linux/of.h>
> +#include <linux/serdev.h>
> #include <linux/skbuff.h>
> +#include <linux/ti_wilink_st.h>
>
> #include <net/bluetooth/bluetooth.h>
> #include <net/bluetooth/hci_core.h>
> +#include <linux/gpio/consumer.h>
>
> #include "hci_uart.h"
>
> @@ -76,6 +80,12 @@ struct hcill_cmd {
> u8 cmd;
> } __packed;
>
> +struct ll_device {
> + struct hci_uart hu;
> + struct serdev_device *serdev;
> + struct gpio_desc *enable_gpio;
> +};
> +
> struct ll_struct {
> unsigned long rx_state;
> unsigned long rx_count;
> @@ -136,6 +146,9 @@ static int ll_open(struct hci_uart *hu)
>
> hu->priv = ll;
>
> + if (hu->serdev)
> + serdev_device_open(hu->serdev);
> +
> return 0;
> }
>
> @@ -164,6 +177,13 @@ static int ll_close(struct hci_uart *hu)
>
> kfree_skb(ll->rx_skb);
>
> + if (hu->serdev) {
> + struct ll_device *lldev = serdev_device_get_drvdata(hu->serdev);
> + gpiod_set_value_cansleep(lldev->enable_gpio, 0);
> +
> + serdev_device_close(hu->serdev);
> + }
> +
> hu->priv = NULL;
>
> kfree(ll);
> @@ -505,9 +525,245 @@ static struct sk_buff *ll_dequeue(struct hci_uart *hu)
> return skb_dequeue(&ll->txq);
> }
>
> +#if IS_ENABLED(CONFIG_SERIAL_DEV_BUS)
> +static int read_local_version(struct hci_dev *hdev)
> +{
> + int err = 0;
> + unsigned short version = 0;
> + struct sk_buff *skb;
> + struct hci_rp_read_local_version *ver;
> +
> + skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, HCI_INIT_TIMEOUT);
> + if (IS_ERR(skb)) {
> + bt_dev_err(hdev, "Reading TI version information failed (%ld)",
> + PTR_ERR(skb));
> + err = PTR_ERR(skb);
> + goto out;
> + }
> + if (skb->len != sizeof(*ver)) {
> + err = -EILSEQ;
> + goto out;
> + }
> +
> + ver = (struct hci_rp_read_local_version *)skb->data;
> + if (le16_to_cpu(ver->manufacturer) != 13) {
> + err = -ENODEV;
> + goto out;
> + }
> +
> + version = le16_to_cpu(ver->lmp_subver);
> +
> +out:
> + if (err) bt_dev_err(hdev, "Failed to read TI version info: %d", err);
> + kfree_skb(skb);
> + return err ? err : version;
> +}
> +
> +/**
> + * download_firmware -
> + * internal function which parses through the .bts firmware
> + * script file intreprets SEND, DELAY actions only as of now
> + */
> +static int download_firmware(struct ll_device *lldev)
> +{
> + unsigned short chip, min_ver, maj_ver;
> + int version, err, len;
> + unsigned char *ptr, *action_ptr;
> + unsigned char bts_scr_name[40]; /* 40 char long bts scr name? */
> + const struct firmware *fw;
> + struct sk_buff *skb;
> + struct hci_command *cmd;
> +
> + version = read_local_version(lldev->hu.hdev);
> + if (version < 0)
> + return version;
> +
> + chip = (version & 0x7C00) >> 10;
> + min_ver = (version & 0x007F);
> + maj_ver = (version & 0x0380) >> 7;
> + if (version & 0x8000)
> + maj_ver |= 0x0008;
> +
> + snprintf(bts_scr_name, sizeof(bts_scr_name),
> + "ti-connectivity/TIInit_%d.%d.%d.bts",
> + chip, maj_ver, min_ver);
> +
> + err = request_firmware(&fw, bts_scr_name, &lldev->serdev->dev);
> + if (err || !fw->data || !fw->size) {
> + bt_dev_err(lldev->hu.hdev, "request_firmware failed(errno %d) for %s",
> + err, bts_scr_name);
> + return -EINVAL;
> + }
> + ptr = (void *)fw->data;
> + len = fw->size;
> + /* bts_header to remove out magic number and
> + * version
> + */
> + ptr += sizeof(struct bts_header);
> + len -= sizeof(struct bts_header);
> +
> + while (len > 0 && ptr) {
> + bt_dev_dbg(lldev->hu.hdev, " action size %d, type %d ",
> + ((struct bts_action *)ptr)->size,
> + ((struct bts_action *)ptr)->type);
> +
> + action_ptr = &(((struct bts_action *)ptr)->data[0]);
> +
> + switch (((struct bts_action *)ptr)->type) {
> + case ACTION_SEND_COMMAND: /* action send */
> + bt_dev_dbg(lldev->hu.hdev, "S");
> + cmd = (struct hci_command *)action_ptr;
> + if (cmd->opcode == 0xff36) {
> + /* ignore remote change
> + * baud rate HCI VS command */
> + bt_dev_warn(lldev->hu.hdev, "change remote baud rate command in firmware");
> + break;
> + }
> + if (cmd->prefix != 1)
> + bt_dev_dbg(lldev->hu.hdev, "command type %d\n", cmd->prefix);
> +
> + skb = __hci_cmd_sync(lldev->hu.hdev, cmd->opcode, cmd->plen, &cmd->speed, HCI_INIT_TIMEOUT);
> + if (IS_ERR(skb)) {
> + bt_dev_err(lldev->hu.hdev, "send command failed\n");
> + goto out_rel_fw;
> + }
> + kfree_skb(skb);
> + break;
> + case ACTION_WAIT_EVENT: /* wait */
> + /* no need to wait as command was synchronous */
> + bt_dev_dbg(lldev->hu.hdev, "W");
> + break;
> + case ACTION_DELAY: /* sleep */
> + bt_dev_info(lldev->hu.hdev, "sleep command in scr");
> + mdelay(((struct bts_action_delay *)action_ptr)->msec);
> + break;
> + }
> + len -= (sizeof(struct bts_action) +
> + ((struct bts_action *)ptr)->size);
> + ptr += sizeof(struct bts_action) +
> + ((struct bts_action *)ptr)->size;
> + }
> +
> +out_rel_fw:
> + /* fw download complete */
> + release_firmware(fw);
> + return err;
> +}
> +
> +static int ll_setup(struct hci_uart *hu)
> +{
> + int err, retry = 3;
> + struct ll_device *lldev;
> + struct serdev_device *serdev = hu->serdev;
> + u32 speed;
> +
> + if (!serdev)
> + return 0;
> +
> + lldev = serdev_device_get_drvdata(serdev);
> +
> + serdev_device_set_flow_control(serdev, true);
> +
> + do {
> + /* Configure BT_EN to HIGH state */
> + gpiod_set_value_cansleep(lldev->enable_gpio, 0);
> + msleep(5);
> + gpiod_set_value_cansleep(lldev->enable_gpio, 1);
> + msleep(100);
> +
> + err = download_firmware(lldev);
> + if (!err)
> + break;
> +
> + /* Toggle BT_EN and retry */
> + bt_dev_err(hu->hdev, "download firmware failed, retrying...");
> + } while (retry--);
> +
> + if (err)
> + return err;
> +
> + /* Operational speed if any */
> + if (hu->oper_speed)
> + speed = hu->oper_speed;
> + else if (hu->proto->oper_speed)
> + speed = hu->proto->oper_speed;
> + else
> + speed = 0;
> +
> + if (speed) {
> + struct sk_buff *skb = __hci_cmd_sync(hu->hdev, 0xff36, sizeof(speed), &speed, HCI_INIT_TIMEOUT);
> + if (!IS_ERR(skb)) {
> + kfree_skb(skb);
> + serdev_device_set_baudrate(serdev, speed);
> + }
> + }
> +
> + return 0;
> +}
> +
> +static const struct hci_uart_proto llp;
> +
> +static int hci_ti_probe(struct serdev_device *serdev)
> +{
> + struct hci_uart *hu;
> + struct ll_device *lldev;
> + u32 max_speed = 3000000;
> +
> + lldev = devm_kzalloc(&serdev->dev, sizeof(struct ll_device), GFP_KERNEL);
> + if (!lldev)
> + return -ENOMEM;
> + hu = &lldev->hu;
> +
> + serdev_device_set_drvdata(serdev, lldev);
> + lldev->serdev = hu->serdev = serdev;
> +
> + lldev->enable_gpio = devm_gpiod_get_optional(&serdev->dev, "enable", GPIOD_OUT_LOW);
> + if (IS_ERR(lldev->enable_gpio))
> + return PTR_ERR(lldev->enable_gpio);
> +
> + of_property_read_u32(serdev->dev.of_node, "max-speed", &max_speed);
> + hci_uart_set_speeds(hu, 115200, max_speed);
> +
> + return hci_uart_register_device(hu, &llp);
> +}
> +
> +static void hci_ti_remove(struct serdev_device *serdev)
> +{
> + struct ll_device *lldev = serdev_device_get_drvdata(serdev);
> + struct hci_uart *hu = &lldev->hu;
> + struct hci_dev *hdev = hu->hdev;
> +
> + cancel_work_sync(&hu->write_work);
> +
> + hci_unregister_dev(hdev);
> + hci_free_dev(hdev);
> + hu->proto->close(hu);
> +}
> +
> +static const struct of_device_id hci_ti_of_match[] = {
> + { .compatible = "ti,wl1831-st" },
> + { .compatible = "ti,wl1835-st" },
> + { .compatible = "ti,wl1837-st" },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, hci_ti_of_match);
> +
> +static struct serdev_device_driver hci_ti_drv = {
> + .driver = {
> + .name = "hci-ti",
> + .of_match_table = of_match_ptr(hci_ti_of_match),
> + },
> + .probe = hci_ti_probe,
> + .remove = hci_ti_remove,
> +};
> +#else
> +#define ll_setup NULL
> +#endif
> +
> static const struct hci_uart_proto llp = {
> .id = HCI_UART_LL,
> .name = "LL",
> + .setup = ll_setup,
> .open = ll_open,
> .close = ll_close,
> .recv = ll_recv,
> @@ -518,10 +774,14 @@ static const struct hci_uart_proto llp = {
>
> int __init ll_init(void)
> {
> + serdev_device_driver_register(&hci_ti_drv);
> +
> return hci_uart_register_proto(&llp);
> }
>
> int __exit ll_deinit(void)
> {
> + serdev_device_driver_unregister(&hci_ti_drv);
> +
> return hci_uart_unregister_proto(&llp);
> }
> --
> 2.11.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH RFC] sparc64: eBPF JIT
From: David Miller @ 2017-04-17 20:12 UTC (permalink / raw)
To: daniel; +Cc: sparclinux, netdev, ast
In-Reply-To: <58F50D13.3090001@iogearbox.net>
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Mon, 17 Apr 2017 20:44:35 +0200
> On a quick initial glance, you also need to map BPF_REG_AX. If
> I understand the convention correctly, you could use L7 for that.
>
> You can test for it through tools/testing/selftests/bpf/test_kmod.sh
> which exercises the test_bpf.ko under various sysctl combinations as
> part of the BPF selftest suite.
Ok, blinding works properly with this fix:
--- arch/sparc/net/bpf_jit.h~ 2017-04-13 17:44:24.084936201 -0700
+++ arch/sparc/net/bpf_jit.h 2017-04-17 12:07:22.559029482 -0700
@@ -17,8 +17,10 @@
#ifndef __ASSEMBLER__
#define G0 0x00
#define G1 0x01
+#define G2 0x02
#define G3 0x03
#define G6 0x06
+#define G7 0x07
#define O0 0x08
#define O1 0x09
#define O2 0x0a
--- arch/sparc/net/bpf_jit_comp.c~ 2017-04-16 20:24:49.060342700 -0700
+++ arch/sparc/net/bpf_jit_comp.c 2017-04-17 12:05:08.470048483 -0700
@@ -195,10 +195,12 @@ static const int bpf2sparc[] = {
/* read-only frame pointer to access stack */
[BPF_REG_FP] = FP,
+ [BPF_REG_AX] = G7,
+
/* temporary register for internal BPF JIT */
[TMP_REG_1] = G1,
- [TMP_REG_2] = G3,
- [TMP_REG_3] = L6,
+ [TMP_REG_2] = G2,
+ [TMP_REG_3] = G3,
[SKB_HLEN_REG] = L4,
[SKB_DATA_REG] = L5,
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -31,7 +31,8 @@ config SPARC
select ARCH_WANT_IPC_PARSE_VERSION
select GENERIC_PCI_IOMAP
select HAVE_NMI_WATCHDOG if SPARC64
- select HAVE_CBPF_JIT
+ select HAVE_CBPF_JIT if SPARC32
+ select HAVE_EBPF_JIT if SPARC64
select HAVE_DEBUG_BUGVERBOSE
select GENERIC_SMP_IDLE_THREAD
select GENERIC_CLOCKEVENTS
^ permalink raw reply
* Re: [PATCH] net: cx89x0: move attribute declaration before struct keyword
From: Stefan Agner @ 2017-04-17 20:31 UTC (permalink / raw)
To: David Miller; +Cc: shc_work, jarod, netdev, linux-kernel
In-Reply-To: <20170417.160942.2196583103295700079.davem@redhat.com>
On 2017-04-17 13:09, David Miller wrote:
> From: Stefan Agner <stefan@agner.ch>
> Date: Sun, 16 Apr 2017 23:20:32 -0700
>
>> The attribute declaration is typically before the definition. Move
>> the __maybe_unused attribute declaration before the struct keyword.
>>
>> Signed-off-by: Stefan Agner <stefan@agner.ch>
>
I did catch that while compiling with clang, and the exact error message
is:
drivers/net/ethernet/cirrus/cs89x0.c:1899:21: warning: attribute
declaration must precede definition [-Wignored-attributes]
static const struct __maybe_unused of_device_id cs89x0_match[] = {
> Well, I see if just as often after the variable name too:
>
> net/irda/iriap.c:static const char *const ias_charset_types[] __maybe_unused = {
> net/irda/irlap.c:static const char *const lap_reasons[] __maybe_unused = {
> net/irda/irlap_event.c:static const char *const irlap_event[] __maybe_unused = {
> net/irda/irlmp_event.c:static const char *const irlmp_event[] __maybe_unused = {
>
That seems not to fire when compiling with clang. I guess because the
attribute is after the _complete_ type?
> Or after the struct:
>
> drivers/net/phy/ste10Xp.c:static struct mdio_device_id __maybe_unused
> ste10Xp_tbl[] = {
> drivers/net/phy/teranetics.c:static struct mdio_device_id
> __maybe_unused teranetics_tbl[] = {
> drivers/net/phy/vitesse.c:static struct mdio_device_id __maybe_unused
> vitesse_tbl[] = {
>
Same here...
> So unless we decide tree wide to do it in one order or another, such changes
> are largely a waste of time.
Afaik, "struct of_device_id" as a whole is a type. This case is really
odd since it puts the attribute in the middle of a type. It is the only
instance which came across (not everything compiles fine with clang yet,
so there might be more... but a quick grep did not turn up more of the
same cases)...
>
> Sorry I'm not applying this patch.
Given that, can you reconsider?
^ permalink raw reply
* Re: [PATCH v2 0/9] ftgmac100: Rework batch 5 - Features
From: Benjamin Herrenschmidt @ 2017-04-17 20:44 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20170417.111131.340382798463663490.davem@davemloft.net>
On Mon, 2017-04-17 at 11:11 -0400, David Miller wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Date: Thu, 13 Apr 2017 14:39:07 +1000
>
> > This is the second spin of the fifth and last batch of
> > updates to the ftgmac100 driver.
>
> This series doesn't apply cleanly to net-next, please respin.
Sure, I'll do this today. Thanks.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] net: cx89x0: move attribute declaration before struct keyword
From: David Miller @ 2017-04-17 20:44 UTC (permalink / raw)
To: stefan; +Cc: shc_work, jarod, netdev, linux-kernel
In-Reply-To: <6fbaa209a827778ff56a7ac3b36e5e17@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Mon, 17 Apr 2017 13:31:28 -0700
> Given that, can you reconsider?
Please put the attribute after the compete type.
Thanks.
^ permalink raw reply
* [PATCH v2] net: cx89x0: move attribute declaration before struct keyword
From: Stefan Agner @ 2017-04-17 20:54 UTC (permalink / raw)
To: davem; +Cc: shc_work, jarod, netdev, linux-kernel, Stefan Agner
The attribute declaration is typically before the definition. Move
the __maybe_unused attribute declaration before the struct keyword.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
Changes in v2:
- Move __maybe_unused after the complete type
drivers/net/ethernet/cirrus/cs89x0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index 3647b28e8de0..47384f7323ac 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -1896,7 +1896,7 @@ static int cs89x0_platform_remove(struct platform_device *pdev)
return 0;
}
-static const struct __maybe_unused of_device_id cs89x0_match[] = {
+static const struct of_device_id __maybe_unused cs89x0_match[] = {
{ .compatible = "cirrus,cs8900", },
{ .compatible = "cirrus,cs8920", },
{ },
--
2.12.2
^ permalink raw reply related
* Re: [PATCH RFC] sparc64: eBPF JIT
From: Daniel Borkmann @ 2017-04-17 20:55 UTC (permalink / raw)
To: David Miller; +Cc: sparclinux, netdev, ast
In-Reply-To: <20170417.150326.345314944044934203.davem@davemloft.net>
On 04/17/2017 09:03 PM, David Miller wrote:
> From: Daniel Borkmann <daniel@iogearbox.net>
> Date: Mon, 17 Apr 2017 20:44:35 +0200
>
>> On 04/17/2017 05:38 AM, David Miller wrote:
>>> +/* Map BPF registers to SPARC registers */
>>> +static const int bpf2sparc[] = {
>>> + /* return value from in-kernel function, and exit value from eBPF */
>>> + [BPF_REG_0] = I5,
>>> +
>>> + /* arguments from eBPF program to in-kernel function */
>>> + [BPF_REG_1] = I0,
>>> + [BPF_REG_2] = I1,
>>> + [BPF_REG_3] = I2,
>>> + [BPF_REG_4] = I3,
>>> + [BPF_REG_5] = I4,
>>> +
>>> + /* callee saved registers that in-kernel function will preserve */
>>> + [BPF_REG_6] = L0,
>>> + [BPF_REG_7] = L1,
>>> + [BPF_REG_8] = L2,
>>> + [BPF_REG_9] = L3,
>>> +
>>> + /* read-only frame pointer to access stack */
>>> + [BPF_REG_FP] = FP,
>>
>> On a quick initial glance, you also need to map BPF_REG_AX. If
>> I understand the convention correctly, you could use L7 for that.
>>
>> You can test for it through tools/testing/selftests/bpf/test_kmod.sh
>> which exercises the test_bpf.ko under various sysctl combinations as
>> part of the BPF selftest suite.
>
> Oh I see, it's used for constant blinding. I can use a global register
> for that since it's only used as a temporary right?
Yeah, correct.
^ permalink raw reply
* [PATCH] mac80211: ibss: Fix channel type enum in ieee80211_sta_join_ibss()
From: Matthias Kaehlcke @ 2017-04-17 20:59 UTC (permalink / raw)
To: Johannes Berg, David S . Miller, Simon Wunderlich
Cc: linux-wireless, netdev, linux-kernel, Grant Grundler,
Greg Hackmann, Michael Davidson, Matthias Kaehlcke
cfg80211_chandef_create() expects an 'enum nl80211_channel_type' as
channel type however in ieee80211_sta_join_ibss()
NL80211_CHAN_WIDTH_20_NOHT is passed in two occasions, which is of
the enum type 'nl80211_chan_width'. Change the value to NL80211_CHAN_NO_HT
(20 MHz, non-HT channel) of the channel type enum.
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
net/mac80211/ibss.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 98999d3d5262..e957351976a2 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -425,7 +425,7 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
case NL80211_CHAN_WIDTH_5:
case NL80211_CHAN_WIDTH_10:
cfg80211_chandef_create(&chandef, cbss->channel,
- NL80211_CHAN_WIDTH_20_NOHT);
+ NL80211_CHAN_NO_HT);
chandef.width = sdata->u.ibss.chandef.width;
break;
case NL80211_CHAN_WIDTH_80:
@@ -437,7 +437,7 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
default:
/* fall back to 20 MHz for unsupported modes */
cfg80211_chandef_create(&chandef, cbss->channel,
- NL80211_CHAN_WIDTH_20_NOHT);
+ NL80211_CHAN_NO_HT);
break;
}
--
2.12.2.762.g0e3151a226-goog
^ permalink raw reply related
* [PATCH net-next] net: ipv6: Fix UDP early demux lookup with udp_l3mdev_accept=0
From: Subash Abhinov Kasiviswanathan @ 2017-04-17 21:11 UTC (permalink / raw)
To: dsa, davem, netdev, rshearma, eric.dumazet; +Cc: Subash Abhinov Kasiviswanathan
David Ahern reported that 5425077d73e0c ("net: ipv6: Add early demux
handler for UDP unicast") breaks udp_l3mdev_accept=0 since early
demux for IPv6 UDP was doing a generic socket lookup which does not
require an exact match. Fix this by making UDPv6 early demux match
connected sockets only.
Fixes: 5425077d73e0c ("net: ipv6: Add early demux handler for UDP unicast")
Reported-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
net/ipv6/udp.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index b793ed1..0e307e5 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -46,6 +46,7 @@
#include <net/tcp_states.h>
#include <net/ip6_checksum.h>
#include <net/xfrm.h>
+#include <net/inet_hashtables.h>
#include <net/inet6_hashtables.h>
#include <net/busy_poll.h>
#include <net/sock_reuseport.h>
@@ -864,21 +865,25 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
return 0;
}
+
static struct sock *__udp6_lib_demux_lookup(struct net *net,
__be16 loc_port, const struct in6_addr *loc_addr,
__be16 rmt_port, const struct in6_addr *rmt_addr,
int dif)
{
+ unsigned short hnum = ntohs(loc_port);
+ unsigned int hash2 = udp6_portaddr_hash(net, loc_addr, hnum);
+ unsigned int slot2 = hash2 & udp_table.mask;
+ struct udp_hslot *hslot2 = &udp_table.hash2[slot2];
+ const __portpair ports = INET_COMBINED_PORTS(rmt_port, hnum);
struct sock *sk;
- rcu_read_lock();
- sk = __udp6_lib_lookup(net, rmt_addr, rmt_port, loc_addr, loc_port,
- dif, &udp_table, NULL);
- if (sk && !atomic_inc_not_zero(&sk->sk_refcnt))
- sk = NULL;
- rcu_read_unlock();
-
- return sk;
+ udp_portaddr_for_each_entry_rcu(sk, &hslot2->head) {
+ if (INET6_MATCH(sk, net, rmt_addr, loc_addr, ports, dif))
+ return sk;
+ break;
+ }
+ return NULL;
}
static void udp_v6_early_demux(struct sk_buff *skb)
--
1.9.1
^ permalink raw reply related
* Re: IGMP on IPv6
From: Cong Wang @ 2017-04-17 21:38 UTC (permalink / raw)
To: Murali Karicheri
Cc: Hangbin Liu, open list:TI NETCP ETHERNET DRIVER, David Miller
In-Reply-To: <58EFA913.5060604@ti.com>
Hello,
On Thu, Apr 13, 2017 at 9:36 AM, Murali Karicheri <m-karicheri2@ti.com> wrote:
> On 03/22/2017 11:04 AM, Murali Karicheri wrote:
>> This is going directly to the slave Ethernet interface.
>>
>> When I put a WARN_ONCE, I found this is coming directly from
>> mld_ifc_timer_expire() -> mld_sendpack() -> ip6_output()
>>
>> Do you think this is fixed in latest kernel at master? If so, could
>> you point me to some commits.
>>
>>
> Ping... I see this behavior is also seen on v4.9.x Kernel. Any clue if
> this is fixed by some commit or I need to debug? I see IGMPv6 has some
> fixes on the list to make it similar to IGMPv4. So can someone clarify this is
> is a bug at IGMPv6 code or I need to look into the HSR driver code?
> Since IGMPv4 is going over the HSR interface I am assuming this is a
> bug in the IGMPv6 code. But since I have not experience with this code
> can some expert comment please?
>
How did you configure your network interfaces and IPv4/IPv6 multicast?
IOW, how did you reproduce this? For example, did you change your
HSR setup when this happened since you mentioned
NETDEV_CHANGEUPPER?
^ 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