* Re: [PATCH net-next 1/3] bpf: Implement map_delete_elem for BPF_MAP_TYPE_LPM_TRIE
From: Alexei Starovoitov @ 2017-09-18 22:53 UTC (permalink / raw)
To: Craig Gallek, Daniel Mack, Daniel Borkmann, David S . Miller; +Cc: netdev
In-Reply-To: <20170918193057.37644-2-kraigatgoog@gmail.com>
On 9/18/17 12:30 PM, Craig Gallek wrote:
> From: Craig Gallek <kraig@google.com>
>
> This is a simple non-recursive delete operation. It prunes paths
> of empty nodes in the tree, but it does not try to further compress
> the tree as nodes are removed.
>
> Signed-off-by: Craig Gallek <kraig@google.com>
> ---
> kernel/bpf/lpm_trie.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 77 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/bpf/lpm_trie.c b/kernel/bpf/lpm_trie.c
> index 1b767844a76f..9d58a576b2ae 100644
> --- a/kernel/bpf/lpm_trie.c
> +++ b/kernel/bpf/lpm_trie.c
> @@ -389,10 +389,84 @@ static int trie_update_elem(struct bpf_map *map,
> return ret;
> }
>
> -static int trie_delete_elem(struct bpf_map *map, void *key)
> +/* Called from syscall or from eBPF program */
> +static int trie_delete_elem(struct bpf_map *map, void *_key)
> {
> - /* TODO */
> - return -ENOSYS;
> + struct lpm_trie *trie = container_of(map, struct lpm_trie, map);
> + struct bpf_lpm_trie_key *key = _key;
> + struct lpm_trie_node __rcu **trim;
> + struct lpm_trie_node *node;
> + unsigned long irq_flags;
> + unsigned int next_bit;
> + size_t matchlen = 0;
> + int ret = 0;
> +
> + if (key->prefixlen > trie->max_prefixlen)
> + return -EINVAL;
> +
> + raw_spin_lock_irqsave(&trie->lock, irq_flags);
> +
> + /* Walk the tree looking for an exact key/length match and keeping
> + * track of where we could begin trimming the tree. The trim-point
> + * is the sub-tree along the walk consisting of only single-child
> + * intermediate nodes and ending at a leaf node that we want to
> + * remove.
> + */
> + trim = &trie->root;
> + node = rcu_dereference_protected(
> + trie->root, lockdep_is_held(&trie->lock));
> + while (node) {
> + matchlen = longest_prefix_match(trie, node, key);
> +
> + if (node->prefixlen != matchlen ||
> + node->prefixlen == key->prefixlen)
> + break;
curious why there is no need to do
'node->prefixlen == trie->max_prefixlen' in the above
like update/lookup do?
> +
> + next_bit = extract_bit(key->data, node->prefixlen);
> + /* If we hit a node that has more than one child or is a valid
> + * prefix itself, do not remove it. Reset the root of the trim
> + * path to its descendant on our path.
> + */
> + if (!(node->flags & LPM_TREE_NODE_FLAG_IM) ||
> + (node->child[0] && node->child[1]))
> + trim = &node->child[next_bit];
> + node = rcu_dereference_protected(
> + node->child[next_bit], lockdep_is_held(&trie->lock));
> + }
> +
> + if (!node || node->prefixlen != key->prefixlen ||
> + (node->flags & LPM_TREE_NODE_FLAG_IM)) {
> + ret = -ENOENT;
> + goto out;
> + }
> +
> + trie->n_entries--;
> +
> + /* If the node we are removing is not a leaf node, simply mark it
> + * as intermediate and we are done.
> + */
> + if (rcu_access_pointer(node->child[0]) ||
> + rcu_access_pointer(node->child[1])) {
> + node->flags |= LPM_TREE_NODE_FLAG_IM;
> + goto out;
> + }
> +
> + /* trim should now point to the slot holding the start of a path from
> + * zero or more intermediate nodes to our leaf node for deletion.
> + */
> + while ((node = rcu_dereference_protected(
> + *trim, lockdep_is_held(&trie->lock)))) {
> + RCU_INIT_POINTER(*trim, NULL);
> + trim = rcu_access_pointer(node->child[0]) ?
> + &node->child[0] :
> + &node->child[1];
> + kfree_rcu(node, rcu);
can it be that some of the nodes this loop walks have
both child[0] and [1] ?
^ permalink raw reply
* Re: [PATCH RFC 6/6] Modify tag_ksz.c to support other KSZ switch drivers
From: Andrew Lunn @ 2017-09-18 22:51 UTC (permalink / raw)
To: Tristram.Ha
Cc: muvarov, pavel, nathan.leigh.conrad, vivien.didelot, f.fainelli,
netdev, linux-kernel, Woojung.Huh
In-Reply-To: <93AF473E2DA327428DE3D46B72B1E9FD41124D7C@CHN-SV-EXMX02.mchp-main.com>
> In the old DSA implementation all the ports are partitioned into its own device
> and the bridge joining them will do all the forwarding. This is useful for quick
> testing with some protocols like RSTP but it is probably useless for real
> operation.
It is a good minimal driver, to get something into the kernel. You can
then add features to it.
> The new switchdev model tries to use the switch hardware as much as
> possible. This offload_fwd_mark bit means the frame is forwarded by the
> hardware switch, so the software bridge does not need to do it again. Without
> this bit there will be duplicated multicast frames coming out the ports if internal
> forwarding is enabled.
Correct. Once you switch driver is clever enough, you can enable
offload_fwd_mark.
> When RSTP is used the port can be put in blocked state and so the forwarding
> will stop for that port. Currently the switch driver will check that membership
> to decide whether to set that bit.
This i don't get. RSTP or STP just break loops. How does RSTP vs STP
mean you need to set offload_fwd_mark differently?
> The KSZ switches never have a built-in MAC controller, so it is always a support
> issue for us.
Not quite right. Once your drivers are in mainline, it becomes a
support issue for the community, with you being part of the community.
I've helped others fix this issue, one of the less well used Marvell
Ethernet drivers had this problem, and i gave somebody pointers how to
fix it.
Andrew
^ permalink raw reply
* Re: [PATCH RFC 6/6] Modify tag_ksz.c to support other KSZ switch drivers
From: Andrew Lunn @ 2017-09-18 22:42 UTC (permalink / raw)
To: Tristram.Ha
Cc: muvarov, pavel, nathan.leigh.conrad, vivien.didelot, f.fainelli,
netdev, linux-kernel, Woojung.Huh
In-Reply-To: <93AF473E2DA327428DE3D46B72B1E9FD41124D7C@CHN-SV-EXMX02.mchp-main.com>
On Mon, Sep 18, 2017 at 08:55:17PM +0000, Tristram.Ha@microchip.com wrote:
> > > > This is ugly. We have a clean separation between a switch driver and a
> > > > tag driver. Here you are mixing them together. Don't. Look at the
> > > > mailing lists for what Florian and I suggested to Pavel. It will also
> > > > solve your include file issue above.
> > >
> > > It seems to me all tag_*.c are hard-coded. They do not have access to
> > > the switch device and just use the bit definitions defined in the top to
> > > do the job.
> > >
> > > This creates a problem for all KSZ switch devices as they have different
> > > tail tag formats and lengths. There will be potentially 4 additional
> > > DSA_TAG_PROT_KSZ* just to handle them. Extra files will be added
> > > with about the same code.
> >
> > Hi Tristram
> >
> > Think about factoring out the common code into a shared functions.
> >
>
> I am a little unsure what you have in mind. Can you elaborate?
You say you need 4 DSA_TAG_PROT_KSZ. I guess the code is nearly
identical in them all? If i remember correctly, the two tag bytes are
the other way around?
static int ksz8k_xmit( *skb, struct net_device *dev)
{
uint8* tag;
tag = ksz_xmit(skb, dev)
if (!tag)
return NULL;
tag[0] = 1 << p->dp->index;
tag[1] = 0;
return skb;
}
static int ksz9k_xmit( *skb, struct net_device *dev)
{
uint8* tag;
tag = ksz_xmit(skb, dev)
if (!tag)
return NULL;
tag[0] = 0;
tag[1] = 1 << p->dp->index;
return skb;
}
const struct dsa_device_ops ksz8k_netdev_ops = {
.xmit = ksz8k_xmit,
.rcv = ksz8k_rcv,
};
const struct dsa_device_ops ksz9k_netdev_ops = {
.xmit = ksz9k_xmit,
.rcv = ksz9k_rcv,
};
Andrew
^ permalink raw reply
* Re: [PATCH net-next 09/12] net: dsa: b53: Wire-up EEE
From: Florian Fainelli @ 2017-09-18 22:34 UTC (permalink / raw)
To: Vivien Didelot, netdev; +Cc: davem, andrew
In-Reply-To: <87mv5r1vzx.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
On 09/18/2017 03:29 PM, Vivien Didelot wrote:
> Hi Florian,
>
> Florian Fainelli <f.fainelli@gmail.com> writes:
>
>> @@ -1000,6 +1005,9 @@ static void b53_adjust_link(struct dsa_switch *ds, int port,
>> b53_write8(dev, B53_CTRL_PAGE, po_reg, gmii_po);
>> }
>> }
>> +
>> + /* Re-negotiate EEE if it was enabled already */
>> + p->eee_enabled = b53_eee_init(ds, port, phydev);
>> }
>
> Same here, I think we can move this up to DSA core, maybe with a
> eee_enabled mask in dsa_switch or a bool in dsa_port.
This can be done as a subsequent patch, sure.
--
Florian
^ permalink raw reply
* Re: [PATCH net-next 08/12] net: dsa: b53: Move EEE functions to b53
From: Florian Fainelli @ 2017-09-18 22:33 UTC (permalink / raw)
To: Vivien Didelot, netdev; +Cc: davem, andrew
In-Reply-To: <87poan1w2q.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
On 09/18/2017 03:27 PM, Vivien Didelot wrote:
> Hi Florian,
>
> Florian Fainelli <f.fainelli@gmail.com> writes:
>
>> @@ -649,7 +595,7 @@ static void bcm_sf2_sw_adjust_link(struct dsa_switch *ds, int port,
>> core_writel(priv, reg, offset);
>>
>> if (!phydev->is_pseudo_fixed_link)
>> - p->eee_enabled = bcm_sf2_eee_init(ds, port, phydev);
>> + p->eee_enabled = b53_eee_init(ds, port, phydev);
>> }
>
> I know this is a bit out-of-scope of this patch, but I have to say I am
> not confortable with having still phy device stuffs in switch drivers...
Yes, this is out of scope :)
>
> Can this is_pseudo_fixed_link check + phy_eee_init + eee_enable be moved
> up to dsa_slave_adjust_link in a future patch maybe?
Not 100% positive this applies to all switches, which is why this is
still largely a switch driver decision.
--
Florian
^ permalink raw reply
* Re: [PATCH net-next 09/12] net: dsa: b53: Wire-up EEE
From: Vivien Didelot @ 2017-09-18 22:29 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: davem, andrew, Florian Fainelli
In-Reply-To: <20170918214128.27896-10-f.fainelli@gmail.com>
Hi Florian,
Florian Fainelli <f.fainelli@gmail.com> writes:
> @@ -1000,6 +1005,9 @@ static void b53_adjust_link(struct dsa_switch *ds, int port,
> b53_write8(dev, B53_CTRL_PAGE, po_reg, gmii_po);
> }
> }
> +
> + /* Re-negotiate EEE if it was enabled already */
> + p->eee_enabled = b53_eee_init(ds, port, phydev);
> }
Same here, I think we can move this up to DSA core, maybe with a
eee_enabled mask in dsa_switch or a bool in dsa_port.
^ permalink raw reply
* Re: [PATCH net-next 08/12] net: dsa: b53: Move EEE functions to b53
From: Vivien Didelot @ 2017-09-18 22:27 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: davem, andrew, Florian Fainelli
In-Reply-To: <20170918214128.27896-9-f.fainelli@gmail.com>
Hi Florian,
Florian Fainelli <f.fainelli@gmail.com> writes:
> @@ -649,7 +595,7 @@ static void bcm_sf2_sw_adjust_link(struct dsa_switch *ds, int port,
> core_writel(priv, reg, offset);
>
> if (!phydev->is_pseudo_fixed_link)
> - p->eee_enabled = bcm_sf2_eee_init(ds, port, phydev);
> + p->eee_enabled = b53_eee_init(ds, port, phydev);
> }
I know this is a bit out-of-scope of this patch, but I have to say I am
not confortable with having still phy device stuffs in switch drivers...
Can this is_pseudo_fixed_link check + phy_eee_init + eee_enable be moved
up to dsa_slave_adjust_link in a future patch maybe?
Thanks,
Vivien
^ permalink raw reply
* Re: [PATCH net-next 06/12] net: dsa: b53: Move Broadcom header setup to b53
From: Vivien Didelot @ 2017-09-18 22:14 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: davem, andrew, Florian Fainelli
In-Reply-To: <20170918214128.27896-7-f.fainelli@gmail.com>
Florian Fainelli <f.fainelli@gmail.com> writes:
> The code to enable Broadcom tags/headers is largely switch independent,
> and in preparation for enabling it for multiple devices with b53, move
> the code we have in bcm_sf2.c to b53_common.c
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
^ permalink raw reply
* Re: [PATCH net-next 05/12] net: dsa: b53: Use a macro to define I/O operations
From: Vivien Didelot @ 2017-09-18 22:12 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: davem, andrew, Florian Fainelli
In-Reply-To: <20170918214128.27896-6-f.fainelli@gmail.com>
Hi Florian,
Florian Fainelli <f.fainelli@gmail.com> writes:
> Instead of repeating the same pattern: acquire mutex, read/write, release
> mutex, define a macro: b53_build_op() which takes the type (read|write), I/O
> size, and value (scalar or pointer). This helps with fixing bugs that could
> exit (e.g: missing barrier, lock etc.).
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
^ permalink raw reply
* Re: [PATCH 2/3] selftests: actually run the various net selftests
From: Shuah Khan @ 2017-09-18 22:14 UTC (permalink / raw)
To: josef
Cc: Josef Bacik, David S. Miller, linux-kernel, linux-kselftest,
netdev, Shuah Khan, Shuah Khan
In-Reply-To: <1505755982-7855-2-git-send-email-jbacik@fb.com>
On 09/18/2017 11:32 AM, josef@toxicpanda.com wrote:
> From: Josef Bacik <jbacik@fb.com>
>
> These self tests are just self contained binaries, they are not run by
> any of the scripts in the directory. This means they need to be marked
> with TEST_GEN_PROGS to actually be run, not TEST_GEN_FILES.
>
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> ---
> tools/testing/selftests/net/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
> index 3df542c84610..45a4e77a47c4 100644
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@ -6,8 +6,8 @@ CFLAGS += -I../../../../usr/include/
> TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh rtnetlink.sh
> TEST_GEN_FILES = socket
> TEST_GEN_FILES += psock_fanout psock_tpacket
> -TEST_GEN_FILES += reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
> -TEST_GEN_FILES += reuseport_dualstack msg_zerocopy reuseaddr_conflict
> +TEST_GEN_PROGS += reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
> +TEST_GEN_PROGS += reuseport_dualstack msg_zerocopy reuseaddr_conflict
Hmm. I see msg_zerocopy.sh for running msg_zerocopy. msg_zerocopy should
still stay in TEST_GEN_FILES and msg_zerocopy.sh needs to be added to
TEST_PROGS so it runs.
thanks,
-- Shuah
^ permalink raw reply
* Re: RACK not getting disabled
From: Yuchung Cheng @ 2017-09-18 22:05 UTC (permalink / raw)
To: hiren panchasara; +Cc: Eric Dumazet, netdev
In-Reply-To: <20170918215522.GE28186@strugglingcoder.info>
On Mon, Sep 18, 2017 at 2:55 PM, hiren panchasara
<hiren@strugglingcoder.info> wrote:
> On 09/18/17 at 02:46P, Yuchung Cheng wrote:
>> On Mon, Sep 18, 2017 at 2:29 PM, hiren panchasara
>> <hiren@strugglingcoder.info> wrote:
>> > On 09/18/17 at 02:18P, Eric Dumazet wrote:
>> >> On Mon, 2017-09-18 at 13:14 -0700, hiren panchasara wrote:
>> >> > Hi all, I am trying to disable rack to see 3dupacks in action during
>> >> > loss-detection but based on the pcap, I see that it's still trigger
>> >> > loss-recovery on the first SACK (as if RACK is still enabled/active).
>> just to be clear: 3-dupack (aka RFC3517) is still enabled with RACK
>> enabled. I am experimenting a patch set to disable 3-dupack approach
>> completely.
>
> So any incoming packet undergoes both checks right now to decide whether
> to mark it lost based on 3-dupacks (and eventually rfc6675) and also
> rack? Any insights into how they are working together would be great.
>
> Also whichever scheme detects loss first can kick connection into
> loss-recovery, right?
Yes. essentially we run both algorithms. the recovery starts when any
packet is deemed lost
>
> Thanks for the clarification, Yuchung.
>
> Cheers,
> Hiren
^ permalink raw reply
* Re: [PATCH net-next 04/12] net: dsa: bcm_sf2: Defer port enabling to calling port_enable
From: Vivien Didelot @ 2017-09-18 21:54 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: davem, andrew, Florian Fainelli
In-Reply-To: <20170918214128.27896-5-f.fainelli@gmail.com>
Florian Fainelli <f.fainelli@gmail.com> writes:
> There is no need to configure the enabled ports once in bcm_sf2_sw_setup() and
> then a second time around when dsa_switch_ops::port_enable is called, just do
> it when port_enable is called which is better in terms of power consumption and
> correctness.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
^ permalink raw reply
* Re: [PATCH net-next 03/12] net: dsa: b53: Defer port enabling to calling port_enable
From: Vivien Didelot @ 2017-09-18 21:53 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: davem, andrew, Florian Fainelli
In-Reply-To: <20170918214128.27896-4-f.fainelli@gmail.com>
Florian Fainelli <f.fainelli@gmail.com> writes:
> There is no need to configure the enabled ports once in b53_setup() and then a
> second time around when dsa_switch_ops::port_enable is called, just do it when
> port_enable is called which is better in terms of power consumption and
> correctness.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Great, my next step is to move up the ports enabling/disabling withing
DSA core. This patch helps going in that direction, thanks.
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
^ permalink raw reply
* Re: [PATCH v2] net/ethernet/freescale: fix warning for ucc_geth
From: David Miller @ 2017-09-18 21:56 UTC (permalink / raw)
To: valentin.longchamp; +Cc: leoli, netdev, christophe.leroy, linuxppc-dev
In-Reply-To: <20170915055847.29716-1-valentin.longchamp@keymile.com>
From: Valentin Longchamp <valentin.longchamp@keymile.com>
Date: Fri, 15 Sep 2017 07:58:47 +0200
> uf_info.regs is resource_size_t i.e. phys_addr_t that can be either u32
> or u64 according to CONFIG_PHYS_ADDR_T_64BIT.
>
> The printk format is thus adaptet to u64 and the regs value cast to u64
> to take both u32 and u64 into account.
>
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: RACK not getting disabled
From: hiren panchasara @ 2017-09-18 21:55 UTC (permalink / raw)
To: Yuchung Cheng; +Cc: Eric Dumazet, netdev
In-Reply-To: <CAK6E8=eu+1ywBfpAM34seZDKVc-ep5HBuz9fQRuzoaX9BWqeJA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 985 bytes --]
On 09/18/17 at 02:46P, Yuchung Cheng wrote:
> On Mon, Sep 18, 2017 at 2:29 PM, hiren panchasara
> <hiren@strugglingcoder.info> wrote:
> > On 09/18/17 at 02:18P, Eric Dumazet wrote:
> >> On Mon, 2017-09-18 at 13:14 -0700, hiren panchasara wrote:
> >> > Hi all, I am trying to disable rack to see 3dupacks in action during
> >> > loss-detection but based on the pcap, I see that it's still trigger
> >> > loss-recovery on the first SACK (as if RACK is still enabled/active).
> just to be clear: 3-dupack (aka RFC3517) is still enabled with RACK
> enabled. I am experimenting a patch set to disable 3-dupack approach
> completely.
So any incoming packet undergoes both checks right now to decide whether
to mark it lost based on 3-dupacks (and eventually rfc6675) and also
rack? Any insights into how they are working together would be great.
Also whichever scheme detects loss first can kick connection into
loss-recovery, right?
Thanks for the clarification, Yuchung.
Cheers,
Hiren
[-- Attachment #2: Type: application/pgp-signature, Size: 603 bytes --]
^ permalink raw reply
* Re: [PATCH 1/1] ipv6_skip_exthdr: use ipv6_authlen for AH header length computation
From: David Miller @ 2017-09-18 21:53 UTC (permalink / raw)
To: qasdfgtyuiop; +Cc: trivial, netdev, kuznet, yoshfuji
In-Reply-To: <CAMtaSwRk0ne+kG3ejH6685N=ByEAVOkvtyCbmPu9jTng3h2YNQ@mail.gmail.com>
From: Xiang Gao <qasdfgtyuiop@gmail.com>
Date: Fri, 15 Sep 2017 01:04:27 -0400
> From 09cf2e3cf09cf591283785aaa8159baf39ac2e08 Mon Sep 17 00:00:00 2001
> From: Xiang Gao <qasdfgtyuiop@gmail.com>
> Date: Fri, 15 Sep 2017 00:44:12 -0400
> Subject: [PATCH] ipv6_skip_exthdr: use ipv6_authlen for AH hdrlen
>
> In ipv6_skip_exthdr, the lengh of AH header is computed manually
> as (hp->hdrlen+2)<<2. However, in include/linux/ipv6.h, a macro
> named ipv6_authlen is already defined for exactly the same job. This
> commit replaces the manual computation code with the macro.
Your patch was whitespace corrupted by your email client.
^ permalink raw reply
* Re: [PATCH net] ip6_gre: skb_push ipv6hdr before packing the header in ip6gre_header
From: David Miller @ 2017-09-18 21:52 UTC (permalink / raw)
To: lucien.xin; +Cc: netdev, xeb
In-Reply-To: <4337e23831098961437503efa2c9d7adfce96b81.1505448007.git.lucien.xin@gmail.com>
From: Xin Long <lucien.xin@gmail.com>
Date: Fri, 15 Sep 2017 12:00:07 +0800
> Now in ip6gre_header before packing the ipv6 header, it skb_push t->hlen
> which only includes encap_hlen + tun_hlen. It means greh and inner header
> would be over written by ipv6 stuff and ipv6h might have no chance to set
> up.
>
> Jianlin found this issue when using remote any on ip6_gre, the packets he
> captured on gre dev are truncated:
>
> 22:50:26.210866 Out ethertype IPv6 (0x86dd), length 120: truncated-ip6 -\
> 8128 bytes missing!(flowlabel 0x92f40, hlim 0, next-header Options (0) \
> payload length: 8192) ::1:2000:0 > ::1:0:86dd: HBH [trunc] ip-proto-128 \
> 8184
>
> It should also skb_push ipv6hdr so that ipv6h points to the right position
> to set ipv6 stuff up.
>
> This patch is to skb_push hlen + sizeof(*ipv6h) and also fix some indents
> in ip6gre_header.
>
> Fixes: c12b395a4664 ("gre: Support GRE over IPv6")
> Reported-by: Jianlin Shi <jishi@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Yes, this is consistent with how t->hlen is used in the rest of this
tunnel driver.
Applied and queued up for -stable, thanks!
^ permalink raw reply
* Re: [PATCH net-next 02/12] net: dsa: b53: Make b53_enable_cpu_port() take a port argument
From: Vivien Didelot @ 2017-09-18 21:46 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: davem, andrew, Florian Fainelli
In-Reply-To: <20170918214128.27896-3-f.fainelli@gmail.com>
Florian Fainelli <f.fainelli@gmail.com> writes:
> In preparation for future changes allowing the configuring of multiple
> CPU ports, make b53_enable_cpu_port() take a port argument.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Thanks,
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
^ permalink raw reply
* Re: [PATCH 1/1] forcedeth: replace pci_map_single with dma_map_single functions
From: David Miller @ 2017-09-18 21:49 UTC (permalink / raw)
To: yanjun.zhu; +Cc: jarod, netdev
In-Reply-To: <1505444511-27231-1-git-send-email-yanjun.zhu@oracle.com>
From: Zhu Yanjun <yanjun.zhu@oracle.com>
Date: Thu, 14 Sep 2017 23:01:51 -0400
> pci_map_single functions are obsolete. So replace them with
> dma_map_single functions.
>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 01/12] net: dsa: b53: Remove is_cpu_port()
From: Vivien Didelot @ 2017-09-18 21:44 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: davem, andrew, Florian Fainelli
In-Reply-To: <20170918214128.27896-2-f.fainelli@gmail.com>
Florian Fainelli <f.fainelli@gmail.com> writes:
> This is not used anywhere, so remove it.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
^ permalink raw reply
* Re: RACK not getting disabled
From: Yuchung Cheng @ 2017-09-18 21:46 UTC (permalink / raw)
To: hiren panchasara; +Cc: Eric Dumazet, netdev
In-Reply-To: <20170918212952.GC28186@strugglingcoder.info>
On Mon, Sep 18, 2017 at 2:29 PM, hiren panchasara
<hiren@strugglingcoder.info> wrote:
> On 09/18/17 at 02:18P, Eric Dumazet wrote:
>> On Mon, 2017-09-18 at 13:14 -0700, hiren panchasara wrote:
>> > Hi all, I am trying to disable rack to see 3dupacks in action during
>> > loss-detection but based on the pcap, I see that it's still trigger
>> > loss-recovery on the first SACK (as if RACK is still enabled/active).
just to be clear: 3-dupack (aka RFC3517) is still enabled with RACK
enabled. I am experimenting a patch set to disable 3-dupack approach
completely.
>> >
>> > Here is what I did to disable rack:
>> > net.ipv4.tcp_recovery = 0
>> >
>> > I've also disabled metrics:
>> > net.ipv4.tcp_no_metrics_save = 1
>> > And also flushed existing entries with 'ip tcp_metrics flush' just to be
>> > on a safer side.
>> >
>> > Not really relevant here but I've also switched to reno.
>> >
>> > I am on: 4.10.0-33-generic
>> > pcap: https://transfer.sh/mfoiN/reno_no_rack.pcap
>> >
>> > What am I missing? I can provide any additional info.
>> >
>> > Cheers,
>> > Hiren
>>
>>
>> A single SACK can contains enough information to trigger a retransmit.
>
> Bah, right. FACK!
>>
>> If you absolutely want to see the old 3 dupack in action, you also want
>> to disable SACK.
>
> I believe net.ipv4.tcp_fack = 0 would achieve that without disabling
> sack.
>
> Thanks for your help!
> Cheers,
> Hiren
^ permalink raw reply
* Re: [PATCH net-next 00/12] net: dsa: b53/bcm_sf2 cleanups
From: Florian Fainelli @ 2017-09-18 21:46 UTC (permalink / raw)
To: netdev, davem; +Cc: andrew, vivien.didelot
In-Reply-To: <20170918214128.27896-1-f.fainelli@gmail.com>
On 09/18/2017 02:41 PM, Florian Fainelli wrote:
> Hi all,
>
> This patch series is a first pass set of clean-ups to reduce the number of LOCs
> between b53 and bcm_sf2 and sharing as many functions as possible.
>
> There is a number of additional cleanups queued up locally that require more
> thorough testing.
David, I just spotted a missing EXPORT_SYMBOL() in patch 8 that was not
flagged since I had temporarily disabled modular build, I will resubmit
this shortly after checking the other patches too. Thanks!
>
> Thanks!
>
> Florian Fainelli (12):
> net: dsa: b53: Remove is_cpu_port()
> net: dsa: b53: Make b53_enable_cpu_port() take a port argument
> net: dsa: b53: Defer port enabling to calling port_enable
> net: dsa: bcm_sf2: Defer port enabling to calling port_enable
> net: dsa: b53: Use a macro to define I/O operations
> net: dsa: b53: Move Broadcom header setup to b53
> net: dsa: b53: Define EEE register page
> net: dsa: b53: Move EEE functions to b53
> net: dsa: b53: Wire-up EEE
> net: dsa: b53: Export b53_imp_vlan_setup()
> net: dsa: bcm_sf2: Use SF2_NUM_EGRESS_QUEUES for CFP
> net: dsa: bcm_sf2: Utilize b53_{enable,disable}_port
>
> drivers/net/dsa/b53/b53_common.c | 150 ++++++++++++++++++++++++++++++++----
> drivers/net/dsa/b53/b53_priv.h | 145 ++++++++---------------------------
> drivers/net/dsa/b53/b53_regs.h | 48 ++++++++++++
> drivers/net/dsa/bcm_sf2.c | 161 +++------------------------------------
> drivers/net/dsa/bcm_sf2.h | 2 -
> drivers/net/dsa/bcm_sf2_cfp.c | 6 +-
> drivers/net/dsa/bcm_sf2_regs.h | 11 ---
> 7 files changed, 227 insertions(+), 296 deletions(-)
>
--
Florian
^ permalink raw reply
* Re: RACK not getting disabled
From: hiren panchasara @ 2017-09-18 21:45 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <20170918212952.GC28186@strugglingcoder.info>
[-- Attachment #1: Type: text/plain, Size: 1423 bytes --]
On 09/18/17 at 02:29P, hiren panchasara wrote:
> On 09/18/17 at 02:18P, Eric Dumazet wrote:
> > On Mon, 2017-09-18 at 13:14 -0700, hiren panchasara wrote:
> > > Hi all, I am trying to disable rack to see 3dupacks in action during
> > > loss-detection but based on the pcap, I see that it's still trigger
> > > loss-recovery on the first SACK (as if RACK is still enabled/active).
> > >
> > > Here is what I did to disable rack:
> > > net.ipv4.tcp_recovery = 0
> > >
> > > I've also disabled metrics:
> > > net.ipv4.tcp_no_metrics_save = 1
> > > And also flushed existing entries with 'ip tcp_metrics flush' just to be
> > > on a safer side.
> > >
> > > Not really relevant here but I've also switched to reno.
> > >
> > > I am on: 4.10.0-33-generic
> > > pcap: https://transfer.sh/mfoiN/reno_no_rack.pcap
> > >
> > > What am I missing? I can provide any additional info.
> > >
> > > Cheers,
> > > Hiren
> >
> >
> > A single SACK can contains enough information to trigger a retransmit.
>
> Bah, right. FACK!
> >
> > If you absolutely want to see the old 3 dupack in action, you also want
> > to disable SACK.
>
> I believe net.ipv4.tcp_fack = 0 would achieve that without disabling
> sack.
Ah, what you probably meant was that this could still be < 3 dupacks
triggering loss-recovery based on reordering.
I believe I got what I was looking for.
Thanks a ton,
Hiren
[-- Attachment #2: Type: application/pgp-signature, Size: 603 bytes --]
^ permalink raw reply
* [PATCH net-next 12/12] net: dsa: bcm_sf2: Utilize b53_{enable,disable}_port
From: Florian Fainelli @ 2017-09-18 21:41 UTC (permalink / raw)
To: netdev; +Cc: davem, andrew, vivien.didelot, Florian Fainelli
In-Reply-To: <20170918214128.27896-1-f.fainelli@gmail.com>
Export b53_{enable,disable}_port and use these two functions in
bcm_sf2_port_setup and bcm_sf2_port_disable. The generic functions
cannot be used without wrapping because we need to manage additional
switch integration details (PHY, Broadcom tag etc.).
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 8 ++++----
drivers/net/dsa/b53/b53_priv.h | 2 ++
drivers/net/dsa/bcm_sf2.c | 26 ++------------------------
3 files changed, 8 insertions(+), 28 deletions(-)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 84068697a509..b9139140a10f 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -502,8 +502,7 @@ void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port)
}
EXPORT_SYMBOL(b53_imp_vlan_setup);
-static int b53_enable_port(struct dsa_switch *ds, int port,
- struct phy_device *phy)
+int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy)
{
struct b53_device *dev = ds->priv;
unsigned int cpu_port = dev->cpu_port;
@@ -530,9 +529,9 @@ static int b53_enable_port(struct dsa_switch *ds, int port,
return 0;
}
+EXPORT_SYMBOL(b53_enable_port);
-static void b53_disable_port(struct dsa_switch *ds, int port,
- struct phy_device *phy)
+void b53_disable_port(struct dsa_switch *ds, int port, struct phy_device *phy)
{
struct b53_device *dev = ds->priv;
u8 reg;
@@ -542,6 +541,7 @@ static void b53_disable_port(struct dsa_switch *ds, int port,
reg |= PORT_CTRL_RX_DISABLE | PORT_CTRL_TX_DISABLE;
b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), reg);
}
+EXPORT_SYMBOL(b53_disable_port);
void b53_brcm_hdr_setup(struct dsa_switch *ds, int port)
{
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
index df8bea4105e4..8b5ba78edfd2 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -311,6 +311,8 @@ int b53_mirror_add(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror, bool ingress);
void b53_mirror_del(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror);
+int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy);
+void b53_disable_port(struct dsa_switch *ds, int port, struct phy_device *phy);
void b53_brcm_hdr_setup(struct dsa_switch *ds, int port);
void b53_eee_enable_set(struct dsa_switch *ds, int port, bool enable);
int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy);
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 08639674947a..0072a959db5b 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -163,7 +163,6 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,
struct phy_device *phy)
{
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
- s8 cpu_port = ds->dst->cpu_dp->index;
unsigned int i;
u32 reg;
@@ -184,9 +183,6 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,
reg |= i << (PRT_TO_QID_SHIFT * i);
core_writel(priv, reg, CORE_PORT_TC2_QOS_MAP_PORT(port));
- /* Clear the Rx and Tx disable bits and set to no spanning tree */
- core_writel(priv, 0, CORE_G_PCTL_PORT(port));
-
/* Re-enable the GPHY and re-apply workarounds */
if (priv->int_phy_mask & 1 << port && priv->hw_params.num_gphy == 1) {
bcm_sf2_gphy_enable_set(ds, true);
@@ -209,23 +205,7 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,
if (port == priv->moca_port)
bcm_sf2_port_intr_enable(priv, port);
- /* Set this port, and only this one to be in the default VLAN,
- * if member of a bridge, restore its membership prior to
- * bringing down this port.
- */
- reg = core_readl(priv, CORE_PORT_VLAN_CTL_PORT(port));
- reg &= ~PORT_VLAN_CTRL_MASK;
- reg |= (1 << port);
- reg |= priv->dev->ports[port].vlan_ctl_mask;
- core_writel(priv, reg, CORE_PORT_VLAN_CTL_PORT(port));
-
- b53_imp_vlan_setup(ds, cpu_port);
-
- /* If EEE was enabled, restore it */
- if (priv->dev->ports[port].eee.eee_enabled)
- b53_eee_enable_set(ds, port, true);
-
- return 0;
+ return b53_enable_port(ds, port, phy);
}
static void bcm_sf2_port_disable(struct dsa_switch *ds, int port,
@@ -248,9 +228,7 @@ static void bcm_sf2_port_disable(struct dsa_switch *ds, int port,
else
off = CORE_G_PCTL_PORT(port);
- reg = core_readl(priv, off);
- reg |= RX_DIS | TX_DIS;
- core_writel(priv, reg, off);
+ b53_disable_port(ds, port, phy);
/* Power down the port memory */
reg = core_readl(priv, CORE_MEM_PSM_VDD_CTRL);
--
2.9.3
^ permalink raw reply related
* [PATCH net-next 11/12] net: dsa: bcm_sf2: Use SF2_NUM_EGRESS_QUEUES for CFP
From: Florian Fainelli @ 2017-09-18 21:41 UTC (permalink / raw)
To: netdev; +Cc: davem, andrew, vivien.didelot, Florian Fainelli
In-Reply-To: <20170918214128.27896-1-f.fainelli@gmail.com>
The magic number 8 in 3 locations in bcm_sf2_cfp.c actually designates the
number of switch port egress queues, so use that define instead of open-coding
it.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2_cfp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c
index 8a1da7e67707..94649e1481ec 100644
--- a/drivers/net/dsa/bcm_sf2_cfp.c
+++ b/drivers/net/dsa/bcm_sf2_cfp.c
@@ -144,7 +144,7 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port,
* destination port is enabled and that we are within the
* number of ports supported by the switch
*/
- port_num = fs->ring_cookie / 8;
+ port_num = fs->ring_cookie / SF2_NUM_EGRESS_QUEUES;
if (fs->ring_cookie == RX_CLS_FLOW_DISC ||
!(BIT(port_num) & ds->enabled_port_mask) ||
@@ -280,7 +280,7 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port,
* We have a small oddity where Port 6 just does not have a
* valid bit here (so we subtract by one).
*/
- queue_num = fs->ring_cookie % 8;
+ queue_num = fs->ring_cookie % SF2_NUM_EGRESS_QUEUES;
if (port_num >= 7)
port_num -= 1;
@@ -401,7 +401,7 @@ static int bcm_sf2_cfp_rule_get(struct bcm_sf2_priv *priv, int port,
/* There is no Port 6, so we compensate for that here */
if (nfc->fs.ring_cookie >= 6)
nfc->fs.ring_cookie++;
- nfc->fs.ring_cookie *= 8;
+ nfc->fs.ring_cookie *= SF2_NUM_EGRESS_QUEUES;
/* Extract the destination queue */
queue_num = (reg >> NEW_TC_SHIFT) & NEW_TC_MASK;
--
2.9.3
^ permalink raw reply related
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