* [PATCH net] tls: don't use stack memory in a scatterlist
From: Matt Mullins @ 2018-05-16 17:48 UTC (permalink / raw)
To: David S. Miller
Cc: Matt Mullins, Ilya Lesokhin, Aviad Yehezkel, Dave Watson, netdev,
linux-kernel
scatterlist code expects virt_to_page() to work, which fails with
CONFIG_VMAP_STACK=y.
Fixes: c46234ebb4d1e ("tls: RX path for ktls")
Signed-off-by: Matt Mullins <mmullins@fb.com>
---
include/net/tls.h | 3 +++
net/tls/tls_sw.c | 9 ++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/include/net/tls.h b/include/net/tls.h
index b400d0bb7448..f5fb16da3860 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -97,6 +97,9 @@ struct tls_sw_context {
u8 control;
bool decrypted;
+ char rx_aad_ciphertext[TLS_AAD_SPACE_SIZE];
+ char rx_aad_plaintext[TLS_AAD_SPACE_SIZE];
+
/* Sending context */
char aad_space[TLS_AAD_SPACE_SIZE];
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 71e79597f940..e1c93ce74e0f 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -680,7 +680,6 @@ static int decrypt_skb(struct sock *sk, struct sk_buff *skb,
struct scatterlist *sgin = &sgin_arr[0];
struct strp_msg *rxm = strp_msg(skb);
int ret, nsg = ARRAY_SIZE(sgin_arr);
- char aad_recv[TLS_AAD_SPACE_SIZE];
struct sk_buff *unused;
ret = skb_copy_bits(skb, rxm->offset + TLS_HEADER_SIZE,
@@ -698,13 +697,13 @@ static int decrypt_skb(struct sock *sk, struct sk_buff *skb,
}
sg_init_table(sgin, nsg);
- sg_set_buf(&sgin[0], aad_recv, sizeof(aad_recv));
+ sg_set_buf(&sgin[0], ctx->rx_aad_ciphertext, TLS_AAD_SPACE_SIZE);
nsg = skb_to_sgvec(skb, &sgin[1],
rxm->offset + tls_ctx->rx.prepend_size,
rxm->full_len - tls_ctx->rx.prepend_size);
- tls_make_aad(aad_recv,
+ tls_make_aad(ctx->rx_aad_ciphertext,
rxm->full_len - tls_ctx->rx.overhead_size,
tls_ctx->rx.rec_seq,
tls_ctx->rx.rec_seq_size,
@@ -803,12 +802,12 @@ int tls_sw_recvmsg(struct sock *sk,
if (to_copy <= len && page_count < MAX_SKB_FRAGS &&
likely(!(flags & MSG_PEEK))) {
struct scatterlist sgin[MAX_SKB_FRAGS + 1];
- char unused[21];
int pages = 0;
zc = true;
sg_init_table(sgin, MAX_SKB_FRAGS + 1);
- sg_set_buf(&sgin[0], unused, 13);
+ sg_set_buf(&sgin[0], ctx->rx_aad_plaintext,
+ TLS_AAD_SPACE_SIZE);
err = zerocopy_from_iter(sk, &msg->msg_iter,
to_copy, &pages,
--
2.14.1
^ permalink raw reply related
* Re: [PATCH 00/14] Modify action API for implementing lockless actions
From: Roman Mashak @ 2018-05-16 17:36 UTC (permalink / raw)
To: Vlad Buslov
Cc: Jamal Hadi Salim, Linux Kernel Network Developers, David Miller,
Cong Wang, Jiri Pirko, pablo, kadlec, fw, ast, Daniel Borkmann,
Eric Dumazet, kliteyn
In-Reply-To: <vbfsh6rk42w.fsf@reg-r-vrt-018-180.mtr.labs.mlnx>
Vlad Buslov <vladbu@mellanox.com> writes:
> On Wed 16 May 2018 at 14:38, Roman Mashak <mrv@mojatatu.com> wrote:
>> On Wed, May 16, 2018 at 2:43 AM, Vlad Buslov <vladbu@mellanox.com> wrote:
>>>>>>> I'm trying to run tdc, but keep getting following error even on clean
>>>>>>> branch without my patches:
>>>>>>
>>>>>> Vlad, not sure if you saw my email:
>>>>>> Apply Roman's patch and try again
>>>>>>
>>>>>> https://marc.info/?l=linux-netdev&m=152639369112020&w=2
>>>>>>
>>>>>> cheers,
>>>>>> jamal
>>>>>
>>>>> With patch applied I get following error:
>>>>>
>>>>> Test 7d50: Add skbmod action to set destination mac
>>>>> exit: 255 0
>>>>> dst MAC address <11:22:33:44:55:66>
>>>>> RTNETLINK answers: No such file or directory
>>>>> We have an error talking to the kernel
>>>>>
>>>>
>>>> You may actually have broken something with your patches in this case.
>>>
>>> Results is for net-next without my patches.
>>
>> Do you have skbmod compiled in kernel or as a module?
>
> Thanks, already figured out that default config has some actions
> disabled.
> Have more errors now. Everything related to ife:
>
> Test 7682: Create valid ife encode action with mark and pass control
> exit: 255 0
> IFE type 0xED3E
> RTNETLINK answers: No such file or directory
> We have an error talking to the kernel
>
> Test ef47: Create valid ife encode action with mark and pipe control
> exit: 255 0
> IFE type 0xED3E
> RTNETLINK answers: No space left on device
> We have an error talking to the kernel
>
> Test df43: Create valid ife encode action with mark and continue control
> exit: 255 0
> IFE type 0xED3E
> RTNETLINK answers: No space left on device
> We have an error talking to the kernel
>
> Test e4cf: Create valid ife encode action with mark and drop control
> exit: 255 0
> IFE type 0xED3E
> RTNETLINK answers: No space left on device
> We have an error talking to the kernel
>
> Test ccba: Create valid ife encode action with mark and reclassify control
> exit: 255 0
> IFE type 0xED3E
> RTNETLINK answers: No space left on device
> We have an error talking to the kernel
>
> Test a1cf: Create valid ife encode action with mark and jump control
> exit: 255 0
> IFE type 0xED3E
> RTNETLINK answers: No space left on device
> We have an error talking to the kernel
>
> ...
>
>
Please make sure you have these in your kernel config:
CONFIG_NET_ACT_IFE=y
CONFIG_NET_IFE_SKBMARK=m
CONFIG_NET_IFE_SKBPRIO=m
CONFIG_NET_IFE_SKBTCINDEX=m
For tdc to run all the tests, it is assumed that all the supported tc
actions/filters are enabled and compiled.
^ permalink raw reply
* Re: [PATCH net-next 1/1] tc-testing: fixed copy-pasting error in police tests
From: David Miller @ 2018-05-16 17:27 UTC (permalink / raw)
To: mrv; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri
In-Reply-To: <1526393680-3571-1-git-send-email-mrv@mojatatu.com>
From: Roman Mashak <mrv@mojatatu.com>
Date: Tue, 15 May 2018 10:14:40 -0400
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next v2 4/4] bonding: allow carrier and link status to determine link state
From: David Miller @ 2018-05-16 17:20 UTC (permalink / raw)
To: dbanerje; +Cc: jay.vosburgh, netdev, vfalico, andy
In-Reply-To: <fdc5f4772d1f4a4b89c533b5ef6c3db5@usma1ex-dag1mb2.msg.corp.akamai.com>
From: "Banerjee, Debabrata" <dbanerje@akamai.com>
Date: Wed, 16 May 2018 17:14:07 +0000
> I'll send v3 without this patch.
I already applied your series so you need to send me a revert of this
patch.
^ permalink raw reply
* Re: [PATCH bpf-next] samples/bpf: Decrement ttl in fib forwarding example
From: Y Song @ 2018-05-16 17:17 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, Daniel Borkmann, Alexei Starovoitov
In-Reply-To: <20180515232052.28004-1-dsahern@gmail.com>
On Tue, May 15, 2018 at 4:20 PM, David Ahern <dsahern@gmail.com> wrote:
> Only consider forwarding packets if ttl in received packet is > 1 and
> decrement ttl before handing off to bpf_redirect_map.
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
I did not test this patch, but it looks good to me with visual inspection.
Acked-by: Yonghong Song <yhs@fb.com>
^ permalink raw reply
* RE: [PATCH net-next v2 4/4] bonding: allow carrier and link status to determine link state
From: Banerjee, Debabrata @ 2018-05-16 17:14 UTC (permalink / raw)
To: 'David Miller'
Cc: jay.vosburgh@canonical.com, netdev@vger.kernel.org,
vfalico@gmail.com, andy@greyhouse.net
In-Reply-To: <20180516.131005.1506778995198859622.davem@davemloft.net>
> From: David Miller [mailto:davem@davemloft.net]
>
> Looking at the bnx2x driver, it's management of link state is very convoluted.
>
> The link parameters and the "link_up" state is maintained separately from
> the values that are snapshot when the carrier is enabled.
...
> If the carrier is up, you should be able to provide the link speed and duplex
> values immediately not some indeterminate amount of time later.
This was steady state, the machine was stuck like this for hours/days.
> I don't think we should reward drivers for behaving this way.
I'll send v3 without this patch.
^ permalink raw reply
* Re: [PATCH net-next v2 4/4] bonding: allow carrier and link status to determine link state
From: David Miller @ 2018-05-16 17:10 UTC (permalink / raw)
To: dbanerje; +Cc: jay.vosburgh, netdev, vfalico, andy
In-Reply-To: <27902b745c4240b4a7968f1a148b4340@usma1ex-dag1mb2.msg.corp.akamai.com>
From: "Banerjee, Debabrata" <dbanerje@akamai.com>
Date: Wed, 16 May 2018 16:54:40 +0000
> See output of /proc/net/bonding/bond0 below, same content as the
> prior email. bnx2x driver, on ith1: "MII Status: up" is directly
> from netif_carrier_ok(bond->dev) , but speed and duplex are unknown,
> which come from the same call as would be used from
> bond_mii_monitor(), __ethtool_get_link_ksettings(slave_dev,
> &ecmd). Yes it's possible this is because of bugs in the drivers
> themselves, but without being able to readily reproduce the state
> below we can't debug it, nor do we know which combination of
> hardware and drivers are reliable at any given point in time. We can
> say though that if this had been set to "both", ith1 would have been
> correctly removed from the bond. That said if this is still
> controversial I can resubmit the series without this patch.
Looking at the bnx2x driver, it's management of link state is very
convoluted.
The link parameters and the "link_up" state is maintained separately
from the values that are snapshot when the carrier is enabled.
I don't think we should reward drivers for behaving this way.
If the carrier is up, you should be able to provide the link speed and
duplex values immediately not some indeterminate amount of time later.
^ permalink raw reply
* Re: [PATCH net-next 2/2] drivers: net: Remove device_node checks with of_mdiobus_register()
From: kbuild test robot @ 2018-05-16 17:05 UTC (permalink / raw)
To: Florian Fainelli
Cc: kbuild-all, netdev, Florian Fainelli, Andrew Lunn, Vivien Didelot,
David S. Miller, Nicolas Ferre, Fugang Duan, Sergei Shtylyov,
Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
Grygorii Strashko, Woojung Huh, Microchip Linux Driver Support,
Rob Herring, Frank Rowand, Antoine Tenart, Tobias Jordan <Tob
In-Reply-To: <20180515215930.12115-3-f.fainelli@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 33109 bytes --]
Hi Florian,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Florian-Fainelli/of-mdio-Fall-back-to-mdiobus_register-with-np-is-NULL/20180516-203317
config: arm-omap2plus_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm
All error/warnings (new ones prefixed by >>):
drivers/net//ethernet/ti/davinci_mdio.c: In function 'davinci_mdio_probe':
>> drivers/net//ethernet/ti/davinci_mdio.c:457:12: error: invalid storage class for function 'davinci_mdio_remove'
static int davinci_mdio_remove(struct platform_device *pdev)
^~~~~~~~~~~~~~~~~~~
>> drivers/net//ethernet/ti/davinci_mdio.c:457:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static int davinci_mdio_remove(struct platform_device *pdev)
^~~~~~
>> drivers/net//ethernet/ti/davinci_mdio.c:471:12: error: invalid storage class for function 'davinci_mdio_runtime_suspend'
static int davinci_mdio_runtime_suspend(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net//ethernet/ti/davinci_mdio.c:485:12: error: invalid storage class for function 'davinci_mdio_runtime_resume'
static int davinci_mdio_runtime_resume(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net//ethernet/ti/davinci_mdio.c:495:12: error: invalid storage class for function 'davinci_mdio_suspend'
static int davinci_mdio_suspend(struct device *dev)
^~~~~~~~~~~~~~~~~~~~
>> drivers/net//ethernet/ti/davinci_mdio.c:512:12: error: invalid storage class for function 'davinci_mdio_resume'
static int davinci_mdio_resume(struct device *dev)
^~~~~~~~~~~~~~~~~~~
In file included from include/linux/device.h:23:0,
from include/linux/platform_device.h:14,
from drivers/net//ethernet/ti/davinci_mdio.c:29:
>> drivers/net//ethernet/ti/davinci_mdio.c:527:21: error: initializer element is not constant
SET_RUNTIME_PM_OPS(davinci_mdio_runtime_suspend,
^
include/linux/pm.h:354:21: note: in definition of macro 'SET_RUNTIME_PM_OPS'
.runtime_suspend = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:527:21: note: (near initialization for 'davinci_mdio_pm_ops.runtime_suspend')
SET_RUNTIME_PM_OPS(davinci_mdio_runtime_suspend,
^
include/linux/pm.h:354:21: note: in definition of macro 'SET_RUNTIME_PM_OPS'
.runtime_suspend = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:528:7: error: initializer element is not constant
davinci_mdio_runtime_resume, NULL)
^
include/linux/pm.h:355:20: note: in definition of macro 'SET_RUNTIME_PM_OPS'
.runtime_resume = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:528:7: note: (near initialization for 'davinci_mdio_pm_ops.runtime_resume')
davinci_mdio_runtime_resume, NULL)
^
include/linux/pm.h:355:20: note: in definition of macro 'SET_RUNTIME_PM_OPS'
.runtime_resume = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:330:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.suspend_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.suspend_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:330:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.suspend_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:331:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.resume_early = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.resume_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:331:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.resume_early = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:332:17: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.freeze_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.freeze_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:332:17: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.freeze_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:333:16: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.thaw_early = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.thaw_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:333:16: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.thaw_early = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:334:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.poweroff_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.poweroff_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:334:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.poweroff_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:335:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.restore_early = resume_fn,
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.restore_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:335:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.restore_early = resume_fn,
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:539:12: error: initializer element is not constant
.remove = davinci_mdio_remove,
^~~~~~~~~~~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:539:12: note: (near initialization for 'davinci_mdio_driver.remove')
>> drivers/net//ethernet/ti/davinci_mdio.c:542:19: error: invalid storage class for function 'davinci_mdio_init'
static int __init davinci_mdio_init(void)
^~~~~~~~~~~~~~~~~
In file included from include/linux/printk.h:6:0,
from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/module.h:9,
from drivers/net//ethernet/ti/davinci_mdio.c:27:
drivers/net//ethernet/ti/davinci_mdio.c:546:17: error: initializer element is not constant
device_initcall(davinci_mdio_init);
^
include/linux/init.h:172:58: note: in definition of macro '__define_initcall'
__attribute__((__section__(".initcall" #id ".init"))) = fn;
^~
>> drivers/net//ethernet/ti/davinci_mdio.c:546:1: note: in expansion of macro 'device_initcall'
device_initcall(davinci_mdio_init);
^~~~~~~~~~~~~~~
>> drivers/net//ethernet/ti/davinci_mdio.c:548:20: error: invalid storage class for function 'davinci_mdio_exit'
static void __exit davinci_mdio_exit(void)
^~~~~~~~~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:548:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static void __exit davinci_mdio_exit(void)
^~~~~~
In file included from include/linux/printk.h:6:0,
from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/module.h:9,
from drivers/net//ethernet/ti/davinci_mdio.c:27:
drivers/net//ethernet/ti/davinci_mdio.c:552:13: error: initializer element is not constant
module_exit(davinci_mdio_exit);
^
include/linux/init.h:209:50: note: in definition of macro '__exitcall'
static exitcall_t __exitcall_##fn __exit_call = fn
^~
>> drivers/net//ethernet/ti/davinci_mdio.c:552:1: note: in expansion of macro 'module_exit'
module_exit(davinci_mdio_exit);
^~~~~~~~~~~
In file included from include/linux/module.h:18:0,
from drivers/net//ethernet/ti/davinci_mdio.c:27:
>> include/linux/moduleparam.h:28:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
struct __UNIQUE_ID(name) {}
^
include/linux/module.h:161:32: note: in expansion of macro '__MODULE_INFO'
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^~~~~~~~~~~~~
include/linux/module.h:199:34: note: in expansion of macro 'MODULE_INFO'
#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
^~~~~~~~~~~
>> drivers/net//ethernet/ti/davinci_mdio.c:554:1: note: in expansion of macro 'MODULE_LICENSE'
MODULE_LICENSE("GPL");
^~~~~~~~~~~~~~
In file included from <command-line>:0:0:
>> include/linux/compiler-gcc.h:193:45: error: expected declaration or statement at end of input
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^
include/linux/compiler_types.h:52:23: note: in definition of macro '___PASTE'
#define ___PASTE(a,b) a##b
^
include/linux/compiler-gcc.h:193:29: note: in expansion of macro '__PASTE'
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^~~~~~~
include/linux/compiler_types.h:53:22: note: in expansion of macro '___PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^~~~~~~~
include/linux/compiler-gcc.h:193:37: note: in expansion of macro '__PASTE'
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^~~~~~~
include/linux/moduleparam.h:28:10: note: in expansion of macro '__UNIQUE_ID'
struct __UNIQUE_ID(name) {}
^~~~~~~~~~~
include/linux/module.h:161:32: note: in expansion of macro '__MODULE_INFO'
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^~~~~~~~~~~~~
include/linux/module.h:208:42: note: in expansion of macro 'MODULE_INFO'
#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
^~~~~~~~~~~
>> drivers/net//ethernet/ti/davinci_mdio.c:555:1: note: in expansion of macro 'MODULE_DESCRIPTION'
MODULE_DESCRIPTION("DaVinci MDIO driver");
^~~~~~~~~~~~~~~~~~
At top level:
drivers/net//ethernet/ti/davinci_mdio.c:357:12: warning: 'davinci_mdio_probe' defined but not used [-Wunused-function]
static int davinci_mdio_probe(struct platform_device *pdev)
^~~~~~~~~~~~~~~~~~
--
include/linux/pm.h:331:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.resume_early = resume_fn, \
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.resume_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:331:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.resume_early = resume_fn, \
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:332:17: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.freeze_late = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.freeze_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:332:17: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.freeze_late = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:333:16: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.thaw_early = resume_fn, \
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.thaw_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:333:16: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.thaw_early = resume_fn, \
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:334:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.poweroff_late = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.poweroff_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:334:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.poweroff_late = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:335:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.restore_early = resume_fn,
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.restore_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:335:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.restore_early = resume_fn,
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:539:12: error: initializer element is not constant
.remove = davinci_mdio_remove,
^~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:539:12: note: (near initialization for 'davinci_mdio_driver.remove')
drivers/net/ethernet/ti/davinci_mdio.c:542:19: error: invalid storage class for function 'davinci_mdio_init'
static int __init davinci_mdio_init(void)
^~~~~~~~~~~~~~~~~
In file included from include/linux/printk.h:6:0,
from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/module.h:9,
from drivers/net/ethernet/ti/davinci_mdio.c:27:
drivers/net/ethernet/ti/davinci_mdio.c:546:17: error: initializer element is not constant
device_initcall(davinci_mdio_init);
^
include/linux/init.h:172:58: note: in definition of macro '__define_initcall'
__attribute__((__section__(".initcall" #id ".init"))) = fn;
^~
drivers/net/ethernet/ti/davinci_mdio.c:546:1: note: in expansion of macro 'device_initcall'
device_initcall(davinci_mdio_init);
^~~~~~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:548:20: error: invalid storage class for function 'davinci_mdio_exit'
static void __exit davinci_mdio_exit(void)
^~~~~~~~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:548:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static void __exit davinci_mdio_exit(void)
^~~~~~
In file included from include/linux/printk.h:6:0,
from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/module.h:9,
from drivers/net/ethernet/ti/davinci_mdio.c:27:
drivers/net/ethernet/ti/davinci_mdio.c:552:13: error: initializer element is not constant
module_exit(davinci_mdio_exit);
^
include/linux/init.h:209:50: note: in definition of macro '__exitcall'
static exitcall_t __exitcall_##fn __exit_call = fn
^~
drivers/net/ethernet/ti/davinci_mdio.c:552:1: note: in expansion of macro 'module_exit'
module_exit(davinci_mdio_exit);
^~~~~~~~~~~
In file included from include/linux/module.h:18:0,
from drivers/net/ethernet/ti/davinci_mdio.c:27:
>> include/linux/moduleparam.h:28:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
struct __UNIQUE_ID(name) {}
^
include/linux/module.h:161:32: note: in expansion of macro '__MODULE_INFO'
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^~~~~~~~~~~~~
include/linux/module.h:199:34: note: in expansion of macro 'MODULE_INFO'
#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
^~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:554:1: note: in expansion of macro 'MODULE_LICENSE'
MODULE_LICENSE("GPL");
^~~~~~~~~~~~~~
In file included from <command-line>:0:0:
>> include/linux/compiler-gcc.h:193:45: error: expected declaration or statement at end of input
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^
include/linux/compiler_types.h:52:23: note: in definition of macro '___PASTE'
#define ___PASTE(a,b) a##b
^
include/linux/compiler-gcc.h:193:29: note: in expansion of macro '__PASTE'
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^~~~~~~
include/linux/compiler_types.h:53:22: note: in expansion of macro '___PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^~~~~~~~
include/linux/compiler-gcc.h:193:37: note: in expansion of macro '__PASTE'
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^~~~~~~
include/linux/moduleparam.h:28:10: note: in expansion of macro '__UNIQUE_ID'
struct __UNIQUE_ID(name) {}
^~~~~~~~~~~
include/linux/module.h:161:32: note: in expansion of macro '__MODULE_INFO'
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^~~~~~~~~~~~~
include/linux/module.h:208:42: note: in expansion of macro 'MODULE_INFO'
#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
^~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:555:1: note: in expansion of macro 'MODULE_DESCRIPTION'
MODULE_DESCRIPTION("DaVinci MDIO driver");
^~~~~~~~~~~~~~~~~~
At top level:
drivers/net/ethernet/ti/davinci_mdio.c:357:12: warning: 'davinci_mdio_probe' defined but not used [-Wunused-function]
static int davinci_mdio_probe(struct platform_device *pdev)
^~~~~~~~~~~~~~~~~~
vim +/davinci_mdio_remove +457 drivers/net//ethernet/ti/davinci_mdio.c
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 456
e38921d4 drivers/net/ethernet/ti/davinci_mdio.c Bill Pemberton 2012-12-03 @457 static int davinci_mdio_remove(struct platform_device *pdev)
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 458 {
84ce22df drivers/net/ethernet/ti/davinci_mdio.c Libo Chen 2013-08-19 459 struct davinci_mdio_data *data = platform_get_drvdata(pdev);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 460
50d0636e drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2014-04-30 461 if (data->bus)
b27393ae drivers/net/ethernet/ti/davinci_mdio.c Bin Liu 2012-08-30 462 mdiobus_unregister(data->bus);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 463
8ea63bba drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 464 pm_runtime_dont_use_autosuspend(&pdev->dev);
8e476d9d drivers/net/ethernet/ti/davinci_mdio.c Mugunthan V N 2012-07-17 465 pm_runtime_disable(&pdev->dev);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 466
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 467 return 0;
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 468 }
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 469
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 470 #ifdef CONFIG_PM
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 @471 static int davinci_mdio_runtime_suspend(struct device *dev)
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 472 {
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 473 struct davinci_mdio_data *data = dev_get_drvdata(dev);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 474 u32 ctrl;
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 475
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 476 /* shutdown the scan state machine */
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 477 ctrl = __raw_readl(&data->regs->control);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 478 ctrl &= ~CONTROL_ENABLE;
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 479 __raw_writel(ctrl, &data->regs->control);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 480 wait_for_idle(data);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 481
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 482 return 0;
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 483 }
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 484
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 @485 static int davinci_mdio_runtime_resume(struct device *dev)
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 486 {
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 487 struct davinci_mdio_data *data = dev_get_drvdata(dev);
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 488
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 489 davinci_mdio_enable(data);
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 490 return 0;
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 491 }
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 492 #endif
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 493
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 494 #ifdef CONFIG_PM_SLEEP
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 @495 static int davinci_mdio_suspend(struct device *dev)
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 496 {
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 497 struct davinci_mdio_data *data = dev_get_drvdata(dev);
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 498 int ret = 0;
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 499
8ea63bba drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 500 data->active_in_suspend = !pm_runtime_status_suspended(dev);
8ea63bba drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 501 if (data->active_in_suspend)
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 502 ret = pm_runtime_force_suspend(dev);
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 503 if (ret < 0)
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 504 return ret;
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 505
5c0e3580 drivers/net/ethernet/ti/davinci_mdio.c Mugunthan V N 2013-06-06 506 /* Select sleep pin state */
5c0e3580 drivers/net/ethernet/ti/davinci_mdio.c Mugunthan V N 2013-06-06 507 pinctrl_pm_select_sleep_state(dev);
5c0e3580 drivers/net/ethernet/ti/davinci_mdio.c Mugunthan V N 2013-06-06 508
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 509 return 0;
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 510 }
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 511
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 @512 static int davinci_mdio_resume(struct device *dev)
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 513 {
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 514 struct davinci_mdio_data *data = dev_get_drvdata(dev);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 515
5c0e3580 drivers/net/ethernet/ti/davinci_mdio.c Mugunthan V N 2013-06-06 516 /* Select default pin state */
5c0e3580 drivers/net/ethernet/ti/davinci_mdio.c Mugunthan V N 2013-06-06 517 pinctrl_pm_select_default_state(dev);
5c0e3580 drivers/net/ethernet/ti/davinci_mdio.c Mugunthan V N 2013-06-06 518
8ea63bba drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 519 if (data->active_in_suspend)
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 520 pm_runtime_force_resume(dev);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 521
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 522 return 0;
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 523 }
2f5c54ce drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2015-02-27 524 #endif
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 525
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 526 static const struct dev_pm_ops davinci_mdio_pm_ops = {
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 @527 SET_RUNTIME_PM_OPS(davinci_mdio_runtime_suspend,
651652aa drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2016-06-24 528 davinci_mdio_runtime_resume, NULL)
2f5c54ce drivers/net/ethernet/ti/davinci_mdio.c Grygorii Strashko 2015-02-27 529 SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 530 };
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 531
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 532 static struct platform_driver davinci_mdio_driver = {
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 533 .driver = {
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 534 .name = "davinci_mdio",
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 535 .pm = &davinci_mdio_pm_ops,
ec03e6a8 drivers/net/ethernet/ti/davinci_mdio.c Mugunthan V N 2012-08-06 536 .of_match_table = of_match_ptr(davinci_mdio_of_mtable),
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 537 },
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 538 .probe = davinci_mdio_probe,
e38921d4 drivers/net/ethernet/ti/davinci_mdio.c Bill Pemberton 2012-12-03 @539 .remove = davinci_mdio_remove,
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 540 };
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 541
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 @542 static int __init davinci_mdio_init(void)
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 543 {
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 544 return platform_driver_register(&davinci_mdio_driver);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 545 }
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 @546 device_initcall(davinci_mdio_init);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 547
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 @548 static void __exit davinci_mdio_exit(void)
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 549 {
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 550 platform_driver_unregister(&davinci_mdio_driver);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 551 }
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 @552 module_exit(davinci_mdio_exit);
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 553
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 @554 MODULE_LICENSE("GPL");
f20136eb drivers/net/davinci_mdio.c Cyril Chemparathy 2010-09-15 @555 MODULE_DESCRIPTION("DaVinci MDIO driver");
:::::: The code at line 457 was first introduced by commit
:::::: e38921d4dd7d2f052c1c2344fac307463c3b8d2d net/davinci_emac: remove __dev* attributes
:::::: TO: Bill Pemberton <wfp5p@virginia.edu>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33627 bytes --]
^ permalink raw reply
* Re: [RFC PATCH bpf-next 00/12] AF_XDP, zero-copy support
From: Alexei Starovoitov @ 2018-05-16 17:04 UTC (permalink / raw)
To: Björn Töpel
Cc: magnus.karlsson, magnus.karlsson, alexander.h.duyck,
alexander.duyck, john.fastabend, ast, brouer,
willemdebruijn.kernel, daniel, mst, netdev, Björn Töpel,
michael.lundkvist, jesse.brandeburg, anjali.singhai, qi.z.zhang,
intel-wired-lan
In-Reply-To: <20180515190615.23099-1-bjorn.topel@gmail.com>
On Tue, May 15, 2018 at 09:06:03PM +0200, Björn Töpel wrote:
>
> Alexei had two concerns in conjunction with adding ZC support to
> AF_XDP: show that the user interface holds and can deliver good
> performance for ZC and that the driver interfaces for ZC are good. We
> think that this patch set shows that we have addressed the first
> issue: performance is good and there is no change to the uapi. But
> please take a look at the code and see if you like the ZC interfaces
> that was the second concern.
Looks like we're not on the same page with definition of 'uapi'.
Here you're saying that patches demonstrate performance without
a change to uapi, whereas patch 1 does remove rebind support
which _is_ a change to uapi.
That was exactly my concern with the previous set.
The other restrictions that are introduced in this patch set
are actually ok:
- like in patch 12: 'no redirect to an AF_XDP enabled XDP Tx ring'
this is fine, since this restriction can be lifted later without
breaking uapi
- patch 11: 'No passing to the stack via XDP_PASS'
also fine, since can be addressed later.
> To do for this RFC to become a patch set:
>
> * Implement dynamic creation and deletion of queues in the i40e driver
can be deferred, no?
> * Properly splitting up the i40e changes
Imo patch 11 and 12 are reasonable in terms of size
and reviewable as-is. I don't think they have to be split.
Would be nice though.
> * Have the Intel NIC team review the i40e changes from at least an
> architecture point of view
As Alexander pointed out in patch 11, if you split it into
separate file the changes to i40e core become pretty small and
I think Intel folks (Jeff, Alexander, ...) will be ok if we merge
this set via bpf-next tree asap and clean up, refactor, share
more code with i40e core later.
> * Implement a more fair scheduling policy for multiple XSKs that share
> an umem for TX. This can be combined with a batching API for
> xsk_umem_consume_tx.
can be deferred too?
I think the first 10 patches in this set is a hard dependency on i40e
patches, so the whole thing have to reviewed and landed together.
May be the first 5 patches can be applied already.
Anyway at this point I still think that removing AF_XDP and bpf xskmap
from uapi is necessary before the merge window, unless this patch set
(including i40e changes can land right now).
Also I'd like to see another NIC vendor demonstrating RFC for ZC as well.
The allocator api looks good and I don't anticipate issues, but still
I think it's necessary to make sure that we're not adding i40e-only feature.
^ permalink raw reply
* RE: [PATCH net-next v2 4/4] bonding: allow carrier and link status to determine link state
From: Banerjee, Debabrata @ 2018-05-16 16:54 UTC (permalink / raw)
To: 'David Miller', jay.vosburgh@canonical.com
Cc: netdev@vger.kernel.org, vfalico@gmail.com, andy@greyhouse.net
In-Reply-To: <20180516.122847.2004339616613745427.davem@davemloft.net>
> From: David Miller [mailto:davem@davemloft.net]
> From: Jay Vosburgh <jay.vosburgh@canonical.com>
> Date: Wed, 16 May 2018 18:11:08 +0200
>
> > Debabrata Banerjee <dbanerje@akamai.com> wrote:
> >
> >>In a mixed environment it may be difficult to tell if your hardware
> >>support carrier, if it does not it can always report true. With a new
> >>use_carrier option of 2, we can check both carrier and link status
> >>sequentially, instead of one or the other
> >
> > Your reply in the prior discussion suggests to me that there is a bug
> > somewhere else (perhaps in bonding, perhaps in the network driver),
> > and this is just papering over it. As I said, I don't believe that an
> > additional hack to bonding is the appropriate way to resolve this.
>
> Sorry this crossed with my review and application of this series, my bad.
>
> Debabrata please give a specific example of a case where the new "both"
> mode actually is needed.
>
> Thank you.
See output of /proc/net/bonding/bond0 below, same content as the prior email. bnx2x driver, on ith1: "MII Status: up" is directly from netif_carrier_ok(bond->dev) , but speed and duplex are unknown, which come from the same call as would be used from bond_mii_monitor(), __ethtool_get_link_ksettings(slave_dev, &ecmd). Yes it's possible this is because of bugs in the drivers themselves, but without being able to readily reproduce the state below we can't debug it, nor do we know which combination of hardware and drivers are reliable at any given point in time. We can say though that if this had been set to "both", ith1 would have been correctly removed from the bond. That said if this is still controversial I can resubmit the series without this patch.
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: ith1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: ith0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:e0:81:e5:0e:16
Slave queue ID: 0
Slave Interface: ith1
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: 00:e0:81:e5:0e:18
Slave queue ID: 0
^ permalink raw reply
* Re: [iproute2] Bug#898840: Latest update breaks ip6 default gateway cli api
From: Luca Boccassi @ 2018-05-16 16:48 UTC (permalink / raw)
To: Michal Kubecek, netdev
Cc: Serhey Popovych, Stephen Hemminger, Hans van Kranenburg, 898840
In-Reply-To: <20180516145344.fle2t7qng7cvowsu@unicorn.suse.cz>
[-- Attachment #1: Type: text/plain, Size: 789 bytes --]
On Wed, 2018-05-16 at 16:53 +0200, Michal Kubecek wrote:
> On Wed, May 16, 2018 at 02:42:24PM +0100, Luca Boccassi wrote:
> > Hans reported a regression in v4.16.0, ip route now requires -6 to
> > be
> > manually added when using v6 addresses while up to 4.15 it didn't,
> > the
> > commands quoted show the problem.
> >
> > Bisecting shows that the following commit from Serhey introduced
> > the
> > problem:
> >
> > 93fa12418dc6f5943692250244be303bb162175b
> > utils: Always specify family and ->bytelen in get_prefix_1()
> >
> > Could you please have a look when you have a moment? It's very easy
> > to
> > reproduce, and it breaks existing scripts and so on.
>
> Fixed already:
Ah fantastic, thanks, sorry I missed that.
--
Kind regards,
Luca Boccassi
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH net-next 2/2] drivers: net: Remove device_node checks with of_mdiobus_register()
From: kbuild test robot @ 2018-05-16 16:33 UTC (permalink / raw)
To: Florian Fainelli
Cc: kbuild-all, netdev, Florian Fainelli, Andrew Lunn, Vivien Didelot,
David S. Miller, Nicolas Ferre, Fugang Duan, Sergei Shtylyov,
Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
Grygorii Strashko, Woojung Huh, Microchip Linux Driver Support,
Rob Herring, Frank Rowand, Antoine Tenart, Tobias Jordan <Tob
In-Reply-To: <20180515215930.12115-3-f.fainelli@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 20047 bytes --]
Hi Florian,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Florian-Fainelli/of-mdio-Fall-back-to-mdiobus_register-with-np-is-NULL/20180516-203317
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm
All error/warnings (new ones prefixed by >>):
.runtime_suspend = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:527:21: note: (near initialization for 'davinci_mdio_pm_ops.runtime_suspend')
SET_RUNTIME_PM_OPS(davinci_mdio_runtime_suspend,
^
include/linux/pm.h:354:21: note: in definition of macro 'SET_RUNTIME_PM_OPS'
.runtime_suspend = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:528:7: error: initializer element is not constant
davinci_mdio_runtime_resume, NULL)
^
include/linux/pm.h:355:20: note: in definition of macro 'SET_RUNTIME_PM_OPS'
.runtime_resume = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:528:7: note: (near initialization for 'davinci_mdio_pm_ops.runtime_resume')
davinci_mdio_runtime_resume, NULL)
^
include/linux/pm.h:355:20: note: in definition of macro 'SET_RUNTIME_PM_OPS'
.runtime_resume = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:330:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.suspend_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.suspend_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:330:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.suspend_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:331:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.resume_early = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.resume_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:331:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.resume_early = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:332:17: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.freeze_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.freeze_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:332:17: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.freeze_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:333:16: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.thaw_early = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.thaw_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:333:16: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.thaw_early = resume_fn, \
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:334:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.poweroff_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.poweroff_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:334:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.poweroff_late = suspend_fn, \
^~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:335:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.restore_early = resume_fn,
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.restore_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:335:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.restore_early = resume_fn,
^~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:539:12: error: initializer element is not constant
.remove = davinci_mdio_remove,
^~~~~~~~~~~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:539:12: note: (near initialization for 'davinci_mdio_driver.remove')
drivers/net//ethernet/ti/davinci_mdio.c:542:19: error: invalid storage class for function 'davinci_mdio_init'
static int __init davinci_mdio_init(void)
^~~~~~~~~~~~~~~~~
In file included from drivers/net//ethernet/ti/davinci_mdio.c:27:0:
>> include/linux/module.h:130:42: error: invalid storage class for function '__inittest'
static inline initcall_t __maybe_unused __inittest(void) \
^
include/linux/module.h:120:30: note: in expansion of macro 'module_init'
#define device_initcall(fn) module_init(fn)
^~~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:546:1: note: in expansion of macro 'device_initcall'
device_initcall(davinci_mdio_init);
^~~~~~~~~~~~~~~
>> drivers/net//ethernet/ti/davinci_mdio.c:546:1: warning: 'alias' attribute ignored [-Wattributes]
drivers/net//ethernet/ti/davinci_mdio.c:548:20: error: invalid storage class for function 'davinci_mdio_exit'
static void __exit davinci_mdio_exit(void)
^~~~~~~~~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:548:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static void __exit davinci_mdio_exit(void)
^~~~~~
In file included from drivers/net//ethernet/ti/davinci_mdio.c:27:0:
>> include/linux/module.h:136:42: error: invalid storage class for function '__exittest'
static inline exitcall_t __maybe_unused __exittest(void) \
^
drivers/net//ethernet/ti/davinci_mdio.c:552:1: note: in expansion of macro 'module_exit'
module_exit(davinci_mdio_exit);
^~~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:552:1: warning: 'alias' attribute ignored [-Wattributes]
In file included from include/linux/module.h:18:0,
from drivers/net//ethernet/ti/davinci_mdio.c:27:
include/linux/moduleparam.h:22:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static const char __UNIQUE_ID(name)[] \
^
include/linux/module.h:161:32: note: in expansion of macro '__MODULE_INFO'
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^~~~~~~~~~~~~
include/linux/module.h:199:34: note: in expansion of macro 'MODULE_INFO'
#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
^~~~~~~~~~~
drivers/net//ethernet/ti/davinci_mdio.c:554:1: note: in expansion of macro 'MODULE_LICENSE'
MODULE_LICENSE("GPL");
^~~~~~~~~~~~~~
>> drivers/net//ethernet/ti/davinci_mdio.c:555:1: error: expected declaration or statement at end of input
MODULE_DESCRIPTION("DaVinci MDIO driver");
^~~~~~~~~~~~~~~~~~
At top level:
drivers/net//ethernet/ti/davinci_mdio.c:357:12: warning: 'davinci_mdio_probe' defined but not used [-Wunused-function]
static int davinci_mdio_probe(struct platform_device *pdev)
^~~~~~~~~~~~~~~~~~
--
.runtime_suspend = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:527:21: note: (near initialization for 'davinci_mdio_pm_ops.runtime_suspend')
SET_RUNTIME_PM_OPS(davinci_mdio_runtime_suspend,
^
include/linux/pm.h:354:21: note: in definition of macro 'SET_RUNTIME_PM_OPS'
.runtime_suspend = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:528:7: error: initializer element is not constant
davinci_mdio_runtime_resume, NULL)
^
include/linux/pm.h:355:20: note: in definition of macro 'SET_RUNTIME_PM_OPS'
.runtime_resume = resume_fn, \
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:528:7: note: (near initialization for 'davinci_mdio_pm_ops.runtime_resume')
davinci_mdio_runtime_resume, NULL)
^
include/linux/pm.h:355:20: note: in definition of macro 'SET_RUNTIME_PM_OPS'
.runtime_resume = resume_fn, \
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:330:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.suspend_late = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.suspend_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:330:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.suspend_late = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:331:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.resume_early = resume_fn, \
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.resume_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:331:18: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.resume_early = resume_fn, \
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:332:17: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.freeze_late = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.freeze_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:332:17: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.freeze_late = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:333:16: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.thaw_early = resume_fn, \
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.thaw_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:333:16: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.thaw_early = resume_fn, \
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:31: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:334:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.poweroff_late = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:31: note: (near initialization for 'davinci_mdio_pm_ops.poweroff_late')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:334:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.poweroff_late = suspend_fn, \
^~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: error: initializer element is not constant
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:335:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.restore_early = resume_fn,
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:529:53: note: (near initialization for 'davinci_mdio_pm_ops.restore_early')
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
^
include/linux/pm.h:335:19: note: in definition of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS'
.restore_early = resume_fn,
^~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:539:12: error: initializer element is not constant
.remove = davinci_mdio_remove,
^~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:539:12: note: (near initialization for 'davinci_mdio_driver.remove')
drivers/net/ethernet/ti/davinci_mdio.c:542:19: error: invalid storage class for function 'davinci_mdio_init'
static int __init davinci_mdio_init(void)
^~~~~~~~~~~~~~~~~
In file included from drivers/net/ethernet/ti/davinci_mdio.c:27:0:
>> include/linux/module.h:130:42: error: invalid storage class for function '__inittest'
static inline initcall_t __maybe_unused __inittest(void) \
^
include/linux/module.h:120:30: note: in expansion of macro 'module_init'
#define device_initcall(fn) module_init(fn)
^~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:546:1: note: in expansion of macro 'device_initcall'
device_initcall(davinci_mdio_init);
^~~~~~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:546:1: warning: 'alias' attribute ignored [-Wattributes]
drivers/net/ethernet/ti/davinci_mdio.c:548:20: error: invalid storage class for function 'davinci_mdio_exit'
static void __exit davinci_mdio_exit(void)
^~~~~~~~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:548:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static void __exit davinci_mdio_exit(void)
^~~~~~
In file included from drivers/net/ethernet/ti/davinci_mdio.c:27:0:
>> include/linux/module.h:136:42: error: invalid storage class for function '__exittest'
static inline exitcall_t __maybe_unused __exittest(void) \
^
drivers/net/ethernet/ti/davinci_mdio.c:552:1: note: in expansion of macro 'module_exit'
module_exit(davinci_mdio_exit);
^~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:552:1: warning: 'alias' attribute ignored [-Wattributes]
In file included from include/linux/module.h:18:0,
from drivers/net/ethernet/ti/davinci_mdio.c:27:
include/linux/moduleparam.h:22:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static const char __UNIQUE_ID(name)[] \
^
include/linux/module.h:161:32: note: in expansion of macro '__MODULE_INFO'
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^~~~~~~~~~~~~
include/linux/module.h:199:34: note: in expansion of macro 'MODULE_INFO'
#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
^~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:554:1: note: in expansion of macro 'MODULE_LICENSE'
MODULE_LICENSE("GPL");
^~~~~~~~~~~~~~
drivers/net/ethernet/ti/davinci_mdio.c:555:1: error: expected declaration or statement at end of input
MODULE_DESCRIPTION("DaVinci MDIO driver");
^~~~~~~~~~~~~~~~~~
At top level:
drivers/net/ethernet/ti/davinci_mdio.c:357:12: warning: 'davinci_mdio_probe' defined but not used [-Wunused-function]
static int davinci_mdio_probe(struct platform_device *pdev)
^~~~~~~~~~~~~~~~~~
vim +/__inittest +130 include/linux/module.h
0fd972a7 Paul Gortmaker 2015-05-01 127
0fd972a7 Paul Gortmaker 2015-05-01 128 /* Each module must use one module_init(). */
0fd972a7 Paul Gortmaker 2015-05-01 129 #define module_init(initfn) \
1f318a8b Arnd Bergmann 2017-02-01 @130 static inline initcall_t __maybe_unused __inittest(void) \
0fd972a7 Paul Gortmaker 2015-05-01 131 { return initfn; } \
0fd972a7 Paul Gortmaker 2015-05-01 132 int init_module(void) __attribute__((alias(#initfn)));
0fd972a7 Paul Gortmaker 2015-05-01 133
0fd972a7 Paul Gortmaker 2015-05-01 134 /* This is only required if you want to be unloadable. */
0fd972a7 Paul Gortmaker 2015-05-01 135 #define module_exit(exitfn) \
1f318a8b Arnd Bergmann 2017-02-01 @136 static inline exitcall_t __maybe_unused __exittest(void) \
0fd972a7 Paul Gortmaker 2015-05-01 137 { return exitfn; } \
0fd972a7 Paul Gortmaker 2015-05-01 138 void cleanup_module(void) __attribute__((alias(#exitfn)));
0fd972a7 Paul Gortmaker 2015-05-01 139
:::::: The code at line 130 was first introduced by commit
:::::: 1f318a8bafcfba9f0d623f4870c4e890fd22e659 modules: mark __inittest/__exittest as __maybe_unused
:::::: TO: Arnd Bergmann <arnd@arndb.de>
:::::: CC: Jessica Yu <jeyu@redhat.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 65284 bytes --]
^ permalink raw reply
* Re: [PATCH net-next v2 4/4] bonding: allow carrier and link status to determine link state
From: David Miller @ 2018-05-16 16:28 UTC (permalink / raw)
To: jay.vosburgh; +Cc: dbanerje, netdev, vfalico, andy
In-Reply-To: <26172.1526487068@nyx>
From: Jay Vosburgh <jay.vosburgh@canonical.com>
Date: Wed, 16 May 2018 18:11:08 +0200
> Debabrata Banerjee <dbanerje@akamai.com> wrote:
>
>>In a mixed environment it may be difficult to tell if your hardware
>>support carrier, if it does not it can always report true. With a new
>>use_carrier option of 2, we can check both carrier and link status
>>sequentially, instead of one or the other
>
> Your reply in the prior discussion suggests to me that there is
> a bug somewhere else (perhaps in bonding, perhaps in the network
> driver), and this is just papering over it. As I said, I don't believe
> that an additional hack to bonding is the appropriate way to resolve
> this.
Sorry this crossed with my review and application of this series, my bad.
Debabrata please give a specific example of a case where the new "both"
mode actually is needed.
Thank you.
^ permalink raw reply
* Re: [PATCH net-next] sched: manipulate __QDISC_STATE_RUNNING in qdisc_run_* helpers
From: David Miller @ 2018-05-16 16:26 UTC (permalink / raw)
To: pabeni; +Cc: netdev, jhs, xiyou.wangcong, jiri, john.fastabend
In-Reply-To: <b589d9ffd51932b66469a36252d1dee0f9e825c7.1526374069.git.pabeni@redhat.com>
From: Paolo Abeni <pabeni@redhat.com>
Date: Tue, 15 May 2018 10:50:31 +0200
> Currently NOLOCK qdiscs pay a measurable overhead to atomically
> manipulate the __QDISC_STATE_RUNNING. Such bit is flipped twice per
> packet in the uncontended scenario with packet rate below the
> line rate: on packed dequeue and on the next, failing dequeue attempt.
>
> This changeset moves the bit manipulation into the qdisc_run_{begin,end}
> helpers, so that the bit is now flipped only once per packet, with
> measurable performance improvement in the uncontended scenario.
>
> This also allows simplifying the qdisc teardown code path - since
> qdisc_is_running() is now effective for each qdisc type - and avoid a
> possible race between qdisc_run() and dev_deactivate_many(), as now
> the some_qdisc_is_busy() can properly detect NOLOCK qdiscs being busy
> dequeuing packets.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Applied, thank you.
^ permalink raw reply
* Re: [RESEND PATCH v2 1/1] net: phy: micrel: add 125MHz reference clock workaround
From: David Miller @ 2018-05-16 16:21 UTC (permalink / raw)
To: m.felsch
Cc: robh+dt, mark.rutland, andrew, f.fainelli, netdev, devicetree,
kernel, niebelm
In-Reply-To: <20180515081856.23322-2-m.felsch@pengutronix.de>
From: Marco Felsch <m.felsch@pengutronix.de>
Date: Tue, 15 May 2018 10:18:56 +0200
> From: Markus Niebel <Markus.Niebel@tqs.de>
>
> The micrel KSZ9031 phy has a optional clock pin (CLK125_NDO) which can be
> used as reference clock for the MAC unit. The clock signal must meet the
> RGMII requirements to ensure the correct data transmission between the
> MAC and the PHY. The KSZ9031 phy does not fulfill the duty cycle
> requirement if the phy is configured as slave. For a complete
> describtion look at the errata sheets: DS80000691D or DS80000692D.
>
> The errata sheet recommends to force the phy into master mode whenever
> there is a 1000Base-T link-up as work around. Only set the
> "micrel,force-master" property if you use the phy reference clock provided
> by CLK125_NDO pin as MAC reference clock in your application.
>
> Attenation, this workaround is only usable if the link partner can
> be configured to slave mode for 1000Base-T.
>
> Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
> [m.felsch@pengutronix.de: fix dt-binding documentation]
> [m.felsch@pengutronix.de: use already existing result var for read/write]
> [m.felsch@pengutronix.de: add error handling]
> [m.felsch@pengutronix.de: add more comments]
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net] tcp: purge write queue in tcp_connect_init()
From: David Miller @ 2018-05-16 16:19 UTC (permalink / raw)
To: edumazet; +Cc: netdev, eric.dumazet, ycheng, ncardwell
In-Reply-To: <20180515041426.94062-1-edumazet@google.com>
From: Eric Dumazet <edumazet@google.com>
Date: Mon, 14 May 2018 21:14:26 -0700
> syzkaller found a reliable way to crash the host, hitting a BUG()
> in __tcp_retransmit_skb()
>
> Malicous MSG_FASTOPEN is the root cause. We need to purge write queue
> in tcp_connect_init() at the point we init snd_una/write_seq.
>
> This patch also replaces the BUG() by a less intrusive WARN_ON_ONCE()
...
> Fixes: cf60af03ca4e ("net-tcp: Fast Open client - sendmsg(MSG_FASTOPEN)")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Yuchung Cheng <ycheng@google.com>
> Cc: Neal Cardwell <ncardwell@google.com>
> Reported-by: syzbot <syzkaller@googlegroups.com>
Applied and queued up for -stable, thanks Eric.
^ permalink raw reply
* Re: [net 1/1] net/mlx5: Fix build break when CONFIG_SMP=n
From: David Miller @ 2018-05-16 16:17 UTC (permalink / raw)
To: saeedm; +Cc: netdev, rdunlap, linux, tglx
In-Reply-To: <20180514223810.21197-1-saeedm@mellanox.com>
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Mon, 14 May 2018 15:38:10 -0700
> Avoid using the kernel's irq_descriptor and return IRQ vector affinity
> directly from the driver.
>
> This fixes the following build break when CONFIG_SMP=n
>
> include/linux/mlx5/driver.h: In function ‘mlx5_get_vector_affinity_hint’:
> include/linux/mlx5/driver.h:1299:13: error:
> ‘struct irq_desc’ has no member named ‘affinity_hint’
>
> Fixes: 6082d9c9c94a ("net/mlx5: Fix mlx5_get_vector_affinity function")
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> CC: Randy Dunlap <rdunlap@infradead.org>
> CC: Guenter Roeck <linux@roeck-us.net>
> CC: Thomas Gleixner <tglx@linutronix.de>
> Tested-by: Israel Rukshin <israelr@mellanox.com>
> ---
>
> For -stable v4.14
Applied and queued up for -stable, thanks.
^ permalink raw reply
* RE: ECMP routing: problematic selection of outgoing interface
From: Hirotaka Yamamoto @ 2018-05-16 16:16 UTC (permalink / raw)
To: Andrew Lunn; +Cc: netdev@vger.kernel.org
In-Reply-To: <20180516130128.GE22000@lunn.ch>
Hi Andrew,
> I assume you add the 192.168.11.1 and 192.168.12.1 to the interfaces
> using global scope? Global scope means the IP addresses are valid
> everywhere. All routers should know how to route packets to these IP
> addresses. So a host is free to pick any of its global scope IP
Yes their scopes are global,
> It sounds like your router is doing reverse path filtering. It is
> checking its routing table for the source address, and throwing the
> packets away if they don't come in the interface the route points out
> of.
and yes the routers do reverse path filtering.
Now I understood that this is an intended and in fact a legitimate behavior.
So it seems that one thing I can do is to talk with networking people to accept
these packets. Another option that has come to my mind is to change the
address scope to link-local and assign a global, routable address to a dummy
interface so that Linux chooses the address for the dummyif.
I'm going to evaluate these options. Thank you!
- ymmt
^ permalink raw reply
* Re: [PATCH net-next v2 0/4] bonding: performance and reliability
From: David Miller @ 2018-05-16 16:16 UTC (permalink / raw)
To: dbanerje; +Cc: netdev, j.vosburgh, vfalico, andy
In-Reply-To: <20180514184810.15506-1-dbanerje@akamai.com>
From: Debabrata Banerjee <dbanerje@akamai.com>
Date: Mon, 14 May 2018 14:48:06 -0400
> Series of fixes to how rlb updates are handled, code cleanup, allowing
> higher performance tx hashing in balance-alb mode, and reliability of
> link up/down monitoring.
>
> v2: refactor bond_is_nondyn_tlb with inline fn, update log comment to
> point out that multicast addresses will not get rlb updates.
Series applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next v2 4/4] bonding: allow carrier and link status to determine link state
From: Jay Vosburgh @ 2018-05-16 16:11 UTC (permalink / raw)
To: Debabrata Banerjee
Cc: David S . Miller, netdev, Veaceslav Falico, Andy Gospodarek
In-Reply-To: <20180514184810.15506-5-dbanerje@akamai.com>
Debabrata Banerjee <dbanerje@akamai.com> wrote:
>In a mixed environment it may be difficult to tell if your hardware
>support carrier, if it does not it can always report true. With a new
>use_carrier option of 2, we can check both carrier and link status
>sequentially, instead of one or the other
Your reply in the prior discussion suggests to me that there is
a bug somewhere else (perhaps in bonding, perhaps in the network
driver), and this is just papering over it. As I said, I don't believe
that an additional hack to bonding is the appropriate way to resolve
this.
-J
>Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
>---
> Documentation/networking/bonding.txt | 4 ++--
> drivers/net/bonding/bond_main.c | 12 ++++++++----
> drivers/net/bonding/bond_options.c | 7 ++++---
> 3 files changed, 14 insertions(+), 9 deletions(-)
>
>diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
>index 9ba04c0bab8d..f063730e7e73 100644
>--- a/Documentation/networking/bonding.txt
>+++ b/Documentation/networking/bonding.txt
>@@ -828,8 +828,8 @@ use_carrier
> MII / ETHTOOL ioctl method to determine the link state.
>
> A value of 1 enables the use of netif_carrier_ok(), a value of
>- 0 will use the deprecated MII / ETHTOOL ioctls. The default
>- value is 1.
>+ 0 will use the deprecated MII / ETHTOOL ioctls. A value of 2
>+ will check both. The default value is 1.
>
> xmit_hash_policy
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index f7f8a49cb32b..7e9652c4b35c 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -132,7 +132,7 @@ MODULE_PARM_DESC(downdelay, "Delay before considering link down, "
> "in milliseconds");
> module_param(use_carrier, int, 0);
> MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; "
>- "0 for off, 1 for on (default)");
>+ "0 for off, 1 for on (default), 2 for carrier then legacy checks");
> module_param(mode, charp, 0);
> MODULE_PARM_DESC(mode, "Mode of operation; 0 for balance-rr, "
> "1 for active-backup, 2 for balance-xor, "
>@@ -434,12 +434,16 @@ static int bond_check_dev_link(struct bonding *bond,
> int (*ioctl)(struct net_device *, struct ifreq *, int);
> struct ifreq ifr;
> struct mii_ioctl_data *mii;
>+ bool carrier = true;
>
> if (!reporting && !netif_running(slave_dev))
> return 0;
>
> if (bond->params.use_carrier)
>- return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
>+ carrier = netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
>+
>+ if (!carrier)
>+ return carrier;
>
> /* Try to get link status using Ethtool first. */
> if (slave_dev->ethtool_ops->get_link)
>@@ -4399,8 +4403,8 @@ static int bond_check_params(struct bond_params *params)
> downdelay = 0;
> }
>
>- if ((use_carrier != 0) && (use_carrier != 1)) {
>- pr_warn("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n",
>+ if (use_carrier < 0 || use_carrier > 2) {
>+ pr_warn("Warning: use_carrier module parameter (%d), not of valid value (0-2), so it was set to 1\n",
> use_carrier);
> use_carrier = 1;
> }
>diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
>index 8a945c9341d6..dba6cef05134 100644
>--- a/drivers/net/bonding/bond_options.c
>+++ b/drivers/net/bonding/bond_options.c
>@@ -164,9 +164,10 @@ static const struct bond_opt_value bond_primary_reselect_tbl[] = {
> };
>
> static const struct bond_opt_value bond_use_carrier_tbl[] = {
>- { "off", 0, 0},
>- { "on", 1, BOND_VALFLAG_DEFAULT},
>- { NULL, -1, 0}
>+ { "off", 0, 0},
>+ { "on", 1, BOND_VALFLAG_DEFAULT},
>+ { "both", 2, 0},
>+ { NULL, -1, 0}
> };
>
> static const struct bond_opt_value bond_all_slaves_active_tbl[] = {
>--
>2.17.0
---
-Jay Vosburgh, jay.vosburgh@canonical.com
^ permalink raw reply
* [PATCH v3 iproute2-next 3/3] rdma: update man pages
From: Steve Wise @ 2018-05-15 20:41 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
In-Reply-To: <cover.1526483157.git.swise@opengridcomputing.com>
Update the man pages for the resource attributes as well
as the driver-specific attributes.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
man/man8/rdma-resource.8 | 29 ++++++++++++++++++++++++++---
man/man8/rdma.8 | 2 +-
2 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/man/man8/rdma-resource.8 b/man/man8/rdma-resource.8
index ff5d25d..40b073d 100644
--- a/man/man8/rdma-resource.8
+++ b/man/man8/rdma-resource.8
@@ -7,13 +7,16 @@ rdma-resource \- rdma resource configuration
.in +8
.ti -8
.B rdma
-.RI "[ " OPTIONS " ]"
-.B resource
-.RI " { " COMMAND " | "
+.RI "[ " OPTIONS " ] " RESOURCE " { " COMMAND " | "
.BR help " }"
.sp
.ti -8
+.IR RESOURCE " := { "
+.BR cm_id " | " cq " | " mr " | " pd " | " qp " }"
+.sp
+
+.ti -8
.IR OPTIONS " := { "
\fB\-j\fR[\fIson\fR] |
\fB\-d\fR[\fIetails\fR] }
@@ -70,11 +73,31 @@ rdma res show qp link mlx5_4/- -d
Detailed view.
.RE
.PP
+rdma res show qp link mlx5_4/- -dd
+.RS 4
+Detailed view including driver-specific details.
+.RE
+.PP
rdma res show qp link mlx5_4/1 lqpn 0-6
.RS 4
Limit to specific Local QPNs.
.RE
.PP
+rdma resource show cm_id dst-port 7174
+.RS 4
+Show CM_IDs with destination ip port of 7174.
+.RE
+.PP
+rdma resource show cm_id src-addr 172.16.0.100
+.RS 4
+Show CM_IDs bound to local ip address 172.16.0.100
+.RE
+.PP
+rdma resource show cq pid 30489
+.RS 4
+Show CQs belonging to pid 30489
+.RE
+.PP
.SH SEE ALSO
.BR rdma (8),
diff --git a/man/man8/rdma.8 b/man/man8/rdma.8
index 6f88f37..12aa149 100644
--- a/man/man8/rdma.8
+++ b/man/man8/rdma.8
@@ -49,7 +49,7 @@ If there were any errors during execution of the commands, the application retur
.TP
.BR "\-d" , " --details"
-Output detailed information.
+Output detailed information. Adding a second \-d includes driver-specific details.
.TP
.BR "\-p" , " --pretty"
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 iproute2-next 2/3] rdma: print driver resource attributes
From: Steve Wise @ 2018-05-15 20:41 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
In-Reply-To: <cover.1526483157.git.swise@opengridcomputing.com>
This enhancement allows printing rdma device-specific state, if provided
by the kernel. This is done in a generic manner, so rdma tool doesn't
need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key,
[print_type], value> tuples, where the key is a string and the value can
be any supported driver attribute. The print_type attribute, if present,
provides a print format to use vs the standard print format for the type.
For example, the default print type for a PROVIDER_S32 value is "%d ",
but "0x%x " if the print_type of PRINT_TYPE_HEX is included inthe tuple.
Driver resources are only printed when the -dd flag is present.
If -p is present, then the output is formatted to not exceed 80 columns,
otherwise it is printed as a single row to be grep/awk friendly.
Example output:
# rdma resource show qp lqpn 1028 -dd -p
link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0 path-mig-state MIGRATED pid 0 comm [nvme_rdma]
sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106 flush_cidx 85 in_use 0
size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41 wq_pidx 171 msn 44 rqt_hwaddr 0x2a8a5d00
rqt_size 256 in_use 128 size 130
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
rdma/rdma.c | 9 ++-
rdma/rdma.h | 11 ++++
rdma/res.c | 30 +++------
rdma/utils.c | 196 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 224 insertions(+), 22 deletions(-)
diff --git a/rdma/rdma.c b/rdma/rdma.c
index b43e538..010e983 100644
--- a/rdma/rdma.c
+++ b/rdma/rdma.c
@@ -129,13 +129,14 @@ int main(int argc, char **argv)
{ "batch", required_argument, NULL, 'b' },
{ NULL, 0, NULL, 0 }
};
+ bool show_driver_details = false;
const char *batch_file = NULL;
bool pretty_output = false;
bool show_details = false;
bool json_output = false;
bool force = false;
- char *filename;
struct rd rd = {};
+ char *filename;
int opt;
int err;
@@ -152,7 +153,10 @@ int main(int argc, char **argv)
pretty_output = true;
break;
case 'd':
- show_details = true;
+ if (show_details)
+ show_driver_details = true;
+ else
+ show_details = true;
break;
case 'j':
json_output = true;
@@ -180,6 +184,7 @@ int main(int argc, char **argv)
argv += optind;
rd.show_details = show_details;
+ rd.show_driver_details = show_driver_details;
rd.json_output = json_output;
rd.pretty_output = pretty_output;
diff --git a/rdma/rdma.h b/rdma/rdma.h
index 1908fc4..fcaf9e6 100644
--- a/rdma/rdma.h
+++ b/rdma/rdma.h
@@ -55,6 +55,7 @@ struct rd {
char **argv;
char *filename;
bool show_details;
+ bool show_driver_details;
struct list_head dev_map_list;
uint32_t dev_idx;
uint32_t port_idx;
@@ -115,4 +116,14 @@ int rd_recv_msg(struct rd *rd, mnl_cb_t callback, void *data, uint32_t seq);
void rd_prepare_msg(struct rd *rd, uint32_t cmd, uint32_t *seq, uint16_t flags);
int rd_dev_init_cb(const struct nlmsghdr *nlh, void *data);
int rd_attr_cb(const struct nlattr *attr, void *data);
+int rd_attr_check(const struct nlattr *attr, int *typep);
+
+/*
+ * Print helpers
+ */
+void print_driver_table(struct rd *rd, struct nlattr *tb);
+void newline(struct rd *rd);
+void newline_indent(struct rd *rd);
+#define MAX_LINE_LENGTH 80
+
#endif /* _RDMA_TOOL_H_ */
diff --git a/rdma/res.c b/rdma/res.c
index 1a0aab6..074b992 100644
--- a/rdma/res.c
+++ b/rdma/res.c
@@ -439,10 +439,8 @@ static int res_qp_parse_cb(const struct nlmsghdr *nlh, void *data)
if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
free(comm);
- if (rd->json_output)
- jsonw_end_array(rd->jw);
- else
- pr_out("\n");
+ print_driver_table(rd, nla_line[RDMA_NLDEV_ATTR_DRIVER]);
+ newline(rd);
}
return MNL_CB_OK;
}
@@ -678,10 +676,8 @@ static int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)
if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
free(comm);
- if (rd->json_output)
- jsonw_end_array(rd->jw);
- else
- pr_out("\n");
+ print_driver_table(rd, nla_line[RDMA_NLDEV_ATTR_DRIVER]);
+ newline(rd);
}
return MNL_CB_OK;
}
@@ -804,10 +800,8 @@ static int res_cq_parse_cb(const struct nlmsghdr *nlh, void *data)
if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
free(comm);
- if (rd->json_output)
- jsonw_end_array(rd->jw);
- else
- pr_out("\n");
+ print_driver_table(rd, nla_line[RDMA_NLDEV_ATTR_DRIVER]);
+ newline(rd);
}
return MNL_CB_OK;
}
@@ -919,10 +913,8 @@ static int res_mr_parse_cb(const struct nlmsghdr *nlh, void *data)
if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
free(comm);
- if (rd->json_output)
- jsonw_end_array(rd->jw);
- else
- pr_out("\n");
+ print_driver_table(rd, nla_line[RDMA_NLDEV_ATTR_DRIVER]);
+ newline(rd);
}
return MNL_CB_OK;
}
@@ -1004,10 +996,8 @@ static int res_pd_parse_cb(const struct nlmsghdr *nlh, void *data)
if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
free(comm);
- if (rd->json_output)
- jsonw_end_array(rd->jw);
- else
- pr_out("\n");
+ print_driver_table(rd, nla_line[RDMA_NLDEV_ATTR_DRIVER]);
+ newline(rd);
}
return MNL_CB_OK;
}
diff --git a/rdma/utils.c b/rdma/utils.c
index 49c967f..79c3d9f 100644
--- a/rdma/utils.c
+++ b/rdma/utils.c
@@ -11,6 +11,7 @@
#include "rdma.h"
#include <ctype.h>
+#include <inttypes.h>
int rd_argc(struct rd *rd)
{
@@ -393,8 +394,32 @@ static const enum mnl_attr_data_type nldev_policy[RDMA_NLDEV_ATTR_MAX] = {
[RDMA_NLDEV_ATTR_RES_MRLEN] = MNL_TYPE_U64,
[RDMA_NLDEV_ATTR_NDEV_INDEX] = MNL_TYPE_U32,
[RDMA_NLDEV_ATTR_NDEV_NAME] = MNL_TYPE_NUL_STRING,
+ [RDMA_NLDEV_ATTR_DRIVER] = MNL_TYPE_NESTED,
+ [RDMA_NLDEV_ATTR_DRIVER_ENTRY] = MNL_TYPE_NESTED,
+ [RDMA_NLDEV_ATTR_DRIVER_STRING] = MNL_TYPE_NUL_STRING,
+ [RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE] = MNL_TYPE_U8,
+ [RDMA_NLDEV_ATTR_DRIVER_S32] = MNL_TYPE_U32,
+ [RDMA_NLDEV_ATTR_DRIVER_U32] = MNL_TYPE_U32,
+ [RDMA_NLDEV_ATTR_DRIVER_S64] = MNL_TYPE_U64,
+ [RDMA_NLDEV_ATTR_DRIVER_U64] = MNL_TYPE_U64,
};
+int rd_attr_check(const struct nlattr *attr, int *typep)
+{
+ int type;
+
+ if (mnl_attr_type_valid(attr, RDMA_NLDEV_ATTR_MAX) < 0)
+ return MNL_CB_ERROR;
+
+ type = mnl_attr_get_type(attr);
+
+ if (mnl_attr_validate(attr, nldev_policy[type]) < 0)
+ return MNL_CB_ERROR;
+
+ *typep = nldev_policy[type];
+ return MNL_CB_OK;
+}
+
int rd_attr_cb(const struct nlattr *attr, void *data)
{
const struct nlattr **tb = data;
@@ -660,3 +685,174 @@ struct dev_map *dev_map_lookup(struct rd *rd, bool allow_port_index)
free(dev_name);
return dev_map;
}
+
+#define nla_type(attr) ((attr)->nla_type & NLA_TYPE_MASK)
+
+void newline(struct rd *rd)
+{
+ if (rd->json_output)
+ jsonw_end_array(rd->jw);
+ else
+ pr_out("\n");
+}
+
+void newline_indent(struct rd *rd)
+{
+ newline(rd);
+ if (!rd->json_output)
+ pr_out(" ");
+}
+
+static int print_driver_string(struct rd *rd, const char *key_str,
+ const char *val_str)
+{
+ if (rd->json_output) {
+ jsonw_string_field(rd->jw, key_str, val_str);
+ return 0;
+ } else {
+ return pr_out("%s %s ", key_str, val_str);
+ }
+}
+
+static int print_driver_s32(struct rd *rd, const char *key_str, int32_t val,
+ enum rdma_nldev_print_type print_type)
+{
+ if (rd->json_output) {
+ jsonw_int_field(rd->jw, key_str, val);
+ return 0;
+ }
+ switch (print_type) {
+ case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
+ return pr_out("%s %d ", key_str, val);
+ case RDMA_NLDEV_PRINT_TYPE_HEX:
+ return pr_out("%s 0x%x ", key_str, val);
+ default:
+ return -EINVAL;
+ }
+}
+
+static int print_driver_u32(struct rd *rd, const char *key_str, uint32_t val,
+ enum rdma_nldev_print_type print_type)
+{
+ if (rd->json_output) {
+ jsonw_int_field(rd->jw, key_str, val);
+ return 0;
+ }
+ switch (print_type) {
+ case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
+ return pr_out("%s %u ", key_str, val);
+ case RDMA_NLDEV_PRINT_TYPE_HEX:
+ return pr_out("%s 0x%x ", key_str, val);
+ default:
+ return -EINVAL;
+ }
+}
+
+static int print_driver_s64(struct rd *rd, const char *key_str, int64_t val,
+ enum rdma_nldev_print_type print_type)
+{
+ if (rd->json_output) {
+ jsonw_int_field(rd->jw, key_str, val);
+ return 0;
+ }
+ switch (print_type) {
+ case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
+ return pr_out("%s %" PRId64 " ", key_str, val);
+ case RDMA_NLDEV_PRINT_TYPE_HEX:
+ return pr_out("%s 0x%" PRIx64 " ", key_str, val);
+ default:
+ return -EINVAL;
+ }
+}
+
+static int print_driver_u64(struct rd *rd, const char *key_str, uint64_t val,
+ enum rdma_nldev_print_type print_type)
+{
+ if (rd->json_output) {
+ jsonw_int_field(rd->jw, key_str, val);
+ return 0;
+ }
+ switch (print_type) {
+ case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
+ return pr_out("%s %" PRIu64 " ", key_str, val);
+ case RDMA_NLDEV_PRINT_TYPE_HEX:
+ return pr_out("%s 0x%" PRIx64 " ", key_str, val);
+ default:
+ return -EINVAL;
+ }
+}
+
+static int print_driver_entry(struct rd *rd, struct nlattr *key_attr,
+ struct nlattr *val_attr,
+ enum rdma_nldev_print_type print_type)
+{
+ const char *key_str = mnl_attr_get_str(key_attr);
+ int attr_type = nla_type(val_attr);
+
+ switch (attr_type) {
+ case RDMA_NLDEV_ATTR_DRIVER_STRING:
+ return print_driver_string(rd, key_str,
+ mnl_attr_get_str(val_attr));
+ case RDMA_NLDEV_ATTR_DRIVER_S32:
+ return print_driver_s32(rd, key_str,
+ mnl_attr_get_u32(val_attr), print_type);
+ case RDMA_NLDEV_ATTR_DRIVER_U32:
+ return print_driver_u32(rd, key_str,
+ mnl_attr_get_u32(val_attr), print_type);
+ case RDMA_NLDEV_ATTR_DRIVER_S64:
+ return print_driver_s64(rd, key_str,
+ mnl_attr_get_u64(val_attr), print_type);
+ case RDMA_NLDEV_ATTR_DRIVER_U64:
+ return print_driver_u64(rd, key_str,
+ mnl_attr_get_u64(val_attr), print_type);
+ }
+ return -EINVAL;
+}
+
+void print_driver_table(struct rd *rd, struct nlattr *tb)
+{
+ int print_type = RDMA_NLDEV_PRINT_TYPE_UNSPEC;
+ struct nlattr *tb_entry, *key = NULL, *val;
+ int type, cc = 0;
+ int ret;
+
+ if (!rd->show_driver_details || !tb)
+ return;
+
+ if (rd->pretty_output)
+ newline_indent(rd);
+
+ /*
+ * Driver attrs are tuples of {key, [print-type], value}.
+ * The key must be a string. If print-type is present, it
+ * defines an alternate printf format type vs the native format
+ * for the attribute. And the value can be any available
+ * driver type.
+ */
+ mnl_attr_for_each_nested(tb_entry, tb) {
+
+ if (cc > MAX_LINE_LENGTH) {
+ if (rd->pretty_output)
+ newline_indent(rd);
+ cc = 0;
+ }
+ if (rd_attr_check(tb_entry, &type) != MNL_CB_OK)
+ return;
+ if (!key) {
+ if (type != MNL_TYPE_NUL_STRING)
+ return;
+ key = tb_entry;
+ } else if (type == MNL_TYPE_U8) {
+ print_type = mnl_attr_get_u8(tb_entry);
+ } else {
+ val = tb_entry;
+ ret = print_driver_entry(rd, key, val, print_type);
+ if (ret < 0)
+ return;
+ cc += ret;
+ print_type = RDMA_NLDEV_PRINT_TYPE_UNSPEC;
+ key = NULL;
+ }
+ }
+ return;
+}
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 iproute2-next 1/3] rdma: update rdma_netlink.h to get new driver attributes
From: Steve Wise @ 2018-05-15 20:41 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
In-Reply-To: <cover.1526483157.git.swise@opengridcomputing.com>
Pull in the rdma_netlink.h changes from kernel
commits:
25a0ad85156a ("RDMA/nldev: Add explicit pad attribute")
da5c85078215 ("RDMA/nldev: add driver-specific resource tracking)"
0d52d803767e ("RDMA/uapi: Fix uapi breakage")
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
rdma/include/uapi/rdma/rdma_netlink.h | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
index 60416ed..6513fb8 100644
--- a/rdma/include/uapi/rdma/rdma_netlink.h
+++ b/rdma/include/uapi/rdma/rdma_netlink.h
@@ -249,10 +249,22 @@ enum rdma_nldev_command {
RDMA_NLDEV_NUM_OPS
};
+enum {
+ RDMA_NLDEV_ATTR_ENTRY_STRLEN = 16,
+};
+
+enum rdma_nldev_print_type {
+ RDMA_NLDEV_PRINT_TYPE_UNSPEC,
+ RDMA_NLDEV_PRINT_TYPE_HEX,
+};
+
enum rdma_nldev_attr {
/* don't change the order or add anything between, this is ABI! */
RDMA_NLDEV_ATTR_UNSPEC,
+ /* Pad attribute for 64b alignment */
+ RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
+
/* Identifier for ib_device */
RDMA_NLDEV_ATTR_DEV_INDEX, /* u32 */
@@ -387,7 +399,6 @@ enum rdma_nldev_attr {
RDMA_NLDEV_ATTR_RES_PD_ENTRY, /* nested table */
RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY, /* u32 */
RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY, /* u32 */
-
/*
* Provides logical name and index of netdevice which is
* connected to physical port. This information is relevant
@@ -400,7 +411,24 @@ enum rdma_nldev_attr {
*/
RDMA_NLDEV_ATTR_NDEV_INDEX, /* u32 */
RDMA_NLDEV_ATTR_NDEV_NAME, /* string */
+ /*
+ * driver-specific attributes.
+ */
+ RDMA_NLDEV_ATTR_DRIVER, /* nested table */
+ RDMA_NLDEV_ATTR_DRIVER_ENTRY, /* nested table */
+ RDMA_NLDEV_ATTR_DRIVER_STRING, /* string */
+ /*
+ * u8 values from enum rdma_nldev_print_type
+ */
+ RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE, /* u8 */
+ RDMA_NLDEV_ATTR_DRIVER_S32, /* s32 */
+ RDMA_NLDEV_ATTR_DRIVER_U32, /* u32 */
+ RDMA_NLDEV_ATTR_DRIVER_S64, /* s64 */
+ RDMA_NLDEV_ATTR_DRIVER_U64, /* u64 */
+ /*
+ * Always the end
+ */
RDMA_NLDEV_ATTR_MAX
};
#endif /* _RDMA_NETLINK_H */
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 iproute2-next 0/3] RDMA tool driver-specific resource tracking
From: Steve Wise @ 2018-05-16 15:05 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
This series enhances the iproute2 rdma tool to include displaying
driver-specific resource attributes. It is the user-space part of the
kernel driver resource tracking series that has been accepted for merging
into linux-4.18 [1]
If there are no additional review comments, it can now be merged, I think.
Changes since v2:
- resync rdma_netlink.h to fix uapi break
Changes since v1:
- commit log editorial fixes
- cite kernel commits that updated rdma_netlink.h in the
iproute2 commit syncing this header
- reorder stack definitions ala "reverse christmas tree"
- correctly handle unknown driver attributes when printing
Changes since v0/rfc:
- changed "provider" to "driver" based on kernel side changes
- updated man pages
- removed "RFC" tag
Thanks,
Steve.
[1] https://www.spinics.net/lists/linux-rdma/msg64199.html
Steve Wise (3):
rdma: update rdma_netlink.h to get new driver attributes
rdma: print driver resource attributes
rdma: update man pages
man/man8/rdma-resource.8 | 29 ++++-
man/man8/rdma.8 | 2 +-
rdma/include/uapi/rdma/rdma_netlink.h | 30 +++++-
rdma/rdma.c | 9 +-
rdma/rdma.h | 11 ++
rdma/res.c | 30 ++----
rdma/utils.c | 196 ++++++++++++++++++++++++++++++++++
7 files changed, 280 insertions(+), 27 deletions(-)
--
1.8.3.1
^ permalink raw reply
* Re: [PATCH v3] ipvlan: call netdevice notifier when master mac address changed
From: David Miller @ 2018-05-16 16:00 UTC (permalink / raw)
To: liuqifa
Cc: dsahern, maheshb, weiyongjun1, maowenan, dingtianhong, netdev,
linux-kernel
In-Reply-To: <20180514113809.10196-1-liuqifa@huawei.com>
From: <liuqifa@huawei.com>
Date: Mon, 14 May 2018 19:38:09 +0800
> From: Keefe Liu <liuqifa@huawei.com>
>
> When master device's mac has been changed, the commit
> 32c10bbfe914 ("ipvlan: always use the current L2 addr of the
> master") makes the IPVlan devices's mac changed also, but it
> doesn't do related works such as flush the IPVlan devices's
> arp table.
>
> Signed-off-by: Keefe Liu <liuqifa@huawei.com>
Applied and queued up for -stable, thanks.
^ 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