* Re: [PATCH 2/3] net/unix: hook unix_socketpair() into LSM
From: David Miller @ 2018-04-24 17:56 UTC (permalink / raw)
To: paul
Cc: dh.herrmann, linux-kernel, jmorris, teg, sds, selinux,
linux-security-module, eparis, serge, netdev
In-Reply-To: <CAHC9VhSv6tacFb+nEs1cCUOj52Vu+wXD6ZPZ1r1W4pYXo0VJMQ@mail.gmail.com>
From: Paul Moore <paul@paul-moore.com>
Date: Tue, 24 Apr 2018 13:55:31 -0400
> On Mon, Apr 23, 2018 at 9:30 AM, David Herrmann <dh.herrmann@gmail.com> wrote:
>> Use the newly created LSM-hook for unix_socketpair(). The default hook
>> return-value is 0, so behavior stays the same unless LSMs start using
>> this hook.
>>
>> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
>> ---
>> net/unix/af_unix.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
>> index 68bb70a62afe..bc9705ace9b1 100644
>> --- a/net/unix/af_unix.c
>> +++ b/net/unix/af_unix.c
>> @@ -1371,6 +1371,11 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
>> static int unix_socketpair(struct socket *socka, struct socket *sockb)
>> {
>> struct sock *ska = socka->sk, *skb = sockb->sk;
>> + int err;
>> +
>> + err = security_unix_stream_socketpair(ska, skb);
>> + if (err)
>> + return err;
>
> I recognize that AF_UNIX is really the only protocol that supports
> socketpair(2) at the moment, but I like to avoid protocol specific LSM
> hooks whenever possible. Unless someone can think of a good
> objection, I would prefer to see the hook placed in __sys_socketpair()
> instead (and obviously drop the "unix_stream" portion from the hook
> name).
The counterargument is that after 30 years no other protocol has grown
usage of this operation. :-)
^ permalink raw reply
* Re: [PATCH 2/3] net/unix: hook unix_socketpair() into LSM
From: Paul Moore @ 2018-04-24 17:55 UTC (permalink / raw)
To: David Herrmann
Cc: linux-kernel, James Morris, teg, Stephen Smalley, selinux,
linux-security-module, Eric Paris, serge, davem, netdev
In-Reply-To: <20180423133015.5455-3-dh.herrmann@gmail.com>
On Mon, Apr 23, 2018 at 9:30 AM, David Herrmann <dh.herrmann@gmail.com> wrote:
> Use the newly created LSM-hook for unix_socketpair(). The default hook
> return-value is 0, so behavior stays the same unless LSMs start using
> this hook.
>
> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
> ---
> net/unix/af_unix.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 68bb70a62afe..bc9705ace9b1 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -1371,6 +1371,11 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
> static int unix_socketpair(struct socket *socka, struct socket *sockb)
> {
> struct sock *ska = socka->sk, *skb = sockb->sk;
> + int err;
> +
> + err = security_unix_stream_socketpair(ska, skb);
> + if (err)
> + return err;
I recognize that AF_UNIX is really the only protocol that supports
socketpair(2) at the moment, but I like to avoid protocol specific LSM
hooks whenever possible. Unless someone can think of a good
objection, I would prefer to see the hook placed in __sys_socketpair()
instead (and obviously drop the "unix_stream" portion from the hook
name).
> /* Join our sockets back to back */
> sock_hold(ska);
> --
> 2.17.0
--
paul moore
www.paul-moore.com
^ permalink raw reply
* Re: [PATCH] net: phy: TLK10X initial driver submission
From: Andrew Lunn @ 2018-04-24 17:52 UTC (permalink / raw)
To: Rob Herring
Cc: Måns Andersson, Mark Rutland, Florian Fainelli, netdev,
devicetree, linux-kernel
In-Reply-To: <20180424163455.vmftcg5xbj6svtcu@rob-hp-laptop>
> > +Required properties:
> > + - reg - The ID number for the phy, usually a small integer
>
> Isn't this the MDIO bus address?
Hi Rob
Yes. This text has been take direct from the generic PHY binding.
> This should have a compatible string too.
Please see Documentation/devicetree/bindings/net/phy.txt
compatible strings are optional. We know what device it is from its ID
registers, which are in a well known location.
Andrew
^ permalink raw reply
* Re: [PATCH v3 net] sfc: ARFS filter IDs
From: David Miller @ 2018-04-24 17:51 UTC (permalink / raw)
To: ecree; +Cc: linux-net-drivers, netdev
In-Reply-To: <c3d6d078-2113-8b4c-4c8f-8e7126253092@solarflare.com>
From: Edward Cree <ecree@solarflare.com>
Date: Tue, 24 Apr 2018 17:09:30 +0100
> Associate an arbitrary ID with each ARFS filter, allowing to properly query
> for expiry. The association is maintained in a hash table, which is
> protected by a spinlock.
>
> v3: fix build warnings when CONFIG_RFS_ACCEL is disabled (thanks lkp-robot).
> v2: fixed uninitialised variable (thanks davem and lkp-robot).
>
> Fixes: 3af0f34290f6 ("sfc: replace asynchronous filter operations")
> Signed-off-by: Edward Cree <ecree@solarflare.com>
Applied, thanks Edward.
^ permalink raw reply
* [PATCH net-next v2] ipv6: addrconf: don't evaluate keep_addr_on_down twice
From: Ivan Vecera @ 2018-04-24 17:51 UTC (permalink / raw)
To: netdev; +Cc: David Ahern
The addrconf_ifdown() evaluates keep_addr_on_down state twice. There
is no need to do it.
Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Ivan Vecera <cera@cera.cz>
---
net/ipv6/addrconf.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 7b4d7bbf2c17..fbfd71a2d9c8 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3622,8 +3622,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
struct net *net = dev_net(dev);
struct inet6_dev *idev;
struct inet6_ifaddr *ifa, *tmp;
- int _keep_addr;
- bool keep_addr;
+ bool keep_addr = false;
int state, i;
ASSERT_RTNL();
@@ -3649,15 +3648,18 @@ static int addrconf_ifdown(struct net_device *dev, int how)
}
- /* aggregate the system setting and interface setting */
- _keep_addr = net->ipv6.devconf_all->keep_addr_on_down;
- if (!_keep_addr)
- _keep_addr = idev->cnf.keep_addr_on_down;
-
/* combine the user config with event to determine if permanent
* addresses are to be removed from address hash table
*/
- keep_addr = !(how || _keep_addr <= 0 || idev->cnf.disable_ipv6);
+ if (!how && !idev->cnf.disable_ipv6) {
+ /* aggregate the system setting and interface setting */
+ int _keep_addr = net->ipv6.devconf_all->keep_addr_on_down;
+
+ if (!_keep_addr)
+ _keep_addr = idev->cnf.keep_addr_on_down;
+
+ keep_addr = (_keep_addr > 0);
+ }
/* Step 2: clear hash table */
for (i = 0; i < IN6_ADDR_HSIZE; i++) {
@@ -3707,11 +3709,6 @@ static int addrconf_ifdown(struct net_device *dev, int how)
write_lock_bh(&idev->lock);
}
- /* re-combine the user config with event to determine if permanent
- * addresses are to be removed from the interface list
- */
- keep_addr = (!how && _keep_addr > 0 && !idev->cnf.disable_ipv6);
-
list_for_each_entry_safe(ifa, tmp, &idev->addr_list, if_list) {
struct fib6_info *rt = NULL;
bool keep;
--
2.16.1
^ permalink raw reply related
* Re: [PATCH net-next] ipv6: addrconf: don't evaluate keep_addr_on_down twice
From: David Ahern @ 2018-04-24 17:44 UTC (permalink / raw)
To: Ivan Vecera, netdev
In-Reply-To: <20180424073143.18511-1-cera@cera.cz>
On 4/24/18 1:31 AM, Ivan Vecera wrote:
> The addrconf_ifdown() evaluates keep_addr_on_down state twice. There
> is no need to do it.
>
> Cc: David Ahern <dsahern@gmail.com>
> Signed-off-by: Ivan Vecera <cera@cera.cz>
> ---
> net/ipv6/addrconf.c | 23 ++++++++++-------------
> 1 file changed, 10 insertions(+), 13 deletions(-)
Looks right to me.
Acked-by: David Ahern <dsahern@gmail.com>
But ...
> @@ -3697,11 +3699,6 @@ static int addrconf_ifdown(struct net_device *dev, int how)
> write_lock_bh(&idev->lock);
> }
>
> - /* re-combine the user config with event to determine if permanent
> - * addresses are to be removed from the interface list
> - */
> - keep_addr = (!how && _keep_addr > 0 && !idev->cnf.disable_ipv6);
> -
> list_for_each_entry_safe(ifa, tmp, &idev->addr_list, if_list) {
> struct rt6_info *rt = NULL;
> bool keep;
>
you need to rebase to top of tree. That is 'struct fib6_info *rt' now so
the patch does not apply cleanly using git am.
^ permalink raw reply
* Re: [PATCH net-next v2 0/2] openvswitch: Support conntrack zone limit
From: David Miller @ 2018-04-24 17:42 UTC (permalink / raw)
To: pshelar; +Cc: yihung.wei, netdev, fw
In-Reply-To: <CAOrHB_BSHqsmuYgLOHDTxMSH6=6w+uZ9N0SYy26FpoLj88w0Qg@mail.gmail.com>
From: Pravin Shelar <pshelar@ovn.org>
Date: Mon, 23 Apr 2018 23:34:48 -0700
> OK. Thanks for the info.
So, ACK, Reviewed-by, etc.? :-)
^ permalink raw reply
* Re: [PATCH v2 0/8] ipconfig: NTP server support, bug fixes, documentation improvements
From: David Miller @ 2018-04-24 17:40 UTC (permalink / raw)
To: chris; +Cc: netdev
In-Reply-To: <20180424025639.2228-1-chris@chrisn.me.uk>
From: Chris Novakovic <chris@chrisn.me.uk>
Date: Tue, 24 Apr 2018 03:56:31 +0100
> This series (against net-next) makes various improvements to ipconfig:
>
> - Patch #1 correctly documents the behaviour of parameter 4 in the
> "ip=" and "nfsaddrs=" command line parameter.
> - Patch #2 tidies up the printk()s for reporting configured name
> servers.
> - Patch #3 fixes a bug in autoconfiguration via BOOTP whereby the IP
> addresses of IEN-116 name servers are requested from the BOOTP
> server, rather than those of DNS name servers.
> - Patch #4 requests the number of DNS servers specified by
> CONF_NAMESERVERS_MAX when autoconfiguring via BOOTP, rather than
> hardcoding it to 2.
> - Patch #5 fully documents the contents and format of /proc/net/pnp in
> Documentation/filesystems/nfs/nfsroot.txt.
> - Patch #6 fixes a bug whereby bogus information is written to
> /proc/net/pnp when ipconfig is not used.
> - Patch #7 creates a new procfs directory for ipconfig-related
> configuration reports at /proc/net/ipconfig.
> - Patch #8 allows for NTP servers to be configured (manually on the
> kernel command line or automatically via DHCP), enabling systems with
> an NFS root filesystem to synchronise their clock before mounting
> their root filesystem. NTP server IP addresses are written to
> /proc/net/ipconfig/ntp_servers.
>
> Changes from v1:
>
> - David requested that a new directory /proc/net/ipconfig be created to
> contain ipconfig-related configuration reports, which is implemented
> in the new patch #7. NTP server IPs are now written to this directory
> instead of /proc/net/ntp in the new patch #8.
> - Cong and David both requested that the modification to CREDITS be
> dropped. This patch has been removed from the series.
Series applied, thank you.
^ permalink raw reply
* Re: [PATCH net v2] net: ethtool: Add missing kernel doc for FEC parameters
From: David Miller @ 2018-04-24 17:38 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev, vidya.chowdary, dustin, roopa
In-Reply-To: <20180423225138.8238-1-f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Mon, 23 Apr 2018 15:51:38 -0700
> While adding support for ethtool::get_fecparam and set_fecparam, kernel
> doc for these functions was missed, add those.
>
> Fixes: 1a5f3da20bd9 ("net: ethtool: add support for forward error correction modes")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> Changes in v2:
>
> - corrected set_fecparam in commit message
Applied, thanks Florian.
^ permalink raw reply
* Re: [PATCH v3] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG
From: Michal Hocko @ 2018-04-24 17:38 UTC (permalink / raw)
To: Mikulas Patocka
Cc: Matthew Wilcox, David Miller, Andrew Morton, linux-mm,
eric.dumazet, edumazet, netdev, linux-kernel, mst, jasowang,
virtualization, dm-devel, Vlastimil Babka
In-Reply-To: <alpine.LRH.2.02.1804241319390.28995@file01.intranet.prod.int.rdu2.redhat.com>
On Tue 24-04-18 13:28:49, Mikulas Patocka wrote:
>
>
> On Tue, 24 Apr 2018, Michal Hocko wrote:
>
> > On Tue 24-04-18 13:00:11, Mikulas Patocka wrote:
> > >
> > >
> > > On Tue, 24 Apr 2018, Michal Hocko wrote:
> > >
> > > > On Tue 24-04-18 11:50:30, Mikulas Patocka wrote:
> > > > >
> > > > >
> > > > > On Tue, 24 Apr 2018, Michal Hocko wrote:
> > > > >
> > > > > > On Mon 23-04-18 20:06:16, Mikulas Patocka wrote:
> > > > > > [...]
> > > > > > > @@ -404,6 +405,12 @@ void *kvmalloc_node(size_t size, gfp_t f
> > > > > > > */
> > > > > > > WARN_ON_ONCE((flags & GFP_KERNEL) != GFP_KERNEL);
> > > > > > >
> > > > > > > +#ifdef CONFIG_DEBUG_SG
> > > > > > > + /* Catch bugs when the caller uses DMA API on the result of kvmalloc. */
> > > > > > > + if (!(prandom_u32_max(2) & 1))
> > > > > > > + goto do_vmalloc;
> > > > > > > +#endif
> > > > > >
> > > > > > I really do not think there is anything DEBUG_SG specific here. Why you
> > > > > > simply do not follow should_failslab path or even reuse the function?
> > > > >
> > > > > CONFIG_DEBUG_SG is enabled by default in RHEL and Fedora debug kernel (if
> > > > > you don't like CONFIG_DEBUG_SG, pick any other option that is enabled
> > > > > there).
> > > >
> > > > Are you telling me that you are shaping a debugging functionality basing
> > > > on what RHEL has enabled? And you call me evil. This is just rediculous.
> > > >
> > > > > Fail-injection framework is if off by default and it must be explicitly
> > > > > enabled and configured by the user - and most users won't enable it.
> > > >
> > > > It can be enabled easily. And if you care enough for your debugging
> > > > kernel then just make it enabled unconditionally.
> > >
> > > So, should we add a new option CONFIG_KVMALLOC_FALLBACK_DEFAULT? I'm not
> > > quite sure if 3 lines of debugging code need an extra option, but if you
> > > don't want to reuse any existing debug option, it may be possible. Adding
> > > it to the RHEL debug kernel would be trivial.
> >
> > Wouldn't it be equally trivial to simply enable the fault injection? You
> > would get additional failure paths testing as a bonus.
>
> The RHEL and Fedora debugging kernels are compiled with fault injection.
> But the fault-injection framework will do nothing unless it is enabled by
> a kernel parameter or debugfs write.
>
> Most users don't know about the fault injection kernel parameters or
> debugfs files and won't enabled it. We need a CONFIG_ option to enable it
> by default in the debugging kernels (and we could add a kernel parameter
> to override the default, fine-tune the fallback probability etc.)
If it is a real issue to install the debugging kernel with the required
kernel parameter then I a config option for the default on makes sense
to me.
--
Michal Hocko
SUSE Labs
^ permalink raw reply
* Re: [PATCH 0/4] A few rhashtables cleanups
From: David Miller @ 2018-04-24 17:38 UTC (permalink / raw)
To: neilb; +Cc: tgraf, herbert, netdev, linux-kernel
In-Reply-To: <152452244405.1456.8175298512483573078.stgit@noble>
From: NeilBrown <neilb@suse.com>
Date: Tue, 24 Apr 2018 08:29:13 +1000
> 2 patches fixes documentation
> 1 fixes a bit in rhashtable_walk_start()
> 1 improves rhashtable_walk stability.
>
> All reviewed and Acked.
Series applied to net-next, thanks Neil.
^ permalink raw reply
* Re: [PATCH v3] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG
From: Mikulas Patocka @ 2018-04-24 17:28 UTC (permalink / raw)
To: Michal Hocko
Cc: Matthew Wilcox, David Miller, Andrew Morton, linux-mm,
eric.dumazet, edumazet, netdev, linux-kernel, mst, jasowang,
virtualization, dm-devel, Vlastimil Babka
In-Reply-To: <20180424170349.GQ17484@dhcp22.suse.cz>
On Tue, 24 Apr 2018, Michal Hocko wrote:
> On Tue 24-04-18 13:00:11, Mikulas Patocka wrote:
> >
> >
> > On Tue, 24 Apr 2018, Michal Hocko wrote:
> >
> > > On Tue 24-04-18 11:50:30, Mikulas Patocka wrote:
> > > >
> > > >
> > > > On Tue, 24 Apr 2018, Michal Hocko wrote:
> > > >
> > > > > On Mon 23-04-18 20:06:16, Mikulas Patocka wrote:
> > > > > [...]
> > > > > > @@ -404,6 +405,12 @@ void *kvmalloc_node(size_t size, gfp_t f
> > > > > > */
> > > > > > WARN_ON_ONCE((flags & GFP_KERNEL) != GFP_KERNEL);
> > > > > >
> > > > > > +#ifdef CONFIG_DEBUG_SG
> > > > > > + /* Catch bugs when the caller uses DMA API on the result of kvmalloc. */
> > > > > > + if (!(prandom_u32_max(2) & 1))
> > > > > > + goto do_vmalloc;
> > > > > > +#endif
> > > > >
> > > > > I really do not think there is anything DEBUG_SG specific here. Why you
> > > > > simply do not follow should_failslab path or even reuse the function?
> > > >
> > > > CONFIG_DEBUG_SG is enabled by default in RHEL and Fedora debug kernel (if
> > > > you don't like CONFIG_DEBUG_SG, pick any other option that is enabled
> > > > there).
> > >
> > > Are you telling me that you are shaping a debugging functionality basing
> > > on what RHEL has enabled? And you call me evil. This is just rediculous.
> > >
> > > > Fail-injection framework is if off by default and it must be explicitly
> > > > enabled and configured by the user - and most users won't enable it.
> > >
> > > It can be enabled easily. And if you care enough for your debugging
> > > kernel then just make it enabled unconditionally.
> >
> > So, should we add a new option CONFIG_KVMALLOC_FALLBACK_DEFAULT? I'm not
> > quite sure if 3 lines of debugging code need an extra option, but if you
> > don't want to reuse any existing debug option, it may be possible. Adding
> > it to the RHEL debug kernel would be trivial.
>
> Wouldn't it be equally trivial to simply enable the fault injection? You
> would get additional failure paths testing as a bonus.
The RHEL and Fedora debugging kernels are compiled with fault injection.
But the fault-injection framework will do nothing unless it is enabled by
a kernel parameter or debugfs write.
Most users don't know about the fault injection kernel parameters or
debugfs files and won't enabled it. We need a CONFIG_ option to enable it
by default in the debugging kernels (and we could add a kernel parameter
to override the default, fine-tune the fallback probability etc.)
Mikulas
^ permalink raw reply
* Re: mt7601u: phy: mark expected switch fall-through
From: Kalle Valo @ 2018-04-24 17:28 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Jakub Kicinski, linux-wireless, netdev, linux-kernel,
Gustavo A. R. Silva
In-Reply-To: <20180330211223.GA22497@embeddedgus>
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Acked-by: Jakub Kicinski <kubakici@wp.pl>
Patch applied to wireless-drivers-next.git, thanks.
5156b054bcda mt7601u: phy: mark expected switch fall-through
--
https://patchwork.kernel.org/patch/10318419/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: ath9k_htc - Division by zero in kernel (as well as firmware panic)
From: Nathan Royce @ 2018-04-24 17:28 UTC (permalink / raw)
To: Tobias Diedrich, Oleksij Rempel, Nathan Royce,
QCA ath9k Development, Kalle Valo, linux-wireless, netdev,
linux-kernel, ath9k_htc_fw
In-Reply-To: <20170607223913.GD20162@yumi.tdiedrich.de>
I finally got around to applying your patch, building the toolchain
(based on master source (gcc8)), but alas while there is no firmware
panic in the log, wifi drops off the face of the planet (ssid
disappears and hostapd doesn't know wifi failed (nothing in the log
either)).
On Wed, Jun 7, 2017 at 5:39 PM, Tobias Diedrich
<ranma+ath9k_htc_fw@tdiedrich.de> wrote:
> Oleksij Rempel wrote:
>> Am 07.06.2017 um 02:12 schrieb Tobias Diedrich:
>> > Oleksij Rempel wrote:
>> >> Yes, this is "normal" problem. The firmware has no error handler for PCI
>> >> bus related exceptions. So if we filed to read PCI bus first time, we
>> >> have choice to Ooops and stall or Ooops and reboot ASAP. So we reboot
>> >> and provide an kernel "firmware panic!" message.
>> >> Every one who can or will to fix this, is welcome.
>> >>
>> >>> *****
>> >>> Jun 02 14:55:30 computer kernel: usb 1-1.1: ath: firmware panic!
>> >>> exccause: 0x0000000d; pc: 0x0090ae81; badvaddr: 0x10ff4038.
>> > [...]
>> >
>> >> memdmp 50ae78 50ae88
>> >
>> > 50ae78: 6c10 0412 6aa2 0c02 0088 20c0 2008 1940 l...j..........@
>> >
>> > [...copy to bin...]
>> > $ bin/objdump -b binary -m xtensa -D /tmp/memdump.bin
>> > [..]
>> > 0: 6c1004 entry a1, 32
>> > 3: 126aa2 l32r a2, 0xfffdaa8c
>> > 6: 0c0200 memw
>> > 9: 8820 l32i.n a8, a2, 0 <----------Exception cause PC still points at load
>> > b: c020 movi.n a2, 0
>> > d: 081940 extui a9, a8, 1, 1
>> >
>> > Judging from that it should be fairly simple to at least implement
>> > some sort of retry, possible after triggering a PCIe link retrain?
>>
>> I assume, yes.
>>
>> > There are some related PCIe root complex registers that may point to
>> > what exactly failed if they were dumped.
>> >
>> > The root complex registers live at 0x00040000 and I think match the
>> > registers described for the root complex in the AR9344 datasheet.
>>
>> Suddenly I don't have ar7010 docs to tell..
>>
>> > PCIE_INT_MASK would map to 0x40050 and has a bit for SYS_ERR:
>> > "A system error. The RC Core asserts CFG_SYS_ERR_RC if any device in
>> > the hierarchy reports any of the following errors and the associated
>> > enable bit is set in the Root Control register: ERR_COR, ERR_FATAL,
>> > ERR_NONFATAL."
>> >
>> > AFAICS link retrain can be done by setting bit3 (INIT_RST,
>> > "Application request to initiate a training reset") in
>> > PCIE_APP (0x40000).
>> >
>> > See sboot/magpie_1_1/sboot/cmnos/eeprom/src/cmnos_eeprom.c (which
>> > flips some bits in the RC to enable the PCIe bus for reading the
>> > EEPROM).
>> >
>> > The root complex pci configuration space is at 0x20000 which could
>> > have further error details:
>> >> memdmp 20000 20200
>> >
>> > 020000: a02a 168c 0010 0006 0000 0001 0001 0000 .*..............
>> > 020010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 020020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 020030: 0000 0000 0000 0040 0000 0000 0000 01ff .......@........
>> > 020040: 5bc3 5001 0000 0000 0000 0000 0000 0000 [.P.............
>> > 020050: 0080 7005 0000 0000 0000 0000 0000 0000 ..p.............
>> > 020060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 020070: 0042 0010 0000 8701 0000 2010 0013 4411 .B............D.
>> > 020080: 3011 0000 0000 0000 00c0 03c0 0000 0000 0...............
>> > 020090: 0000 0000 0000 0010 0000 0000 0000 0000 ................
>> > 0200a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0200b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0200c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0200d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0200e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0200f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 020100: 1401 0001 0000 0000 0000 0000 0006 2030 ...............0
>> > 020110: 0000 0000 0000 2000 0000 00a0 0000 0000 ................
>> > 020120: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 020130: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 020140: 0001 0002 0000 0000 0000 0000 0000 0000 ................
>> > 020150: 0000 0000 8000 00ff 0000 0000 0000 0000 ................
>> > 020160: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 020170: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 020180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 020190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0201a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0201b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0201c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0201d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0201e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> > 0201f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
>> >
>> > Transformed into something suitable for feeding into lspci -F:
>> >
>> > 00:00.0 Description filled in by lspci
>> > 00: 8c 16 2a a0 06 00 10 00 01 00 00 00 00 00 01 00
>> > 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> > 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> > 30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
>> > 40: 01 50 c3 5b 00 00 00 00 00 00 00 00 00 00 00 00
>> > 50: 05 70 80 00 00 00 00 00 00 00 00 00 00 00 00 00
>> > 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> > 70: 10 00 42 00 01 87 00 00 10 20 00 00 11 44 13 00
>> > 80: 00 00 11 30 00 00 00 00 c0 03 c0 00 00 00 00 00
>> > 90: 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00
>> > a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> > b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> > c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> > d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> > e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> > f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> >
>> > $ lspci -F /tmp/hexdump -vvv
>> > 00:00.0 Non-VGA unclassified device: Qualcomm Atheros Device a02a (rev 01)
>> > !!! Invalid class 0000 for header type 01
>> > Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
>> > Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>> > Latency: 0
>> > Interrupt: pin A routed to IRQ 255
>> > Bus: primary=00, secondary=00, subordinate=00, sec-latency=0
>> > I/O behind bridge: 00000000-00000fff
>> > Memory behind bridge: 00000000-000fffff
>> > Prefetchable memory behind bridge: 00000000-000fffff
>> > Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
>> > BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
>> > PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>> > Capabilities: [40] Power Management version 3
>> > Flags: PMEClk- DSI- D1+ D2- AuxCurrent=375mA PME(D0+,D1+,D2-,D3hot+,D3cold-)
>> > Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>> > Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
>> > Address: 0000000000000000 Data: 0000
>> > Capabilities: [70] Express (v2) Root Port (Slot-), MSI 00
>> > DevCap: MaxPayload 256 bytes, PhantFunc 0
>> > ExtTag- RBE+
>> > DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>> > RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
>> > MaxPayload 128 bytes, MaxReadReq 512 bytes
>> > DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
>> > LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s, Exit Latency L0s <1us, L1 <64us
>> > ClockPM- Surprise- LLActRep+ BwNot- ASPMOptComp-
>> > LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
>> > ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>> > LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive+ BWMgmt- ABWMgmt-
>> > RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
>> > RootCap: CRSVisible-
>> > RootSta: PME ReqID 0000, PMEStatus- PMEPending-
>> > DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-, OBFF Not Supported ARIFwd-
>> > DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled ARIFwd-
>> > LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
>> > Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
>> > Compliance De-emphasis: -6dB
>> > LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-
>> > EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
>> >
>>
>> Looks promising :)
>>
>
> POC seems to work, though this may additionally need to restore wifi
> state as well, no guarantees there.
>
>>str 40018 3
> 00040018 : 00000003
>>
> Retry(1) failed PCIe access @0x10ff4038
> Before: int_mask=0 app=ffc1 reset=0
> After: int_mask=0 app=ffc1 reset=7
> wlan int status=0
>
>>str 40018 3
> 00040018 : 00000003
>>
> Retry(1) failed PCIe access @0x10ff4038
> Before: int_mask=0 app=ffc1 reset=0
> After: int_mask=0 app=ffc1 reset=7
> wlan int status=0
>>
>
>
> diff --git a/target_firmware/magpie_fw_dev/target/init/app_start.c b/target_firmware/magpie_fw_dev/target/init/app_start.c
> index 8fa9c8b..fea62c1 100644
> --- a/target_firmware/magpie_fw_dev/target/init/app_start.c
> +++ b/target_firmware/magpie_fw_dev/target/init/app_start.c
> @@ -137,6 +137,13 @@ void __section(boot) __noreturn __visible app_start(void)
>
> A_PRINTF(" A_WDT_INIT()\n\r");
>
> +#if defined(PROJECT_MAGPIE)
> + // For some reason needs to be called again here for the
> + // exception handlers to work properly, at least on the XBOX
> + // adapter.
> + fatal_exception_func();
> +#endif
> +
> #if defined(PROJECT_K2)
> save_cmnos_printf = fw_cmnos_printf;
> #endif
> diff --git a/target_firmware/magpie_fw_dev/target/init/init.c b/target_firmware/magpie_fw_dev/target/init/init.c
> index 7484c05..cad2519 100755
> --- a/target_firmware/magpie_fw_dev/target/init/init.c
> +++ b/target_firmware/magpie_fw_dev/target/init/init.c
> @@ -212,6 +212,78 @@ LOCAL void zfGenWrongEpidEvent(uint32_t epid)
> mUSB_EP3_XFER_DONE();
> }
>
> +static void
> +AR7010_pcie_reset(void)
> +{
> +#define PCIE_RC_ACCESS_DELAY 20
> +
> +#define PCI_RC_RESET_BIT BIT6
> +#define PCI_RC_PHY_RESET_BIT BIT7
> +#define PCI_RC_PLL_RESET_BIT BIT8
> +#define PCI_RC_PHY_SHIFT_RESET_BIT BIT10
> +
> +#define HAL_WORD_REG_WRITE(addr, val) do { *((uint32_t*)(addr)) = val; } while (0)
> +#define HAL_WORD_REG_READ(addr) (*((uint32_t*)(addr)))
> +
> +#define CMD_PCI_RC_RESET_ON() HAL_WORD_REG_WRITE(MAGPIE_REG_RST_RESET_ADDR, \
> + (HAL_WORD_REG_READ(MAGPIE_REG_RST_RESET_ADDR)| \
> + (PCI_RC_PHY_SHIFT_RESET_BIT|PCI_RC_PLL_RESET_BIT|PCI_RC_PHY_RESET_BIT|PCI_RC_RESET_BIT)))
> +
> +#define CMD_PCI_RC_RESET_CLR() HAL_WORD_REG_WRITE(MAGPIE_REG_RST_RESET_ADDR, \
> + (HAL_WORD_REG_READ(MAGPIE_REG_RST_RESET_ADDR)& \
> + (~(PCI_RC_PHY_SHIFT_RESET_BIT|PCI_RC_PLL_RESET_BIT|PCI_RC_PHY_RESET_BIT|PCI_RC_RESET_BIT))))
> +
> + int i;
> +
> + CMD_PCI_RC_RESET_ON();
> + A_DELAY_USECS(PCIE_RC_ACCESS_DELAY);
> +
> + /* dereset the reset */
> + CMD_PCI_RC_RESET_CLR();
> + A_DELAY_USECS(500);
> +
> + /* 7. set bus master and memory space enable */
> + DEBUG_SYSTEM_STATE = (DEBUG_SYSTEM_STATE&(~0xff)) | 0x45;
> + HAL_WORD_REG_WRITE(0x00020004, (HAL_WORD_REG_READ(0x00020004)|(BIT1|BIT2)));
> + A_DELAY_USECS(PCIE_RC_ACCESS_DELAY);
> +
> + /* 7.5. asser pcie_ep reset */
> + HAL_WORD_REG_WRITE(0x00040018, (HAL_WORD_REG_READ(0x00040018) & ~(0x1 << 2)));
> + A_DELAY_USECS(PCIE_RC_ACCESS_DELAY);
> +
> + /* 7.5. de-asser pcie_ep reset */
> + HAL_WORD_REG_WRITE(0x00040018, (HAL_WORD_REG_READ(0x00040018)|(0x1 << 2)));
> + A_DELAY_USECS(PCIE_RC_ACCESS_DELAY);
> +
> + /* 8. set app_ltssm_enable */
> + DEBUG_SYSTEM_STATE = (DEBUG_SYSTEM_STATE&(~0xff)) | 0x46;
> + HAL_WORD_REG_WRITE(0x00040000, (HAL_WORD_REG_READ(0x00040000)|0xffc1));
> +
> + /*!
> + * Receive control (PCIE_RESET),
> + * 0x40018, BIT0: LINK_UP, PHY Link up -PHY Link up/down indicator
> + * in case the link up is not ready and we access the 0x14000000,
> + * vmc will hang here
> + */
> +
> + /* poll 0x40018/bit0 (1000 times) until it turns to 1 */
> + i = 10000;
> + while(i-->0)
> + {
> + uint32_t reg_value = HAL_WORD_REG_READ(0x00040018);
> + if( reg_value & BIT0 )
> + break;
> + A_DELAY_USECS(PCIE_RC_ACCESS_DELAY);
> + }
> +
> + HAL_WORD_REG_WRITE(0x14000004, (HAL_WORD_REG_READ(0x14000004)|0x116));
> + A_DELAY_USECS(PCIE_RC_ACCESS_DELAY);
> +
> + HAL_WORD_REG_WRITE(0x14000010, (HAL_WORD_REG_READ(0x14000010)|EEPROM_CTRL_BASE));
> +}
> +
> +static int exception_retries = 0;
> +
> void
> AR6002_fatal_exception_handler_patch(CPU_exception_frame_t *exc_frame)
> {
> @@ -226,6 +298,32 @@ AR6002_fatal_exception_handler_patch(CPU_exception_frame_t *exc_frame)
> dump.pc = exc_frame->xt_pc;
> dump.assline = 0;
>
> + if (dump.badvaddr >= 0x10000000 &&
> + dump.badvaddr < 0x18000000) {
> + // Exception while accessing PCIe memory space.
> + volatile uint32_t *pcie_app = (uint32_t*) 0x40000;
> + volatile uint32_t *pcie_reset = (uint32_t*) 0x40018;
> + volatile uint32_t *pcie_int_mask = (uint32_t*) 0x40050;
> +
> + // Maybe retry.
> + if (++exception_retries < 2) {
> + A_PRINTF("\nRetry(%d) failed PCIe access @0x%x\n",
> + exception_retries, dump.badvaddr);
> + A_PRINTF("Before: int_mask=%x app=%x reset=%x\n", *pcie_int_mask, *pcie_app, *pcie_reset);
> +
> + AR7010_pcie_reset();
> +
> + A_PRINTF("After: int_mask=%x app=%x reset=%x\n", *pcie_int_mask, *pcie_app, *pcie_reset);
> +
> + // This should recurse if we failed to recover.
> + A_PRINTF("wlan int status=%x\n", HAL_WORD_REG_READ(0x10ff4038));
> +
> + // Reset retry counter.
> + exception_retries = 0;
> + return;
> + }
> + }
> +
> zfGenExceptionEvent(dump.exc_frame.xt_exccause, dump.pc, dump.badvaddr);
>
> #if SYSTEM_MODULE_PRINT
>
>
> --
> Tobias PGP: http://8ef7ddba.uguu.de
^ permalink raw reply
* Re: [net-next 1/2] ipv6: sr: add a per namespace sysctl to control seg6 flowlabel
From: Ahmed Abdelsalam @ 2018-04-24 17:25 UTC (permalink / raw)
To: David Miller; +Cc: dav.lebrun, kuznet, yoshfuji, netdev, linux-kernel
In-Reply-To: <20180424.131650.2276839479783300009.davem@davemloft.net>
On Tue, 24 Apr 2018 13:16:50 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:
> From: Ahmed Abdelsalam <amsalam20@gmail.com>
> Date: Mon, 23 Apr 2018 23:36:59 +0200
>
> > This patch adds a per namespace sysctl, named 'seg6_flowlabel', to be used
> > by seg6_do_srh_encap() to control the behaviour of setting the flowlabel
> > value of outer IPv6.
> >
> > The currently support behaviours are as follows:
> > -1 set flowlabel to zero.
> > 0 copy flowlabel from Inner paceket in case of Inner IPv6 (0 for IPv4/L2)
> > 1 Compute the flowlabel using seg6_make_flowlabel()
> >
> > Signed-off-by: Ahmed Abdelsalam <amsalam20@gmail.com>
>
> There really isn't a reason to make this a separate patch.
>
> Adding a sysctl that nothing refers to doesn't add much value.
>
> So please combine patches #1 and #2.
Ok, I will combine them and send you a new patch.
Thanks
--
Ahmed Abdelsalam <amsalam20@gmail.com>
^ permalink raw reply
* [PATCH net-next] liquidio: Swap VF representor Tx and Rx statistics
From: Felix Manlunas @ 2018-04-24 17:23 UTC (permalink / raw)
To: davem
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
felix.manlunas, srinivasa.jampala
From: Srinivas Jampala <srinivasa.jampala@cavium.com>
Swap VF representor tx and rx interface statistics since it is a
virtual switchdev port and tx for VM should be rx for VF representor
and vice-versa.
Signed-off-by: Srinivas Jampala <srinivasa.jampala@cavium.com>
Acked-by: Derek Chickles <derek.chickles@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
---
drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
index 2adafa3..ddd7431 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
@@ -201,13 +201,14 @@ static void lio_vf_rep_get_stats64(struct net_device *dev,
{
struct lio_vf_rep_desc *vf_rep = netdev_priv(dev);
- stats64->tx_packets = vf_rep->stats.tx_packets;
- stats64->tx_bytes = vf_rep->stats.tx_bytes;
- stats64->tx_dropped = vf_rep->stats.tx_dropped;
-
- stats64->rx_packets = vf_rep->stats.rx_packets;
- stats64->rx_bytes = vf_rep->stats.rx_bytes;
- stats64->rx_dropped = vf_rep->stats.rx_dropped;
+ /* Swap tx and rx stats as VF rep is a switch port */
+ stats64->tx_packets = vf_rep->stats.rx_packets;
+ stats64->tx_bytes = vf_rep->stats.rx_bytes;
+ stats64->tx_dropped = vf_rep->stats.rx_dropped;
+
+ stats64->rx_packets = vf_rep->stats.tx_packets;
+ stats64->rx_bytes = vf_rep->stats.tx_bytes;
+ stats64->rx_dropped = vf_rep->stats.tx_dropped;
}
static int
--
1.8.3.1
^ permalink raw reply related
* Re: cw1200: fix spelling mistake: "Mailformed" -> "Malformed"
From: Kalle Valo @ 2018-04-24 17:23 UTC (permalink / raw)
To: Colin Ian King
Cc: Solomon Peachy, linux-wireless, netdev, kernel-janitors,
linux-kernel
In-Reply-To: <20180329153818.29538-1-colin.king@canonical.com>
Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Trivial fix to spelling mistake in wiphy_warn warning message text
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Patch applied to wireless-drivers-next.git, thanks.
0fb1abc3a0b8 cw1200: fix spelling mistake: "Mailformed" -> "Malformed"
--
https://patchwork.kernel.org/patch/10315587/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: fix for bnx2x panic during ethtool reporting
From: Sebastian Kuzminsky @ 2018-04-24 17:22 UTC (permalink / raw)
To: Kalluru, Sudarsana
Cc: Florian Fainelli, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, Elior, Ariel, Dept-Eng Everest Linux L2
In-Reply-To: <MW2PR07MB4139D11DC60825A8A6C04E068A880@MW2PR07MB4139.namprd07.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 126 bytes --]
Here's an updated version of the patch that is checkpatch.pl clean (I
had forgotten to sign off...).
--
Sebastian Kuzminsky
[-- Attachment #2: 0001-bnx2x-make-fw-str-in-a-non-crazy-way.patch --]
[-- Type: text/x-patch, Size: 1290 bytes --]
From 45fe6fb1f6a187233bd1304b031bed20b3819d26 Mon Sep 17 00:00:00 2001
From: Sebastian Kuzminsky <seb@highlab.com>
Date: Mon, 16 Apr 2018 23:24:07 +0000
Subject: [PATCH] bnx2x: make fw str in a non-crazy way
This fixes an unterminated string bug when the firwmare version
(bp->fw_ver) is longer than the passed-in buffer (buf/buf_len).
Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 6465414dad74..f023ee365c63 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -150,9 +150,9 @@ void bnx2x_fill_fw_str(struct bnx2x *bp, char *buf, size_t buf_len)
phy_fw_ver[0] = '\0';
bnx2x_get_ext_phy_fw_version(&bp->link_params,
phy_fw_ver, PHY_FW_VER_LEN);
- strlcpy(buf, bp->fw_ver, buf_len);
- snprintf(buf + strlen(bp->fw_ver), 32 - strlen(bp->fw_ver),
- "bc %d.%d.%d%s%s",
+ snprintf(buf, buf_len,
+ "%s bc %d.%d.%d%s%s",
+ bp->fw_ver,
(bp->common.bc_ver & 0xff0000) >> 16,
(bp->common.bc_ver & 0xff00) >> 8,
(bp->common.bc_ver & 0xff),
--
2.11.0
^ permalink raw reply related
* Re: [PATCH net-next] tcp: md5: only call tp->af_specific->md5_lookup() for md5 sockets
From: David Miller @ 2018-04-24 17:20 UTC (permalink / raw)
To: edumazet; +Cc: netdev, eric.dumazet
In-Reply-To: <20180423214625.107867-1-edumazet@google.com>
From: Eric Dumazet <edumazet@google.com>
Date: Mon, 23 Apr 2018 14:46:25 -0700
> RETPOLINE made calls to tp->af_specific->md5_lookup() quite expensive,
> given they have no result.
> We can omit the calls for sockets that have no md5 keys.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: [PATCH] liquidio: fix liquidio_xmit()'s return type
From: Felix Manlunas @ 2018-04-24 17:18 UTC (permalink / raw)
To: Luc Van Oostenryck
Cc: linux-kernel, Derek Chickles, Satanand Burla, Felix Manlunas,
Raghu Vatsavayi, netdev
In-Reply-To: <20180424131637.3707-1-luc.vanoostenryck@gmail.com>
On Tue, Apr 24, 2018 at 03:16:37PM +0200, Luc Van Oostenryck wrote:
> The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
> which is a typedef for an enum type, but the implementations in this
> driver returns an 'int'.
>
> Fix this by returning 'netdev_tx_t' in this driver too.
>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
> drivers/net/ethernet/cavium/liquidio/lio_main.c | 2 +-
> drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
> index 603a144d3..6d6f16815 100644
> --- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
> +++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
> @@ -2491,7 +2491,7 @@ static inline int send_nic_timestamp_pkt(struct octeon_device *oct,
> * @returns whether the packet was transmitted to the device okay or not
> * (NETDEV_TX_OK or NETDEV_TX_BUSY)
> */
> -static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
> +static netdev_tx_t liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
> {
> struct lio *lio;
> struct octnet_buf_free_info *finfo;
> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> index f92dfa411..13ef46a85 100644
> --- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> +++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> @@ -1560,7 +1560,7 @@ static int send_nic_timestamp_pkt(struct octeon_device *oct,
> * @returns whether the packet was transmitted to the device okay or not
> * (NETDEV_TX_OK or NETDEV_TX_BUSY)
> */
> -static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
> +static netdev_tx_t liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
> {
> struct octnet_buf_free_info *finfo;
> union octnic_cmd_setup cmdsetup;
> --
> 2.17.0
>
Acked-by: Felix Manlunas <felix.manlunas@cavium.com>
^ permalink raw reply
* Re: [PATCH net] packet: fix bitfield update race
From: David Miller @ 2018-04-24 17:17 UTC (permalink / raw)
To: willemdebruijn.kernel
Cc: netdev, byoungyoung, threeearcat, xiyou.wangcong, herbert,
willemb
In-Reply-To: <20180423213703.241054-1-willemdebruijn.kernel@gmail.com>
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Mon, 23 Apr 2018 17:37:03 -0400
> From: Willem de Bruijn <willemb@google.com>
>
> Updates to the bitfields in struct packet_sock are not atomic.
> Serialize these read-modify-write cycles.
>
> Move po->running into a separate variable. Its writes are protected by
> po->bind_lock (except for one startup case at packet_create). Also
> replace a textual precondition warning with lockdep annotation.
>
> All others are set only in packet_setsockopt. Serialize these
> updates by holding the socket lock. Analogous to other field updates,
> also hold the lock when testing whether a ring is active (pg_vec).
>
> Fixes: 8dc419447415 ("[PACKET]: Add optional checksum computation for recvmsg")
> Reported-by: DaeRyong Jeong <threeearcat@gmail.com>
> Reported-by: Byoungyoung Lee <byoungyoung@purdue.edu>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
Looks good, applied and queued up for -stable.
Thanks for fixing this Willem.
^ permalink raw reply
* Re: [PATCH] liquidio: fix lio_vf_rep_pkt_xmit()'s return type
From: Felix Manlunas @ 2018-04-24 17:17 UTC (permalink / raw)
To: Luc Van Oostenryck
Cc: linux-kernel, Derek Chickles, Satanand Burla, Felix Manlunas,
Raghu Vatsavayi, netdev
In-Reply-To: <20180424131639.3757-1-luc.vanoostenryck@gmail.com>
On Tue, Apr 24, 2018 at 03:16:39PM +0200, Luc Van Oostenryck wrote:
> The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
> which is a typedef for an enum type, but the implementation in this
> driver returns an 'int'.
>
> Fix this by returning 'netdev_tx_t' in this driver too.
>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
> drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
> index 2adafa366..5973a4083 100644
> --- a/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
> +++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c
> @@ -31,7 +31,7 @@
>
> static int lio_vf_rep_open(struct net_device *ndev);
> static int lio_vf_rep_stop(struct net_device *ndev);
> -static int lio_vf_rep_pkt_xmit(struct sk_buff *skb, struct net_device *ndev);
> +static netdev_tx_t lio_vf_rep_pkt_xmit(struct sk_buff *skb, struct net_device *ndev);
> static void lio_vf_rep_tx_timeout(struct net_device *netdev);
> static int lio_vf_rep_phys_port_name(struct net_device *dev,
> char *buf, size_t len);
> @@ -379,7 +379,7 @@ lio_vf_rep_packet_sent_callback(struct octeon_device *oct,
> netif_wake_queue(ndev);
> }
>
> -static int
> +static netdev_tx_t
> lio_vf_rep_pkt_xmit(struct sk_buff *skb, struct net_device *ndev)
> {
> struct lio_vf_rep_desc *vf_rep = netdev_priv(ndev);
> --
> 2.17.0
>
Thanks.
Acked-by: Felix Manlunas <felix.manlunas@cavium.com>
^ permalink raw reply
* Re: [PATCH v3] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG
From: Matthew Wilcox @ 2018-04-24 17:16 UTC (permalink / raw)
To: Mikulas Patocka
Cc: Michal Hocko, David Miller, Andrew Morton, linux-mm, eric.dumazet,
edumazet, netdev, linux-kernel, mst, jasowang, virtualization,
dm-devel, Vlastimil Babka, Christoph Lameter, Pekka Enberg,
David Rientjes, Joonsoo Kim
In-Reply-To: <alpine.LRH.2.02.1804240818530.28016@file01.intranet.prod.int.rdu2.redhat.com>
On Tue, Apr 24, 2018 at 08:29:14AM -0400, Mikulas Patocka wrote:
>
>
> On Mon, 23 Apr 2018, Matthew Wilcox wrote:
>
> > On Mon, Apr 23, 2018 at 08:06:16PM -0400, Mikulas Patocka wrote:
> > > Some bugs (such as buffer overflows) are better detected
> > > with kmalloc code, so we must test the kmalloc path too.
> >
> > Well now, this brings up another item for the collective TODO list --
> > implement redzone checks for vmalloc. Unless this is something already
> > taken care of by kasan or similar.
>
> The kmalloc overflow testing is also not ideal - it rounds the size up to
> the next slab size and detects buffer overflows only at this boundary.
>
> Some times ago, I made a "kmalloc guard" patch that places a magic number
> immediatelly after the requested size - so that it can detect overflows at
> byte boundary
> ( https://www.redhat.com/archives/dm-devel/2014-September/msg00018.html )
>
> That patch found a bug in crypto code:
> ( http://lkml.iu.edu/hypermail/linux/kernel/1409.1/02325.html )
Is it still worth doing this, now we have kasan?
^ permalink raw reply
* Re: [net-next 1/2] ipv6: sr: add a per namespace sysctl to control seg6 flowlabel
From: David Miller @ 2018-04-24 17:16 UTC (permalink / raw)
To: amsalam20; +Cc: dav.lebrun, kuznet, yoshfuji, netdev, linux-kernel
In-Reply-To: <1524519420-1612-1-git-send-email-amsalam20@gmail.com>
From: Ahmed Abdelsalam <amsalam20@gmail.com>
Date: Mon, 23 Apr 2018 23:36:59 +0200
> This patch adds a per namespace sysctl, named 'seg6_flowlabel', to be used
> by seg6_do_srh_encap() to control the behaviour of setting the flowlabel
> value of outer IPv6.
>
> The currently support behaviours are as follows:
> -1 set flowlabel to zero.
> 0 copy flowlabel from Inner paceket in case of Inner IPv6 (0 for IPv4/L2)
> 1 Compute the flowlabel using seg6_make_flowlabel()
>
> Signed-off-by: Ahmed Abdelsalam <amsalam20@gmail.com>
There really isn't a reason to make this a separate patch.
Adding a sysctl that nothing refers to doesn't add much value.
So please combine patches #1 and #2.
^ permalink raw reply
* Re: [PATCH bpf-next 00/15] Introducing AF_XDP support
From: Willem de Bruijn @ 2018-04-24 17:03 UTC (permalink / raw)
To: Björn Töpel
Cc: Karlsson, Magnus, Alexander Duyck, Alexander Duyck,
John Fastabend, Alexei Starovoitov, Jesper Dangaard Brouer,
Daniel Borkmann, Michael S. Tsirkin, Network Development,
Björn Töpel, michael.lundkvist, Brandeburg, Jesse,
Singhai, Anjali, Zhang, Qi Z
In-Reply-To: <20180423135619.7179-1-bjorn.topel@gmail.com>
On Mon, Apr 23, 2018 at 9:56 AM, Björn Töpel <bjorn.topel@gmail.com> wrote:
> From: Björn Töpel <bjorn.topel@intel.com>
>
> This RFC introduces a new address family called AF_XDP that is
> optimized for high performance packet processing and, in upcoming
> patch sets, zero-copy semantics.
Overall, this looks really nice!
> In this v2 version, we have removed
> all zero-copy related code in order to make it smaller, simpler and
> hopefully more review friendly. This RFC only supports copy-mode for
> the generic XDP path (XDP_SKB) for both RX and TX and copy-mode for RX
> using the XDP_DRV path.
Please remove references to RFC when resending to bpf-next.
> An AF_XDP socket (XSK) is created with the normal socket()
> syscall. Associated with each XSK are two queues: the RX queue and the
> TX queue. A socket can receive packets on the RX queue and it can send
> packets on the TX queue. These queues are registered and sized with
> the setsockopts XDP_RX_RING and XDP_TX_RING, respectively. It is
> mandatory to have at least one of these queues for each socket. In
> contrast to AF_PACKET V2/V3 these descriptor queues are separated from
> packet buffers. An RX or TX descriptor points to a data buffer in a
> memory area called a UMEM. RX and TX can share the same UMEM so that a
> packet does not have to be copied between RX and TX. Moreover, if a
> packet needs to be kept for a while due to a possible retransmit, the
> descriptor that points to that packet can be changed to point to
> another and reused right away. This again avoids copying data.
>
> This new dedicated packet buffer area is call a UMEM. It consists of a
> number of equally size frames and each frame has a unique frame id. A
> descriptor in one of the queues references a frame by referencing its
> frame id. The user space allocates memory for this UMEM using whatever
> means it feels is most appropriate (malloc, mmap, huge pages,
> etc). This memory area is then registered with the kernel using the new
> setsockopt XDP_UMEM_REG. The UMEM also has two queues: the FILL queue
> and the COMPLETION queue. The fill queue is used by the application to
> send down frame ids for the kernel to fill in with RX packet
> data. References to these frames will then appear in the RX queue of
> the XSK once they have been received. The completion queue, on the
> other hand, contains frame ids that the kernel has transmitted
> completely and can now be used again by user space, for either TX or
> RX. Thus, the frame ids appearing in the completion queue are ids that
> were previously transmitted using the TX queue. In summary, the RX and
> FILL queues are used for the RX path and the TX and COMPLETION queues
> are used for the TX path.
>
> The socket is then finally bound with a bind() call to a device and a
> specific queue id on that device,
The setup involves a lot of system calls. You may want to require the
caller to take these in a well defined order, and same for destruction.
Arbitrary order leads to a state explosion in paths through the code.
With AF_PACKET we've had to fix quite a few bugs due to unexpected
states of the socket, e.g., on teardown, and it is too late now to restrict
the number of states.
^ 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