03 Apr, 2019
5 commits
-
Use new function genphy_read_abilities(). This allows to remove all
calls to genphy_config_init().Signed-off-by: Heiner Kallweit
Signed-off-by: David S. Miller -
Currently the genphy driver populates phydev->supported like this:
First all possible feature bits are set, then genphy_config_init()
reads the available features from the chip and remove all unsupported
features from phydev->supported. This can be simplified by using
genphy_read_abilities().Signed-off-by: Heiner Kallweit
Signed-off-by: David S. Miller -
Similar to genphy_c45_pma_read_abilities() add a function to dynamically
detect the abilities of a Clause 22 PHY. This is mainly copied from
genphy_config_init().Signed-off-by: Heiner Kallweit
Signed-off-by: David S. Miller -
We free "ct_info->ct" and then use it on the next line when we pass it
to nf_ct_destroy_timeout(). This patch swaps the order to avoid the use
after free.Fixes: 06bd2bdf19d2 ("openvswitch: Add timeout support to ct action")
Signed-off-by: Dan Carpenter
Acked-by: Yi-Hung Wei
Signed-off-by: David S. Miller -
Make tg3 behave like other drivers and let "ethtool -p" identify the
NIC even when it's in the DOWN state. Before this patch it would get an
error as follows if the NIC was down:# ip link set down dev em4
# ethtool -p em4
Cannot identify NIC: Resource temporarily unavailableWith this patch ethtool identify works regardless of whether the NIC is up
or down as it does for other drivers.Signed-off-by: Jon Maxwell
Acked-by: Michael Chan
Signed-off-by: David S. Miller
02 Apr, 2019
21 commits
-
seen with debug config:
drivers/net/macsec.c: In function 'dump_secy':
drivers/net/macsec.c:2597: warning: the frame size of 2216 bytes is larger
than 2048 bytes [-Wframe-larger-than=]just mark it with noinline_for_stack, this is netlink dump code.
v2: use 'static noinline_for_stack int' consistently
Cc: Sabrina Dubroca
Signed-off-by: Florian Westphal
Reviewed-by: Sabrina Dubroca
Signed-off-by: David S. Miller -
Florian Westphal says:
====================
net: move skb->xmit_more to percpu softnet dataEric Dumazet mentioned we could place xmit_more hint in same
spot as device xmit recursion counter, instead of using
an sk_buff flag bit.This series places xmit_recursion counter and xmit_more hint
in softnet data, filling a hole.After this, skb->xmit_more is always zero. Drivers are converted
to use "netdev_xmit_more()" helper instead.Last patch removes the skb->xmit_more flag.
====================Signed-off-by: David S. Miller
-
This is the last driver using always-0 skb->xmit_more.
Switch it to netdev_xmit_more and remove the now unused xmit_more flag
from sk_buff.Signed-off-by: Florian Westphal
Signed-off-by: David S. Miller -
skb->xmit_more hint is now always 0, this switches the sfc driver to
use the netdev_xmit_more helper instead.Cc: Solarflare linux maintainers
Cc: Edward Cree
Cc: Bert Kenward
Signed-off-by: Florian Westphal
Signed-off-by: David S. Miller -
skb->xmit_more hint is now always 0. This switches the mellanox drivers
to the netdev_xmit_more() helper.Cc: Saeed Mahameed
Cc: Leon Romanovsky
Cc: Boris Pismenny
Cc: Ilya Lesokhin
Cc: Eran Ben Elisha
Signed-off-by: Florian Westphal
Signed-off-by: David S. Miller -
There are two reasons for this.
First, the xmit_more flag conceptually doesn't fit into the skb, as
xmit_more is not a property related to the skb.
Its only a hint to the driver that the stack is about to transmit another
packet immediately.Second, it was only done this way to not have to pass another argument
to ndo_start_xmit().We can place xmit_more in the softnet data, next to the device recursion.
The recursion counter is already written to on each transmit. The "more"
indicator is placed right next to it.Drivers can use the netdev_xmit_more() helper instead of skb->xmit_more
to check the "more packets coming" hint.skb->xmit_more is retained (but always 0) to not cause build breakage.
This change takes care of the simple s/skb->xmit_more/netdev_xmit_more()/
conversions. Remaining drivers are converted in the next patches.Suggested-by: Eric Dumazet
Signed-off-by: Florian Westphal
Signed-off-by: David S. Miller -
This fills a hole in softnet data, so no change in structure size.
Also prepares for xmit_more placement in the same spot;
skb->xmit_more will be removed in followup patch.Signed-off-by: Florian Westphal
Signed-off-by: David S. Miller -
The AQR107 family has SGMII statistics counters. Let's expose them to
ethtool. To interpret the counters correctly one has to be aware that
rx on SGMII side is tx on ethernet side. The counters are populated
by the chip in 100Mbps/1Gbps mode only.v2:
- add constant AQR107_SGMII_STAT_SZ
- add struct aqr107_priv to be prepared for more private data fields
- let aqr107_get_stat() return U64_MAX in case of an errorSigned-off-by: Heiner Kallweit
Signed-off-by: David S. Miller -
As Eric noticed, in .sk_destruct, sk->sk_dst_cache update is prevented, and
no barrier is needed for this. So change to use rcu_dereference_protected()
instead of rcu_dereference_check() to fetch sk_dst_cache in there.v1->v2:
- no change, repost after net-next is open.Reported-by: Eric Dumazet
Signed-off-by: Xin Long
Signed-off-by: David S. Miller -
This patch improves few aspects of genphy_read_status():
- Don't initialize lpagb, it's not needed.
- Move initializing phydev->speed et al before the if clause.
- In auto-neg case, skip populating lp_advertising if we
don't have a link. This avoids quite some unnecessary
MDIO reads in case of phylib polling mode.Signed-off-by: Heiner Kallweit
Signed-off-by: David S. Miller -
Jakub Kicinski says:
====================
nfp: flower improvement and SFF module EEPROMThe first patch in this series from Pieter improves the
handling of mangle actions in TC flower offload. These
used to be sent down to the driver in groups, but after
Pablo N's patches they are split out causing suboptimal
expression.The ramaining two patches from Dirk add support for reading
SFF module EEPROM data.
====================Signed-off-by: David S. Miller
-
Now that the NSP provides the ability to read from the SFF modules'
EEPROM, we can use this interface to implement the ethtool callback.If the NSP only provides partial data, we log the event from within
the driver but pass a success code to ethtool to prevent it from
discarding the partial data.Signed-off-by: Dirk van der Merwe
Reviewed-by: Jakub Kicinski
Signed-off-by: David S. Miller -
The NSP now provides the ability to read from the SFF module EEPROM.
Note that even if an error occurs, the NSP may still provide some of the
data.Signed-off-by: Dirk van der Merwe
Reviewed-by: Jakub Kicinski
Signed-off-by: David S. Miller -
With the introduction of flow_action_for_each pedit actions are no
longer grouped together, instead pedit actions are broken out per
32 byte word. This results in an inefficient use of the action list
that is pushed to hardware where each 32 byte word becomes its own
action. Therefore we combine groups of 32 byte word before sending
the action list to hardware.Signed-off-by: Pieter Jansen van Vuuren
Reviewed-by: Jakub Kicinski
Signed-off-by: David S. Miller -
Add suspend / resume callbacks for AQR107 family. Suspend powers down
the complete chip except MDIO and internal CPU.Signed-off-by: Heiner Kallweit
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
Switch to readl/writel() APIs, because this is recommended
API and the MDIO block is reused on Keystone 2 SoCs
where LE/BE modes are supported.Cc: Arnd Bergmann
Signed-off-by: Grygorii Strashko
Signed-off-by: David S. Miller -
Gustavo A. R. Silva says:
====================
cxgb3/l2t: Fix undefined behaviour and use struct_size() helperThis patchset aims to fix an undefined behaviour when using a zero-sized
array and, add the use of the struct_size() helper in kvzalloc().You might consider the first patch in this series for stable.
More details in the commit logs.
====================Signed-off-by: David S. Miller
-
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:struct foo {
int stuff;
struct boo entry[];
};size = sizeof(struct foo) + count * sizeof(struct boo);
instance = kvzalloc(size, GFP_KERNEL);Instead of leaving these open-coded and prone to type mistakes, we can
now use the new struct_size() helper:instance = kvzalloc(struct_size(instance, entry, count), GFP_KERNEL);
Notice that, in this case, variable size is not necessary, hence
it is removed.This code was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva
Signed-off-by: David S. Miller -
The use of zero-sized array causes undefined behaviour when it is not
the last member in a structure. As it happens to be in this case.Also, the current code makes use of a language extension to the C90
standard, but the preferred mechanism to declare variable-length
types such as this one is a flexible array member, introduced in
C99:struct foo {
int stuff;
struct boo array[];
};By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last. Which is beneficial
to cultivate a high-quality code.Fixes: e48f129c2f20 ("[SCSI] cxgb3i: convert cdev->l2opt to use rcu to prevent NULL dereference")
Signed-off-by: Gustavo A. R. Silva
Signed-off-by: David S. Miller -
Before creating a slave netdevice, get the mac address from DTS and
apply in case it is valid.Signed-off-by: Xiaofei Shen
Signed-off-by: Vinod Koul
Signed-off-by: David S. Miller -
It turns out that struct ipv6_pinfo is not located as we think.
inet6_sk_generic() and tcp_inet6_sk() disagree on 32bit kernels by 4-bytes,
because struct tcp_sock has 8-bytes alignment,
but ipv6_pinfo size is not a multiple of 8.sizeof(struct ipv6_pinfo): 116 (not padded to 8)
I actually first coded tcp_inet6_sk() as this patch does, but thought
that "container_of(tcp_sk(sk), struct tcp6_sock, tcp)" was cleaner.As Julian told me : Nobody should use tcp6_sock.inet6
directly, it should be accessed via tcp_inet6_sk() or inet6_sk().This happened when we added the first u64 field in struct tcp_sock.
Fixes: 93a77c11ae79 ("tcp: add tcp_inet6_sk() helper")
Signed-off-by: Eric Dumazet
Bisected-by: Julian Anastasov
Signed-off-by: David S. Miller
01 Apr, 2019
6 commits
-
Use netif_receive_skb_list() instead of napi_gro_receive() to benefit
from batched skb processing.Signed-off-by: Heiner Kallweit
Signed-off-by: David S. Miller -
Ido Schimmel says:
====================
mlxsw: spectrum_acl: Get rid of failed_rollback mechanismJiri says:
Currently if vregion rehash fails, it rolls back to the original ERP
set. However, in case of unlikely rollback fail, the vregion is in a
zombie state and never gets rehashed again. With the recent changes, it
is possible to try to continue the rollback. Do it from the last failed
ventry.
====================Signed-off-by: David S. Miller
-
The name of the trace is no longer correct, since there is no disable of
rehash done. So name it "rehash_rollback_failed".Signed-off-by: Jiri Pirko
Signed-off-by: Ido Schimmel
Signed-off-by: David S. Miller -
Currently if a rollback ends with error, the vregion is in a zombie
state until end of the existence. Instead of that, rather try to
continue where rollback ended later on (after rehash interval).Signed-off-by: Jiri Pirko
Signed-off-by: Ido Schimmel
Signed-off-by: David S. Miller -
Move the call of rehash_dis trace and the error message to
vregion_migrate() next to the failed_rollback flag set.Signed-off-by: Jiri Pirko
Signed-off-by: Ido Schimmel
Signed-off-by: David S. Miller -
The flag is set by the caller mlxsw_sp_acl_tcam_vregion_migrate() anyway,
so don't set it here.Signed-off-by: Jiri Pirko
Signed-off-by: Ido Schimmel
Signed-off-by: David S. Miller
30 Mar, 2019
8 commits
-
Replace the br_port_exists() macro with its twin from netdevice.h
CC: Roopa Prabhu
CC: Nikolay Aleksandrov
Signed-off-by: Julian Wiedmann
Acked-by: Roopa Prabhu
Signed-off-by: David S. Miller -
Replace the team_port_exists() macro with its twin from netdevice.h
CC: Jiri Pirko
Signed-off-by: Julian Wiedmann
Acked-by: Jiri Pirko
Signed-off-by: David S. Miller -
This patch advertises Forward Error Correction in ethtool
Signed-off-by: Casey Leedom
Signed-off-by: Vishal Kulkarni
Signed-off-by: David S. Miller -
Change t4fw_version.h to update latest firmware version
number to 1.23.3.0.Signed-off-by: Vishal Kulkarni
Signed-off-by: David S. Miller -
There is currently no support for the multicast/broadcast aspects
of VXLAN in ovs. In the datapath flow the tun_dst must specific.
But in the IP_TUNNEL_INFO_BRIDGE mode the tun_dst can not be specific.
And the packet can forward through the fdb table of vxlan devcice. In
this mode the broadcast/multicast packet can be sent through the
following ways in ovs.ovs-vsctl add-port br0 vxlan -- set in vxlan type=vxlan \
options:key=1000 options:remote_ip=flow
ovs-ofctl add-flow br0 in_port=LOCAL,dl_dst=ff:ff:ff:ff:ff:ff, \
action=output:vxlanbridge fdb append ff:ff:ff:ff:ff:ff dev vxlan_sys_4789 dst 172.168.0.1 \
src_vni 1000 vni 1000 self
bridge fdb append ff:ff:ff:ff:ff:ff dev vxlan_sys_4789 dst 172.168.0.2 \
src_vni 1000 vni 1000 selfSigned-off-by: wenxu
Acked-by: Pravin B Shelar
Signed-off-by: David S. Miller -
TCP stack relies on the fact that a freshly allocated skb
has skb->cb[] and skb_shinfo(skb)->tx_flags cleared.When recycling tx skb, we must ensure these fields are cleared.
Fixes: 472c2e07eef0 ("tcp: add one skb cache for tx")
Signed-off-by: Eric Dumazet
Cc: Soheil Hassas Yeganeh
Cc: Willem de Bruijn
Acked-by: Soheil Hassas Yeganeh
Signed-off-by: David S. Miller -
The Innova IPsec driver is part of all Innova drivers, and its
maintainenece is covered by an existing entry in this file.Signed-off-by: Boris Pismenny
Signed-off-by: David S. Miller -
Add 36 pedit action tests to check pedit options described in tc-pedit(8)
man page. Test cases can be specified by categories: actions, pedit,
raw_op, layered_op. RAW_OP cases check offset option for u8, u16 and u32
offset size. LAYERED_OP cases check fields option for eth, ip, ip6,
tcp and udp headers.Include following tests:
377e - Add pedit action with RAW_OP offset u32
a0ca - Add pedit action with RAW_OP offset u32 (INVALID)
dd8a - Add pedit action with RAW_OP offset u16 u16
53db - Add pedit action with RAW_OP offset u16 (INVALID)
5c7e - Add pedit action with RAW_OP offset u8 add value
2893 - Add pedit action with RAW_OP offset u8 quad
3a07 - Add pedit action with RAW_OP offset u8-u16-u8
ab0f - Add pedit action with RAW_OP offset u16-u8-u8
9d12 - Add pedit action with RAW_OP offset u32 set u16 clear u8 invert
ebfa - Add pedit action with RAW_OP offset overflow u32 (INVALID)
f512 - Add pedit action with RAW_OP offset u16 at offmask shift set
c2cb - Add pedit action with RAW_OP offset u32 retain value
86d4 - Add pedit action with LAYERED_OP eth set src & dst
c715 - Add pedit action with LAYERED_OP eth set src (INVALID)
ba22 - Add pedit action with LAYERED_OP eth type set/clear sequence
5810 - Add pedit action with LAYERED_OP ip set src & dst
1092 - Add pedit action with LAYERED_OP ip set ihl & dsfield
02d8 - Add pedit action with LAYERED_OP ip set ttl & protocol
3e2d - Add pedit action with LAYERED_OP ip set ttl (INVALID)
31ae - Add pedit action with LAYERED_OP ip ttl clear/set
486f - Add pedit action with LAYERED_OP ip set duplicate fields
e790 - Add pedit action with LAYERED_OP ip set ce, df, mf, firstfrag,
nofrag fields
6829 - Add pedit action with LAYERED_OP beyond ip set dport & sport
afd8 - Add pedit action with LAYERED_OP beyond ip set icmp_type &
icmp_code
3143 - Add pedit action with LAYERED_OP beyond ip set dport (INVALID)
fc1f - Add pedit action with LAYERED_OP ip6 set src & dst
6d34 - Add pedit action with LAYERED_OP ip6 dst retain value (INVALID)
6f5e - Add pedit action with LAYERED_OP ip6 flow_lbl
6795 - Add pedit action with LAYERED_OP ip6 set payload_len, nexthdr,
hoplimit
1442 - Add pedit action with LAYERED_OP tcp set dport & sport
b7ac - Add pedit action with LAYERED_OP tcp sport set (INVALID)
cfcc - Add pedit action with LAYERED_OP tcp flags set
3bc4 - Add pedit action with LAYERED_OP tcp set dport, sport & flags
fields
f1c8 - Add pedit action with LAYERED_OP udp set dport & sport
d784 - Add pedit action with mixed RAW/LAYERED_OP #1
70ca - Add pedit action with mixed RAW/LAYERED_OP #2Signed-off-by: Dmytro Linkin
Signed-off-by: David S. Miller