Ivan Khoronzhuk [Fri, 6 Jul 2018 18:44:45 +0000 (21:44 +0300)]
net: ethernet: ti: cpsw: allow PTP 224.0.0.107 to be timestamped
Tested on AM572x with cpsw v1.15 for PTP sync and delay_req messages.
It doesn't work on cpsw v1.12, so added only for cpsw v > 1.15.
Command for testing:
ptp4l -P -4 -H -i eth0 -l 6 -m -q -p /dev/ptp0 -f ptp.cfg
where ptp.cfg:
[global]
tx_timestamp_timeout 20
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ivan Khoronzhuk [Fri, 6 Jul 2018 18:44:44 +0000 (21:44 +0300)]
net: ethernet: ti: cpsw: use BIT macro
It's needed to avoid checkpatch warnings for farther changes.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Arnd Bergmann [Fri, 6 Jul 2018 13:36:07 +0000 (15:36 +0200)]
stmmac: fix signed 64-bit division
I link error on 32-bit ARM points to yet another arithmetic bug:
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.o: In function `tc_setup_cbs':
stmmac_tc.c:(.text+0x148): undefined reference to `__aeabi_uldivmod'
stmmac_tc.c:(.text+0x1fc): undefined reference to `__aeabi_uldivmod'
stmmac_tc.c:(.text+0x308): undefined reference to `__aeabi_uldivmod'
stmmac_tc.c:(.text+0x320): undefined reference to `__aeabi_uldivmod'
stmmac_tc.c:(.text+0x33c): undefined reference to `__aeabi_uldivmod'
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.o:stmmac_tc.c:(.text+0x3a4): more undefined references to `__aeabi_uldivmod' follow
I observe that the last change to add the 'ul' prefix was incorrect,
as it did not turn the result of the multiplication into a 64-bit
expression on 32-bit architectures. Further, it seems that the
do_div() macro gets confused by the fact that we pass a signed
variable rather than unsigned into it.
This changes the code to instead use the div_s64() helper that is
meant for signed division, along with changing the constant suffix
to 'll' to actually make it a 64-bit argument everywhere, fixing
both of the issues I pointed out.
I'm not completely convinced that this makes the code correct, but
I'm fairly sure that we have two problems less than before.
Fixes: 1f705bc61aee ("net: stmmac: Add support for CBS QDISC")
Fixes: c18a9c096683 ("net: stmmac_tc: use 64-bit arithmetic instead of 32-bit")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jon Maloy [Fri, 6 Jul 2018 13:22:36 +0000 (15:22 +0200)]
tipc: extend link reset criteria for stale packet retransmission
Currently a link is declared stale and reset if there has been 100
repeated attempts to retransmit the same packet. However, in certain
infrastructures we see that packet (NACK) duplicates and delays may
cause such retransmit attempts to occur at a high rate, so that the
peer doesn't have a reasonable chance to acknowledge the reception
before the 100-limit is hit. This may take much less than the
stipulated link tolerance time, and despite that probe/probe replies
otherwise go through as normal.
We now extend the criteria for link reset to also being time based.
I.e., we don't reset the link until the link tolerance time is passed
AND we have made 100 retransmissions attempts.
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 7 Jul 2018 11:51:53 +0000 (20:51 +0900)]
Merge branch 'Introduce-matching-on-double-vlan-QinQ-headers-for-TC-flower'
Jianbo Liu says:
====================
Introduce matching on double vlan/QinQ headers for TC flower
Currently TC flower supports only one vlan tag, it doesn't match on both outer
and inner vlan headers for QinQ. To do this, we add support to get both outer
and inner vlan headers for flow dissector, and then TC flower do matching on
those information.
We also plan to extend TC command to support this feature. We add new
cvlan_id/cvlan_prio/cvlan_ethtype keywords for inner vlan header. The existing
vlan_id/vlan_prio/vlan_ethtype are for outer vlan header, and vlan_ethtype must
be 802.1q or 802.1ad.
The examples for command and output are as the following.
flower vlan_id 1000 vlan_ethtype 802.1q \
cvlan_id 100 cvlan_ethtype ipv4 \
action vlan pop \
action vlan pop \
action mirred egress redirect dev ens1f1_0
filter protocol 802.1ad pref 33 flower chain 0
filter protocol 802.1ad pref 33 flower chain 0 handle 0x1
vlan_id 1000
vlan_ethtype 802.1Q
cvlan_id 100
cvlan_ethtype ip
eth_type ipv4
in_hw
...
v2:
fix sparse warning.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Jianbo Liu [Fri, 6 Jul 2018 05:38:16 +0000 (05:38 +0000)]
net/sched: flower: Add supprt for matching on QinQ vlan headers
As support dissecting of QinQ inner and outer vlan headers, user can
add rules to match on QinQ vlan headers.
Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jianbo Liu [Fri, 6 Jul 2018 05:38:15 +0000 (05:38 +0000)]
net/sched: flower: Dump the ethertype encapsulated in vlan
Currently the encapsulated ethertype is not dumped as it's the same as
TCA_FLOWER_KEY_ETH_TYPE keyvalue. But the dumping result is inconsistent
with input, we add dumping it with TCA_FLOWER_KEY_VLAN_ETH_TYPE.
Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jianbo Liu [Fri, 6 Jul 2018 05:38:14 +0000 (05:38 +0000)]
net/flow_dissector: Add support for QinQ dissection
Dissect the QinQ packets to get both outer and inner vlan information,
then store to the extended flow keys.
Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jianbo Liu [Fri, 6 Jul 2018 05:38:13 +0000 (05:38 +0000)]
net/sched: flower: Add support for matching on vlan ethertype
As flow dissector stores vlan ethertype, tc flower now can match on that.
It is to make preparation for supporting QinQ.
Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jianbo Liu [Fri, 6 Jul 2018 05:38:12 +0000 (05:38 +0000)]
net/flow_dissector: Save vlan ethertype from headers
Change vlan dissector key to save vlan tpid to support both 802.1Q
and 802.1AD ethertype.
Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Sat, 7 Jul 2018 11:27:30 +0000 (12:27 +0100)]
farsync: remove redundant variable txq_length
Variable txq_length is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'txq_length' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 7 Jul 2018 11:29:34 +0000 (20:29 +0900)]
Merge branch 'Add-a-mlxsw-specific-test-for-mirror-to-gretap'
Petr Machata says:
====================
Add a mlxsw-specific test for mirror-to-gretap
Some configurations of mirror-to-gretap are impossible for mlxsw to
offload. Add a test that checks that these out-of-domain conditions are
handled properly by mlxsw.
In patch #1, fix mirror_gre_lib.sh and mirror_gre_topo_lib.sh so that
they can be imported from directories other than forwarding/.
In patch #2, add a test to check handling of several scenarios that
mlxsw is expected to fail to offload.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Thu, 5 Jul 2018 19:09:04 +0000 (21:09 +0200)]
selftests: mlxsw: Add mlxsw-specific test for mirror to gretap
Test several aspects of offloading mirror to gretap and ip6gretap
netdevices that are specific to mlxsw, such as requirements for TTL and
TOS values.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Thu, 5 Jul 2018 19:10:59 +0000 (21:10 +0200)]
selftests: forwarding: Allow importing dependent libraries
The next patch introduces a new mlxsw-specific test that uses
mirror_gre_lib.sh and mirror_gre_topo_lib.sh.
However when sourcing their own deps, these libraries assume that the
test that's running is in the same directory. That's not the case for
driver-specific tests.
So change the libraries to source their deps through $relative_path.
That variable is set up by lib.sh, which should be imported by the test
in question in any case.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 7 Jul 2018 11:20:46 +0000 (20:20 +0900)]
Merge branch 'vxlan-fix-default-fdb-entry-user-space-notify-ordering-race'
Roopa Prabhu says:
====================
vxlan: fix default fdb entry user-space notify ordering/race
Problem:
In vxlan_newlink, a default fdb entry is added before register_netdev.
The default fdb creation function notifies user-space of the
fdb entry on the vxlan device which user-space does not know about yet.
(RTM_NEWNEIGH goes before RTM_NEWLINK for the same ifindex).
This series fixes the user-space netlink notification ordering issue
with the following changes:
- decouple fdb notify from fdb create.
- Move fdb notify after register_netdev.
- modify rtnl_configure_link to allow configuring a link early.
- Call rtnl_configure_link in vxlan newlink handler to notify
userspace about the newlink before fdb notify and
hence avoiding the user-space race.
====================
Fixes: afbd8bae9c79 ("vxlan: add implicit fdb entry for default destination")
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Roopa Prabhu [Wed, 4 Jul 2018 23:46:32 +0000 (16:46 -0700)]
vxlan: fix default fdb entry netlink notify ordering during netdev create
Problem:
In vxlan_newlink, a default fdb entry is added before register_netdev.
The default fdb creation function also notifies user-space of the
fdb entry on the vxlan device which user-space does not know about yet.
(RTM_NEWNEIGH goes before RTM_NEWLINK for the same ifindex).
This patch fixes the user-space netlink notification ordering issue
with the following changes:
- decouple fdb notify from fdb create.
- Move fdb notify after register_netdev.
- Call rtnl_configure_link in vxlan newlink handler to notify
userspace about the newlink before fdb notify and
hence avoiding the user-space race.
Fixes: afbd8bae9c79 ("vxlan: add implicit fdb entry for default destination")
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Roopa Prabhu [Wed, 4 Jul 2018 23:46:31 +0000 (16:46 -0700)]
vxlan: make netlink notify in vxlan_fdb_destroy optional
Add a new option do_notify to vxlan_fdb_destroy to make
sending netlink notify optional. Used by a later patch.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Roopa Prabhu [Wed, 4 Jul 2018 23:46:30 +0000 (16:46 -0700)]
vxlan: add new fdb alloc and create helpers
- Add new vxlan_fdb_alloc helper
- rename existing vxlan_fdb_create into vxlan_fdb_update:
because it really creates or updates an existing
fdb entry
- move new fdb creation into a separate vxlan_fdb_create
Main motivation for this change is to introduce the ability
to decouple vxlan fdb creation and notify, used in a later patch.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Roopa Prabhu [Wed, 4 Jul 2018 23:46:29 +0000 (16:46 -0700)]
rtnetlink: add rtnl_link_state check in rtnl_configure_link
rtnl_configure_link sets dev->rtnl_link_state to
RTNL_LINK_INITIALIZED and unconditionally calls
__dev_notify_flags to notify user-space of dev flags.
current call sequence for rtnl_configure_link
rtnetlink_newlink
rtnl_link_ops->newlink
rtnl_configure_link (unconditionally notifies userspace of
default and new dev flags)
If a newlink handler wants to call rtnl_configure_link
early, we will end up with duplicate notifications to
user-space.
This patch fixes rtnl_configure_link to check rtnl_link_state
and call __dev_notify_flags with gchanges = 0 if already
RTNL_LINK_INITIALIZED.
Later in the series, this patch will help the following sequence
where a driver implementing newlink can call rtnl_configure_link
to initialize the link early.
makes the following call sequence work:
rtnetlink_newlink
rtnl_link_ops->newlink (vxlan) -> rtnl_configure_link (initializes
link and notifies
user-space of default
dev flags)
rtnl_configure_link (updates dev flags if requested by user ifm
and notifies user-space of new dev flags)
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Arnd Bergmann [Fri, 6 Jul 2018 12:58:51 +0000 (14:58 +0200)]
devlink: fix incorrect return statement
A newly added dummy helper function tries to return a failure from a "void"
function:
In file included from include/net/dsa.h:24,
from arch/arm/plat-orion/common.c:21:
include/net/devlink.h: In function 'devlink_param_value_changed':
include/net/devlink.h:771:9: error: 'return' with a value, in function returning void [-Werror]
return -EOPNOTSUPP;
This fixes it by removing the bogus statement.
Fixes: ea601e170988 ("devlink: Add devlink notifications support for params")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Arnd Bergmann [Fri, 6 Jul 2018 12:44:45 +0000 (14:44 +0200)]
mlxsw: spectrum_router: avoid uninitialized variable access
When CONFIG_BRIDGE_VLAN_FILTERING is disabled, gcc correctly points out
that the 'vid' variable is uninitialized whenever br_vlan_get_pvid
returns an error:
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c: In function 'mlxsw_sp_rif_vlan_fid_get':
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:6881:6: error: 'vid' may be used uninitialized in this function [-Werror=maybe-uninitialized]
This changes the condition check to always return -EINVAL here,
which I guess is what the author intended here.
Fixes: e6f1960ae6c7 ("mlxsw: spectrum_router: Allocate FID according to PVID")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 7 Jul 2018 02:13:07 +0000 (11:13 +0900)]
Merge branch 'hns3-misc-fixes'
Salil Mehta says:
====================
Misc. bug fixes & cleanups for HNS3 driver
This patch-set presents some miscellaneous bug fixes and cleanups
for the HNS3 driver.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Huazhong Tan [Fri, 6 Jul 2018 10:28:04 +0000 (11:28 +0100)]
net: hns3: Prevent sending command during global or core reset
According to hardware's description, driver should not send command to
IMP while hardware doing global or core reset.
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Peng Li [Fri, 6 Jul 2018 10:28:03 +0000 (11:28 +0100)]
net: hns3: Remove the warning when clear reset cause
Only the core/global/IMP reset need clear cause, other type does not
need do it. The warning may be treated as error as it is normal. This
patch removes the warning.
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Fri, 6 Jul 2018 10:28:02 +0000 (11:28 +0100)]
net: hns3: Fix get_vector ops in hclgevf_main module
The hclgevf_free_vector function expects the caller to pass
the vector_id to it, and hclgevf_put_vector pass vector to
it now, which will cause vector allocation problem.
This patch fixes it by converting vector into vector_id before
calling hclgevf_free_vector.
Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Fri, 6 Jul 2018 10:28:01 +0000 (11:28 +0100)]
net: hns3: Fix warning bug when doing lp selftest
The napi_alloc_skb is excepted to be called under the
non-preemptible code path when it is called by hns3_clean_rx_ring
during loopback selftest, otherwise the below warning will be
logged:
[ 92.420780] BUG: using smp_processor_id() in preemptible
[
00000000] code: ethtool/1873
<SNIP>
[ 92.463202] check_preemption_disabled+0xf8/0x100
[ 92.467893] debug_smp_processor_id+0x1c/0x28
[ 92.472239] __napi_alloc_skb+0x30/0x130
[ 92.476158] hns3_clean_rx_ring+0x118/0x5f0 [hns3]
[ 92.480941] hns3_self_test+0x32c/0x4d0 [hns3]
[ 92.485375] ethtool_self_test+0xdc/0x1e8
[ 92.489372] dev_ethtool+0x1020/0x1da8
[ 92.493109] dev_ioctl+0x188/0x3a0
[ 92.496499] sock_do_ioctl+0xf4/0x208
[ 92.500148] sock_ioctl+0x228/0x3e8
[ 92.503626] do_vfs_ioctl+0xc4/0x880
[ 92.507189] SyS_ioctl+0x94/0xa8
[ 92.510404] el0_svc_naked+0x30/0x34
This patch fix it by disabling preemption when calling
hns3_clean_rx_ring during loopback selftest.
Fixes: c39c4d98dc65 ("net: hns3: Add mac loopback selftest support in hns3 driver")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jian Shen [Fri, 6 Jul 2018 10:28:00 +0000 (11:28 +0100)]
net: hns3: Add configure for mac minimal frame size
When change the mtu, the minimal frame size of mac will be set
to zero, it is incorrect. This patch fixes it by set it to the
default value.
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fuyun Liang [Fri, 6 Jul 2018 10:27:59 +0000 (11:27 +0100)]
net: hns3: Fix for mailbox message truncated problem
The payload of mailbox message is 16 byte and the value of
HCLGE_MBX_MAX_ARQ_MSG_SIZE is 8. A message truncated problem will
happen when mailbox message is converted to ARQ message. This patch
replaces HCLGE_MBX_MAX_ARQ_MSG_SIZE with the size of ARQ message in
hclgevf_mbx_handler to fix this problem.
Fixes: b11a0bb231f3 ("net: hns3: Add mailbox support to VF driver")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Fri, 6 Jul 2018 10:27:58 +0000 (11:27 +0100)]
net: hns3: Fix for l4 checksum offload bug
Hardware only support tcp/udp/sctp l4 checksum offload, but
the driver currently tell hardware to do l4 checksum offlad when
l3 is IPv4 or IPv6, which may cause checksumm error.
This patch fixes it by only enabling the l4 offload when l4 is
tcp/udp/sctp.
Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Fri, 6 Jul 2018 10:27:57 +0000 (11:27 +0100)]
net: hns3: Fix for waterline not setting correctly
The HCLGE_RX_PRIV_EN_B is used to tell the firmware whether
to update the specific waterline value, if the is not set,
the firmware will ignore the value.
This patch fixes by setting the HCLGE_RX_PRIV_EN_B even if
the updated value is zero.
Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Fri, 6 Jul 2018 10:27:56 +0000 (11:27 +0100)]
net: hns3: Fix for mac pause not disable in pfc mode
When pfc pause mode is enable, the mac pause mode need to be
disabled, otherwise the pfc pause packet will not be sent when
congestion happens.
This patch fixes by disabling the mac pause when pfc pause is
enabled.
Fixes: 848440544b41 ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Fri, 6 Jul 2018 10:27:55 +0000 (11:27 +0100)]
net: hns3: Fix tc setup when netdev is first up
Currently, tc related configuration is not setup when the
netdev is first up, which cause the stack only using tc 0
problem.
This patch fixes it by setting the tc related configuration
using the info from NCL_CONFIG when netdev is first up.
Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Rick Farrington [Fri, 6 Jul 2018 18:27:07 +0000 (11:27 -0700)]
liquidio: fix kernel panic when NIC firmware is older than 1.7.2
Pre-1.7.2 NIC firmware does not support (and does not respond to) the "get
speed" command which is sent by the 1.7.2 driver (for CN23XX-225 cards
only) during modprobe. Due to a bug in older firmware (with respect to
unknown commands), this unsupported command causes a cascade of errors that
ends in a kernel panic.
Fix it by making the sending of the "get speed" command conditional on the
firmware version.
Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 7 Jul 2018 01:58:50 +0000 (10:58 +0900)]
Merge branch 'sock-cookie-initializers'
Willem de Bruijn says:
====================
sock cookie initializers
Recent UDP GSO and SO_TXTIME features added new fields to cookie
structs.
When adding a field, all sites where a struct is initialized have to
be updated, which is a lot of boilerplate. Alternatively, a field can
be initialized selectively, but this is fragile. I introduced a bug
in udp gso where an uninitialized field was read. See also fix commit
("
9887cba19978 ip: limit use of gso_size to udp").
Introduce initializers for structs ipcm(6)_cookie and sockc_cookie.
patch 1..3 do exactly this.
patch 4..5 make ipv4 and ipv6 handle cookies the same way and
remove some boilerplate in doing so.
patch 6 removes the udp gso branch that needed the above fix
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Willem de Bruijn [Fri, 6 Jul 2018 14:12:59 +0000 (10:12 -0400)]
ip: unconditionally set cork gso_size
Now that ipc(6)->gso_size is correctly initialized in all callers of
ip(6)_setup_cork, it is safe to unconditionally pass it to the cork.
Link: http://lkml.kernel.org/r/20180619164752.143249-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Willem de Bruijn [Fri, 6 Jul 2018 14:12:58 +0000 (10:12 -0400)]
ip: remove tx_flags from ipcm_cookie and use same logic for v4 and v6
skb_shinfo(skb)->tx_flags is derived from sk->sk_tsflags, possibly
after modification by __sock_cmsg_send, by calling sock_tx_timestamp.
The IPv4 and IPv6 paths do this conversion differently. In IPv4, the
individual protocols that support tx timestamps call this function
and store the result in ipc.tx_flags. In IPv6, sock_tx_timestamp is
called in __ip6_append_data.
There is no need to store both tx_flags and ts_flags in the cookie
as one is derived from the other. Convert when setting up the cork
and remove the redundant field. This is similar to IPv6, only have
the conversion happen only once per datagram, in ip(6)_setup_cork.
Also change __ip6_append_data to match __ip_append_data. Only update
tskey if timestamping is enabled with OPT_ID. The SOCK_.. test is
redundant: only valid protocols can have non-zero cork->tx_flags.
After this change the IPv4 and IPv6 logic is the same.
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Willem de Bruijn [Fri, 6 Jul 2018 14:12:57 +0000 (10:12 -0400)]
ipv6: fold sockcm_cookie into ipcm6_cookie
ipcm_cookie includes sockcm_cookie. Do the same for ipcm6_cookie.
This reduces the number of arguments that need to be passed around,
applies ipcm6_init to all cookie fields at once and reduces code
differentiation between ipv4 and ipv6.
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Willem de Bruijn [Fri, 6 Jul 2018 14:12:56 +0000 (10:12 -0400)]
sock: sockc cookie initializer
Initialize the cookie in one location to reduce code duplication and
avoid bugs from inconsistent initialization, such as that fixed in
commit
9887cba19978 ("ip: limit use of gso_size to udp").
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Willem de Bruijn [Fri, 6 Jul 2018 14:12:55 +0000 (10:12 -0400)]
ipv6: ipcm6_cookie initializer
Initialize the cookie in one location to reduce code duplication and
avoid bugs from inconsistent initialization, such as that fixed in
commit
9887cba19978 ("ip: limit use of gso_size to udp").
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Willem de Bruijn [Fri, 6 Jul 2018 14:12:54 +0000 (10:12 -0400)]
ipv4: ipcm_cookie initializers
Initialize the cookie in one location to reduce code duplication and
avoid bugs from inconsistent initialization, such as that fixed in
commit
9887cba19978 ("ip: limit use of gso_size to udp").
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 6 Jul 2018 02:19:08 +0000 (11:19 +0900)]
Merge branch 'IP-listification-follow-ups'
Edward Cree says:
====================
IP listification follow-ups
While working on IPv6 list processing, I found another bug in the IPv4
version. So this patch series has that fix, and the IPv6 version with
both fixes incorporated.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Edward Cree [Thu, 5 Jul 2018 14:49:42 +0000 (15:49 +0100)]
net: ipv6: listify ipv6_rcv() and ip6_rcv_finish()
Essentially the same as the ipv4 equivalents.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Edward Cree [Thu, 5 Jul 2018 14:47:39 +0000 (15:47 +0100)]
net: ipv4: fix list processing on L3 slave devices
If we have an L3 master device, l3mdev_ip_rcv() will steal the skb, but
we were returning NET_RX_SUCCESS from ip_rcv_finish_core() which meant
that ip_list_rcv_finish() would keep it on the list. Instead let's
move the l3mdev_ip_rcv() call into the caller, so that our response to
a steal can be different in the single packet path (return
NET_RX_SUCCESS) and the list path (forget this packet and continue).
Fixes: 5fa12739a53d ("net: ipv4: listify ip_rcv_finish")
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gustavo A. R. Silva [Wed, 4 Jul 2018 22:34:37 +0000 (17:34 -0500)]
net: core: filter: mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Warning level 2 was used: -Wimplicit-fallthrough=2
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gustavo A. R. Silva [Wed, 4 Jul 2018 22:05:00 +0000 (17:05 -0500)]
net: decnet: dn_nsp_in: mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gustavo A. R. Silva [Wed, 4 Jul 2018 21:13:59 +0000 (16:13 -0500)]
tipc: mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Warning level 2 was used: -Wimplicit-fallthrough=2
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ganesh Goudar [Wed, 4 Jul 2018 12:19:33 +0000 (17:49 +0530)]
cxgb4: Fix the condition to check if the card is T5
Use 'chip_ver' rather than 'chip' to check if the card
is T5.
Fixes: e8d452923ae6 ("cxgb4: clean up init_one")
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Thu, 5 Jul 2018 11:05:25 +0000 (12:05 +0100)]
net: ethernet: sun: remove redundant variables adv and lpa and mii_reads
Variables adv and lpa are being assigned but are never used hence they
are redundant and can be removed. Also remove the unncessary mii_reads
too.
Cleans up clang warnings:
warning: variable 'lpa' set but not used [-Wunused-but-set-variable]
warning: variable 'adv' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 5 Jul 2018 11:05:55 +0000 (20:05 +0900)]
Merge branch 'net-ethernet-Miscellaneous-Kconfig-and-Makefile-cleanups'
Geert Uytterhoeven says:
====================
net: ethernet: Miscellaneous Kconfig and Makefile cleanups
This patch series contains a few Kconfig and Makefile cleanups w.r.t.
Ethernet vendors.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Geert Uytterhoeven [Wed, 4 Jul 2018 11:50:13 +0000 (13:50 +0200)]
net: ethernet: sfc: Make subdir logic consistent with other vendors
Both SFC and SFC_FALCON depend on NET_VENDOR_SOLARFLARE, hence use the
latter to decide whether to descend into the sfc subdirectory.
Move the rule to descend into sfc/falcon to the sfc subdirectory.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Martin Habets <mhabets@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geert Uytterhoeven [Wed, 4 Jul 2018 11:50:12 +0000 (13:50 +0200)]
net: ethernet: Add missing VENDOR to Cadence and Packet Engines symbols
The vendor guard Kconfig symbols for Cadence and Packet Engines use a
"NET_" prefix, while all other vendor guards use a "NET_VENDOR_"
prefix. Hence make them consistent with the rest, and add the missing
trailing "S" for Packet Engines while at it.
As these options don't directly affect the kernel build, and default to
"y", this change has no impact on kernels built with existing
(def)configs.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geert Uytterhoeven [Wed, 4 Jul 2018 11:50:11 +0000 (13:50 +0200)]
net: ethernet: Make NET_VENDOR_AURORA default to yes
Enabling NET_VENDOR_* Kconfig options does not directly affect the
kernel build. Hence NET_VENDOR_AURORA should default to yes, like other
NET_VENDOR_* options.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 11:45:53 +0000 (12:45 +0100)]
qlogic: netxen: remove various redundant variables
Variables consumer, cmd_desc, end_cnt and no_of_desc are being assigned
but are never used hence they are redundant and can be removed.
Cleans up clang warnings:
warning: variable 'consumer' set but not used [-Wunused-but-set-variable]
warning: variable 'cmd_desc' set but not used [-Wunused-but-set-variable]
warning: variable 'end_cnt' set but not used [-Wunused-but-set-variable]
warning: variable 'no_of_desc' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 5 Jul 2018 10:58:36 +0000 (19:58 +0900)]
Merge branch 'devlink-Add-configuration-parameters-support'
Moshe Shemesh says:
====================
Add configuration parameters support
Add configuration parameters setting through devlink.
Each device registers supported configuration parameters table.
Each parameter can be either generic or driver specific.
The user can retrieve data on these parameters by "devlink param show"
command and can set new value to a parameter by "devlink param set"
command.
The parameters can be set in different configuration modes:
runtime - set while driver is running, no reset required.
driverinit - applied while driver initializes, requires restart
driver by devlink reload command.
permanent - written to device's non-volatile memory, hard reset required.
The patches at the end of the patchset introduce few params that are using
the introduced infrastructure on mlx4 and bnxt.
Command examples and output:
pci/0000:81:00.0:
name internal_error_reset type generic
values:
cmode runtime value true
cmode driverinit value true
name max_macs type generic
values:
cmode driverinit value 128
name enable_64b_cqe_eqe type driver-specific
values:
cmode driverinit value true
name enable_4k_uar type driver-specific
values:
cmode driverinit value false
pci/0000:81:00.0:
name internal_error_reset type generic
values:
cmode runtime value false
cmode driverinit value true
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Vasundhara Volam [Wed, 4 Jul 2018 11:30:37 +0000 (14:30 +0300)]
bnxt_en: Add bnxt_en initial params table and register it.
Create initial devlink parameters table for bnxt_en.
Table consists of a permanent generic parameter.
enable_sriov - Enables Single-Root Input/Output Virtualization(SR-IOV)
characteristic of the device.
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vasundhara Volam [Wed, 4 Jul 2018 11:30:36 +0000 (14:30 +0300)]
devlink: Add enable_sriov boolean generic parameter
enable_sriov - Enables Single-Root Input/Output Virtualization(SR-IOV)
characteristic of the device.
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Moshe Shemesh [Wed, 4 Jul 2018 11:30:35 +0000 (14:30 +0300)]
mlx4: Add support for devlink reload and load driverinit values
Add mlx4_devlink_reload() to support devlink reload operation.
Add mlx4_devlink_param_load_driverinit_values() to load values which
were set using driverinit configuration mode.
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Moshe Shemesh [Wed, 4 Jul 2018 11:30:34 +0000 (14:30 +0300)]
mlx4: Add mlx4 initial parameters table and register it
Create initial parameters table for mlx4.
The table consists of two generic parameters and two driver-specific
parameters.
Generic:
internal_err_reset - Enable reset device on internal errors. This
parameter can be configured on mlx4 either on runtime or during driver
initialization.
max_macs - Max number of MACs per ETH port. For mlx4 this parameter
value range is between 1 and 128. This parameter can be configured on
mlx4 only during driver initialization.
Driver specific:
enable_64b_cqe_eqe - Enable 64 byte CQEs/EQEs when the FW supports it.
This parameter can be configured on mlx4 only during driver
initialization.
enable_4k_uar - Enable using 4K UAR. This parameter can be configured on
mlx4 only during driver initialization.
Register the parameters table on mlx4_init_one() and unregister on
mlx4_remove_one().
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Moshe Shemesh [Wed, 4 Jul 2018 11:30:33 +0000 (14:30 +0300)]
devlink: Add generic parameters internal_err_reset and max_macs
Add 2 first generic parameters to devlink configuration parameters set:
internal_err_reset - When set enables reset device on internal errors.
max_macs - max number of MACs per ETH port.
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Moshe Shemesh [Wed, 4 Jul 2018 11:30:32 +0000 (14:30 +0300)]
devlink: Add devlink notifications support for params
Add devlink_param_notify() function to support devlink param notifications.
Add notification call to devlink param set, register and unregister
functions.
Add devlink_param_value_changed() function to enable the driver notify
devlink on value change. Driver should use this function after value was
changed on any configuration mode part to driverinit.
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Moshe Shemesh [Wed, 4 Jul 2018 11:30:31 +0000 (14:30 +0300)]
devlink: Add support for get/set driverinit value
"driverinit" configuration mode value is held by devlink to enable
the driver query the value after reload. Two additional functions
added to help the driver get/set the value from/to devlink:
devlink_param_driverinit_value_set() and
devlink_param_driverinit_value_get().
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Moshe Shemesh [Wed, 4 Jul 2018 11:30:30 +0000 (14:30 +0300)]
devlink: Add param set command
Add param set command to set value for a parameter.
Value can be set to any of the supported configuration modes.
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Moshe Shemesh [Wed, 4 Jul 2018 11:30:29 +0000 (14:30 +0300)]
devlink: Add param get command
Add param get command which gets data per parameter.
Option to dump the parameters data per device.
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Moshe Shemesh [Wed, 4 Jul 2018 11:30:28 +0000 (14:30 +0300)]
devlink: Add devlink_param register and unregister
Define configuration parameters data structure.
Add functions to register and unregister the driver supported
configuration parameters table.
For each parameter registered, the driver should fill all the parameter's
fields. In case the only supported configuration mode is "driverinit"
the parameter's get()/set() functions are not required and should be set
to NULL, for any other configuration mode, these functions are required
and should be set by the driver.
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Thu, 5 Jul 2018 10:11:07 +0000 (11:11 +0100)]
net/hamradio/6pack: remove redundant variable channel
Variable channel is being assigned but is never used hence it is
redundant and can be removed.
Cleans up two clang warnings:
warning: variable 'channel' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Thu, 5 Jul 2018 10:05:32 +0000 (11:05 +0100)]
fjes: use currently unused variable my_epid and max_epid
Variables my_epid and max_epid are currently assigned and not being
used - however, I suspect they were intended to be used in the for-loops
to reduce the dereferencing of hw. Replace hw->my_epid and hw->max_epid
with these variables.
Cleans up clang warnings:
warning: variable 'my_epid' set but not used [-Wunused-but-set-variable]
variable 'max_epid' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Thu, 5 Jul 2018 09:55:49 +0000 (10:55 +0100)]
net: tehuti: remove redundant pointer skb
Pointer skb is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'skb' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Thu, 5 Jul 2018 09:26:13 +0000 (10:26 +0100)]
net: socionext: remove redundant pointer ndev
Pointer ndev is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'ndev' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Wei Yongjun [Thu, 5 Jul 2018 09:00:10 +0000 (09:00 +0000)]
net: aquantia: Make some functions static
Fixes the following sparse warnings:
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:525:5: warning:
symbol 'hw_atl_utils_mpi_set_speed' was not declared. Should it be static?
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:536:5: warning:
symbol 'hw_atl_utils_mpi_set_state' was not declared. Should it be static?
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Wei Yongjun [Thu, 5 Jul 2018 08:59:09 +0000 (08:59 +0000)]
net: dsa: vsc73xx: Make some functions static
Fixes the following sparse warnings:
drivers/net/dsa/vitesse-vsc73xx.c:1054:6: warning:
symbol 'vsc73xx_get_strings' was not declared. Should it be static?
drivers/net/dsa/vitesse-vsc73xx.c:1113:5: warning:
symbol 'vsc73xx_get_sset_count' was not declared. Should it be static?
drivers/net/dsa/vitesse-vsc73xx.c:1122:6: warning:
symbol 'vsc73xx_get_ethtool_stats' was not declared. Should it be static?
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Thu, 5 Jul 2018 08:30:04 +0000 (09:30 +0100)]
net: dsa: fix spelling mistake "waitting" -> "waiting"
Trivial fix to spelling mistake in dev_err error message.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Li RongQing [Thu, 5 Jul 2018 06:34:32 +0000 (14:34 +0800)]
net: limit each hash list length to MAX_GRO_SKBS
After commit
07d78363dcff ("net: Convert NAPI gro list into a small hash
table.")' there is 8 hash buckets, which allows more flows to be held for
merging. but MAX_GRO_SKBS, the total held skb for merging, is 8 skb still,
limit the hash table performance.
keep MAX_GRO_SKBS as 8 skb, but limit each hash list length to 8 skb, not
the total 8 skb
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Heiner Kallweit [Wed, 4 Jul 2018 19:11:29 +0000 (21:11 +0200)]
r8169: fix runtime suspend
When runtime-suspending we configure WoL w/o touching saved_wolopts.
If saved_wolopts == 0 we would power down the PHY in this case what's
wrong. Therefore we have to check the actual chip WoL settings here.
Fixes: 433f9d0ddcc6 ("r8169: improve saved_wolopts handling")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Edward Cree [Wed, 4 Jul 2018 18:23:50 +0000 (19:23 +0100)]
net: ipv4: fix drop handling in ip_list_rcv() and ip_list_rcv_finish()
Since callees (ip_rcv_core() and ip_rcv_finish_core()) might free or steal
the skb, we can't use the list_cut_before() method; we can't even do a
list_del(&skb->list) in the drop case, because skb might have already been
freed and reused.
So instead, take each skb off the source list before processing, and add it
to the sublist afterwards if it wasn't freed or stolen.
Fixes: 5fa12739a53d net: ipv4: listify ip_rcv_finish
Fixes: 17266ee93984 net: ipv4: listified version of ip_rcv
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Casey Leedom [Wed, 4 Jul 2018 09:42:56 +0000 (15:12 +0530)]
cxgb4: Add support to read actual provisioned resources
In highly constrained resources environments (like the 124VF
T5 and 248VF T6 configurations), PF4 may not have very many
resources at all and we need to adapt to whatever we've been
allocated, this patch adds support to get the provisioned
resources.
Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 12:19:29 +0000 (13:19 +0100)]
epic100: remove redundant variable 'irq'
Variable 'irq' is being assigned but is never used hence it is
and can be removed.
Cleans up clang warning:
warning: variable 'irq' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 12:13:01 +0000 (13:13 +0100)]
sfc: remove redundant variable old_vlan
Variable old_vlan is being assigned but is never used hence it is
and can be removed.
Cleans up clang warning:
warning: variable 'old_vlan' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 12:06:26 +0000 (13:06 +0100)]
qed: remove redundant pointer 'name'
Pointer 'name' is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'name' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 11:20:44 +0000 (12:20 +0100)]
ethernet: micrel: remove redundant pointer 'info'
Pointer 'info' is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'info' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 08:06:27 +0000 (09:06 +0100)]
net: hinic: remove redundant pointer pfhwdev
Pointer pfhwdev is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'pfhwdev' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 07:59:25 +0000 (08:59 +0100)]
net: hns3: remove redundant variable 'protocol'
Variable 'protocol' is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'protocol' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 07:54:55 +0000 (08:54 +0100)]
net: ethernet: gianfar_ethtool: remove redundant variable last_rule_idx
Variable last_rule_idx is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'last_rule_idx' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 07:49:43 +0000 (08:49 +0100)]
net: fec: remove redundant variable 'inc'
Variable 'inc' is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'inc' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 07:39:12 +0000 (08:39 +0100)]
cnic: remove redundant pointer req and variable func
Pointer req and variable func are being assigned but are never used
hence they are redundant and can be removed.
Cleans up clang warnings:
warning: variable 'req' set but not used [-Wunused-but-set-variable]
warning: variable 'func' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 07:30:43 +0000 (08:30 +0100)]
net: bgmac: remove redundant variable 'freed'
Variable 'freed' is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'freed' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 07:20:20 +0000 (08:20 +0100)]
net: ethernet: nb8800: remove redundant pointer rxd
Pointer rxd is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'rxb' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 07:15:30 +0000 (08:15 +0100)]
net: alx: remove redundant variable old_duplex
Variable old_duplex is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'old_duplex' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 07:01:35 +0000 (08:01 +0100)]
net: alteon: acenic: remove redundant pointer rxdesc
Pointer rxdesc is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'rxdesc' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 4 Jul 2018 06:54:36 +0000 (07:54 +0100)]
net: dsa: bcm_sf2: remove redundant variable off
Variable 'off' is being assigned but is never used hence it is
redundant and can be removed.
Cleans up clang warning:
warning: variable 'off' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 4 Jul 2018 13:30:28 +0000 (22:30 +0900)]
Merge branch 'Scheduled-packet-Transmission-ETF'
Jesus Sanchez-Palencia says:
====================
Scheduled packet Transmission: ETF
Changes since v1:
- moved struct sock_txtime from socket.h to uapi net_tstamp.h;
- sk_clockid was changed from u16 to u8;
- sk_txtime_flags was changed from u16 to a u8 bit field in struct sock;
- the socket option flags are now validated in sock_setsockopt();
- added SO_EE_ORIGIN_TXTIME;
- sockc.transmit_time is now initialized from all IPv4 Tx paths;
- added support for the IPv6 Tx path;
Overview
========
This work consists of a set of kernel interfaces that can be used by
applications that require (time-based) Scheduled Tx of packets.
It is comprised by 3 new components to the kernel:
- SO_TXTIME: socket option + cmsg programming interfaces.
- etf: the "earliest txtime first" qdisc, that provides per-queue
TxTime-based scheduling. This has been renamed from 'tbs' to
'etf' to better describe its functionality.
- taprio: the "time-aware priority scheduler" qdisc, that provides
per-port Time-Aware scheduling;
This patchset is providing the first 2 components, which have been
developed for longer. The taprio qdisc will be shared as an RFC separately
(shortly).
Note that this series is a follow up of the "Time based packet
transmission" RFCv3 [1].
etf (formerly known as 'tbs')
=============================
For applications/systems that the concept of time slices isn't precise
enough, the etf qdisc allows applications to control the instant when
a packet should leave the network controller. When used in conjunction
with taprio, it can also be used in case the application needs to
control with greater guarantee the offset into each time slice a packet
will be sent. Another use case of etf, is when only a small number of
applications on a system are time sensitive, so it can then be used
with a more traditional root qdisc (like mqprio).
The etf qdisc is designed so it buffers packets until a configurable
time before their deadline (Tx time). The qdisc uses a rbtree internally
so the buffered packets are always 'ordered' by their txtime (deadline)
and will be dequeued following the earliest txtime first.
It relies on the SO_TXTIME API set for receiving the per-packet timestamp
(txtime) as well as the config flags for each socket: the clockid to be
used as a reference, if the expected mode of txtime for that socket is
deadline or strict mode, and if packet drops should be reported on the
socket's error queue or not.
The qdisc will drop any packets with a Tx time in the past, or if a
packet expires while waiting for being dequeued. Drops can be reported
as errors back to userspace through the socket's error queue.
Example configuration:
$ tc qdisc add dev enp2s0 parent 100:1 etf offload delta 200000 \
clockid CLOCK_TAI
Here, the Qdisc will use HW offload for the txtime control.
Packets will be dequeued by the qdisc "delta" (200000) nanoseconds before
their transmission time. Because this will be using HW offload and
since dynamic clocks are not supported by hrtimers, the system clock
and the PHC clock must be synchronized for this mode to behave as expected.
A more complete example can be found here, with instructions of how to
test it:
https://gist.github.com/jeez/
bd3afeff081ba64a695008dd8215866f [2]
Note that we haven't modified the qdisc so it uses a timerqueue because
the modification needed was increasing the number of cachelines of a sk_buff.
This series is also hosted on github and can be found at [3].
The companion iproute2 patches can be found at [4].
[1] https://patchwork.ozlabs.org/cover/882342/
[2] github doesn't make it clear, but the gist can be cloned like this:
$ git clone https://gist.github.com/jeez/
bd3afeff081ba64a695008dd8215866f scheduled-tx-tests
[3] https://github.com/jeez/linux/tree/etf-v2
[4] https://github.com/jeez/iproute2/tree/etf-v2
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Jesus Sanchez-Palencia [Tue, 3 Jul 2018 22:43:00 +0000 (15:43 -0700)]
net/sched: Make etf report drops on error_queue
Use the socket error queue for reporting dropped packets if the
socket has enabled that feature through the SO_TXTIME API.
Packets are dropped either on enqueue() if they aren't accepted by the
qdisc or on dequeue() if the system misses their deadline. Those are
reported as different errors so applications can react accordingly.
Userspace can retrieve the errors through the socket error queue and the
corresponding cmsg interfaces. A struct sock_extended_err* is used for
returning the error data, and the packet's timestamp can be retrieved by
adding both ee_data and ee_info fields as e.g.:
((__u64) serr->ee_data << 32) + serr->ee_info
This feature is disabled by default and must be explicitly enabled by
applications. Enabling it can bring some overhead for the Tx cycles
of the application.
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jesus Sanchez-Palencia [Tue, 3 Jul 2018 22:42:59 +0000 (15:42 -0700)]
igb: Add support for ETF offload
Implement HW offload support for SO_TXTIME through igb's Launchtime
feature. This is done by extending igb_setup_tc() so it supports
TC_SETUP_QDISC_ETF and configuring i210 so time based transmit
arbitration is enabled.
The FQTSS transmission mode added before is extended so strict
priority (SP) queues wait for stream reservation (SR) ones.
igb_config_tx_modes() is extended so it can support enabling/disabling
Launchtime following the previous approach used for the credit-based
shaper (CBS).
As the previous flow, FQTSS transmission mode is enabled automatically
by the driver once Launchtime (or CBS, as before) is enabled.
Similarly, it's automatically disabled when the feature is disabled
for the last queue that had it setup on.
The driver just consumes the transmit times from the skbuffs directly,
so no special handling is done in case an 'invalid' time is provided.
We assume this has been handled by the ETF qdisc already.
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jesus Sanchez-Palencia [Tue, 3 Jul 2018 22:42:58 +0000 (15:42 -0700)]
igb: Only call skb_tx_timestamp after descriptors are ready
Currently, skb_tx_timestamp() is being called before the Tx
descriptors are prepared in igb_xmit_frame_ring(), which happens
during either the igb_tso() or igb_tx_csum() calls.
Given that now the skb->tstamp might be used to carry the timestamp
for SO_TXTIME, we must only call skb_tx_timestamp() after the
information has been copied into the Tx descriptors.
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jesus Sanchez-Palencia [Tue, 3 Jul 2018 22:42:57 +0000 (15:42 -0700)]
igb: Refactor igb_offload_cbs()
Split code into a separate function (igb_offload_apply()) that will be
used by ETF offload implementation.
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jesus Sanchez-Palencia [Tue, 3 Jul 2018 22:42:56 +0000 (15:42 -0700)]
igb: Only change Tx arbitration when CBS is on
Currently the data transmission arbitration algorithm - DataTranARB
field on TQAVCTRL reg - is always set to CBS when the Tx mode is
changed from legacy to 'Qav' mode.
Make that configuration a bit more granular in preparation for the
upcoming Launchtime enabling patches, since CBS and Launchtime can be
enabled separately. That is achieved by moving the DataTranARB setup
to igb_config_tx_modes() instead.
Similarly, when disabling CBS we must check if it has been disabled
for all queues, and clear the DataTranARB accordingly.
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jesus Sanchez-Palencia [Tue, 3 Jul 2018 22:42:55 +0000 (15:42 -0700)]
igb: Refactor igb_configure_cbs()
Make this function retrieve what it needs from the Tx ring being
addressed since it already relies on what had been saved on it before.
Also, since this function will be used by the upcoming Launchtime
patches rename it to better reflect its intention. Note that
Launchtime is not part of what 802.1Qav specifies, but the i210
datasheet refers to this set of functionality as "Qav Transmission
Mode".
Here we also perform a tiny refactor at is_any_cbs_enabled(), and add
further documentation to igb_setup_tx_mode().
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jesus Sanchez-Palencia [Tue, 3 Jul 2018 22:42:54 +0000 (15:42 -0700)]
net/sched: Add HW offloading capability to ETF
Add infra so etf qdisc supports HW offload of time-based transmission.
For hw offload, the time sorted list is still used, so packets are
dequeued always in order of txtime.
Example:
$ tc qdisc replace dev enp2s0 parent root handle 100 mqprio num_tc 3 \
map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 0
$ tc qdisc add dev enp2s0 parent 100:1 etf offload delta 100000 \
clockid CLOCK_REALTIME
In this example, the Qdisc will use HW offload for the control of the
transmission time through the network adapter. The hrtimer used for
packets scheduling inside the qdisc will use the clockid CLOCK_REALTIME
as reference and packets leave the Qdisc "delta" (100000) nanoseconds
before their transmission time. Because this will be using HW offload and
since dynamic clocks are not supported by the hrtimer, the system clock
and the PHC clock must be synchronized for this mode to behave as
expected.
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vinicius Costa Gomes [Tue, 3 Jul 2018 22:42:53 +0000 (15:42 -0700)]
net/sched: Introduce the ETF Qdisc
The ETF (Earliest TxTime First) qdisc uses the information added
earlier in this series (the socket option SO_TXTIME and the new
role of sk_buff->tstamp) to schedule packets transmission based
on absolute time.
For some workloads, just bandwidth enforcement is not enough, and
precise control of the transmission of packets is necessary.
Example:
$ tc qdisc replace dev enp2s0 parent root handle 100 mqprio num_tc 3 \
map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 0
$ tc qdisc add dev enp2s0 parent 100:1 etf delta 100000 \
clockid CLOCK_TAI
In this example, the Qdisc will provide SW best-effort for the control
of the transmission time to the network adapter, the time stamp in the
socket will be in reference to the clockid CLOCK_TAI and packets
will leave the qdisc "delta" (100000) nanoseconds before its transmission
time.
The ETF qdisc will buffer packets sorted by their txtime. It will drop
packets on enqueue() if their skbuff clockid does not match the clock
reference of the Qdisc. Moreover, on dequeue(), a packet will be dropped
if it expires while being enqueued.
The qdisc also supports the SO_TXTIME deadline mode. For this mode, it
will dequeue a packet as soon as possible and change the skb timestamp
to 'now' during etf_dequeue().
Note that both the qdisc's and the SO_TXTIME ABIs allow for a clockid
to be configured, but it's been decided that usage of CLOCK_TAI should
be enforced until we decide to allow for other clockids to be used.
The rationale here is that PTP times are usually in the TAI scale, thus
no other clocks should be necessary. For now, the qdisc will return
EINVAL if any clocks other than CLOCK_TAI are used.
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vinicius Costa Gomes [Tue, 3 Jul 2018 22:42:52 +0000 (15:42 -0700)]
net/sched: Allow creating a Qdisc watchdog with other clocks
This adds 'qdisc_watchdog_init_clockid()' that allows a clockid to be
passed, this allows other time references to be used when scheduling
the Qdisc to run.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Richard Cochran [Tue, 3 Jul 2018 22:42:51 +0000 (15:42 -0700)]
net: packet: Hook into time based transmission.
For raw layer-2 packets, copy the desired future transmit time from
the CMSG cookie into the skb.
Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>