* Re: [PATCH v6 bpf-next 1/9] bpf: introduce bpf_spin_lock
From: Alexei Starovoitov @ 2019-01-31 18:37 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Alexei Starovoitov, davem, daniel, jannh, netdev, kernel-team
In-Reply-To: <20190131104754.GA31516@hirez.programming.kicks-ass.net>
On Thu, Jan 31, 2019 at 11:47:54AM +0100, Peter Zijlstra wrote:
> > + local_irq_save(flags);
> > + __bpf_spin_lock(lock);
> > + this_cpu_write(irqsave_flags, flags);
>
> __this_cpu_write()
sure. will do
^ permalink raw reply
* Re: [PATCH v2 bpf-next] bpf: add optional memory accounting for maps
From: Alexei Starovoitov @ 2019-01-31 18:36 UTC (permalink / raw)
To: Martynas Pumputis; +Cc: netdev, ys114321, ast, daniel, Yonghong Song
In-Reply-To: <20190131093801.32220-1-m@lambda.lt>
On Thu, Jan 31, 2019 at 10:38:01AM +0100, Martynas Pumputis wrote:
> Previously, memory allocated for a map was not accounted. Therefore,
> this memory could not be taken into consideration by the cgroups
> memory controller.
>
> This patch introduces the "BPF_F_ACCOUNT_MEM" flag which enables
> the memory accounting for a map, and it can be set during
> the map creation ("BPF_MAP_CREATE") in "map_flags".
>
> When enabled, we account only that amount of memory which is charged
> against the "RLIMIT_MEMLOCK" limit.
>
> To validate the change, first we create the memory cgroup-v1 "test-map":
>
> # mkdir /sys/fs/cgroup/memory/test-map
>
> And then we run the following program against the cgroup:
>
> $ cat test_map.c
> <..>
> int main() {
> usleep(3 * 1000000);
> assert(bpf_create_map(BPF_MAP_TYPE_HASH, 8, 16, 65536, 0) > 0);
> usleep(3 * 1000000);
> }
> # cgexec -g memory:test-map ./test_map &
> # cat /sys/fs/cgroup/memory/test-map/memory{,.kmem}.usage_in_bytes
> 397312
> 258048
>
> <after 3 sec the map has been created>
>
> # bpftool map list
> 19: hash flags 0x0
> key 8B value 16B max_entries 65536 memlock 5771264B
> # cat /sys/fs/cgroup/memory/test-map/memory{,.kmem}.usage_in_bytes
> 401408
> 262144
>
> As we can see, the memory allocated for map is not accounted, as
> 397312B + 5771264B > 401408B.
>
> Next, we enabled the accounting and re-run the test:
>
> $ cat test_map.c
> <..>
> int main() {
> usleep(3 * 1000000);
> assert(bpf_create_map(BPF_MAP_TYPE_HASH, 8, 16, 65536, BPF_F_ACCOUNT_MEM) > 0);
> usleep(3 * 1000000);
> }
> # cgexec -g memory:test-map ./test_map &
> # cat /sys/fs/cgroup/memory/test-map/memory{,.kmem}.usage_in_bytes
> 450560
> 307200
>
> <after 3 sec the map has been created>
>
> # bpftool map list
> 20: hash flags 0x80
> key 8B value 16B max_entries 65536 memlock 5771264B
> # cat /sys/fs/cgroup/memory/test-map/memory{,.kmem}.usage_in_bytes
> 6221824
> 6078464
>
> This time, the memory (including kmem) is accounted, as
> 450560B + 5771264B <= 6221824B
>
> Acked-by: Yonghong Song <yhs@fb.com>
> Signed-off-by: Martynas Pumputis <m@lambda.lt>
see my reply in other thread.
^ permalink raw reply
* Re: [PATCH bpf-next] bpf: add optional memory accounting for maps
From: Alexei Starovoitov @ 2019-01-31 18:35 UTC (permalink / raw)
To: Martynas Pumputis; +Cc: netdev, ast, daniel
In-Reply-To: <20190130140251.23784-1-m@lambda.lt>
On Wed, Jan 30, 2019 at 03:02:51PM +0100, Martynas Pumputis wrote:
> Previously, memory allocated for a map was not accounted. Therefore,
> this memory could not be taken into consideration by the cgroups
> memory controller.
>
> This patch introduces the "BPF_F_ACCOUNT_MEM" flag which enables
> the memory accounting for a map, and it can be set during
> the map creation ("BPF_MAP_CREATE") in "map_flags".
>
> When enabled, we account only that amount of memory which is charged
> against the "RLIMIT_MEMLOCK" limit.
>
> To validate the change, first we create the memory cgroup "test-map":
>
> # mkdir /sys/fs/cgroup/memory/test-map
>
> And then we run the following program against the cgroup:
>
> $ cat test_map.c
> <..>
> int main() {
> usleep(3 * 1000000);
> assert(bpf_create_map(BPF_MAP_TYPE_HASH, 8, 16, 65536, 0) > 0);
> usleep(3 * 1000000);
> }
> # cgexec -g memory:test-map ./test_map &
> # cat /sys/fs/cgroup/memory/test-map/memory{,.kmem}.usage_in_bytes
> 397312
> 258048
>
> <after 3 sec the map has been created>
>
> # bpftool map list
> 19: hash flags 0x0
> key 8B value 16B max_entries 65536 memlock 5771264B
> # cat /sys/fs/cgroup/memory/test-map/memory{,.kmem}.usage_in_bytes
> 401408
> 262144
>
> As we can see, the memory allocated for map is not accounted, as
> 397312B + 5771264B > 401408B.
>
> Next, we enabled the accounting and re-run the test:
>
> $ cat test_map.c
> <..>
> int main() {
> usleep(3 * 1000000);
> assert(bpf_create_map(BPF_MAP_TYPE_HASH, 8, 16, 65536, BPF_F_ACCOUNT_MEM) > 0);
> usleep(3 * 1000000);
> }
> # cgexec -g memory:test-map ./test_map &
> # cat /sys/fs/cgroup/memory/test-map/memory{,.kmem}.usage_in_bytes
> 450560
> 307200
>
> <after 3 sec the map has been created>
>
> # bpftool map list
> 20: hash flags 0x80
> key 8B value 16B max_entries 65536 memlock 5771264B
> # cat /sys/fs/cgroup/memory/test-map/memory{,.kmem}.usage_in_bytes
> 6221824
> 6078464
>
> This time, the memory (including kmem) is accounted, as
> 450560B + 5771264B <= 6221824B
>
> Signed-off-by: Martynas Pumputis <m@lambda.lt>
...
> @@ -49,7 +51,9 @@ static struct bpf_map *xsk_map_alloc(union bpf_attr *attr)
>
> err = -ENOMEM;
>
> - m->flush_list = alloc_percpu(struct list_head);
> + if (account_mem)
> + gfp |= __GFP_ACCOUNT;
> + m->flush_list = alloc_percpu_gfp(struct list_head, gfp);
I think it's better to account this memory by default.
Extra flag during map creation is not needed.
There are nokmem and nosocket memcg boot options.
We can add one more to turn off accounting of bpf map memory.
^ permalink raw reply
* Re: r8169 Driver - Poor Network Performance Since Kernel 4.19
From: Heiner Kallweit @ 2019-01-31 18:28 UTC (permalink / raw)
To: Peter Ceiley, David Chang; +Cc: Realtek linux nic maintainers, netdev
In-Reply-To: <CAMLO_R5m+tFa2yzeMbacROrFirwWN+zCUVAbDd864RHVMNe08Q@mail.gmail.com>
Thanks for testing, Peter!
So we have an ASPM-related issue indeed. I'm aware that there are certain
incompatibilities between board chipsets and network chip versions
(although it's not known which combinations are affected).
And we don't know whether it's a hardware or BIOS issue.
Older driver versions dealt with this by simply disabling ASPM in general.
As a result all systems with a supported Realtek chip didn't reach higher
package power-saving states, resulting in significantly reduced battery
lifetime on notebooks.
The network driver has no stake in dealing with the ASPM policies, this
is handled by lower PCI layers.
Unfortunately we can't detect ASPM incompatibilities at runtime. Maybe
we could build some heuristics based on rx_missed percentage, but it's
not clear that ASPM issues always show the same symptoms.
So for now people with affected systems have to set a proper
pcie_aspm.policy parameter.
Just what is not clear to me is why pcie_aspm=off doesn't help.
@David:
I assume you'll check with the affected user to test the ASPM policy
parameter.
Heiner
On 31.01.2019 13:09, Peter Ceiley wrote:
> Hi Heiner,
>
> A quick update on my testing with different pcie_aspm settings:
>
> pcie_aspm=off | no change
> pcie_aspm.policy=default | no change
> pcie_aspm.policy=performance | issue resolved
> pcie_aspm.policy=powersave | issue resolved
> pcie_aspm.policy=powersupersave | issue resolved
>
> It seems the new driver does not play nicely with the default ASPM policy.
>
> As requested, I've included an output of ethtool below when experiencing
> the issue - note that no errors are recorded.
>
> # ethtool -S enp3s0
> NIC statistics:
> tx_packets: 2749
> rx_packets: 4089
> tx_errors: 0
> rx_errors: 0
> rx_missed: 0
> align_errors: 0
> tx_single_collisions: 0
> tx_multi_collisions: 0
> unicast: 4078
> broadcast: 9
> multicast: 2
> tx_aborted: 0
> tx_underrun: 0
>
> David, I hope this helps for your user as well. I appreciate you sharing
> the bug ticket - thanks.
>
> Heiner, thanks very much for your help to date.
>
> Regards,
>
> Peter.
>
> On Thu, 31 Jan 2019 at 18:23, David Chang <dchang@suse.com> wrote:
>>
>> Hi Heiner,
>>
>> On Jan 31, 2019 at 07:35:30 +0100, Heiner Kallweit wrote:
>>> Hi David, two more things:
>>>
>>> 1. Could you please test a recent linux-next kernel?
>>> 2. Please get a register dump (ethtool -d <if>) from 4.18 and 4.19
>>> and compare them.
>>
>> I'm sorry that I do not have the issue machine handy. I would ask
>> our user to do the test. Thanks!
>>
>> Regards,
>> David
>>
>>>
>>> Heiner
>>>
>>>
>>> On 31.01.2019 07:21, Heiner Kallweit wrote:
>>>> David, thanks for the link to the bug ticket.
>>>> I think only a proper bisect can help to find the offending commit.
>>>>
>>>> Heiner
>>>>
>>>>
>>>> On 31.01.2019 03:32, David Chang wrote:
>>>>> Hi,
>>>>>
>>>>> We had a similr case here.
>>>>> - Realtek r8169 receive performance regression in kernel 4.19
>>>>> https://bugzilla.suse.com/show_bug.cgi?id=1119649
>>>>>
>>>>> kernel: r8169 0000:01:00.0 eth0: RTL8168h/8111h, XID 54100880
>>>>> The major symptom is there are many rx_missed count.
>>>>>
>>>>>
>>>>> On Jan 30, 2019 at 20:15:45 +0100, Heiner Kallweit wrote:
>>>>>> Hi Peter,
>>>>>>
>>>>>> recently I had somebody where pcie_aspm=off for whatever reason didn't
>>>>>> do the trick, can you also check with pcie_aspm.policy=performance.
>>>>>
>>>>> We will give it a try later.
>>>>>
>>>>>> And please check with "ethtool -S <if>" whether the chip statistics
>>>>>> show a significant number of errors.
>>>>>>
>>>>>> If this doesn't help you may have to bisect to find the offending commit.
>>>>>
>>>>> We had tried fallback driver to a few previous commits as following,
>>>>> but with no luck.
>>>>>
>>>>> 9675931e6b65 r8169: re-enable MSI-X on RTL8168g (v4.19)
>>>>> 098b01ad9837 r8169: don't include asm headers directly (v4.19-rc1)
>>>>> a2965f12fde6 r8169: remove rtl8169_set_speed_xmii (v4.19-rc1)
>>>>> 6fcf9b1d4d6c r8169: fix runtime suspend (v4.19-rc1)
>>>>> e397286b8e89 r8169: remove TBI 1000BaseX support (v4.19-rc1)
>>>>>
>>>>> Thanks,
>>>>> David Chang
>>>>>
>>>>>>
>>>>>> Heiner
>>>>>>
>>>>>>
>>>>>> On 30.01.2019 10:59, Peter Ceiley wrote:
>>>>>>> Hi Heiner,
>>>>>>>
>>>>>>> I tried disabling the ASPM using the pcie_aspm=off kernel parameter
>>>>>>> and this made no difference.
>>>>>>>
>>>>>>> I tried compiling the 4.18.16 r8169.c with the 4.19.18 source and
>>>>>>> subsequently loaded the module in the running 4.19.18 kernel. I can
>>>>>>> confirm that this immediately resolved the issue and access to the NFS
>>>>>>> shares operated as expected.
>>>>>>>
>>>>>>> I presume this means it is an issue with the r8169 driver included in
>>>>>>> 4.19 onwards?
>>>>>>>
>>>>>>> To answer your last questions:
>>>>>>>
>>>>>>> Base Board Information
>>>>>>> Manufacturer: Alienware
>>>>>>> Product Name: 0PGRP5
>>>>>>> Version: A02
>>>>>>>
>>>>>>> ... and yes, the RTL8168 is the onboard network chip.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Peter.
>>>>>>>
>>>>>>> On Tue, 29 Jan 2019 at 17:44, Heiner Kallweit <hkallweit1@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Hi Peter,
>>>>>>>>
>>>>>>>> I think the vendor driver doesn't enable ASPM per default.
>>>>>>>> So it's worth a try to disable ASPM in the BIOS or via sysfs.
>>>>>>>> Few older systems seem to have issues with ASPM, what kind of
>>>>>>>> system / mainboard are you using? The RTL8168 is the onboard
>>>>>>>> network chip?
>>>>>>>>
>>>>>>>> Rgds, Heiner
>>>>>>>>
>>>>>>>>
>>>>>>>> On 29.01.2019 07:20, Peter Ceiley wrote:
>>>>>>>>> Hi Heiner,
>>>>>>>>>
>>>>>>>>> Thanks, I'll do some more testing. It might not be the driver - I
>>>>>>>>> assumed it was due to the fact that using the r8168 driver 'resolves'
>>>>>>>>> the issue. I'll see if I can test the r8169.c on top of 4.19 - this is
>>>>>>>>> a good idea.
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>>
>>>>>>>>> Peter.
>>>>>>>>>
>>>>>>>>> On Tue, 29 Jan 2019 at 17:16, Heiner Kallweit <hkallweit1@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>> Hi Peter,
>>>>>>>>>>
>>>>>>>>>> at a first glance it doesn't look like a typical driver issue.
>>>>>>>>>> What you could do:
>>>>>>>>>>
>>>>>>>>>> - Test the r8169.c from 4.18 on top of 4.19.
>>>>>>>>>>
>>>>>>>>>> - Check whether disabling ASPM (/sys/module/pcie_aspm) has an effect.
>>>>>>>>>>
>>>>>>>>>> - Bisect between 4.18 and 4.19 to find the offending commit.
>>>>>>>>>>
>>>>>>>>>> Any specific reason why you think root cause is in the driver and not
>>>>>>>>>> elsewhere in the network subsystem?
>>>>>>>>>>
>>>>>>>>>> Heiner
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 28.01.2019 23:10, Peter Ceiley wrote:
>>>>>>>>>>> Hi Heiner,
>>>>>>>>>>>
>>>>>>>>>>> Thanks for getting back to me.
>>>>>>>>>>>
>>>>>>>>>>> No, I don't use jumbo packets.
>>>>>>>>>>>
>>>>>>>>>>> Bandwidth is *generally* good, and iperf results to my NAS provide
>>>>>>>>>>> over 900 Mbits/s in both circumstances. The issue seems to appear when
>>>>>>>>>>> establishing a connection and is most notable, for example, on my
>>>>>>>>>>> mounted NFS shares where it takes seconds (up to 10's of seconds on
>>>>>>>>>>> larger directories) to list the contents of each directory. Once a
>>>>>>>>>>> transfer begins on a file, I appear to get good bandwidth.
>>>>>>>>>>>
>>>>>>>>>>> I'm unsure of the best scientific data to provide you in order to
>>>>>>>>>>> troubleshoot this issue. Running the following
>>>>>>>>>>>
>>>>>>>>>>> netstat -s |grep retransmitted
>>>>>>>>>>>
>>>>>>>>>>> shows a steady increase in retransmitted segments each time I list the
>>>>>>>>>>> contents of a remote directory, for example, running 'ls' on a
>>>>>>>>>>> directory containing 345 media files did the following using kernel
>>>>>>>>>>> 4.19.18:
>>>>>>>>>>>
>>>>>>>>>>> increased retransmitted segments by 21 and the 'time' command showed
>>>>>>>>>>> the following:
>>>>>>>>>>> real 0m19.867s
>>>>>>>>>>> user 0m0.012s
>>>>>>>>>>> sys 0m0.036s
>>>>>>>>>>>
>>>>>>>>>>> The same command shows no retransmitted segments running kernel
>>>>>>>>>>> 4.18.16 and 'time' showed:
>>>>>>>>>>> real 0m0.300s
>>>>>>>>>>> user 0m0.004s
>>>>>>>>>>> sys 0m0.007s
>>>>>>>>>>>
>>>>>>>>>>> ifconfig does not show any RX/TX errors nor dropped packets in either case.
>>>>>>>>>>>
>>>>>>>>>>> dmesg XID:
>>>>>>>>>>> [ 2.979984] r8169 0000:03:00.0 eth0: RTL8168g/8111g,
>>>>>>>>>>> f8:b1:56:fe:67:e0, XID 4c000800, IRQ 32
>>>>>>>>>>>
>>>>>>>>>>> # lspci -vv
>>>>>>>>>>> 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
>>>>>>>>>>> RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
>>>>>>>>>>> Subsystem: Dell RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
>>>>>>>>>>> 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, Cache Line Size: 64 bytes
>>>>>>>>>>> Interrupt: pin A routed to IRQ 19
>>>>>>>>>>> Region 0: I/O ports at d000 [size=256]
>>>>>>>>>>> Region 2: Memory at f7b00000 (64-bit, non-prefetchable) [size=4K]
>>>>>>>>>>> Region 4: Memory at f2100000 (64-bit, prefetchable) [size=16K]
>>>>>>>>>>> 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) Endpoint, MSI 01
>>>>>>>>>>> DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s
>>>>>>>>>>> <512ns, L1 <64us
>>>>>>>>>>> ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
>>>>>>>>>>> SlotPowerLimit 10.000W
>>>>>>>>>>> DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
>>>>>>>>>>> RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>>>>>>>>>>> MaxPayload 128 bytes, MaxReadReq 4096 bytes
>>>>>>>>>>> DevSta: CorrErr+ NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
>>>>>>>>>>> LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
>>>>>>>>>>> Latency L0s unlimited, L1 <64us
>>>>>>>>>>> ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
>>>>>>>>>>> LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
>>>>>>>>>>> ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
>>>>>>>>>>> LnkSta: Speed 2.5GT/s (ok), Width x1 (ok)
>>>>>>>>>>> TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
>>>>>>>>>>> DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, LTR+,
>>>>>>>>>>> OBFF Via message/WAKE#
>>>>>>>>>>> AtomicOpsCap: 32bit- 64bit- 128bitCAS-
>>>>>>>>>>> DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+,
>>>>>>>>>>> OBFF Disabled
>>>>>>>>>>> AtomicOpsCtl: ReqEn-
>>>>>>>>>>> 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-
>>>>>>>>>>> Capabilities: [b0] MSI-X: Enable+ Count=4 Masked-
>>>>>>>>>>> Vector table: BAR=4 offset=00000000
>>>>>>>>>>> PBA: BAR=4 offset=00000800
>>>>>>>>>>> Capabilities: [d0] Vital Product Data
>>>>>>>>>>> pcilib: sysfs_read_vpd: read failed: Input/output error
>>>>>>>>>>> Not readable
>>>>>>>>>>> Capabilities: [100 v1] Advanced Error Reporting
>>>>>>>>>>> UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
>>>>>>>>>>> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>>>>>>>>>>> UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
>>>>>>>>>>> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>>>>>>>>>>> UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
>>>>>>>>>>> RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>>>>>>>>>>> CESta: RxErr+ BadTLP+ BadDLLP+ Rollover- Timeout+ AdvNonFatalErr-
>>>>>>>>>>> CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
>>>>>>>>>>> AERCap: First Error Pointer: 00, ECRCGenCap+ ECRCGenEn-
>>>>>>>>>>> ECRCChkCap+ ECRCChkEn-
>>>>>>>>>>> MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
>>>>>>>>>>> HeaderLog: 00000000 00000000 00000000 00000000
>>>>>>>>>>> Capabilities: [140 v1] Virtual Channel
>>>>>>>>>>> Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
>>>>>>>>>>> Arb: Fixed- WRR32- WRR64- WRR128-
>>>>>>>>>>> Ctrl: ArbSelect=Fixed
>>>>>>>>>>> Status: InProgress-
>>>>>>>>>>> VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>>>>>>>>>>> Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>>>>>>>>>>> Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=01
>>>>>>>>>>> Status: NegoPending- InProgress-
>>>>>>>>>>> Capabilities: [160 v1] Device Serial Number 01-00-00-00-68-4c-e0-00
>>>>>>>>>>> Capabilities: [170 v1] Latency Tolerance Reporting
>>>>>>>>>>> Max snoop latency: 71680ns
>>>>>>>>>>> Max no snoop latency: 71680ns
>>>>>>>>>>> Kernel driver in use: r8169
>>>>>>>>>>> Kernel modules: r8169
>>>>>>>>>>>
>>>>>>>>>>> Please let me know if you have any other ideas in terms of testing.
>>>>>>>>>>>
>>>>>>>>>>> Thanks!
>>>>>>>>>>>
>>>>>>>>>>> Peter.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Tue, 29 Jan 2019 at 05:28, Heiner Kallweit <hkallweit1@gmail.com> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> On 28.01.2019 12:13, Peter Ceiley wrote:
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I have been experiencing very poor network performance since Kernel
>>>>>>>>>>>>> 4.19 and I'm confident it's related to the r8169 driver.
>>>>>>>>>>>>>
>>>>>>>>>>>>> I have no issue with kernel versions 4.18 and prior. I am experiencing
>>>>>>>>>>>>> this issue in kernels 4.19 and 4.20 (currently running/testing with
>>>>>>>>>>>>> 4.20.4 & 4.19.18).
>>>>>>>>>>>>>
>>>>>>>>>>>>> If someone could guide me in the right direction, I'm happy to help
>>>>>>>>>>>>> troubleshoot this issue. Note that I have been keeping an eye on one
>>>>>>>>>>>>> issue related to loading of the PHY driver, however, my symptoms
>>>>>>>>>>>>> differ in that I still have a network connection. I have attempted to
>>>>>>>>>>>>> reload the driver on a running system, but this does not improve the
>>>>>>>>>>>>> situation.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Using the proprietary r8168 driver returns my device to proper working order.
>>>>>>>>>>>>>
>>>>>>>>>>>>> lshw shows:
>>>>>>>>>>>>> description: Ethernet interface
>>>>>>>>>>>>> product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
>>>>>>>>>>>>> vendor: Realtek Semiconductor Co., Ltd.
>>>>>>>>>>>>> physical id: 0
>>>>>>>>>>>>> bus info: pci@0000:03:00.0
>>>>>>>>>>>>> logical name: enp3s0
>>>>>>>>>>>>> version: 0c
>>>>>>>>>>>>> serial:
>>>>>>>>>>>>> size: 1Gbit/s
>>>>>>>>>>>>> capacity: 1Gbit/s
>>>>>>>>>>>>> width: 64 bits
>>>>>>>>>>>>> clock: 33MHz
>>>>>>>>>>>>> capabilities: pm msi pciexpress msix vpd bus_master cap_list
>>>>>>>>>>>>> ethernet physical tp aui bnc mii fibre 10bt 10bt-fd 100bt 100bt-fd
>>>>>>>>>>>>> 1000bt-fd autonegotiation
>>>>>>>>>>>>> configuration: autonegotiation=on broadcast=yes driver=r8169
>>>>>>>>>>>>> duplex=full firmware=rtl8168g-2_0.0.1 02/06/13 ip=192.168.1.25
>>>>>>>>>>>>> latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
>>>>>>>>>>>>> resources: irq:19 ioport:d000(size=256)
>>>>>>>>>>>>> memory:f7b00000-f7b00fff memory:f2100000-f2103fff
>>>>>>>>>>>>>
>>>>>>>>>>>>> Kind Regards,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Peter.
>>>>>>>>>>>>>
>>>>>>>>>>>> Hi Peter,
>>>>>>>>>>>>
>>>>>>>>>>>> the description "poor network performance" is quite vague, therefore:
>>>>>>>>>>>>
>>>>>>>>>>>> - Can you provide any measurements?
>>>>>>>>>>>> - iperf results before and after
>>>>>>>>>>>> - statistics about dropped packets (rx and/or tx)
>>>>>>>>>>>> - Do you use jumbo packets?
>>>>>>>>>>>>
>>>>>>>>>>>> Also help would be a "lspci -vv" output for the network card and
>>>>>>>>>>>> the dmesg output line with the chip XID.
>>>>>>>>>>>>
>>>>>>>>>>>> Heiner
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>>
>
^ permalink raw reply
* Do the work for you
From: Julie @ 2019-01-31 13:03 UTC (permalink / raw)
To: netdev
Want to make white background for your images?
We can add clipping path, or give retouching for your photos if needed.
Let's start testing for your photos.
Thanks,
Julie
Dessau
Seevetal
^ permalink raw reply
* [PATCH iproute2-next] tc: add 'kind' property to 'csum' action
From: Davide Caratti @ 2019-01-31 17:58 UTC (permalink / raw)
To: David Ahern, Stephen Hemminger; +Cc: netdev
unlike other TC actions already supporting JSON printout, 'csum' does not
print the value of TCA_KIND in the 'kind' property: remove 'csum' word
from 'csum' property, and add a separate 'kind' property containing the
action name. The human-readable printout is preserved.
Tested with:
# ./tdc.py -c csum
Cc: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
---
tc/m_csum.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tc/m_csum.c b/tc/m_csum.c
index 752269d1d020..84396d6a482d 100644
--- a/tc/m_csum.c
+++ b/tc/m_csum.c
@@ -199,10 +199,11 @@ print_csum(struct action_util *au, FILE *f, struct rtattr *arg)
uflag_1 = "?empty";
}
+ print_string(PRINT_ANY, "kind", "%s ", "csum");
snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s",
uflag_1, uflag_2, uflag_3,
uflag_4, uflag_5, uflag_6, uflag_7);
- print_string(PRINT_ANY, "csum", "csum (%s) ", buf);
+ print_string(PRINT_ANY, "csum", "(%s) ", buf);
print_action_control(f, "action ", sel->action, "\n");
print_uint(PRINT_ANY, "index", "\tindex %u", sel->index);
--
2.20.1
^ permalink raw reply related
* [PATCH iproute2-next] tc: full JSON support for 'bpf' actions
From: Davide Caratti @ 2019-01-31 17:58 UTC (permalink / raw)
To: David Ahern, Stephen Hemminger; +Cc: netdev
Add full JSON output support in the dump of 'act_bpf'.
Example using eBPF:
# tc actions flush action bpf
# tc action add action bpf object bpf/action.o section 'action-ok'
# tc -j action list action bpf | jq
[
{
"total acts": 1
},
{
"actions": [
{
"order": 0,
"kind": "bpf",
"bpf_name": "action.o:[action-ok]",
"prog": {
"id": 33,
"tag": "a04f5eef06a7f555",
"jited": 1
},
"control_action": {
"type": "pipe"
},
"index": 1,
"ref": 1,
"bind": 0
}
]
}
]
Example using cBPF:
# tc actions flush action bpf
# a=$(mktemp)
# tcpdump -ddd not ether proto 0x888e >$a
# tc action add action bpf bytecode-file $a index 42
# rm $a
# tc -j action list action bpf | jq
[
{
"total acts": 1
},
{
"actions": [
{
"order": 0,
"kind": "bpf",
"bytecode": {
"length": 4,
"insns": [
{
"code": 40,
"jt": 0,
"jf": 0,
"k": 12
},
{
"code": 21,
"jt": 0,
"jf": 1,
"k": 34958
},
{
"code": 6,
"jt": 0,
"jf": 0,
"k": 0
},
{
"code": 6,
"jt": 0,
"jf": 0,
"k": 262144
}
]
},
"control_action": {
"type": "pipe"
},
"index": 42,
"ref": 1,
"bind": 0
}
]
}
]
Tested with:
# ./tdc.py -c bpf
Cc: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
---
include/bpf_util.h | 2 +-
lib/bpf.c | 26 ++++++++++++++++++--------
tc/f_bpf.c | 2 +-
tc/m_bpf.c | 32 +++++++++++++++++---------------
4 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/include/bpf_util.h b/include/bpf_util.h
index 63837a04e56f..63db07ca49ae 100644
--- a/include/bpf_util.h
+++ b/include/bpf_util.h
@@ -272,7 +272,7 @@ const char *bpf_prog_to_default_section(enum bpf_prog_type type);
int bpf_graft_map(const char *map_path, uint32_t *key, int argc, char **argv);
int bpf_trace_pipe(void);
-void bpf_print_ops(FILE *f, struct rtattr *bpf_ops, __u16 len);
+void bpf_print_ops(struct rtattr *bpf_ops, __u16 len);
int bpf_prog_load(enum bpf_prog_type type, const struct bpf_insn *insns,
size_t size_insns, const char *license, char *log,
diff --git a/lib/bpf.c b/lib/bpf.c
index 5e85cfc0bdd5..dfc4f4f522c3 100644
--- a/lib/bpf.c
+++ b/lib/bpf.c
@@ -339,7 +339,7 @@ out:
return ret;
}
-void bpf_print_ops(FILE *f, struct rtattr *bpf_ops, __u16 len)
+void bpf_print_ops(struct rtattr *bpf_ops, __u16 len)
{
struct sock_filter *ops = RTA_DATA(bpf_ops);
int i;
@@ -347,14 +347,24 @@ void bpf_print_ops(FILE *f, struct rtattr *bpf_ops, __u16 len)
if (len == 0)
return;
- fprintf(f, "bytecode \'%u,", len);
-
- for (i = 0; i < len - 1; i++)
- fprintf(f, "%hu %hhu %hhu %u,", ops[i].code, ops[i].jt,
- ops[i].jf, ops[i].k);
+ open_json_object("bytecode");
+ print_uint(PRINT_ANY, "length", "bytecode \'%u,", len);
+ open_json_array(PRINT_JSON, "insns");
+
+ for (i = 0; i < len; i++) {
+ open_json_object(NULL);
+ print_uint(PRINT_ANY, "code", "%hu ", ops[i].code);
+ print_uint(PRINT_ANY, "jt", "%hhu ", ops[i].jt);
+ print_uint(PRINT_ANY, "jf", "%hhu ", ops[i].jf);
+ if (i == len - 1)
+ print_uint(PRINT_ANY, "k", "%u\'", ops[i].k);
+ else
+ print_uint(PRINT_ANY, "k", "%u,", ops[i].k);
+ close_json_object();
+ }
- fprintf(f, "%hu %hhu %hhu %u\'", ops[i].code, ops[i].jt,
- ops[i].jf, ops[i].k);
+ close_json_array(PRINT_JSON, NULL);
+ close_json_object();
}
static void bpf_map_pin_report(const struct bpf_elf_map *pin,
diff --git a/tc/f_bpf.c b/tc/f_bpf.c
index 5906f8bb969d..948d9051b9a5 100644
--- a/tc/f_bpf.c
+++ b/tc/f_bpf.c
@@ -235,7 +235,7 @@ static int bpf_print_opt(struct filter_util *qu, FILE *f,
}
if (tb[TCA_BPF_OPS] && tb[TCA_BPF_OPS_LEN])
- bpf_print_ops(f, tb[TCA_BPF_OPS],
+ bpf_print_ops(tb[TCA_BPF_OPS],
rta_getattr_u16(tb[TCA_BPF_OPS_LEN]));
if (tb[TCA_BPF_ID])
diff --git a/tc/m_bpf.c b/tc/m_bpf.c
index 7c6f8c298abd..3e8468c68324 100644
--- a/tc/m_bpf.c
+++ b/tc/m_bpf.c
@@ -157,7 +157,7 @@ static int bpf_print_opt(struct action_util *au, FILE *f, struct rtattr *arg)
{
struct rtattr *tb[TCA_ACT_BPF_MAX + 1];
struct tc_act_bpf *parm;
- int dump_ok = 0;
+ int d_ok = 0;
if (arg == NULL)
return -1;
@@ -170,31 +170,33 @@ static int bpf_print_opt(struct action_util *au, FILE *f, struct rtattr *arg)
}
parm = RTA_DATA(tb[TCA_ACT_BPF_PARMS]);
- fprintf(f, "bpf ");
+ print_string(PRINT_ANY, "kind", "%s ", "bpf");
if (tb[TCA_ACT_BPF_NAME])
- fprintf(f, "%s ", rta_getattr_str(tb[TCA_ACT_BPF_NAME]));
-
+ print_string(PRINT_ANY, "bpf_name", "%s ",
+ rta_getattr_str(tb[TCA_ACT_BPF_NAME]));
if (tb[TCA_ACT_BPF_OPS] && tb[TCA_ACT_BPF_OPS_LEN]) {
- bpf_print_ops(f, tb[TCA_ACT_BPF_OPS],
+ bpf_print_ops(tb[TCA_ACT_BPF_OPS],
rta_getattr_u16(tb[TCA_ACT_BPF_OPS_LEN]));
- fprintf(f, " ");
+ print_string(PRINT_FP, NULL, "%s", " ");
}
if (tb[TCA_ACT_BPF_ID])
- dump_ok = bpf_dump_prog_info(f, rta_getattr_u32(tb[TCA_ACT_BPF_ID]));
- if (!dump_ok && tb[TCA_ACT_BPF_TAG]) {
+ d_ok = bpf_dump_prog_info(f,
+ rta_getattr_u32(tb[TCA_ACT_BPF_ID]));
+ if (!d_ok && tb[TCA_ACT_BPF_TAG]) {
SPRINT_BUF(b);
- fprintf(f, "tag %s ",
- hexstring_n2a(RTA_DATA(tb[TCA_ACT_BPF_TAG]),
- RTA_PAYLOAD(tb[TCA_ACT_BPF_TAG]),
- b, sizeof(b)));
+ print_string(PRINT_ANY, "tag", "tag %s ",
+ hexstring_n2a(RTA_DATA(tb[TCA_ACT_BPF_TAG]),
+ RTA_PAYLOAD(tb[TCA_ACT_BPF_TAG]),
+ b, sizeof(b)));
}
- print_action_control(f, "default-action ", parm->action, "\n");
- fprintf(f, "\tindex %u ref %d bind %d", parm->index, parm->refcnt,
- parm->bindcnt);
+ print_action_control(f, "default-action ", parm->action, _SL_);
+ print_uint(PRINT_ANY, "index", "\t index %u", parm->index);
+ print_int(PRINT_ANY, "ref", " ref %d", parm->refcnt);
+ print_int(PRINT_ANY, "bind", " bind %d", parm->bindcnt);
if (show_stats) {
if (tb[TCA_ACT_BPF_TM]) {
--
2.20.1
^ permalink raw reply related
* Re: pull-request: ieee802154 for net 2019-01-31
From: David Miller @ 2019-01-31 17:48 UTC (permalink / raw)
To: stefan; +Cc: linux-wpan, alex.aring, netdev
In-Reply-To: <20190131170001.25905-1-stefan@datenfreihafen.org>
From: Stefan Schmidt <stefan@datenfreihafen.org>
Date: Thu, 31 Jan 2019 18:00:01 +0100
> An update from ieee802154 for your *net* tree.
>
> I waited a while to see if anything else comes up, but it seems this time
> we only have one fixup patch for the -rc rounds.
> Colin fixed some indentation in the mcr20a drivers. That's about it.
>
> If there are any problems with taking these two before the final 5.0 let
> me know.
Pulled, thanks!
> Greetings from Brussels, FOSDEM ahead. :-)
Enjoy!
^ permalink raw reply
* Re: [PATCH net] rds: fix refcount bug in rds_sock_addref
From: David Miller @ 2019-01-31 17:46 UTC (permalink / raw)
To: edumazet
Cc: netdev, eric.dumazet, syzkaller, sowmini.varadhan,
santosh.shilimkar, rds-devel, xiyou.wangcong
In-Reply-To: <20190131164710.230590-1-edumazet@google.com>
From: Eric Dumazet <edumazet@google.com>
Date: Thu, 31 Jan 2019 08:47:10 -0800
> syzbot was able to catch a bug in rds [1]
>
> The issue here is that the socket might be found in a hash table
> but that its refcount has already be set to 0 by another cpu.
>
> We need to use refcount_inc_not_zero() to be safe here.
...
> Fixes: cc4dfb7f70a3 ("rds: fix two RCU related problems")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: syzbot <syzkaller@googlegroups.com>
Applied and queued up for -stable, thanks Eric.
^ permalink raw reply
* Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames
From: David Miller @ 2019-01-31 17:45 UTC (permalink / raw)
To: mst; +Cc: makita.toshiaki, jasowang, netdev, virtualization, dsahern, hawk
In-Reply-To: <20190131101516-mutt-send-email-mst@kernel.org>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Thu, 31 Jan 2019 10:25:17 -0500
> On Thu, Jan 31, 2019 at 08:40:30PM +0900, Toshiaki Makita wrote:
>> Previously virtnet_xdp_xmit() did not account for device tx counters,
>> which caused confusions.
>> To be consistent with SKBs, account them on freeing xdp_frames.
>>
>> Reported-by: David Ahern <dsahern@gmail.com>
>> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>
> Well we count them on receive so I guess it makes sense for consistency
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
>
> however, I really wonder whether adding more and more standard net stack
> things like this will end up costing most of XDP its speed.
>
> Should we instead make sure *not* to account XDP packets
> in any counters at all? XDP programs can use maps
> to do their own counting...
This has been definitely a discussion point, and something we should
develop a clear, strong, policy on.
David, Jesper, care to chime in where we ended up in that last thread
discussion this?
^ permalink raw reply
* Re: [PATCH net] net/mlx4_en: Force CHECKSUM_NONE for short ethernet frames
From: David Miller @ 2019-01-31 17:38 UTC (permalink / raw)
To: tariqt; +Cc: netdev, eranbe, saeedm, edumazet
In-Reply-To: <1548939763-20074-1-git-send-email-tariqt@mellanox.com>
From: Tariq Toukan <tariqt@mellanox.com>
Date: Thu, 31 Jan 2019 15:02:43 +0200
> From: Saeed Mahameed <saeedm@mellanox.com>
>
> When an ethernet frame is padded to meet the minimum ethernet frame
> size, the padding octets are not covered by the hardware checksum.
> Fortunately the padding octets are usually zero's, which don't affect
> checksum. However, it is not guaranteed. For example, switches might
> choose to make other use of these octets.
> This repeatedly causes kernel hardware checksum fault.
>
> Prior to the cited commit below, skb checksum was forced to be
> CHECKSUM_NONE when padding is detected. After it, we need to keep
> skb->csum updated. However, fixing up CHECKSUM_COMPLETE requires to
> verify and parse IP headers, it does not worth the effort as the packets
> are so small that CHECKSUM_COMPLETE has no significant advantage.
>
> Fixes: 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends")
> Cc: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
> ---
> drivers/net/ethernet/mellanox/mlx4/en_rx.c | 19 +++++++++++++++++--
> 1 file changed, 17 insertions(+), 2 deletions(-)
>
> Hi Dave,
> Please queue for -stable >= v4.18.
Please look into Eric's feedback and update the comment as needed.
Thank you.
^ permalink raw reply
* Re: BUG: KASAN: double-free or invalid-free in ip_defrag after upgrade from 4.19.13
From: David Miller @ 2019-01-31 17:38 UTC (permalink / raw)
To: gregkh; +Cc: edumazet, ivan, mkubecek, netdev, ignat, sbohrer, jakub
In-Reply-To: <20190131124816.GA8031@kroah.com>
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Thu, 31 Jan 2019 13:48:16 +0100
> Thanks for this, I'll turn this into a real patch and backport it to
> where it is needed.
Thanks a lot for taking care of this!
^ permalink raw reply
* Re: [PATCH v3] lib/test_rhashtable: Make test_insert_dup() allocate its hash table dynamically
From: David Miller @ 2019-01-31 17:37 UTC (permalink / raw)
To: herbert; +Cc: bvanassche, tgraf, netdev, linux-kernel
In-Reply-To: <20190131120826.l4xd3vfonwmldudd@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 31 Jan 2019 20:08:26 +0800
> On Wed, Jan 30, 2019 at 10:42:30AM -0800, Bart Van Assche wrote:
>> The test_insert_dup() function from lib/test_rhashtable.c passes a
>> pointer to a stack object to rhltable_init(). Allocate the hash table
>> dynamically to avoid that the following is reported with object
>> debugging enabled:
...
>> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
...
>
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Applied, thanks everyone.
^ permalink raw reply
* Re: [PATCH net-next v3 8/8] ethtool: add compat for devlink info
From: Jakub Kicinski @ 2019-01-31 17:29 UTC (permalink / raw)
To: David Miller
Cc: lkp, kbuild-all, netdev, oss-drivers, jiri, andrew, f.fainelli,
mkubecek, eugenem, jonathan.lemon
In-Reply-To: <20190131092508.53bb519c@cakuba.hsd1.ca.comcast.net>
On Thu, 31 Jan 2019 09:25:08 -0800, Jakub Kicinski wrote:
> On Thu, 31 Jan 2019 09:23:03 -0800 (PST), David Miller wrote:
> > From: kbuild test robot <lkp@intel.com>
> > Date: Fri, 1 Feb 2019 00:19:33 +0800
> >
> > > All errors (new ones prefixed by >>):
> > >
> > > m68k-linux-gnu-ld: drivers/rtc/proc.o: in function `is_rtc_hctosys.isra.0':
> > > proc.c:(.text+0x178): undefined reference to `strcmp'
> > > m68k-linux-gnu-ld: net/core/ethtool.o: in function `ethtool_get_drvinfo':
> > >>> ethtool.c:(.text+0xc08): undefined reference to `devlink_compat_running_version'
> >
> > Missing string.h include perhaps?
>
> Yeah, that one looks like existing m68k bug, but also I think I need to
> cater to the DEVLINK=m case since ethtool code is always built in we
> can't use the MAY_USE_DEVLINK trick :S
I think we have to do this:
#if IS_REACHABLE(CONFIG_NET_DEVLINK)
void devlink_compat_running_version(struct net_device *dev,
char *buf, size_t len);
#else
static inline void
devlink_compat_running_version(struct net_device *dev, char *buf, size_t len)
{
}
#endif
Jiri, any objections?
^ permalink raw reply
* Re: net: phylink: dsa: mv88e6xxx: flaky link detection on switch ports with internal PHYs
From: John David Anglin @ 2019-01-31 17:27 UTC (permalink / raw)
To: Andrew Lunn; +Cc: Russell King, Vivien Didelot, Florian Fainelli, netdev
In-Reply-To: <9415d82e-965b-7777-0ad0-f23d6c9f177e@bell.net>
On 2019-01-30 8:27 p.m., John David Anglin wrote:
> On 2019-01-30 5:38 p.m., Andrew Lunn wrote:
>> I'd suggest you take a look at the datasheet for the 37xx and check
>> what the hardware actually supports. You might need to extend the
>> driver.
> I did look and the GIC does support level interrupts. But all the
> documentation is in
> generic ARM documents that I don't currently have. I'll see if I can
> find them tomorrow.
On a closer look at MV-S110897-00C, I see that the north and south
bridge GPIO interrupt registers
only provide edge polarity control. The GPIO pins don't appear to
support level interrupts on 88F37xx.
Dave
--
John David Anglin dave.anglin@bell.net
^ permalink raw reply
* Re: [PATCH net-next] macvlan: use netif_is_macvlan_port()
From: David Miller @ 2019-01-31 17:26 UTC (permalink / raw)
To: jwi; +Cc: netdev
In-Reply-To: <20190131094810.57656-1-jwi@linux.ibm.com>
From: Julian Wiedmann <jwi@linux.ibm.com>
Date: Thu, 31 Jan 2019 10:48:10 +0100
> Replace the macvlan_port_exists() macro with its twin from netdevice.h
>
> Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Looks great, applied.
Thanks for cleaning this up.
^ permalink raw reply
* Re: [PATCH -next] mISDN: hfcsusb: Fix potential NULL pointer dereference
From: David Miller @ 2019-01-31 17:25 UTC (permalink / raw)
To: yuehaibing; +Cc: isdn, gustavo, bigeasy, linux-kernel, netdev
In-Reply-To: <b565e6fa-a52f-f4f1-21b9-c63332d06ea0@huawei.com>
From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 31 Jan 2019 17:41:46 +0800
> On 2019/1/31 2:10, David Miller wrote:
>> From: YueHaibing <yuehaibing@huawei.com>
>> Date: Wed, 30 Jan 2019 18:19:02 +0800
>>
>>> There is a potential NULL pointer dereference in case
>>> kzalloc() fails and returns NULL.
>>>
>>> Fixes: 69f52adb2d53 ("mISDN: Add HFC USB driver")
>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>> ---
>>> drivers/isdn/hardware/mISDN/hfcsusb.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
>>> index 124ff53..5660d5a 100644
>>> --- a/drivers/isdn/hardware/mISDN/hfcsusb.c
>>> +++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
>>> @@ -263,6 +263,8 @@ hfcsusb_ph_info(struct hfcsusb *hw)
>>> int i;
>>>
>>> phi = kzalloc(struct_size(phi, bch, dch->dev.nrbchan), GFP_ATOMIC);
>>> + if (!phi)
>>> + return;
>>
>> If we fail with an error and do not perform the operation we were requested to
>> make, we must return an error to the caller, and the caller must do something
>> reasonable with that error (perhaps return it to it's caller) and so on and
>> so forth.
>
>
> hfcsusb_ph_info alloced the 'phi',then use it _alloc_mISDN_skb in _queue_data.
> while _alloc_mISDN_skb fails, it also just return without err handling,then kfree(phi).
> It seems that all the caller of hfcsusb_ph_info doesn't care the return value.
And that's a bug!
^ permalink raw reply
* Re: [PATCH net-next v3 8/8] ethtool: add compat for devlink info
From: Jakub Kicinski @ 2019-01-31 17:25 UTC (permalink / raw)
To: David Miller
Cc: lkp, kbuild-all, netdev, oss-drivers, jiri, andrew, f.fainelli,
mkubecek, eugenem, jonathan.lemon
In-Reply-To: <20190131.092303.1843359963647606693.davem@davemloft.net>
On Thu, 31 Jan 2019 09:23:03 -0800 (PST), David Miller wrote:
> From: kbuild test robot <lkp@intel.com>
> Date: Fri, 1 Feb 2019 00:19:33 +0800
>
> > All errors (new ones prefixed by >>):
> >
> > m68k-linux-gnu-ld: drivers/rtc/proc.o: in function `is_rtc_hctosys.isra.0':
> > proc.c:(.text+0x178): undefined reference to `strcmp'
> > m68k-linux-gnu-ld: net/core/ethtool.o: in function `ethtool_get_drvinfo':
> >>> ethtool.c:(.text+0xc08): undefined reference to `devlink_compat_running_version'
>
> Missing string.h include perhaps?
Yeah, that one looks like existing m68k bug, but also I think I need to
cater to the DEVLINK=m case since ethtool code is always built in we
can't use the MAY_USE_DEVLINK trick :S
^ permalink raw reply
* Re: [PATCH net-next v8 0/8] devlink: Add configuration parameters support for devlink_port
From: David Miller @ 2019-01-31 17:25 UTC (permalink / raw)
To: vasundhara-v.volam; +Cc: jakub.kicinski, michael.chan, jiri, mkubecek, netdev
In-Reply-To: <CAACQVJokoZYSuus+_0NOs4Mjw7i-JnCOU-wz2tFBZS4a7Lqdzw@mail.gmail.com>
From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Thu, 31 Jan 2019 14:14:02 +0530
> On Thu, Jan 31, 2019 at 5:28 AM Jakub Kicinski
> <jakub.kicinski@netronome.com> wrote:
>>
>> On Mon, 28 Jan 2019 18:00:19 +0530, Vasundhara Volam wrote:
>> > This patchset adds support for configuration parameters setting through
>> > devlink_port. Each device registers supported configuration parameters
>> > table.
>> >
>> > The user can retrieve data on these parameters by
>> > "devlink port param show" command and can set new value to a
>> > parameter by "devlink port param set" command.
>> > All configuration modes supported by devlink_dev are supported
>> > by devlink_port also.
>>
>> Hm, I think we were kind of going somewhere with the ethtool/nl
>> attribute encapsulation idea. You seem to have ignored those comments
>> on v7 and reposted v8 a day after.
> Jakub, I have added the idea of future expansion of WOL in my v8 cover letter
> mentioning the same. I will work on this as a future patchset.
>>
>> I think we should explore the nesting further. The only obstacle is
>> that ethtool netlink conversion is not yet finished, but that's just
>> a simple matter of programming. Do you disagree with that direction?
>> Please comment.
> No, I agree with you about ethtool netlink encapsulation.
This is great.
But this has to be resolved before the next merge window, otherwise I will
really have to revert this patch series. You have been warned, so do not
let this slip under the cracks.
Thank you.
^ permalink raw reply
* Re: [PATCH net-next v3 8/8] ethtool: add compat for devlink info
From: David Miller @ 2019-01-31 17:23 UTC (permalink / raw)
To: lkp
Cc: jakub.kicinski, kbuild-all, netdev, oss-drivers, jiri, andrew,
f.fainelli, mkubecek, eugenem, jonathan.lemon
In-Reply-To: <201902010037.2Jsqwihj%fengguang.wu@intel.com>
From: kbuild test robot <lkp@intel.com>
Date: Fri, 1 Feb 2019 00:19:33 +0800
> All errors (new ones prefixed by >>):
>
> m68k-linux-gnu-ld: drivers/rtc/proc.o: in function `is_rtc_hctosys.isra.0':
> proc.c:(.text+0x178): undefined reference to `strcmp'
> m68k-linux-gnu-ld: net/core/ethtool.o: in function `ethtool_get_drvinfo':
>>> ethtool.c:(.text+0xc08): undefined reference to `devlink_compat_running_version'
Missing string.h include perhaps?
^ permalink raw reply
* Re: [PATCH net] l2tp: copy 4 more bytes to linear part if necessary
From: David Miller @ 2019-01-31 17:20 UTC (permalink / raw)
To: jian.w.wen; +Cc: netdev, gnault
In-Reply-To: <20190131071856.22120-1-jian.w.wen@oracle.com>
From: Jacob Wen <jian.w.wen@oracle.com>
Date: Thu, 31 Jan 2019 15:18:56 +0800
> The size of L2TPv2 header with all optional fields is 14 bytes.
> l2tp_udp_recv_core only moves 10 bytes to the linear part of a
> skb. This may lead to l2tp_recv_common read data outside of a skb.
>
> This patch make sure that there is at least 14 bytes in the linear
> part of a skb to meet the maximum need of l2tp_udp_recv_core and
> l2tp_recv_common. The minimum size of both PPP HDLC-like frame and
> Ethernet frame is larger than 14 bytes, so we are safe to do so.
>
> Also remove L2TP_HDR_SIZE_NOSEQ, it is unused now.
>
> Fixes: fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and ppp parts")
> Suggested-by: Guillaume Nault <gnault@redhat.com>
> Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH net] rds: fix refcount bug in rds_sock_addref
From: Santosh Shilimkar @ 2019-01-31 17:16 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, netdev, Eric Dumazet, syzbot, Sowmini Varadhan,
rds-devel, Cong Wang
In-Reply-To: <20190131164710.230590-1-edumazet@google.com>
On 1/31/2019 8:47 AM, Eric Dumazet wrote:
> syzbot was able to catch a bug in rds [1]
>
> The issue here is that the socket might be found in a hash table
> but that its refcount has already be set to 0 by another cpu.
>
> We need to use refcount_inc_not_zero() to be safe here.
>
> [1]
>
> refcount_t: increment on 0; use-after-free.
> WARNING: CPU: 1 PID: 23129 at lib/refcount.c:153 refcount_inc_checked lib/refcount.c:153 [inline]
> WARNING: CPU: 1 PID: 23129 at lib/refcount.c:153 refcount_inc_checked+0x61/0x70 lib/refcount.c:151
> Kernel panic - not syncing: panic_on_warn set ...
> CPU: 1 PID: 23129 Comm: syz-executor3 Not tainted 5.0.0-rc4+ #53
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> Call Trace:
> __dump_stack lib/dump_stack.c:77 [inline]
> dump_stack+0x1db/0x2d0 lib/dump_stack.c:113
> panic+0x2cb/0x65c kernel/panic.c:214
> __warn.cold+0x20/0x48 kernel/panic.c:571
> report_bug+0x263/0x2b0 lib/bug.c:186
> fixup_bug arch/x86/kernel/traps.c:178 [inline]
> fixup_bug arch/x86/kernel/traps.c:173 [inline]
> do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:271
> do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:290
> invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:973
> RIP: 0010:refcount_inc_checked lib/refcount.c:153 [inline]
> RIP: 0010:refcount_inc_checked+0x61/0x70 lib/refcount.c:151
> Code: 1d 51 63 c8 06 31 ff 89 de e8 eb 1b f2 fd 84 db 75 dd e8 a2 1a f2 fd 48 c7 c7 60 9f 81 88 c6 05 31 63 c8 06 01 e8 af 65 bb fd <0f> 0b eb c1 90 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 54 49
> RSP: 0018:ffff8880a0cbf1e8 EFLAGS: 00010282
> RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffc90006113000
> RDX: 000000000001047d RSI: ffffffff81685776 RDI: 0000000000000005
> RBP: ffff8880a0cbf1f8 R08: ffff888097c9e100 R09: ffffed1015ce5021
> R10: ffffed1015ce5020 R11: ffff8880ae728107 R12: ffff8880723c20c0
> R13: ffff8880723c24b0 R14: dffffc0000000000 R15: ffffed1014197e64
> sock_hold include/net/sock.h:647 [inline]
> rds_sock_addref+0x19/0x20 net/rds/af_rds.c:675
> rds_find_bound+0x97c/0x1080 net/rds/bind.c:82
> rds_recv_incoming+0x3be/0x1430 net/rds/recv.c:362
> rds_loop_xmit+0xf3/0x2a0 net/rds/loop.c:96
> rds_send_xmit+0x1355/0x2a10 net/rds/send.c:355
> rds_sendmsg+0x323c/0x44e0 net/rds/send.c:1368
> sock_sendmsg_nosec net/socket.c:621 [inline]
> sock_sendmsg+0xdd/0x130 net/socket.c:631
> __sys_sendto+0x387/0x5f0 net/socket.c:1788
> __do_sys_sendto net/socket.c:1800 [inline]
> __se_sys_sendto net/socket.c:1796 [inline]
> __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1796
> do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290
> entry_SYSCALL_64_after_hwframe+0x49/0xbe
> RIP: 0033:0x458089
> Code: 6d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
> RSP: 002b:00007fc266df8c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
> RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000000458089
> RDX: 0000000000000000 RSI: 00000000204b3fff RDI: 0000000000000005
> RBP: 000000000073bf00 R08: 00000000202b4000 R09: 0000000000000010
> R10: 0000000000000000 R11: 0000000000000246 R12: 00007fc266df96d4
> R13: 00000000004c56e4 R14: 00000000004d94a8 R15: 00000000ffffffff
>
> Fixes: cc4dfb7f70a3 ("rds: fix two RCU related problems")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Cc: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> Cc: Santosh Shilimkar <santosh.shilimkar@oracle.com>
> Cc: rds-devel@oss.oracle.com
> Cc: Cong Wang <xiyou.wangcong@gmail.com>
> ---
Looks good.
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
^ permalink raw reply
* Re: [PATCH net-next] nfp: use struct_size() in kzalloc()
From: Gustavo A. R. Silva @ 2019-01-31 17:15 UTC (permalink / raw)
To: Joe Perches, Jakub Kicinski, David S. Miller
Cc: oss-drivers, netdev, linux-kernel
In-Reply-To: <dc6d827c187cd228b917f8d9d984bd5ea578d712.camel@perches.com>
Hi Joe,
On 1/31/19 11:11 AM, Joe Perches wrote:
> On Wed, 2019-01-30 at 18:38 -0600, Gustavo A. R. Silva wrote:
>> One of the more common cases of allocation size calculations is finding
>> the size of a structure that has a zero-sized array at the end, along
>> with memory for some number of elements for that array. For example:
>>
>> struct foo {
>> int stuff;
>> struct boo entry[];
>> };
>>
>> instance = kzalloc(sizeof(struct foo) + count * sizeof(struct boo), GFP_KERNEL);
>>
>> Instead of leaving these open-coded and prone to type mistakes, we can
>> now use the new struct_size() helper:
>>
>> instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);
>>
>> This code was detected with the help of Coccinelle.
>
> Might be useful to augment the script to include cases
> where the computed size is saved to a temporary and
> that temporary is used ala:
>
Yep. That's already on my list.
> https://patchwork.kernel.org/patch/10782453/
>
> On Sat, 2019-01-26 at 20:42 +0800, YueHaibing wrote:
>> Use kmemdup rather than duplicating its implementation
> []
>> diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
> []
>> @@ -1196,13 +1196,9 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
>> regd_to_copy = sizeof(struct ieee80211_regdomain) +
>> valid_rules * sizeof(struct ieee80211_reg_rule);
>> - copy_rd = kzalloc(regd_to_copy, GFP_KERNEL);
>> - if (!copy_rd) {
>> + copy_rd = kmemdup(regd, regd_to_copy, GFP_KERNEL);
>
> This should probably be
>
> copy_rd = kmemdup(regd, struct_size(regd, reg_rules, valid_rules),
> GFP_KERNEL);
>
I agree.
Thanks
--
Gustavo
^ permalink raw reply
* Re: [PATCH net-next] nfp: use struct_size() in kzalloc()
From: Joe Perches @ 2019-01-31 17:11 UTC (permalink / raw)
To: Gustavo A. R. Silva, Jakub Kicinski, David S. Miller
Cc: oss-drivers, netdev, linux-kernel
In-Reply-To: <20190131003859.GA28539@embeddedor>
On Wed, 2019-01-30 at 18:38 -0600, Gustavo A. R. Silva wrote:
> One of the more common cases of allocation size calculations is finding
> the size of a structure that has a zero-sized array at the end, along
> with memory for some number of elements for that array. For example:
>
> struct foo {
> int stuff;
> struct boo entry[];
> };
>
> instance = kzalloc(sizeof(struct foo) + count * sizeof(struct boo), GFP_KERNEL);
>
> Instead of leaving these open-coded and prone to type mistakes, we can
> now use the new struct_size() helper:
>
> instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);
>
> This code was detected with the help of Coccinelle.
Might be useful to augment the script to include cases
where the computed size is saved to a temporary and
that temporary is used ala:
https://patchwork.kernel.org/patch/10782453/
On Sat, 2019-01-26 at 20:42 +0800, YueHaibing wrote:
> Use kmemdup rather than duplicating its implementation
[]
> diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
[]
> @@ -1196,13 +1196,9 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
> regd_to_copy = sizeof(struct ieee80211_regdomain) +
> valid_rules * sizeof(struct ieee80211_reg_rule);
> - copy_rd = kzalloc(regd_to_copy, GFP_KERNEL);
> - if (!copy_rd) {
> + copy_rd = kmemdup(regd, regd_to_copy, GFP_KERNEL);
This should probably be
copy_rd = kmemdup(regd, struct_size(regd, reg_rules, valid_rules),
GFP_KERNEL);
^ permalink raw reply
* [PATCH] mlx4_ib: Increase the timeout for CM cache
From: Håkon Bugge @ 2019-01-31 17:09 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, linux-rdma, rds-devel, linux-kernel
Using CX-3 virtual functions, either from a bare-metal machine or
pass-through from a VM, MAD packets are proxied through the PF driver.
Since the VMs have separate name spaces for MAD Transaction Ids
(TIDs), the PF driver has to re-map the TIDs and keep the book keeping
in a cache.
Following the RDMA CM protocol, it is clear when an entry has to
evicted form the cache. But life is not perfect, remote peers may die
or be rebooted. Hence, it's a timeout to wipe out a cache entry, when
the PF driver assumes the remote peer has gone.
We have experienced excessive amount of DREQ retries during fail-over
testing, when running with eight VMs per database server.
The problem has been reproduced in a bare-metal system using one VM
per physical node. In this environment, running 256 processes in each
VM, each process uses RDMA CM to create an RC QP between himself and
all (256) remote processes. All in all 16K QPs.
When tearing down these 16K QPs, excessive DREQ retries (and
duplicates) are observed. With some cat/paste/awk wizardry on the
infiniband_cm sysfs, we observe:
dreq: 5007
cm_rx_msgs:
drep: 3838
dreq: 13018
rep: 8128
req: 8256
rtu: 8256
cm_tx_msgs:
drep: 8011
dreq: 68856
rep: 8256
req: 8128
rtu: 8128
cm_tx_retries:
dreq: 60483
Note that the active/passive side is distributed.
Enabling pr_debug in cm.c gives tons of:
[171778.814239] <mlx4_ib> mlx4_ib_multiplex_cm_handler: id{slave:
1,sl_cm_id: 0xd393089f} is NULL!
By increasing the CM_CLEANUP_CACHE_TIMEOUT from 5 to 30 seconds, the
tear-down phase of the application is reduced from 113 to 67
seconds. Retries/duplicates are also significantly reduced:
cm_rx_duplicates:
dreq: 7726
[]
cm_tx_retries:
drep: 1
dreq: 7779
Increasing the timeout further didn't help, as these duplicates and
retries stem from a too short CMA timeout, which was 20 (~4 seconds)
on the systems. By increasing the CMA timeout to 22 (~17 seconds), the
numbers fell down to about one hundred for both of them.
Adjustment of the CMA timeout is _not_ part of this commit.
Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
---
drivers/infiniband/hw/mlx4/cm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx4/cm.c b/drivers/infiniband/hw/mlx4/cm.c
index fedaf8260105..8c79a480f2b7 100644
--- a/drivers/infiniband/hw/mlx4/cm.c
+++ b/drivers/infiniband/hw/mlx4/cm.c
@@ -39,7 +39,7 @@
#include "mlx4_ib.h"
-#define CM_CLEANUP_CACHE_TIMEOUT (5 * HZ)
+#define CM_CLEANUP_CACHE_TIMEOUT (30 * HZ)
struct id_map_entry {
struct rb_node node;
--
2.20.1
^ 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