* Re: [PATCH 2/5] net: add an info message to eth_platform_get_mac_address()
From: David Miller @ 2018-07-18 23:13 UTC (permalink / raw)
To: brgl
Cc: nsekhar, khilman, linux, grygorii.strashko, srinivas.kandagatla,
lukas, robh, f.fainelli, dan.carpenter, ivan.khoronzhuk, david,
gregkh, andrew, linux-arm-kernel, linux-kernel, linux-omap,
netdev, bgolaszewski
In-Reply-To: <20180718161035.7005-3-brgl@bgdev.pl>
From: Bartosz Golaszewski <brgl@bgdev.pl>
Date: Wed, 18 Jul 2018 18:10:32 +0200
>
> + dev_info(dev, "read MAC address from %s\n", from);
> ether_addr_copy(mac_addr, addr);
> return 0;
Ugh, please don't do this.
We probe various bits of information from various sources during
driver probe, and none of them are more or less important than
the MAC address. So singling this out for log info output is
really not such a great idea.
Thank you.
^ permalink raw reply
* RE: [PATCH v3 net-next 6/8] lan743x: Add power management support
From: Bryan.Whitehead @ 2018-07-18 22:36 UTC (permalink / raw)
To: davem; +Cc: netdev, UNGLinuxDriver
In-Reply-To: <20180719.071715.1535661289630106475.davem@davemloft.net>
> From: David Miller <davem@davemloft.net>
> Date: Thu, 19 Jul 2018 07:15:52 +0900 (KST)
>
> > Please remove these "#endif FOO, #ifdef FOO" sequences, and instead
> > just have one large continuous "ifdef FOO, endif FOO" section.
>
> BTW, there were other patches that had this problem too, so please go
> through your entire submission correcting this.
>
> Thank you.
OK will do.
^ permalink raw reply
* Re: [PATCH v3 net-next 6/8] lan743x: Add power management support
From: Andrew Lunn @ 2018-07-18 22:43 UTC (permalink / raw)
To: Bryan.Whitehead; +Cc: davem, netdev, UNGLinuxDriver
In-Reply-To: <90A7E81AE28BAE4CBDDB3B35F187D2644073B198@CHN-SV-EXMX02.mchp-main.com>
> Hi Andrew,
> I assumed that "supported" means that it is supported by both the phy and mac driver, which is why I used the AND operator.
> Am I mistaken? Is WAKE_MAGICSECURE a special case not requiring mac driver support?
It depends on the hardware designs, but in some designs, the PHY can
do WOL, without the MAC involved. When a WoL condition happens, it
triggers an interrupt, or blinks an LED which is also connected to the
power supply etc. And if the PHY is doing WoL, you can shut down the
MAC, save more power.
Look at some of the PHY drivers, at803x, dp83822, dp83tc811, marvell,
and mscc all support some sort of WoL.
Ideally, you want to offer the superset of both PHY WoL and MAC WoL.
Andrew
^ permalink raw reply
* RE: [PATCH v3 net-next 6/8] lan743x: Add power management support
From: Bryan.Whitehead @ 2018-07-18 22:46 UTC (permalink / raw)
To: andrew; +Cc: davem, netdev, UNGLinuxDriver
In-Reply-To: <20180718224357.GA25710@lunn.ch>
> It depends on the hardware designs, but in some designs, the PHY can do
> WOL, without the MAC involved. When a WoL condition happens, it triggers
> an interrupt, or blinks an LED which is also connected to the power supply
> etc. And if the PHY is doing WoL, you can shut down the MAC, save more
> power.
>
> Look at some of the PHY drivers, at803x, dp83822, dp83tc811, marvell, and
> mscc all support some sort of WoL.
>
> Ideally, you want to offer the superset of both PHY WoL and MAC WoL.
>
> Andrew
OK thanks Andrew
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2018-07-18 23:34 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
Lots of fixes, here goes:
1) NULL deref in qtnfmac, from Gustavo A. R. Silva.
2) Kernel oops when fw download fails in rtlwifi, from Ping-Ke Shih.
3) Lost completion messages in AF_XDP, from Magnus Karlsson.
4) Correct bogus self-assignment in rhashtable, from Rishabh Bhatnagar.
5) Fix regression in ipv6 route append handling, from David Ahern.
6) Fix masking in __set_phy_supported(), from Heiner Kallweit.
7) Missing module owner set in x_tables icmp, from Florian Westphal.
8) liquidio's timeouts are HZ dependent, fix from Nicholas Mc Guire.
9) Link setting fixes for sh_eth and ravb, from Vladimir Zapolskiy.
10) Fix NULL deref when using chains in act_csum, from Davide Caratti.
11) XDP_REDIRECT needs to check if the interface is up and whether the
MTU is sufficient. From Toshiaki Makita.
12) Net diag can do a double free when killing TCP_NEW_SYN_RECV
connections, from Lorenzo Colitti.
13) nf_defrag in ipv6 can unnecessarily hold onto dst entries for a
full minute, delaying device unregister. From Eric Dumazet.
14) Update MAC entries in the correct order in ixgbe, from Alexander
Duyck.
15) Don't leave partial mangles bpf program in jit_subprogs, from
Daniel Borkmann.
16) Fix pfmemalloc SKB state propagation, from Stefano Brivio.
17) Fix ACK handling in DCTCP congestion control, from Yuchung
Cheng.
18) Use after free in tun XDP_TX, from Toshiaki Makita.
19) Stale ipv6 header pointer in ipv6 gre code, from Prashant Bhole.
20) Don't reuse remainder of RX page when XDP is set in mlx4, from
Saeed Mahameed.
21) Fix window probe handling of TCP rapair sockets, from Stefan
Baranoff.
22) Missing socket locking in smc_ioctl(), from Ursula Braun.
23) IPV6_ILA needs DST_CACHE, from Arnd Bergmann.
24) Spectre v1 fix in cxgb3, from Gustavo A. R. Silva.
25) Two spots in ipv6 do a rol32() on a hash value but ignore
the result. Fixes from Colin Ian King.
Please pull, thanks a lot!
The following changes since commit d0fbad0aec1df29717fab736eb24c8a49cf2c70b:
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md (2018-07-02 12:40:59 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
for you to fetch changes up to e56b8ce363a36fb7b74b80aaa5cc9084f2c908b4:
tcp: identify cryptic messages as TCP seq # bugs (2018-07-18 15:26:33 -0700)
----------------------------------------------------------------
Alexander Couzens (1):
net: usb: asix: replace mii_nway_restart in resume path
Alexander Duyck (1):
ixgbe: Be more careful when modifying MAC filters
Alexander Sverdlin (2):
octeon_mgmt: Fix MIX registers configuration on MTU setup
net: cavium: Add fine-granular dependencies on PCI
Alexei Starovoitov (3):
Merge branch 'af_xdp-fixes'
Merge branch 'sockmap-fixes'
Merge branch 'sockhash-fixes'
Andrey Ryabinin (1):
netfilter: nf_conntrack: Fix possible possible crash on module loading.
Arnd Bergmann (3):
ieee802154: mcr20a: add missing includes
net: bridge: fix br_vlan_get_{pvid,info} return values
ipv6: ila: select CONFIG_DST_CACHE
Arun Kumar Neelakantam (2):
net: qrtr: Broadcast messages only from control port
net: qrtr: Reset the node and port ID of broadcast messages
Bert Kenward (2):
sfc: avoid hang from nested use of the filter_sem
sfc: hold filter_sem consistently during reset
Casey Leedom (1):
cxgb4: assume flash part size to be 4MB, if it can't be determined
Colin Ian King (2):
ipv6: sr: fix useless rol32 call on hash
ipv6: fix useless rol32 call on hash
Constantine Shulyupin (1):
scripts/tags.sh: Add BPF_CALL
Corentin Labbe (2):
net: stmmac: dwmac-sun8i: fix typo descrive => describe
net: ethernet: stmmac: fix documentation warning
Dan Carpenter (3):
qed: off by one in qed_parse_mcp_trace_buf()
ixgbe: Off by one in ixgbe_ipsec_tx()
qlogic: check kstrtoul() for errors
Daniel Borkmann (4):
bpf: fix ldx in ld_abs rewrite for large offsets
bpf: fix panic due to oob in bpf_prog_test_run_skb
bpf: don't leave partial mangled prog in jit_subprogs error path
Merge branch 'bpf-af-xdp-consistent-err-reporting'
Dave Watson (1):
tls: Stricter error checking in zerocopy sendmsg path
David Ahern (3):
net/ipv6: Revert attempt to simplify route replace and append
net/ipv4: Set oif in fib_compute_spec_dst
net/ipv6: Do not allow device only routes via the multipath API
David Lechner (1):
net: usb: rtl8150: demote allmulti message to dev_dbg()
David S. Miller (18):
Merge tag 'wireless-drivers-for-davem-2018-07-03' of git://git.kernel.org/.../kvalo/wireless-drivers
Merge branch 'qrtr-Broadcasting-control-messages'
Merge branch 'ravb-sh_eth-fix-sleep-in-atomic-by-reusing-shared-ethtool-handlers'
Merge branch 'tipc-dad-fixes'
Merge branch 'net-sched-fix-NULL-dereference-in-goto-chain-control-action'
Merge git://git.kernel.org/.../bpf/bpf
Merge git://git.kernel.org/.../pablo/nf
Merge branch 'bnxt_en-Bug-fixes'
Merge branch 'ieee802154-for-davem-2018-07-11' of git://git.kernel.org/.../sschmidt/wpan
Merge branch '10GbE' of git://git.kernel.org/.../jkirsher/net-queue
Merge branch 'sfc-filter-locking-fixes'
Merge git://git.kernel.org/.../bpf/bpf
Merge branch 'fix-DCTCP-delayed-ACK'
Merge branch 'multicast-init-as-INCLUDE-when-join-SSM-INCLUDE-group'
Merge branch 'tg3-fixes'
Merge branch 'smc-fixes'
Merge tag 'batadv-net-for-davem-20180717' of git://git.open-mesh.org/linux-merge
Merge branch 'net-qca_spi-Minor-bugfixes'
Davide Caratti (2):
net/sched: act_csum: fix NULL dereference when 'goto chain' is used
net/sched: act_tunnel_key: fix NULL dereference when 'goto chain' is used
Davidlohr Bueso (1):
lib/rhashtable: consider param->min_size when setting initial table size
Denis Bolotin (1):
qed: Fix reading stale configuration information
Doron Roberts-Kedes (1):
tls: fix skb_to_sgvec returning unhandled error.
Eric Biggers (1):
KEYS: DNS: fix parsing multiple options
Eric Dumazet (1):
tcp: cleanup copied_seq and urg_data in tcp_disconnect
Ewan D. Milne (1):
qed: fix spelling mistake "successffuly" -> "successfully"
Florian Fainelli (1):
net: systemport: Fix CRC forwarding check for SYSTEMPORT Lite
Florian Westphal (3):
netfilter: x_tables: set module owner for icmp(6) matches
netfilter: nft_compat: explicitly reject ERROR and standard target
netfilter: ipv6: nf_defrag: drop skb dst before queueing
Ganapathi Bhat (2):
Revert "mwifiex: handle race during mwifiex_usb_disconnect"
mwifiex: handle race during mwifiex_usb_disconnect
Geert Uytterhoeven (1):
wcn36xx: Remove Unicode Byte Order Mark from testcode
Gustavo A. R. Silva (3):
qtnfmac: fix NULL pointer dereference
net: cxgb3_main: fix potential Spectre v1
ptp: fix missing break in switch
Haiyang Zhang (1):
hv_netvsc: Fix napi reschedule while receive completion is busy
Hangbin Liu (2):
ipv4/igmp: init group mode as INCLUDE when join source group
ipv6/mcast: init as INCLUDE when join SSM INCLUDE group
Harini Katakam (2):
net: macb: Free RX ring for all queues
net: macb: Allocate valid memory for TX and RX BD prefetch
Heiner Kallweit (2):
r8169: fix mac address change
net: phy: fix flag masking in __set_phy_supported
Igor Russkikh (1):
net: aquantia: vlan unicast address list correct handling
Jacob Keller (1):
sch_fq_codel: zero q->flows_cnt when fq_codel_init fails
John Allen (1):
ibmvnic: Fix error recovery on login failure
John Fastabend (6):
bpf: sockmap, error path can not release psock in multi-map case
bpf: sockmap, hash table is RCU so readers do not need locks
bpf: fix sk_skb programs without skb->dev assigned
bpf: sockhash, disallow bpf_tcp_close and update in parallel
bpf: sockmap, consume_skb in close path
bpf: sockmap, convert bpf_compute_data_pointers to bpf_*_sk_skb
Jon Maloy (4):
tipc: fix wrong return value from function tipc_node_try_addr()
tipc: correct discovery message handling during address trial period
tipc: fix correct setting of message type in second discoverer
tipc: make function tipc_net_finalize() thread safe
Kalle Valo (1):
Merge ath-current from git://git.kernel.org/.../kvalo/ath.git
Karsten Graul (1):
net/smc: reset recv timeout after clc handshake
Krzysztof Kozlowski (1):
MAINTAINERS: Drop inactive Vitaly Bordug's email
Linus Lüssing (2):
batman-adv: Avoid storing non-TT-sync flags on singular entries too
batman-adv: Fix multicast TT issues with bogus ROAM flags
Lorenzo Colitti (1):
net: diag: Don't double-free TCP_NEW_SYN_RECV sockets in tcp_abort
Lubomir Rintel (1):
ieee802154: 6lowpan: set IFLA_LINK
Magnus Karlsson (8):
xsk: fix potential lost completion message in SKB path
xsk: frame could be completed more than once in SKB path
samples/bpf: deal with EBUSY return code from sendmsg in xdpsock sample
xsk: fix potential race in SKB TX completion code
xsk: do not return ENXIO from TX copy mode
xsk: do not return EAGAIN from sendmsg when completion queue is full
xsk: always return ENOBUFS from sendmsg if there is no TX queue
xsk: do not return EMSGSIZE in copy mode for packets larger than MTU
Masanari Iida (1):
bonding: Fix a typo in bonding.txt
Matevz Vucnik (1):
qmi_wwan: add support for Quectel EG91
Mathieu Xhonneux (1):
bpf: fix availability probing for seg6 helpers
Mauricio Vasquez B (1):
bpf: hash map: decrement counter on error
Mauro Carvalho Chehab (2):
networking: e100.rst: Get rid of Sphinx warnings
networking: e1000.rst: Get rid of Sphinx warnings
Michael Chan (4):
bnxt_en: Fix inconsistent BNXT_FLAG_AGG_RINGS logic.
bnxt_en: Always set output parameters in bnxt_get_max_rings().
bnxt_en: Support clearing of the IFF_BROADCAST flag.
bnxt_en: Do not modify max IRQ count after RDMA driver requests/frees IRQs.
Michael Heimpold (1):
net: ethtool: fix spelling mistake: "tubale" -> "tunable"
Michael Hennerich (2):
net: ieee802154: adf7242: Fix erroneous RX enable
net: ieee802154: adf7242: Fix OCL calibration runs
Michael Trimarchi (1):
brcmfmac: stop watchdog before detach and free everything
Máté Eckl (1):
netfilter: nf_tproxy: fix possible non-linear access to transport header
Nicholas Mc Guire (1):
liquidio: make timeout HZ independent and readable
Okash Khawaja (1):
bpf: btf: Fix bitfield extraction for big endian
Pablo Neira Ayuso (1):
netfilter: nf_tables: place all set backends in one single module
Paolo Abeni (1):
ipfrag: really prevent allocation on netns exit
Paul Moore (1):
ipv6: make ipv6_renew_options() interrupt/kernel safe
Ping-Ke Shih (2):
rtlwifi: Fix kernel Oops "Fw download fail!!"
rtlwifi: rtl8821ae: fix firmware is not ready to run
Prashant Bhole (1):
net: ip6_gre: get ipv6hdr after skb_cow_head()
Randy Dunlap (2):
net/ethernet/freescale/fman: fix cross-build error
tcp: identify cryptic messages as TCP seq # bugs
Rishabh Bhatnagar (1):
lib: rhashtable: Correct self-assignment in rhashtable.c
Roman Gushchin (1):
bpf: include errno.h from bpf-cgroup.h
Russell King (2):
sfp: ensure we clean up properly on bus registration failure
sfp: fix module initialisation with netdev already up
Ryan Hsu (1):
ath10k: update the phymode along with bandwidth change request
Sabrina Dubroca (1):
ipv6: make DAD fail with enhanced DAD when nonce length differs
Saeed Mahameed (1):
net/mlx4_en: Don't reuse RX page when XDP is set
Sanjeev Bansal (1):
tg3: Add higher cpu clock for 5762.
Siva Reddy Kallam (1):
tg3: Update copyright
Stanislaw Gruszka (1):
mt7601u: remove warning when avg_rssi is zero
Stefan Baranoff (3):
tcp: fix sequence numbers for repaired sockets re-using TIME-WAIT sockets
tcp: allow user to create repair socket without window probes
tcp: Fix broken repair socket window probe patch
Stefan Schmidt (4):
MAINTAINERS: update my email address
ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem
ieee802154: at86rf230: use __func__ macro for debug messages
ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem
Stefan Wahren (4):
net: lan78xx: Fix race in tx pending skb size calculation
net: qca_spi: Avoid packet drop during initial sync
net: qca_spi: Make sure the QCA7000 reset is triggered
net: qca_spi: Fix log level if probe fails
Stefano Brivio (2):
net: Don't copy pfmemalloc flag in __copy_skb_header()
skbuff: Unconditionally copy pfmemalloc in __skb_clone()
Stephen Hemminger (1):
hv/netvsc: fix handling of fallback to single queue mode
Sven Eckelmann (4):
batman-adv: Fix bat_ogm_iv best gw refcnt after netlink dump
batman-adv: Fix bat_v best gw refcnt after netlink dump
batman-adv: Fix debugfs path for renamed hardif
batman-adv: Fix debugfs path for renamed softif
Taehee Yoo (1):
rhashtable: add restart routine in rhashtable_free_and_destroy()
Taeung Song (5):
samples/bpf: add missing <linux/if_vlan.h>
samples/bpf: Check the result of system()
samples/bpf: Check the error of write() and read()
samples/bpf: add .gitignore file
samples/bpf: Fix tc and ip paths in xdp2skb_meta.sh
Tetsuo Handa (1):
net/nfc: Avoid stalls when nfc_alloc_send_skb() returned NULL.
Thomas Falcon (1):
ibmvnic: Revise RX/TX queue error messages
Toke Høiland-Jørgensen (1):
gen_stats: Fix netlink stats dumping in the presence of padding
Toshiaki Makita (2):
xdp: XDP_REDIRECT should check IFF_UP and MTU
tun: Fix use-after-free on XDP_TX
Tyler Hicks (1):
ipv4: Return EINVAL when ping_group_range sysctl doesn't map to user ns
Ursula Braun (4):
net/smc: reduce sock_put() for fallback sockets
net/smc: take sock lock in smc_ioctl()
net/smc: optimize consumer cursor updates
net/smc: add error handling for get_user()
Venkat Duvvuru (1):
bnxt_en: Fix the vlan_tci exact match check.
Vikas Gupta (1):
bnxt_en: Fix for system hang if request_irq fails
Vladimir Zapolskiy (14):
sh_eth: fix invalid context bug while calling auto-negotiation by ethtool
sh_eth: fix invalid context bug while changing link options by ethtool
sh_eth: simplify link auto-negotiation by ethtool
sh_eth: remove custom .nway_reset from ethtool ops
sh_eth: remove useless serialization in sh_eth_get_link_ksettings()
sh_eth: remove custom .get_link_ksettings from ethtool ops
sh_eth: remove custom .set_link_ksettings from ethtool ops
ravb: fix invalid context bug while calling auto-negotiation by ethtool
ravb: fix invalid context bug while changing link options by ethtool
ravb: simplify link auto-negotiation by ethtool
ravb: remove custom .nway_reset from ethtool ops
ravb: remove useless serialization in ravb_get_link_ksettings()
ravb: remove custom .get_link_ksettings from ethtool ops
ravb: remove custom .set_link_ksettings from ethtool ops
Wang Dongsheng (1):
net: phy: marvell: change default m88e1510 LED configuration
Willem de Bruijn (3):
nsh: set mac len based on inner packet
packet: reset network header if packet shorter than ll reserved space
selftests: in udpgso_bench do not test udp zerocopy
Xin Long (1):
sctp: fix the issue that pathmtu may be set lower than MINSEGMENT
Xinming Hu (1):
MAINTAINERS: update Xinming's email address
Yuchung Cheng (2):
tcp: fix dctcp delayed ACK schedule
tcp: remove DELAYED ACK events in DCTCP
YueHaibing (1):
net: sched: Using NULL instead of plain integer
Yuiko Oshino (1):
smsc75xx: Add workaround for gigabit link up hardware errata.
Documentation/networking/bonding.txt | 2 +-
Documentation/networking/e100.rst | 27 +++++++----
Documentation/networking/e1000.rst | 187 ++++++++++++++++++++++++++++++++++++++++++++-----------------------------
MAINTAINERS | 7 ++-
drivers/net/ethernet/aquantia/atlantic/aq_cfg.h | 2 -
drivers/net/ethernet/aquantia/atlantic/aq_hw.h | 4 +-
drivers/net/ethernet/aquantia/atlantic/aq_main.c | 11 +----
drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 47 +++++++++++--------
drivers/net/ethernet/aquantia/atlantic/aq_nic.h | 2 +-
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 2 +-
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 4 +-
drivers/net/ethernet/broadcom/bcmsysport.c | 4 +-
drivers/net/ethernet/broadcom/bcmsysport.h | 3 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 24 +++++++---
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 -
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 30 ++++++++++--
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 2 -
drivers/net/ethernet/broadcom/tg3.c | 13 ++++++
drivers/net/ethernet/broadcom/tg3.h | 2 +
drivers/net/ethernet/cadence/macb.h | 11 +++++
drivers/net/ethernet/cadence/macb_main.c | 36 +++++++++-----
drivers/net/ethernet/cavium/Kconfig | 12 ++---
drivers/net/ethernet/cavium/liquidio/lio_main.c | 5 +-
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 14 ++++--
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 2 +
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 35 ++++++--------
drivers/net/ethernet/ibm/ibmvnic.c | 43 +++++++++++------
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 12 ++++-
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 8 +++-
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 48 +++++++++----------
drivers/net/ethernet/qlogic/qed/qed.h | 1 +
drivers/net/ethernet/qlogic/qed/qed_debug.c | 2 +-
drivers/net/ethernet/qlogic/qed/qed_main.c | 2 +-
drivers/net/ethernet/qlogic/qed/qed_mcp.c | 39 +++++++++++-----
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | 2 +
drivers/net/ethernet/qualcomm/qca_spi.c | 21 +++++----
drivers/net/ethernet/realtek/r8169.c | 1 +
drivers/net/ethernet/renesas/ravb_main.c | 93 +++++++-----------------------------
drivers/net/ethernet/renesas/sh_eth.c | 94 +++++++------------------------------
drivers/net/ethernet/sfc/ef10.c | 30 ++++++++----
drivers/net/ethernet/sfc/efx.c | 17 ++++---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 1 -
drivers/net/hyperv/netvsc.c | 17 ++++---
drivers/net/hyperv/rndis_filter.c | 1 +
drivers/net/ieee802154/adf7242.c | 34 +++++++++++++-
drivers/net/ieee802154/at86rf230.c | 15 ++----
drivers/net/ieee802154/fakelb.c | 2 +-
drivers/net/ieee802154/mcr20a.c | 3 +-
drivers/net/phy/marvell.c | 54 ++++++++++++++-------
drivers/net/phy/phy_device.c | 7 +--
drivers/net/phy/sfp-bus.c | 35 ++++++++++----
drivers/net/tun.c | 2 +-
drivers/net/usb/asix_devices.c | 4 +-
drivers/net/usb/lan78xx.c | 5 +-
drivers/net/usb/qmi_wwan.c | 1 +
drivers/net/usb/rtl8150.c | 2 +-
drivers/net/usb/smsc75xx.c | 62 ++++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/mac.c | 16 ++++++-
drivers/net/wireless/ath/ath10k/wmi.h | 1 +
drivers/net/wireless/ath/wcn36xx/testmode.c | 2 +-
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++
drivers/net/wireless/marvell/mwifiex/usb.c | 7 +--
drivers/net/wireless/mediatek/mt7601u/phy.c | 6 ++-
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 3 +-
drivers/net/wireless/realtek/rtlwifi/base.c | 17 ++++---
drivers/net/wireless/realtek/rtlwifi/base.h | 2 +-
drivers/net/wireless/realtek/rtlwifi/core.c | 3 +-
drivers/net/wireless/realtek/rtlwifi/pci.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/ps.c | 4 +-
drivers/net/wireless/realtek/rtlwifi/usb.c | 2 +-
drivers/ptp/ptp_chardev.c | 1 +
include/linux/bpf-cgroup.h | 1 +
include/linux/filter.h | 6 +--
include/linux/fsl/guts.h | 1 +
include/linux/if_bridge.h | 4 +-
include/linux/igmp.h | 2 +
include/linux/marvell_phy.h | 2 +
include/linux/skbuff.h | 10 ++--
include/net/ip6_route.h | 6 +++
include/net/ipv6.h | 13 ++----
include/net/netfilter/nf_tables_core.h | 6 +++
include/net/netfilter/nf_tproxy.h | 4 +-
include/net/tc_act/tc_csum.h | 1 -
include/net/tc_act/tc_tunnel_key.h | 1 -
include/net/tcp.h | 6 ++-
include/net/xdp_sock.h | 4 ++
include/uapi/linux/ethtool.h | 2 +-
include/uapi/linux/tcp.h | 4 ++
kernel/bpf/btf.c | 30 ++++++------
kernel/bpf/devmap.c | 7 ++-
kernel/bpf/hashtab.c | 16 +++++--
kernel/bpf/sockmap.c | 43 ++++++++++-------
kernel/bpf/syscall.c | 4 +-
kernel/bpf/verifier.c | 11 ++++-
lib/rhashtable.c | 27 +++++++----
net/batman-adv/bat_iv_ogm.c | 4 +-
net/batman-adv/bat_v.c | 4 +-
net/batman-adv/debugfs.c | 40 ++++++++++++++++
net/batman-adv/debugfs.h | 11 +++++
net/batman-adv/hard-interface.c | 37 ++++++++++++---
net/batman-adv/translation-table.c | 7 ++-
net/bpf/test_run.c | 17 +++++--
net/core/filter.c | 149 +++++++++++++++++++++++++++++++++++++++++++++++-----------
net/core/gen_stats.c | 16 ++++++-
net/core/skbuff.c | 1 +
net/dns_resolver/dns_key.c | 28 ++++++-----
net/ieee802154/6lowpan/core.c | 6 +++
net/ipv4/fib_frontend.c | 1 +
net/ipv4/igmp.c | 58 ++++++++++++++++-------
net/ipv4/inet_fragment.c | 2 +-
net/ipv4/ip_sockglue.c | 4 +-
net/ipv4/netfilter/ip_tables.c | 1 +
net/ipv4/netfilter/nf_tproxy_ipv4.c | 18 ++++---
net/ipv4/sysctl_net_ipv4.c | 5 +-
net/ipv4/tcp.c | 16 ++++---
net/ipv4/tcp_dctcp.c | 31 ++----------
net/ipv4/tcp_ipv4.c | 23 +++++++--
net/ipv4/tcp_output.c | 4 --
net/ipv6/Kconfig | 1 +
net/ipv6/calipso.c | 9 ++--
net/ipv6/exthdrs.c | 111 ++++++++++++-------------------------------
net/ipv6/ip6_fib.c | 156 ++++++++++++++++++++++++++++++++++---------------------------
net/ipv6/ip6_gre.c | 3 +-
net/ipv6/ipv6_sockglue.c | 32 +++++++++----
net/ipv6/mcast.c | 64 +++++++++++++++++--------
net/ipv6/ndisc.c | 2 +-
net/ipv6/netfilter/ip6_tables.c | 1 +
net/ipv6/netfilter/nf_conntrack_reasm.c | 2 +
net/ipv6/netfilter/nf_tproxy_ipv6.c | 18 ++++---
net/ipv6/route.c | 10 +++-
net/ipv6/seg6_iptunnel.c | 2 +-
net/netfilter/Kconfig | 25 +++-------
net/netfilter/Makefile | 7 +--
net/netfilter/nf_conntrack_core.c | 2 +-
net/netfilter/nf_tables_set_core.c | 28 +++++++++++
net/netfilter/nft_compat.c | 13 ++++++
net/netfilter/nft_set_bitmap.c | 19 +-------
net/netfilter/nft_set_hash.c | 29 ++----------
net/netfilter/nft_set_rbtree.c | 19 +-------
net/netfilter/xt_TPROXY.c | 8 ++--
net/nfc/llcp_commands.c | 9 ++--
net/nsh/nsh.c | 2 +-
net/packet/af_packet.c | 2 +
net/qrtr/qrtr.c | 13 +++++-
net/sched/act_csum.c | 6 +--
net/sched/act_tunnel_key.c | 6 +--
net/sched/cls_api.c | 4 +-
net/sched/sch_fq_codel.c | 25 +++++++---
net/sctp/transport.c | 2 +-
net/smc/af_smc.c | 37 +++++++++++----
net/smc/smc_clc.c | 3 +-
net/smc/smc_close.c | 2 +
net/smc/smc_tx.c | 12 ++++-
net/tipc/discover.c | 18 ++++---
net/tipc/net.c | 17 ++++---
net/tipc/node.c | 7 ++-
net/tls/tls_sw.c | 7 ++-
net/xdp/xsk.c | 30 +++++-------
net/xdp/xsk_queue.h | 9 +---
samples/bpf/.gitignore | 49 +++++++++++++++++++
samples/bpf/parse_varlen.c | 6 +--
samples/bpf/test_overhead_user.c | 19 ++++++--
samples/bpf/trace_event_user.c | 27 +++++++++--
samples/bpf/xdp2skb_meta.sh | 6 +--
samples/bpf/xdpsock_user.c | 2 +-
scripts/tags.sh | 1 +
tools/testing/selftests/bpf/test_verifier.c | 23 ++++++++-
tools/testing/selftests/net/fib_tests.sh | 41 ----------------
tools/testing/selftests/net/udpgso_bench.sh | 3 --
171 files changed, 1739 insertions(+), 1128 deletions(-)
create mode 100644 net/netfilter/nf_tables_set_core.c
create mode 100644 samples/bpf/.gitignore
^ permalink raw reply
* Re: [PATCH iproute2 v2] ip: add support for seg6local End.BPF action
From: Stephen Hemminger @ 2018-07-18 22:57 UTC (permalink / raw)
To: Mathieu Xhonneux; +Cc: netdev, dlebrun
In-Reply-To: <20180717144952.4540-1-m.xhonneux@gmail.com>
On Tue, 17 Jul 2018 14:49:52 +0000
Mathieu Xhonneux <m.xhonneux@gmail.com> wrote:
> This patch adds support for the End.BPF action of the seg6local
> lightweight tunnel. Functions from the BPF lightweight tunnel are
> re-used in this patch. Example:
>
> $ ip -6 route add fc00::18 encap seg6local action End.BPF endpoint
> obj my_bpf.o sec my_func dev eth0
>
> $ ip -6 route show fc00::18
> fc00::18 encap seg6local action End.BPF endpoint my_bpf.o:[my_func]
> dev eth0 metric 1024 pref medium
>
> v2: - re-use of print_encap_bpf_prog instead of fprintf
> - introduction of "endpoint" keyword for more consistency with
> others parameters
>
> Signed-off-by: Mathieu Xhonneux <m.xhonneux@gmail.com>
Ok. Applied
^ permalink raw reply
* Re: [PATCH iproute2] ipaddress: Fix and make consistent label match handling
From: Stephen Hemminger @ 2018-07-18 22:54 UTC (permalink / raw)
To: Serhey Popovych; +Cc: netdev, vincent, dsahern
In-Reply-To: <1531604194-12136-1-git-send-email-serhe.popovych@gmail.com>
On Sun, 15 Jul 2018 00:36:34 +0300
Serhey Popovych <serhe.popovych@gmail.com> wrote:
> Since commit 9516823051ce ("ipaddress: Improve print_linkinfo()") we
> return -1 instead of 0 when ip-address(8) label does not match network
> device name as we did before change. This causes regression when trying
> to output ip address matching label:
>
> # ip addr add 192.168.192.1/24 dev lo label lo:1
> # ip addr show label lo:1
> <no output>
>
> This is special case and return 0 from print_linkinfo() earlier to match
> only filter.ifindex and filter.up if given, but not rest fields in
> @filter. Then call print_selected_addrinfo() without calling
> print_link_stats() in ipaddr_list_flush_or_save().
>
> Later print_selected_addrinfo() calls print_addrinfo() that finally
> matches IFA_LABEL attribute in netlink buffer with filter.label using
> ifa_label_match_rta().
>
> On the other hand there is three conditions checked in print_linkinfo()
> to determine label special case:
>
> 1) filter.label != NULL
> 2) filter.family == AF_UNSPEC || filter.family == AF_PACKET
> 3) fnmatch(filter.label, name, 0)
>
> With 1) it is ok to check if filtering by label is on by given pattern
> in @filter.label.
>
> Since label is IPv4 specific and AF_PACKET is for printing ip-link(8)
> information (see ipaddr_link_list()::ipaddress.c as example) checking
> for AF_PACKET in 2) doesn't take much sense: better to defer these
> checks to print_addrinfo() determine valid combinations before calling
> ifa_label_match_rta() to finally match IFA_LABEL to pattern in
> filter.label.
>
> For 3) we have following call for test case:
>
> fnmatch(pattern, string, flags) ->
> fnmatch(filter.label, name, 0) ->
> fnmatch("lo:1", "lo", 0) == FNM_NOMATCH (1) or non-zero on error
>
> To support special case in print_linkinfo() for filtering by label we
> only need to check if label pattern is given in filter.label and return
> 0 to skip print_link_stats() in ipaddr_list_flush_or_save(): actual
> filtering will be done in print_addrinfo().
>
> Before commit 9516823051ce ("ipaddress: Improve print_linkinfo()"):
> -------------------------------------------------------------------
>
> $ ip addr sh label lo
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN \
> group default qlen 1000
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> fnmatch("lo", "lo", 0) == 0
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> inet 127.0.0.1/8 scope host lo
> valid_lft forever preferred_lft forever
> inet6 ::1/128 scope host
> valid_lft forever preferred_lft forever
> $ ip addr show label 'lo:*'
> inet 192.168.192.1/24 scope global lo:1
> valid_lft forever preferred_lft forever
> $ ip addr sh label lo:1
> inet 192.168.192.1/24 scope global lo:1
> valid_lft forever preferred_lft forever
> $ ip -4 addr sh label lo:1
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN \
> group default qlen 1000
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> filter.family == AF_INET
> inet 192.168.192.1/24 scope global lo:1
> valid_lft forever preferred_lft forever
>
> After this change applied:
> --------------------------
>
> $ ip/ip addr show label lo
> inet 127.0.0.1/8 scope host lo
> valid_lft forever preferred_lft forever
> inet6 ::1/128 scope host
> valid_lft forever preferred_lft forever
> $ ip/ip addr show label 'lo:*'
> inet 192.168.192.1/24 scope global lo:1
> valid_lft forever preferred_lft forever
> $ ip/ip addr show label lo:1
> inet 192.168.192.1/24 scope global lo:1
> valid_lft forever preferred_lft forever
> $ ip/ip -4 addr show label lo:1
> inet 192.168.192.1/24 scope global lo:1
> valid_lft forever preferred_lft forever
>
> Note that we no longer show link information as we did previously:
> we are filtering by "label" pattern, not showing by "dev".
>
> Fixes: commit 9516823051ce ("ipaddress: Improve print_linkinfo()")
> Reported-by: Vincent Bernat <vincent@bernat.im>
> Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Makes sense applied. Thanks for following through on this.
^ permalink raw reply
* Re: [PATCH next v2] bonding: pass link-local packets to bonding master also.
From: Mahesh Bandewar (महेश बंडेवार) @ 2018-07-18 23:19 UTC (permalink / raw)
To: David Miller; +Cc: mahesh, j.vosburgh, andy, vfalico, linux-netdev, soltys
In-Reply-To: <20180719.051847.322856597854497478.davem@davemloft.net>
On Wed, Jul 18, 2018 at 1:18 PM, David Miller <davem@davemloft.net> wrote:
> From: Mahesh Bandewar <mahesh@bandewar.net>
> Date: Wed, 18 Jul 2018 12:55:42 -0700
>
>> From: Mahesh Bandewar <maheshb@google.com>
>>
>> Commit b89f04c61efe ("bonding: deliver link-local packets with
>> skb->dev set to link that packets arrived on") changed the behavior
>> of how link-local-multicast packets are processed. The change in
>> the behavior broke some legacy use cases where these packets are
>> expected to arrive on bonding master device also.
>>
>> This patch passes the packet to the stack with the link it arrived
>> on as well as passes to the bonding-master device to preserve the
>> legacy use case.
>>
>> Fixes: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on")
>> Reported-by: Michal Soltys <soltys@ziu.info>
>> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>
> If this is a regression, it should target 'net' rather than 'net-next'
> so we can queue it up for -stable as well.
>
Yes, it is. Just forgot to revise the subject. Do you want me to
resend the patch?
thanks,
--mahesh..
> Thank you.
^ permalink raw reply
* [PATCH net] tls: check RCV_SHUTDOWN in tls_wait_data
From: Doron Roberts-Kedes @ 2018-07-18 23:22 UTC (permalink / raw)
To: David S . Miller; +Cc: Dave Watson, netdev, Doron Roberts-Kedes
The current code does not check sk->sk_shutdown & RCV_SHUTDOWN.
tls_sw_recvmsg may return a positive value in the case where bytes have
already been copied when the socket is shutdown. sk->sk_err has been
cleared, causing the tls_wait_data to hang forever on a subsequent
invocation. Checking sk->sk_shutdown & RCV_SHUTDOWN, as in tcp_recvmsg,
fixes this problem.
Fixes: c46234ebb4d1 ("tls: RX path for ktls")
Acked-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: Doron Roberts-Kedes <doronrk@fb.com>
---
net/tls/tls_sw.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index ef15e35232dd..f90c4391f859 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -647,6 +647,9 @@ static struct sk_buff *tls_wait_data(struct sock *sk, int flags,
return NULL;
}
+ if (sk->sk_shutdown & RCV_SHUTDOWN)
+ return NULL;
+
if (sock_flag(sk, SOCK_DONE))
return NULL;
--
2.17.1
^ permalink raw reply related
* Re: [PATCH next v2] bonding: pass link-local packets to bonding master also.
From: David Miller @ 2018-07-18 23:33 UTC (permalink / raw)
To: maheshb; +Cc: mahesh, j.vosburgh, andy, vfalico, netdev, soltys
In-Reply-To: <CAF2d9jiWcu1VEdoC-tNfVuy2pMPDQ1_17Bq=h8ZK6d1aJS7tAA@mail.gmail.com>
From: Mahesh Bandewar (महेश बंडेवार) <maheshb@google.com>
Date: Wed, 18 Jul 2018 16:19:17 -0700
> On Wed, Jul 18, 2018 at 1:18 PM, David Miller <davem@davemloft.net> wrote:
>> From: Mahesh Bandewar <mahesh@bandewar.net>
>> Date: Wed, 18 Jul 2018 12:55:42 -0700
>>
>>> From: Mahesh Bandewar <maheshb@google.com>
>>>
>>> Commit b89f04c61efe ("bonding: deliver link-local packets with
>>> skb->dev set to link that packets arrived on") changed the behavior
>>> of how link-local-multicast packets are processed. The change in
>>> the behavior broke some legacy use cases where these packets are
>>> expected to arrive on bonding master device also.
>>>
>>> This patch passes the packet to the stack with the link it arrived
>>> on as well as passes to the bonding-master device to preserve the
>>> legacy use case.
>>>
>>> Fixes: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on")
>>> Reported-by: Michal Soltys <soltys@ziu.info>
>>> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>>
>> If this is a regression, it should target 'net' rather than 'net-next'
>> so we can queue it up for -stable as well.
>>
> Yes, it is. Just forgot to revise the subject. Do you want me to
> resend the patch?
Yes, please.
^ permalink raw reply
* Re: [PATCH next v2] bonding: pass link-local packets to bonding master also.
From: Mahesh Bandewar (महेश बंडेवार) @ 2018-07-18 23:40 UTC (permalink / raw)
To: David Miller; +Cc: mahesh, j.vosburgh, andy, vfalico, linux-netdev, soltys
In-Reply-To: <20180719.083319.216042302413807364.davem@davemloft.net>
On Wed, Jul 18, 2018 at 4:33 PM, David Miller <davem@davemloft.net> wrote:
> From: Mahesh Bandewar (महेश बंडेवार) <maheshb@google.com>
> Date: Wed, 18 Jul 2018 16:19:17 -0700
>
>> On Wed, Jul 18, 2018 at 1:18 PM, David Miller <davem@davemloft.net> wrote:
>>> From: Mahesh Bandewar <mahesh@bandewar.net>
>>> Date: Wed, 18 Jul 2018 12:55:42 -0700
>>>
>>>> From: Mahesh Bandewar <maheshb@google.com>
>>>>
>>>> Commit b89f04c61efe ("bonding: deliver link-local packets with
>>>> skb->dev set to link that packets arrived on") changed the behavior
>>>> of how link-local-multicast packets are processed. The change in
>>>> the behavior broke some legacy use cases where these packets are
>>>> expected to arrive on bonding master device also.
>>>>
>>>> This patch passes the packet to the stack with the link it arrived
>>>> on as well as passes to the bonding-master device to preserve the
>>>> legacy use case.
>>>>
>>>> Fixes: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on")
>>>> Reported-by: Michal Soltys <soltys@ziu.info>
>>>> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>>>
>>> If this is a regression, it should target 'net' rather than 'net-next'
>>> so we can queue it up for -stable as well.
>>>
>> Yes, it is. Just forgot to revise the subject. Do you want me to
>> resend the patch?
>
> Yes, please.
sure, will do.
^ permalink raw reply
* [PATCH net v2] bonding: pass link-local packets to bonding master also.
From: Mahesh Bandewar @ 2018-07-18 23:41 UTC (permalink / raw)
To: Jay Vosburgh, Andy Gospodarek, Veaceslav Falico, David Miller
Cc: Netdev, Michal Soltys, Mahesh Bandewar, Mahesh Bandewar
From: Mahesh Bandewar <maheshb@google.com>
Commit b89f04c61efe ("bonding: deliver link-local packets with
skb->dev set to link that packets arrived on") changed the behavior
of how link-local-multicast packets are processed. The change in
the behavior broke some legacy use cases where these packets are
expected to arrive on bonding master device also.
This patch passes the packet to the stack with the link it arrived
on as well as passes to the bonding-master device to preserve the
legacy use case.
Fixes: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on")
Reported-by: Michal Soltys <soltys@ziu.info>
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
v2: Added Fixes tag.
v1: Initial patch.
drivers/net/bonding/bond_main.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 9a2ea3c1f949..1d3b7d8448f2 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1177,9 +1177,22 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
}
}
- /* don't change skb->dev for link-local packets */
- if (is_link_local_ether_addr(eth_hdr(skb)->h_dest))
+ /* Link-local multicast packets should be passed to the
+ * stack on the link they arrive as well as pass them to the
+ * bond-master device. These packets are mostly usable when
+ * stack receives it with the link on which they arrive
+ * (e.g. LLDP) but there may be some legacy behavior that
+ * expects these packets to appear on bonding master too.
+ */
+ if (is_link_local_ether_addr(eth_hdr(skb)->h_dest)) {
+ struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
+
+ if (nskb) {
+ nskb->dev = bond->dev;
+ netif_rx(nskb);
+ }
return RX_HANDLER_PASS;
+ }
if (bond_should_deliver_exact_match(skb, slave, bond))
return RX_HANDLER_EXACT;
--
2.18.0.203.gfac676dfb9-goog
^ permalink raw reply related
* Re: [PATCH iproute2 5/5] bpf: implement btf handling and map annotation
From: Martin KaFai Lau @ 2018-07-18 23:52 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: Daniel Borkmann, dsahern, alexei.starovoitov, netdev
In-Reply-To: <20180717172743.6e5e1231@cakuba.lan>
On Tue, Jul 17, 2018 at 05:27:43PM -0700, Jakub Kicinski wrote:
> On Wed, 18 Jul 2018 01:31:22 +0200, Daniel Borkmann wrote:
> > # bpftool map dump id 386
> > [{
> > "key": 0,
> > "value": {
> > "": {
> > "value": 0,
> > "ifindex": 0,
> > "mac": []
> > }
> > }
> > },{
> > "key": 1,
> > "value": {
> > "": {
> > "value": 0,
> > "ifindex": 0,
> > "mac": []
> > }
> > }
> > },{
> > [...]
>
> Ugh, the empty keys ("") look worrying, we should probably improve
> handling of anonymous structs in bpftool :S
Note that the kernel's btf_verifier_log is using "(anon)" in this case.
Not sure if it is a good idea for json.
^ permalink raw reply
* [PATCH net-next,v2] net: rename ndo_setup_tc to ndo_setup_offload
From: Pablo Neira Ayuso @ 2018-07-19 0:11 UTC (permalink / raw)
To: netdev
Cc: jiri, thomas.lendacky, f.fainelli, ariel.elior, michael.chan,
santosh, madalin.bucur, yisen.zhuang, salil.mehta,
jeffrey.t.kirsher, tariqt, saeedm, jiri, idosch, ganeshgr,
jakub.kicinski, linux-net-drivers, peppe.cavallaro,
alexandre.torgue, joabreu, grygorii.strashko, andrew,
vivien.didelot
One of the recurring complaints is that we do not have, as a driver
writer, a central location from which we would be fed offloading rules
into a NIC. This was brought up again during Netconf'18 in Boston.
This patch just renames ndo_setup_tc to ndo_setup_offload as a very
early initial work to prepare for follow up patch that discuss unified
flow representation for the existing offload programming APIs.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
v2: Missing function definition update in drivers/net/ethernet/sfc/falcon/tx.c
apparently I forgot to turn on that driver when doing compile-testing,
problem spotted by Martin Habets. Keeping Jakub and Jiri Acked-by tags,
as this is the only change in the v1 patch.
drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 6 +++---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 +++---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 4 ++--
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +++---
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 6 +++---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 6 +++---
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 6 +++---
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 +++---
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 6 +++---
drivers/net/ethernet/intel/i40e/i40e_main.c | 6 +++---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 8 ++++----
drivers/net/ethernet/intel/igb/igb_main.c | 6 +++---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 +++---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 9 +++++----
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 +++---
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 6 +++---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 6 +++---
drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 +-
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 2 +-
drivers/net/ethernet/netronome/nfp/nfp_port.c | 4 ++--
drivers/net/ethernet/netronome/nfp/nfp_port.h | 4 ++--
drivers/net/ethernet/sfc/efx.c | 2 +-
drivers/net/ethernet/sfc/efx.h | 4 ++--
drivers/net/ethernet/sfc/falcon/efx.c | 2 +-
drivers/net/ethernet/sfc/falcon/efx.h | 4 ++--
drivers/net/ethernet/sfc/falcon/tx.c | 4 ++--
drivers/net/ethernet/sfc/tx.c | 4 ++--
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++---
drivers/net/ethernet/ti/netcp_core.c | 6 +++---
drivers/net/netdevsim/netdev.c | 5 +++--
include/linux/netdevice.h | 18 +++++++++---------
net/dsa/slave.c | 7 ++++---
net/sched/cls_api.c | 6 +++---
net/sched/sch_cbs.c | 8 ++++----
net/sched/sch_etf.c | 8 ++++----
net/sched/sch_mq.c | 8 ++++----
net/sched/sch_mqprio.c | 16 ++++++++--------
net/sched/sch_prio.c | 15 ++++++++-------
net/sched/sch_red.c | 15 ++++++++-------
40 files changed, 131 insertions(+), 126 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index 24f1053b8785..766864a35648 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -2246,8 +2246,8 @@ static void xgbe_poll_controller(struct net_device *netdev)
}
#endif /* End CONFIG_NET_POLL_CONTROLLER */
-static int xgbe_setup_tc(struct net_device *netdev, enum tc_setup_type type,
- void *type_data)
+static int xgbe_setup_offload(struct net_device *netdev,
+ enum tc_setup_type type, void *type_data)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
struct tc_mqprio_qopt *mqprio = type_data;
@@ -2501,7 +2501,7 @@ static const struct net_device_ops xgbe_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = xgbe_poll_controller,
#endif
- .ndo_setup_tc = xgbe_setup_tc,
+ .ndo_setup_offload = xgbe_setup_offload,
.ndo_fix_features = xgbe_fix_features,
.ndo_set_features = xgbe_set_features,
.ndo_udp_tunnel_add = xgbe_udp_tunnel_add,
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 5a727d4729da..200a5938dfe5 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -4228,7 +4228,7 @@ void bnx2x_get_c2s_mapping(struct bnx2x *bp, u8 *c2s_map, u8 *c2s_default)
* @netdev: net device to configure
* @tc: number of traffic classes to enable
*
- * callback connected to the ndo_setup_tc function pointer
+ * callback connected to the ndo_setup_offload function pointer
*/
int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
{
@@ -4293,8 +4293,8 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
return 0;
}
-int __bnx2x_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+int __bnx2x_setup_offload(struct net_device *dev, enum tc_setup_type type,
+ void *type_data)
{
struct tc_mqprio_qopt *mqprio = type_data;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
index 0e508e5defce..e3df86f8d140 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -486,8 +486,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev);
/* setup_tc callback */
int bnx2x_setup_tc(struct net_device *dev, u8 num_tc);
-int __bnx2x_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data);
+int __bnx2x_setup_offload(struct net_device *dev, enum tc_setup_type type,
+ void *type_data);
int bnx2x_get_vf_config(struct net_device *dev, int vf,
struct ifla_vf_info *ivi);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 71362b7f6040..b238f3478a2f 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13116,7 +13116,7 @@ static const struct net_device_ops bnx2x_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = poll_bnx2x,
#endif
- .ndo_setup_tc = __bnx2x_setup_tc,
+ .ndo_setup_offload = __bnx2x_setup_offload,
#ifdef CONFIG_BNX2X_SRIOV
.ndo_set_vf_mac = bnx2x_set_vf_mac,
.ndo_set_vf_vlan = bnx2x_set_vf_vlan,
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index d2dadade1d0e..e38e1cdd4e02 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -7993,8 +7993,8 @@ static int bnxt_setup_tc_block(struct net_device *dev,
}
}
-static int bnxt_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int bnxt_setup_offload(struct net_device *dev, enum tc_setup_type type,
+ void *type_data)
{
switch (type) {
case TC_SETUP_BLOCK:
@@ -8377,7 +8377,7 @@ static const struct net_device_ops bnxt_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = bnxt_poll_controller,
#endif
- .ndo_setup_tc = bnxt_setup_tc,
+ .ndo_setup_offload = bnxt_setup_offload,
#ifdef CONFIG_RFS_ACCEL
.ndo_rx_flow_steer = bnxt_rx_flow_steer,
#endif
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
index e31f5d803c13..76abfd943d7c 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
@@ -183,8 +183,8 @@ static int bnxt_vf_rep_setup_tc_block(struct net_device *dev,
}
}
-static int bnxt_vf_rep_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int bnxt_vf_rep_setup_offload(struct net_device *dev,
+ enum tc_setup_type type, void *type_data)
{
switch (type) {
case TC_SETUP_BLOCK:
@@ -263,7 +263,7 @@ static const struct net_device_ops bnxt_vf_rep_netdev_ops = {
.ndo_stop = bnxt_vf_rep_close,
.ndo_start_xmit = bnxt_vf_rep_xmit,
.ndo_get_stats64 = bnxt_vf_rep_get_stats64,
- .ndo_setup_tc = bnxt_vf_rep_setup_tc,
+ .ndo_setup_offload = bnxt_vf_rep_setup_offload,
.ndo_get_phys_port_name = bnxt_vf_rep_get_phys_port_name
};
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 40cf8dc9f163..899fe9921bdf 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -3027,8 +3027,8 @@ static int cxgb_setup_tc_block(struct net_device *dev,
}
}
-static int cxgb_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int cxgb_setup_offload(struct net_device *dev, enum tc_setup_type type,
+ void *type_data)
{
switch (type) {
case TC_SETUP_BLOCK:
@@ -3236,7 +3236,7 @@ static const struct net_device_ops cxgb4_netdev_ops = {
.ndo_fcoe_disable = cxgb_fcoe_disable,
#endif /* CONFIG_CHELSIO_T4_FCOE */
.ndo_set_tx_maxrate = cxgb_set_tx_maxrate,
- .ndo_setup_tc = cxgb_setup_tc,
+ .ndo_setup_offload = cxgb_setup_offload,
.ndo_udp_tunnel_add = cxgb_add_udp_tunnel,
.ndo_udp_tunnel_del = cxgb_del_udp_tunnel,
.ndo_features_check = cxgb_features_check,
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 65a22cd9aef2..1537e92d147c 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -346,8 +346,8 @@ static void dpaa_get_stats64(struct net_device *net_dev,
}
}
-static int dpaa_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
- void *type_data)
+static int dpaa_setup_offload(struct net_device *net_dev,
+ enum tc_setup_type type, void *type_data)
{
struct dpaa_priv *priv = netdev_priv(net_dev);
struct tc_mqprio_qopt *mqprio = type_data;
@@ -2619,7 +2619,7 @@ static const struct net_device_ops dpaa_ops = {
.ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = dpaa_set_rx_mode,
.ndo_do_ioctl = dpaa_ioctl,
- .ndo_setup_tc = dpaa_setup_tc,
+ .ndo_setup_offload = dpaa_setup_offload,
};
static int dpaa_napi_add(struct net_device *net_dev)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index c211450bfd78..b5fdafff1ff7 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -1368,8 +1368,8 @@ static int hns3_setup_tc(struct net_device *netdev, void *type_data)
return ret;
}
-static int hns3_nic_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int hns3_nic_setup_offload(struct net_device *dev,
+ enum tc_setup_type type, void *type_data)
{
if (type != TC_SETUP_QDISC_MQPRIO)
return -EOPNOTSUPP;
@@ -1543,7 +1543,7 @@ static const struct net_device_ops hns3_nic_netdev_ops = {
.ndo_change_mtu = hns3_nic_change_mtu,
.ndo_set_features = hns3_nic_set_features,
.ndo_get_stats64 = hns3_nic_get_stats64,
- .ndo_setup_tc = hns3_nic_setup_tc,
+ .ndo_setup_offload = hns3_nic_setup_offload,
.ndo_set_rx_mode = hns3_nic_set_rx_mode,
.ndo_vlan_rx_add_vid = hns3_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = hns3_vlan_rx_kill_vid,
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index 929f538d28bc..40bfc52f1928 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -1428,8 +1428,8 @@ int fm10k_setup_tc(struct net_device *dev, u8 tc)
return err;
}
-static int __fm10k_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int __fm10k_setup_offload(struct net_device *dev,
+ enum tc_setup_type type, void *type_data)
{
struct tc_mqprio_qopt *mqprio = type_data;
@@ -1639,7 +1639,7 @@ static const struct net_device_ops fm10k_netdev_ops = {
.ndo_vlan_rx_kill_vid = fm10k_vlan_rx_kill_vid,
.ndo_set_rx_mode = fm10k_set_rx_mode,
.ndo_get_stats64 = fm10k_get_stats64,
- .ndo_setup_tc = __fm10k_setup_tc,
+ .ndo_setup_offload = __fm10k_setup_offload,
.ndo_set_vf_mac = fm10k_ndo_set_vf_mac,
.ndo_set_vf_vlan = fm10k_ndo_set_vf_vlan,
.ndo_set_vf_rate = fm10k_ndo_set_vf_bw,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 51762428b40e..f409ca5a9c9a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7563,8 +7563,8 @@ static int i40e_setup_tc_block(struct net_device *dev,
}
}
-static int __i40e_setup_tc(struct net_device *netdev, enum tc_setup_type type,
- void *type_data)
+static int __i40e_setup_offload(struct net_device *netdev,
+ enum tc_setup_type type, void *type_data)
{
switch (type) {
case TC_SETUP_QDISC_MQPRIO:
@@ -11864,7 +11864,7 @@ static const struct net_device_ops i40e_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = i40e_netpoll,
#endif
- .ndo_setup_tc = __i40e_setup_tc,
+ .ndo_setup_offload = __i40e_setup_offload,
.ndo_set_features = i40e_set_features,
.ndo_set_vf_mac = i40e_ndo_set_vf_mac,
.ndo_set_vf_vlan = i40e_ndo_set_vf_port_vlan,
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 5906c1c1d19d..9c1111410f2b 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2942,13 +2942,13 @@ static int i40evf_setup_tc_block(struct net_device *dev,
* @type: type of offload
* @type_date: tc offload data
*
- * This function is the callback to ndo_setup_tc in the
+ * This function is the callback to ndo_setup_offload in the
* netdev_ops.
*
* Returns 0 on success
**/
-static int i40evf_setup_tc(struct net_device *netdev, enum tc_setup_type type,
- void *type_data)
+static int i40evf_setup_offload(struct net_device *netdev,
+ enum tc_setup_type type, void *type_data)
{
switch (type) {
case TC_SETUP_QDISC_MQPRIO:
@@ -3232,7 +3232,7 @@ static const struct net_device_ops i40evf_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = i40evf_netpoll,
#endif
- .ndo_setup_tc = i40evf_setup_tc,
+ .ndo_setup_offload = i40evf_setup_offload,
};
/**
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index e3a0c02721c9..69b1633b6351 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2845,8 +2845,8 @@ static int igb_offload_txtime(struct igb_adapter *adapter,
return 0;
}
-static int igb_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int igb_setup_offload(struct net_device *dev, enum tc_setup_type type,
+ void *type_data)
{
struct igb_adapter *adapter = netdev_priv(dev);
@@ -2889,7 +2889,7 @@ static const struct net_device_ops igb_netdev_ops = {
.ndo_set_features = igb_set_features,
.ndo_fdb_add = igb_ndo_fdb_add,
.ndo_features_check = igb_features_check,
- .ndo_setup_tc = igb_setup_tc,
+ .ndo_setup_offload = igb_setup_offload,
};
/**
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 5a6600f7b382..872b2a4f3d9a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9360,8 +9360,8 @@ static int ixgbe_setup_tc_mqprio(struct net_device *dev,
return ixgbe_setup_tc(dev, mqprio->num_tc);
}
-static int __ixgbe_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int __ixgbe_setup_offload(struct net_device *dev,
+ enum tc_setup_type type, void *type_data)
{
switch (type) {
case TC_SETUP_BLOCK:
@@ -10068,7 +10068,7 @@ static const struct net_device_ops ixgbe_netdev_ops = {
.ndo_set_vf_trust = ixgbe_ndo_set_vf_trust,
.ndo_get_vf_config = ixgbe_ndo_get_vf_config,
.ndo_get_stats64 = ixgbe_get_stats64,
- .ndo_setup_tc = __ixgbe_setup_tc,
+ .ndo_setup_offload = __ixgbe_setup_offload,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = ixgbe_netpoll,
#endif
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 6785661d1a72..4a01b58a07f4 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -130,8 +130,9 @@ int mlx4_en_alloc_tx_queue_per_tc(struct net_device *dev, u8 tc)
return err;
}
-static int __mlx4_en_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int __mlx4_en_setup_offload(struct net_device *dev,
+ enum tc_setup_type type,
+ void *type_data)
{
struct tc_mqprio_qopt *mqprio = type_data;
@@ -2951,7 +2952,7 @@ static const struct net_device_ops mlx4_netdev_ops = {
#endif
.ndo_set_features = mlx4_en_set_features,
.ndo_fix_features = mlx4_en_fix_features,
- .ndo_setup_tc = __mlx4_en_setup_tc,
+ .ndo_setup_offload = __mlx4_en_setup_offload,
#ifdef CONFIG_RFS_ACCEL
.ndo_rx_flow_steer = mlx4_en_filter_rfs,
#endif
@@ -2988,7 +2989,7 @@ static const struct net_device_ops mlx4_netdev_ops_master = {
#endif
.ndo_set_features = mlx4_en_set_features,
.ndo_fix_features = mlx4_en_fix_features,
- .ndo_setup_tc = __mlx4_en_setup_tc,
+ .ndo_setup_offload = __mlx4_en_setup_offload,
#ifdef CONFIG_RFS_ACCEL
.ndo_rx_flow_steer = mlx4_en_filter_rfs,
#endif
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 712b9766485f..469359cbef27 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3383,8 +3383,8 @@ static int mlx5e_setup_tc_block(struct net_device *dev,
}
#endif
-static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int mlx5e_setup_offload(struct net_device *dev, enum tc_setup_type type,
+ void *type_data)
{
switch (type) {
#ifdef CONFIG_MLX5_ESWITCH
@@ -4222,7 +4222,7 @@ static const struct net_device_ops mlx5e_netdev_ops = {
.ndo_open = mlx5e_open,
.ndo_stop = mlx5e_close,
.ndo_start_xmit = mlx5e_xmit,
- .ndo_setup_tc = mlx5e_setup_tc,
+ .ndo_setup_offload = mlx5e_setup_offload,
.ndo_select_queue = mlx5e_select_queue,
.ndo_get_stats64 = mlx5e_get_stats,
.ndo_set_rx_mode = mlx5e_set_rx_mode,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 8e3c5b4b90ab..eddb20fd4dcc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -806,8 +806,8 @@ static int mlx5e_rep_setup_tc_block(struct net_device *dev,
}
}
-static int mlx5e_rep_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int mlx5e_rep_setup_offload(struct net_device *dev,
+ enum tc_setup_type type, void *type_data)
{
switch (type) {
case TC_SETUP_BLOCK:
@@ -917,7 +917,7 @@ static const struct net_device_ops mlx5e_netdev_ops_rep = {
.ndo_stop = mlx5e_rep_close,
.ndo_start_xmit = mlx5e_xmit,
.ndo_get_phys_port_name = mlx5e_rep_get_phys_port_name,
- .ndo_setup_tc = mlx5e_rep_setup_tc,
+ .ndo_setup_offload = mlx5e_rep_setup_offload,
.ndo_get_stats64 = mlx5e_rep_get_stats,
.ndo_has_offload_stats = mlx5e_has_offload_stats,
.ndo_get_offload_stats = mlx5e_get_offload_stats,
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 6ec0f91a93cc..910fefbec88d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1631,8 +1631,8 @@ static int mlxsw_sp_setup_tc_block(struct mlxsw_sp_port *mlxsw_sp_port,
}
}
-static int mlxsw_sp_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int mlxsw_sp_setup_offload(struct net_device *dev,
+ enum tc_setup_type type, void *type_data)
{
struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev);
@@ -1708,7 +1708,7 @@ static const struct net_device_ops mlxsw_sp_port_netdev_ops = {
.ndo_open = mlxsw_sp_port_open,
.ndo_stop = mlxsw_sp_port_stop,
.ndo_start_xmit = mlxsw_sp_port_xmit,
- .ndo_setup_tc = mlxsw_sp_setup_tc,
+ .ndo_setup_offload = mlxsw_sp_setup_offload,
.ndo_set_rx_mode = mlxsw_sp_set_rx_mode,
.ndo_set_mac_address = mlxsw_sp_port_set_mac_address,
.ndo_change_mtu = mlxsw_sp_port_change_mtu,
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index a712e83c3f0f..56f7b468bc8c 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -3494,7 +3494,7 @@ const struct net_device_ops nfp_net_netdev_ops = {
.ndo_set_vf_spoofchk = nfp_app_set_vf_spoofchk,
.ndo_get_vf_config = nfp_app_get_vf_config,
.ndo_set_vf_link_state = nfp_app_set_vf_link_state,
- .ndo_setup_tc = nfp_port_setup_tc,
+ .ndo_setup_offload = nfp_port_setup_offload,
.ndo_tx_timeout = nfp_net_tx_timeout,
.ndo_set_rx_mode = nfp_net_set_rx_mode,
.ndo_change_mtu = nfp_net_change_mtu,
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
index d7b712f6362f..a98d3762caa2 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
@@ -270,7 +270,7 @@ const struct net_device_ops nfp_repr_netdev_ops = {
.ndo_has_offload_stats = nfp_repr_has_offload_stats,
.ndo_get_offload_stats = nfp_repr_get_offload_stats,
.ndo_get_phys_port_name = nfp_port_get_phys_port_name,
- .ndo_setup_tc = nfp_port_setup_tc,
+ .ndo_setup_offload = nfp_port_setup_offload,
.ndo_set_vf_mac = nfp_app_set_vf_mac,
.ndo_set_vf_vlan = nfp_app_set_vf_vlan,
.ndo_set_vf_spoofchk = nfp_app_set_vf_spoofchk,
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.c b/drivers/net/ethernet/netronome/nfp/nfp_port.c
index 9c1298114c70..fb945adada08 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_port.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_port.c
@@ -89,8 +89,8 @@ const struct switchdev_ops nfp_port_switchdev_ops = {
.switchdev_port_attr_get = nfp_port_attr_get,
};
-int nfp_port_setup_tc(struct net_device *netdev, enum tc_setup_type type,
- void *type_data)
+int nfp_port_setup_offload(struct net_device *netdev, enum tc_setup_type type,
+ void *type_data)
{
struct nfp_port *port;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.h b/drivers/net/ethernet/netronome/nfp/nfp_port.h
index 51f10ae2d53e..044fbb6f9219 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_port.h
+++ b/drivers/net/ethernet/netronome/nfp/nfp_port.h
@@ -124,8 +124,8 @@ extern const struct switchdev_ops nfp_port_switchdev_ops;
__printf(2, 3) u8 *nfp_pr_et(u8 *data, const char *fmt, ...);
-int nfp_port_setup_tc(struct net_device *netdev, enum tc_setup_type type,
- void *type_data);
+int nfp_port_setup_offload(struct net_device *netdev, enum tc_setup_type type,
+ void *type_data);
static inline bool nfp_port_is_vnic(const struct nfp_port *port)
{
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index b24c2e21db8e..d0cbded8360b 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2518,7 +2518,7 @@ static const struct net_device_ops efx_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = efx_netpoll,
#endif
- .ndo_setup_tc = efx_setup_tc,
+ .ndo_setup_offload = efx_setup_offload,
#ifdef CONFIG_RFS_ACCEL
.ndo_rx_flow_steer = efx_filter_rfs,
#endif
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index 3f759ebdcf10..383fb4c15dea 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -27,8 +27,8 @@ netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb,
struct net_device *net_dev);
netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb);
void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index);
-int efx_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
- void *type_data);
+int efx_setup_offload(struct net_device *net_dev, enum tc_setup_type type,
+ void *type_data);
unsigned int efx_tx_max_skb_descs(struct efx_nic *efx);
extern unsigned int efx_piobuf_size;
extern bool efx_separate_tx_channels;
diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c
index dd5530a4f8c8..8c8b012945a8 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.c
+++ b/drivers/net/ethernet/sfc/falcon/efx.c
@@ -2253,7 +2253,7 @@ static const struct net_device_ops ef4_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = ef4_netpoll,
#endif
- .ndo_setup_tc = ef4_setup_tc,
+ .ndo_setup_offload = ef4_setup_offload,
#ifdef CONFIG_RFS_ACCEL
.ndo_rx_flow_steer = ef4_filter_rfs,
#endif
diff --git a/drivers/net/ethernet/sfc/falcon/efx.h b/drivers/net/ethernet/sfc/falcon/efx.h
index a4e4d8ea4078..67ff3891bc42 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.h
+++ b/drivers/net/ethernet/sfc/falcon/efx.h
@@ -32,8 +32,8 @@ netdev_tx_t ef4_hard_start_xmit(struct sk_buff *skb,
struct net_device *net_dev);
netdev_tx_t ef4_enqueue_skb(struct ef4_tx_queue *tx_queue, struct sk_buff *skb);
void ef4_xmit_done(struct ef4_tx_queue *tx_queue, unsigned int index);
-int ef4_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
- void *type_data);
+int ef4_setup_offload(struct net_device *net_dev, enum tc_setup_type type,
+ void *type_data);
unsigned int ef4_tx_max_skb_descs(struct ef4_nic *efx);
extern bool ef4_separate_tx_channels;
diff --git a/drivers/net/ethernet/sfc/falcon/tx.c b/drivers/net/ethernet/sfc/falcon/tx.c
index 3409bbf5b19f..15a1b82160bb 100644
--- a/drivers/net/ethernet/sfc/falcon/tx.c
+++ b/drivers/net/ethernet/sfc/falcon/tx.c
@@ -425,8 +425,8 @@ void ef4_init_tx_queue_core_txq(struct ef4_tx_queue *tx_queue)
efx->n_tx_channels : 0));
}
-int ef4_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
- void *type_data)
+int ef4_setup_offload(struct net_device *net_dev, enum tc_setup_type type,
+ void *type_data)
{
struct ef4_nic *efx = netdev_priv(net_dev);
struct tc_mqprio_qopt *mqprio = type_data;
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index c3ad564ac4c0..53c7801decbc 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -687,8 +687,8 @@ void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue)
efx->n_tx_channels : 0));
}
-int efx_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
- void *type_data)
+int efx_setup_offload(struct net_device *net_dev, enum tc_setup_type type,
+ void *type_data)
{
struct efx_nic *efx = netdev_priv(net_dev);
struct tc_mqprio_qopt *mqprio = type_data;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index d9e60cfd8a85..a274d0c6b375 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3787,8 +3787,8 @@ static int stmmac_setup_tc_block(struct stmmac_priv *priv,
}
}
-static int stmmac_setup_tc(struct net_device *ndev, enum tc_setup_type type,
- void *type_data)
+static int stmmac_setup_offload(struct net_device *ndev,
+ enum tc_setup_type type, void *type_data)
{
struct stmmac_priv *priv = netdev_priv(ndev);
@@ -4040,7 +4040,7 @@ static const struct net_device_ops stmmac_netdev_ops = {
.ndo_set_rx_mode = stmmac_set_rx_mode,
.ndo_tx_timeout = stmmac_tx_timeout,
.ndo_do_ioctl = stmmac_ioctl,
- .ndo_setup_tc = stmmac_setup_tc,
+ .ndo_setup_offload = stmmac_setup_offload,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = stmmac_poll_controller,
#endif
diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index a1d335a3c5e4..70d469eabc10 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -1889,8 +1889,8 @@ static int netcp_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid)
return err;
}
-static int netcp_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int netcp_setup_offload(struct net_device *dev, enum tc_setup_type type,
+ void *type_data)
{
struct tc_mqprio_qopt *mqprio = type_data;
u8 num_tc;
@@ -1966,7 +1966,7 @@ static const struct net_device_ops netcp_netdev_ops = {
.ndo_vlan_rx_kill_vid = netcp_rx_kill_vid,
.ndo_tx_timeout = netcp_ndo_tx_timeout,
.ndo_select_queue = dev_pick_tx_zero,
- .ndo_setup_tc = netcp_setup_tc,
+ .ndo_setup_offload = netcp_setup_offload,
};
static int netcp_create_interface(struct netcp_device *netcp_device,
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index a7b179f0d954..9b6a5d2f335f 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -393,7 +393,8 @@ static int nsim_set_vf_link_state(struct net_device *dev, int vf, int state)
}
static int
-nsim_setup_tc(struct net_device *dev, enum tc_setup_type type, void *type_data)
+nsim_setup_offload(struct net_device *dev, enum tc_setup_type type,
+ void *type_data)
{
switch (type) {
case TC_SETUP_BLOCK:
@@ -431,7 +432,7 @@ static const struct net_device_ops nsim_netdev_ops = {
.ndo_get_vf_config = nsim_get_vf_config,
.ndo_set_vf_link_state = nsim_set_vf_link_state,
.ndo_set_vf_rss_query_en = nsim_set_vf_rss_query_en,
- .ndo_setup_tc = nsim_setup_tc,
+ .ndo_setup_offload = nsim_setup_offload,
.ndo_set_features = nsim_set_features,
.ndo_bpf = nsim_bpf,
};
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3514d67112b3..0f50bf95b7cd 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1047,12 +1047,12 @@ struct dev_ifalias {
* with PF and querying it may introduce a theoretical security risk.
* int (*ndo_set_vf_rss_query_en)(struct net_device *dev, int vf, bool setting);
* int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb);
- * int (*ndo_setup_tc)(struct net_device *dev, enum tc_setup_type type,
- * void *type_data);
- * Called to setup any 'tc' scheduler, classifier or action on @dev.
- * This is always called from the stack with the rtnl lock held and netif
- * tx queues stopped. This allows the netdevice to perform queue
- * management safely.
+ * int (*ndo_setup_offload)(struct net_device *dev, enum tc_setup_type type,
+ void *type_data);
+ * Called to setup any offload, such as 'tc' scheduler, classifier or
+ * action on @dev. This is always called from the stack with the rtnl lock
+ * held and netif tx queues stopped. This allows the netdevice to perform
+ * queue management safely.
*
* Fiber Channel over Ethernet (FCoE) offload functions.
* int (*ndo_fcoe_enable)(struct net_device *dev);
@@ -1297,9 +1297,9 @@ struct net_device_ops {
int (*ndo_set_vf_rss_query_en)(
struct net_device *dev,
int vf, bool setting);
- int (*ndo_setup_tc)(struct net_device *dev,
- enum tc_setup_type type,
- void *type_data);
+ int (*ndo_setup_offload)(struct net_device *dev,
+ enum tc_setup_type type,
+ void *type_data);
#if IS_ENABLED(CONFIG_FCOE)
int (*ndo_fcoe_enable)(struct net_device *dev);
int (*ndo_fcoe_disable)(struct net_device *dev);
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 71536c435132..a8f4013edc2a 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -909,8 +909,9 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
}
}
-static int dsa_slave_setup_tc(struct net_device *dev, enum tc_setup_type type,
- void *type_data)
+static int dsa_slave_setup_offload(struct net_device *dev,
+ enum tc_setup_type type,
+ void *type_data)
{
switch (type) {
case TC_SETUP_BLOCK:
@@ -1045,7 +1046,7 @@ static const struct net_device_ops dsa_slave_netdev_ops = {
.ndo_poll_controller = dsa_slave_poll_controller,
#endif
.ndo_get_phys_port_name = dsa_slave_get_phys_port_name,
- .ndo_setup_tc = dsa_slave_setup_tc,
+ .ndo_setup_offload = dsa_slave_setup_offload,
.ndo_get_stats64 = dsa_slave_get_stats64,
};
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index c51b1b12450d..d5add1358b66 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -286,7 +286,7 @@ static int tcf_block_offload_cmd(struct tcf_block *block,
bo.binder_type = ei->binder_type;
bo.block = block;
bo.extack = extack;
- return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_BLOCK, &bo);
+ return dev->netdev_ops->ndo_setup_offload(dev, TC_SETUP_BLOCK, &bo);
}
static int tcf_block_offload_bind(struct tcf_block *block, struct Qdisc *q,
@@ -296,7 +296,7 @@ static int tcf_block_offload_bind(struct tcf_block *block, struct Qdisc *q,
struct net_device *dev = q->dev_queue->dev;
int err;
- if (!dev->netdev_ops->ndo_setup_tc)
+ if (!dev->netdev_ops->ndo_setup_offload)
goto no_offload_dev_inc;
/* If tc offload feature is disabled and the block we try to bind
@@ -325,7 +325,7 @@ static void tcf_block_offload_unbind(struct tcf_block *block, struct Qdisc *q,
struct net_device *dev = q->dev_queue->dev;
int err;
- if (!dev->netdev_ops->ndo_setup_tc)
+ if (!dev->netdev_ops->ndo_setup_offload)
goto no_offload_dev_dec;
err = tcf_block_offload_cmd(block, dev, ei, TC_BLOCK_UNBIND, NULL);
if (err == -EOPNOTSUPP)
diff --git a/net/sched/sch_cbs.c b/net/sched/sch_cbs.c
index cdd96b9a27bc..d7e4169f9a1c 100644
--- a/net/sched/sch_cbs.c
+++ b/net/sched/sch_cbs.c
@@ -206,13 +206,13 @@ static void cbs_disable_offload(struct net_device *dev,
q->dequeue = cbs_dequeue_soft;
ops = dev->netdev_ops;
- if (!ops->ndo_setup_tc)
+ if (!ops->ndo_setup_offload)
return;
cbs.queue = q->queue;
cbs.enable = 0;
- err = ops->ndo_setup_tc(dev, TC_SETUP_QDISC_CBS, &cbs);
+ err = ops->ndo_setup_offload(dev, TC_SETUP_QDISC_CBS, &cbs);
if (err < 0)
pr_warn("Couldn't disable CBS offload for queue %d\n",
cbs.queue);
@@ -226,7 +226,7 @@ static int cbs_enable_offload(struct net_device *dev, struct cbs_sched_data *q,
struct tc_cbs_qopt_offload cbs = { };
int err;
- if (!ops->ndo_setup_tc) {
+ if (!ops->ndo_setup_offload) {
NL_SET_ERR_MSG(extack, "Specified device does not support cbs offload");
return -EOPNOTSUPP;
}
@@ -239,7 +239,7 @@ static int cbs_enable_offload(struct net_device *dev, struct cbs_sched_data *q,
cbs.idleslope = opt->idleslope;
cbs.sendslope = opt->sendslope;
- err = ops->ndo_setup_tc(dev, TC_SETUP_QDISC_CBS, &cbs);
+ err = ops->ndo_setup_offload(dev, TC_SETUP_QDISC_CBS, &cbs);
if (err < 0) {
NL_SET_ERR_MSG(extack, "Specified device failed to setup cbs hardware offload");
return err;
diff --git a/net/sched/sch_etf.c b/net/sched/sch_etf.c
index 1538d6fa8165..97061e26d2b5 100644
--- a/net/sched/sch_etf.c
+++ b/net/sched/sch_etf.c
@@ -272,13 +272,13 @@ static void etf_disable_offload(struct net_device *dev,
return;
ops = dev->netdev_ops;
- if (!ops->ndo_setup_tc)
+ if (!ops->ndo_setup_offload)
return;
etf.queue = q->queue;
etf.enable = 0;
- err = ops->ndo_setup_tc(dev, TC_SETUP_QDISC_ETF, &etf);
+ err = ops->ndo_setup_offload(dev, TC_SETUP_QDISC_ETF, &etf);
if (err < 0)
pr_warn("Couldn't disable ETF offload for queue %d\n",
etf.queue);
@@ -294,7 +294,7 @@ static int etf_enable_offload(struct net_device *dev, struct etf_sched_data *q,
if (q->offload)
return 0;
- if (!ops->ndo_setup_tc) {
+ if (!ops->ndo_setup_offload) {
NL_SET_ERR_MSG(extack, "Specified device does not support ETF offload");
return -EOPNOTSUPP;
}
@@ -302,7 +302,7 @@ static int etf_enable_offload(struct net_device *dev, struct etf_sched_data *q,
etf.queue = q->queue;
etf.enable = 1;
- err = ops->ndo_setup_tc(dev, TC_SETUP_QDISC_ETF, &etf);
+ err = ops->ndo_setup_offload(dev, TC_SETUP_QDISC_ETF, &etf);
if (err < 0) {
NL_SET_ERR_MSG(extack, "Specified device failed to setup ETF hardware offload");
return err;
diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c
index d6b8ae4ed7a3..575a6b168dbc 100644
--- a/net/sched/sch_mq.c
+++ b/net/sched/sch_mq.c
@@ -32,10 +32,10 @@ static int mq_offload(struct Qdisc *sch, enum tc_mq_command cmd)
.handle = sch->handle,
};
- if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
+ if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_offload)
return -EOPNOTSUPP;
- return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_MQ, &opt);
+ return dev->netdev_ops->ndo_setup_offload(dev, TC_SETUP_QDISC_MQ, &opt);
}
static void mq_offload_stats(struct Qdisc *sch)
@@ -50,8 +50,8 @@ static void mq_offload_stats(struct Qdisc *sch)
},
};
- if (tc_can_offload(dev) && dev->netdev_ops->ndo_setup_tc)
- dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_MQ, &opt);
+ if (tc_can_offload(dev) && dev->netdev_ops->ndo_setup_offload)
+ dev->netdev_ops->ndo_setup_offload(dev, TC_SETUP_QDISC_MQ, &opt);
}
static void mq_destroy(struct Qdisc *sch)
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
index 0e9d761cdd80..153d137aa2cc 100644
--- a/net/sched/sch_mqprio.c
+++ b/net/sched/sch_mqprio.c
@@ -44,15 +44,15 @@ static void mqprio_destroy(struct Qdisc *sch)
kfree(priv->qdiscs);
}
- if (priv->hw_offload && dev->netdev_ops->ndo_setup_tc) {
+ if (priv->hw_offload && dev->netdev_ops->ndo_setup_offload) {
struct tc_mqprio_qopt_offload mqprio = { { 0 } };
switch (priv->mode) {
case TC_MQPRIO_MODE_DCB:
case TC_MQPRIO_MODE_CHANNEL:
- dev->netdev_ops->ndo_setup_tc(dev,
- TC_SETUP_QDISC_MQPRIO,
- &mqprio);
+ dev->netdev_ops->ndo_setup_offload(dev,
+ TC_SETUP_QDISC_MQPRIO,
+ &mqprio);
break;
default:
return;
@@ -85,11 +85,11 @@ static int mqprio_parse_opt(struct net_device *dev, struct tc_mqprio_qopt *qopt)
/* If hardware offload is requested we will leave it to the device
* to either populate the queue counts itself or to validate the
- * provided queue counts. If ndo_setup_tc is not present then
+ * provided queue counts. If ndo_setup_offload is not present then
* hardware doesn't support offload and we should return an error.
*/
if (qopt->hw)
- return dev->netdev_ops->ndo_setup_tc ? 0 : -EINVAL;
+ return dev->netdev_ops->ndo_setup_offload ? 0 : -EINVAL;
for (i = 0; i < qopt->num_tc; i++) {
unsigned int last = qopt->offset[i] + qopt->count[i];
@@ -239,7 +239,7 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt,
}
/* If the mqprio options indicate that hardware should own
- * the queue mapping then run ndo_setup_tc otherwise use the
+ * the queue mapping then run ndo_setup_offload otherwise use the
* supplied and verified mapping
*/
if (qopt->hw) {
@@ -266,7 +266,7 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt,
default:
return -EINVAL;
}
- err = dev->netdev_ops->ndo_setup_tc(dev,
+ err = dev->netdev_ops->ndo_setup_offload(dev,
TC_SETUP_QDISC_MQPRIO,
&mqprio);
if (err)
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 222e53d3d27a..ae9bf5fe320a 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -150,7 +150,7 @@ static int prio_offload(struct Qdisc *sch, struct tc_prio_qopt *qopt)
.parent = sch->parent,
};
- if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
+ if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_offload)
return -EOPNOTSUPP;
if (qopt) {
@@ -163,7 +163,8 @@ static int prio_offload(struct Qdisc *sch, struct tc_prio_qopt *qopt)
opt.command = TC_PRIO_DESTROY;
}
- return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_PRIO, &opt);
+ return dev->netdev_ops->ndo_setup_offload(dev, TC_SETUP_QDISC_PRIO,
+ &opt);
}
static void
@@ -266,11 +267,11 @@ static int prio_dump_offload(struct Qdisc *sch)
int err;
sch->flags &= ~TCQ_F_OFFLOADED;
- if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
+ if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_offload)
return 0;
- err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_PRIO,
- &hw_stats);
+ err = dev->netdev_ops->ndo_setup_offload(dev, TC_SETUP_QDISC_PRIO,
+ &hw_stats);
if (err == -EOPNOTSUPP)
return 0;
@@ -328,8 +329,8 @@ static int prio_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
graft_offload.graft_params.child_handle = new->handle;
graft_offload.command = TC_PRIO_GRAFT;
- err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_PRIO,
- &graft_offload);
+ err = dev->netdev_ops->ndo_setup_offload(dev, TC_SETUP_QDISC_PRIO,
+ &graft_offload);
/* Don't report error if the graft is part of destroy operation. */
if (err && new != &noop_qdisc) {
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index 56c181c3feeb..63a4ee50cf05 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -158,7 +158,7 @@ static int red_offload(struct Qdisc *sch, bool enable)
.parent = sch->parent,
};
- if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
+ if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_offload)
return -EOPNOTSUPP;
if (enable) {
@@ -172,7 +172,8 @@ static int red_offload(struct Qdisc *sch, bool enable)
opt.command = TC_RED_DESTROY;
}
- return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_RED, &opt);
+ return dev->netdev_ops->ndo_setup_offload(dev, TC_SETUP_QDISC_RED,
+ &opt);
}
static void red_destroy(struct Qdisc *sch)
@@ -295,11 +296,11 @@ static int red_dump_offload_stats(struct Qdisc *sch, struct tc_red_qopt *opt)
sch->flags &= ~TCQ_F_OFFLOADED;
- if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
+ if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_offload)
return 0;
- err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_RED,
- &hw_stats);
+ err = dev->netdev_ops->ndo_setup_offload(dev, TC_SETUP_QDISC_RED,
+ &hw_stats);
if (err == -EOPNOTSUPP)
return 0;
@@ -356,8 +357,8 @@ static int red_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
.xstats = &q->stats,
},
};
- dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_RED,
- &hw_stats_request);
+ dev->netdev_ops->ndo_setup_offload(dev, TC_SETUP_QDISC_RED,
+ &hw_stats_request);
}
st.early = q->stats.prob_drop + q->stats.forced_drop;
st.pdrop = q->stats.pdrop;
--
2.11.0
^ permalink raw reply related
* Re: [PATCH iproute2 5/5] bpf: implement btf handling and map annotation
From: Martin KaFai Lau @ 2018-07-19 0:11 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: Daniel Borkmann, dsahern, alexei.starovoitov, netdev
In-Reply-To: <20180718111337.165cfd5f@cakuba.lan>
On Wed, Jul 18, 2018 at 11:13:37AM -0700, Jakub Kicinski wrote:
> On Wed, 18 Jul 2018 11:33:22 +0200, Daniel Borkmann wrote:
> > On 07/18/2018 10:42 AM, Daniel Borkmann wrote:
> > > On 07/18/2018 02:27 AM, Jakub Kicinski wrote:
> > >> On Wed, 18 Jul 2018 01:31:22 +0200, Daniel Borkmann wrote:
> > >>> # bpftool map dump id 386
> > >>> [{
> > >>> "key": 0,
> > >>> "value": {
> > >>> "": {
> > >>> "value": 0,
> > >>> "ifindex": 0,
> > >>> "mac": []
> > >>> }
> > >>> }
> > >>> },{
> > >>> "key": 1,
> > >>> "value": {
> > >>> "": {
> > >>> "value": 0,
> > >>> "ifindex": 0,
> > >>> "mac": []
> > >>> }
> > >>> }
> > >>> },{
> > >>> [...]
> > >>
> > >> Ugh, the empty keys ("") look worrying, we should probably improve
> > >> handling of anonymous structs in bpftool :S
> > >
> > > Yeah agree, I think it would be nice to see a more pahole style dump
> > > where we have types and member names along with the value as otherwise
> > > it might be a bit confusing.
> >
> > Another feature that would be super useful imho would be in the /single/
> > map view e.g. 'bpftool map show id 123' to have a detailed BTF key+value
> > type dump, so in addition to the basic map info we show pahole like info
> > of the structs with length/offsets.
>
> That sounds good! We could also consider adding a btf object and
> commands to interrogate BTF types in the kernel in general.. Perhaps
> then we could add something like bpftool btf describe map id 123.
+1 on the btf subcommand.
>
> Having the single map view show more information seems interesting, but
> I wonder if it could be surprising. Is there precedent for such
> behaviour?
Having everything in one page (map show id 123) could be interesting.
One thing is the pahole-like output may be quite long?
e.g. the member of a struct could itself be another struct.
Not sure how the pahole-like output may look like in json though.
^ permalink raw reply
* Re: [PATCH RFC/RFT net-next 00/17] net: Convert neighbor tables to per-namespace
From: Michael Richardson @ 2018-07-19 0:54 UTC (permalink / raw)
To: dsahern
Cc: netdev, nikita.leshchenko, roopa, stephen, idosch, jiri, saeedm,
alex.aring, linux-wpan, netfilter-devel, linux-kernel,
David Ahern
In-Reply-To: <20180717120651.15748-1-dsahern@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]
>>>>> David Ahern <dsahern@gmail.com> writes:
dsahern@kernel.org wrote:
> Nikita Leshenko reported that neighbor entries in one namespace can
> evict neighbor entries in another. The problem is that the neighbor
> tables have entries across all namespaces without separate accounting
> and with global limits on when to scan for entries to evict.
> Resolve by making the neighbor tables for ipv4, ipv6 and decnet per
> namespace and making the accounting and threshold limits per namespace.
This is a good improvement, thank you.
We absolutely need to keep a DOS against a single netns from causing
evictions in another netns.
Within a namespace there may be neighbours entries that are more
sure/valid/useful than others. I would like an API to be able to
mark them explicitely, but that could come leter.
In particular, in the 802.15.4 case, NE that arrive via encrypted
channels should be preferred over entries that arrive over unencrypted
channels. This is needed for IETF 6tisch secure join work, for instance.
I believe that we could use network namespaces to implement though.
I had not considered that before, and I think that it will work, but
there might be something subtle that I've missed. (Alex?)
It appears that one can tune the amount of space on a per-namespace basis:
+ nd_tbl->gc_thresh1 = 128;
+ nd_tbl->gc_thresh2 = 512;
+ nd_tbl->gc_thresh3 = 1024;
> Remove open use of arp_tbl and nd_tbl in favor of the new
> ipv{4,6}_neigh_table helpers. Since the existence of the IPv6 table
> is managed by the core networking, the IS_ENABLED checks for IPv6
> can be removed in favor of "is the table non-NULL".
What's the advantage of changing this check? (I am ignorant)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 464 bytes --]
^ permalink raw reply
* Re: [PATCH v2 net-next 0/7] Make /sys/class/net per net namespace objects belong to container
From: Tyler Hicks @ 2018-07-19 1:07 UTC (permalink / raw)
To: David Miller
Cc: bridge, gregkh, containers, dmitry.torokhov, linux-kernel,
ebiederm, netdev, tj
In-Reply-To: <20180718.134152.1719446664161643330.davem@davemloft.net>
[-- Attachment #1.1: Type: text/plain, Size: 1053 bytes --]
On 07/17/2018 11:41 PM, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Wed, 18 Jul 2018 13:17:34 +0900 (KST)
>
>> Ok, I can't let this series rot forever, so I'll apply it to net-next.
>
> Unfortunately, I had to revert, this breaks the build:
>
> arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:1506:7: error: too few arguments to function ‘__kernfs_create_file’
> kn = __kernfs_create_file(parent_kn, name, 0444, 0,
>
I've got a fix for this. New __kernfs_create_file() users were added
since the v1 of the patch set (defconfig didn't build that code for me).
However, I'm starting to question my assumption that sufficient access
control checks are all in place for the attributes affected by patch #5.
I see a few affected attributes which don't make any capable() calls and
I'm not yet through the entire list.
My current plan is to roll in my build failure fix, drop patch #5,
retest and resubmit as a v3. I wasn't able to get to that today but
should be able to by the end of the week.
Tyler
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* [PATCH V4 net-next 2/3] tcp: Add tcp_retransmit_stamp() helper routine
From: Jon Maxwell @ 2018-07-19 1:14 UTC (permalink / raw)
To: davem
Cc: edumazet, ncardwell, David.Laight, kuznet, yoshfuji, netdev,
linux-kernel, jmaxwell
Create a seperate helper routine as per Neal Cardwells suggestion. To
be used by the final commit in this series and retransmits_timed_out().
Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
---
net/ipv4/tcp_timer.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index fa34984d0b12..d212f183dd2d 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -22,6 +22,20 @@
#include <linux/gfp.h>
#include <net/tcp.h>
+u32 tcp_retransmit_stamp(const struct sock *sk)
+{
+ u32 start_ts = tcp_sk(sk)->retrans_stamp;
+
+ if (unlikely(!start_ts)) {
+ struct sk_buff *head = tcp_rtx_queue_head(sk);
+
+ if (!head)
+ return 0;
+ start_ts = tcp_skb_timestamp(head);
+ }
+ return start_ts;
+}
+
/**
* tcp_write_err() - close socket and save error info
* @sk: The socket the error has appeared on.
@@ -166,14 +180,9 @@ static bool retransmits_timed_out(struct sock *sk,
if (!inet_csk(sk)->icsk_retransmits)
return false;
- start_ts = tcp_sk(sk)->retrans_stamp;
- if (unlikely(!start_ts)) {
- struct sk_buff *head = tcp_rtx_queue_head(sk);
-
- if (!head)
- return false;
- start_ts = tcp_skb_timestamp(head);
- }
+ start_ts = tcp_retransmit_stamp(sk);
+ if (!start_ts)
+ return false;
if (likely(timeout == 0)) {
linear_backoff_thresh = ilog2(TCP_RTO_MAX/rto_base);
--
2.13.6
^ permalink raw reply related
* [PATCH V4 net-next 3/3] tcp: Add tcp_clamp_rto_to_user_timeout() helper to improve accuracy
From: Jon Maxwell @ 2018-07-19 1:14 UTC (permalink / raw)
To: davem
Cc: edumazet, ncardwell, David.Laight, kuznet, yoshfuji, netdev,
linux-kernel, jmaxwell
Create the tcp_clamp_rto_to_user_timeout() helper routine. To calculate
the correct rto, so that the TCP_USER_TIMEOUT socket option is more
accurate. Taking suggestions and feedback into account from
Eric Dumazet, Neal Cardwell and David Laight. Due to the 1st commit we
can avoid the msecs_to_jiffies() and jiffies_to_msecs() dance.
Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
---
net/ipv4/tcp_timer.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index d212f183dd2d..a242f8874629 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -36,6 +36,21 @@ u32 tcp_retransmit_stamp(const struct sock *sk)
return start_ts;
}
+static u32 tcp_clamp_rto_to_user_timeout(const struct sock *sk)
+{
+ struct inet_connection_sock *icsk = inet_csk(sk);
+ u32 elapsed, start_ts;
+
+ start_ts = tcp_retransmit_stamp(sk);
+ if (!icsk->icsk_user_timeout || !start_ts)
+ return icsk->icsk_rto;
+ elapsed = tcp_time_stamp(tcp_sk(sk)) - start_ts;
+ if (elapsed >= icsk->icsk_user_timeout)
+ return 1; /* user timeout has passed; fire ASAP */
+ else
+ return min_t(u32, icsk->icsk_rto, msecs_to_jiffies(icsk->icsk_user_timeout - elapsed));
+}
+
/**
* tcp_write_err() - close socket and save error info
* @sk: The socket the error has appeared on.
@@ -544,7 +559,8 @@ void tcp_retransmit_timer(struct sock *sk)
/* Use normal (exponential) backoff */
icsk->icsk_rto = min(icsk->icsk_rto << 1, TCP_RTO_MAX);
}
- inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, TCP_RTO_MAX);
+ inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
+ tcp_clamp_rto_to_user_timeout(sk), TCP_RTO_MAX);
if (retransmits_timed_out(sk, net->ipv4.sysctl_tcp_retries1 + 1, 0))
__sk_dst_reset(sk);
--
2.13.6
^ permalink raw reply related
* linux-next: manual merge of the net-next tree with the net tree
From: Stephen Rothwell @ 2018-07-19 1:25 UTC (permalink / raw)
To: David Miller, Networking
Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
Stefano Brivio, Boris Pismenny, Ilya Lesokhin
[-- Attachment #1: Type: text/plain, Size: 951 bytes --]
Hi all,
Today's linux-next merge of the net-next tree got a conflict in:
include/linux/skbuff.h
between commit:
8b7008620b84 ("net: Don't copy pfmemalloc flag in __copy_skb_header()")
from the net tree and commits:
784abe24c903 ("net: Add decrypted field to skb")
a48d189ef531 ("net: Move skb decrypted field, avoid explicity copy")
from the net-next tree.
The conflict only occurs because a48d189ef531 didn't put the comment
back on the __unused field that was there before 784abe24c903.
I fixed it up (I used the former version) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging. You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* linux-next: build warning after merge of the net-next tree
From: Stephen Rothwell @ 2018-07-19 1:40 UTC (permalink / raw)
To: David Miller, Networking
Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Linus Walleij
[-- Attachment #1: Type: text/plain, Size: 366 bytes --]
Hi all,
After merging the net-next tree, today's linux-next build (x86_64
allmodconfig) produced this warning:
WARNING: modpost: missing MODULE_LICENSE() in drivers/net/dsa/realtek.o
see include/linux/module.h for more information
Introduced by commit
d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver")
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* [pull request][net-next 00/16] Mellanox, mlx5e updates 2018-07-18
From: Saeed Mahameed @ 2018-07-19 1:00 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Saeed Mahameed
Hi dave,
This series includes updates for mlx5e net device driver, with a couple
of major features and some misc updates.
Please notice the mlx5-next merge patch at the beginning:
"Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux"
For more information please see tag log below.
Please pull and let me know if there's any problem.
Thanks,
Saeed.
---
The following changes since commit 681d5d071c8bd5533a14244c0d55d1c0e30aa989:
Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux (2018-07-18 15:53:31 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5e-updates-2018-07-18
for you to fetch changes up to a0ba57c09676689eb35f13d48990c9674c9baad4:
net/mlx5e: Use PARTIAL_GSO for UDP segmentation (2018-07-18 17:26:28 -0700)
----------------------------------------------------------------
mlx5e-updates-2018-07-18
This series includes update for mlx5e net device driver.
1) From Feras Daoud, Added the support for firmware log tracing,
first by introducing the firmware API needed for the task and then
For each PF do the following:
1- Allocate memory for the tracer strings database and read it from the FW to the SW.
2- Allocate and dma map tracer buffers.
Traces that will be written into the buffer will be parsed as a group
of one or more traces, referred to as trace message. The trace message
represents a C-like printf string.
Once a new trace is available FW will generate an event indicates new trace/s are
available and the driver will parse them and dump them using tracepoints
event tracing
Enable mlx5 fw tracing by:
echo 1 > /sys/kernel/debug/tracing/events/mlx5/mlx5_fw/enable
Read traces by:
cat /sys/kernel/debug/tracing/trace
2) From Eran Ben Elisha, Support PCIe buffer congestion handling
via Devlink, using the new devlink device parameters API, added the new
parameters:
- Congestion action
HW mechanism in the PCIe buffer which monitors the amount of
consumed PCIe buffer per host. This mechanism supports the
following actions in case of threshold overflow:
- Disabled - NOP (Default)
- Drop
- Mark - Mark CE bit in the CQE of received packet
- Congestion mode
- Aggressive - Aggressive static trigger threshold (Default)
- Dynamic - Dynamically change the trigger threshold
3) From Natali, Set ECN for received packets using CQE indication.
Using Eran's congestion settings a user can enable ECN marking, on such case
driver must update ECN CE IP fields when requested by firmware (congestion is sensed).
4) From Roi Dayan, Remove redundant WARN when we cannot find neigh entry
5) From Jianbo Liu, TC double vlan support
- Support offloading tc double vlan headers match
- Support offloading double vlan push/pop tc actions
6) From Boris, re-visit UDP GSO, remove the splitting of UDP_GSO_L4 packets
in the driver, and exposes UDP_GSO_L4 as a PARTIAL_GSO feature.
----------------------------------------------------------------
Boris Pismenny (1):
net/mlx5e: Use PARTIAL_GSO for UDP segmentation
Eran Ben Elisha (3):
net/mlx5: Move all devlink related functions calls to devlink.c
net/mlx5: Add MPEGC register configuration functionality
net/mlx5: Support PCIe buffer congestion handling via Devlink
Feras Daoud (5):
net/mlx5: FW tracer, implement tracer logic
net/mlx5: FW tracer, create trace buffer and copy strings database
net/mlx5: FW tracer, events handling
net/mlx5: FW tracer, parse traces and kernel tracing support
net/mlx5: FW tracer, Enable tracing
Jianbo Liu (3):
net/mlx5e: Support offloading tc double vlan headers match
net/mlx5e: Refactor tc vlan push/pop actions offloading
net/mlx5e: Support offloading double vlan push/pop tc actions
Natali Shechtman (1):
net/mlx5e: Set ECN for received packets using CQE indication
Roi Dayan (1):
net/mlx5e: Remove redundant WARN when we cannot find neigh entry
Saeed Mahameed (2):
net/mlx5: FW tracer, register log buffer memory key
net/mlx5: FW tracer, Add debug prints
drivers/net/ethernet/mellanox/mlx5/core/Makefile | 6 +-
drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 267 ++++++
drivers/net/ethernet/mellanox/mlx5/core/devlink.h | 41 +
.../ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 947 +++++++++++++++++++++
.../ethernet/mellanox/mlx5/core/diag/fw_tracer.h | 175 ++++
.../mellanox/mlx5/core/diag/fw_tracer_tracepoint.h | 78 ++
.../mellanox/mlx5/core/en_accel/en_accel.h | 27 +-
.../ethernet/mellanox/mlx5/core/en_accel/rxtx.c | 109 ---
.../ethernet/mellanox/mlx5/core/en_accel/rxtx.h | 14 -
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 9 +-
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 35 +-
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 3 +
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 2 +
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 134 ++-
drivers/net/ethernet/mellanox/mlx5/core/eq.c | 11 +
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 21 +-
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 23 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 23 +-
include/linux/mlx5/device.h | 7 +
include/linux/mlx5/driver.h | 3 +
20 files changed, 1745 insertions(+), 190 deletions(-)
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/devlink.c
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/devlink.h
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer_tracepoint.h
delete mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en_accel/rxtx.c
delete mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en_accel/rxtx.h
^ permalink raw reply
* [net-next 01/16] net/mlx5: FW tracer, implement tracer logic
From: Saeed Mahameed @ 2018-07-19 1:00 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Feras Daoud, Saeed Mahameed
In-Reply-To: <20180719010107.22363-1-saeedm@mellanox.com>
From: Feras Daoud <ferasda@mellanox.com>
Implement FW tracer logic and registers access, initialization and
cleanup flows.
Initializing the tracer will be part of load one flow, as multiple
PFs will try to acquire ownership but only one will succeed and will
be the tracer owner.
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
.../mellanox/mlx5/core/diag/fw_tracer.c | 196 ++++++++++++++++++
.../mellanox/mlx5/core/diag/fw_tracer.h | 66 ++++++
include/linux/mlx5/driver.h | 3 +
3 files changed, 265 insertions(+)
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
new file mode 100644
index 000000000000..3ecbf06b4d71
--- /dev/null
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) 2018, Mellanox Technologies. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "fw_tracer.h"
+
+static int mlx5_query_mtrc_caps(struct mlx5_fw_tracer *tracer)
+{
+ u32 *string_db_base_address_out = tracer->str_db.base_address_out;
+ u32 *string_db_size_out = tracer->str_db.size_out;
+ struct mlx5_core_dev *dev = tracer->dev;
+ u32 out[MLX5_ST_SZ_DW(mtrc_cap)] = {0};
+ u32 in[MLX5_ST_SZ_DW(mtrc_cap)] = {0};
+ void *mtrc_cap_sp;
+ int err, i;
+
+ err = mlx5_core_access_reg(dev, in, sizeof(in), out, sizeof(out),
+ MLX5_REG_MTRC_CAP, 0, 0);
+ if (err) {
+ mlx5_core_warn(dev, "FWTracer: Error reading tracer caps %d\n",
+ err);
+ return err;
+ }
+
+ if (!MLX5_GET(mtrc_cap, out, trace_to_memory)) {
+ mlx5_core_dbg(dev, "FWTracer: Device does not support logging traces to memory\n");
+ return -ENOTSUPP;
+ }
+
+ tracer->trc_ver = MLX5_GET(mtrc_cap, out, trc_ver);
+ tracer->str_db.first_string_trace =
+ MLX5_GET(mtrc_cap, out, first_string_trace);
+ tracer->str_db.num_string_trace =
+ MLX5_GET(mtrc_cap, out, num_string_trace);
+ tracer->str_db.num_string_db = MLX5_GET(mtrc_cap, out, num_string_db);
+ tracer->owner = !!MLX5_GET(mtrc_cap, out, trace_owner);
+
+ for (i = 0; i < tracer->str_db.num_string_db; i++) {
+ mtrc_cap_sp = MLX5_ADDR_OF(mtrc_cap, out, string_db_param[i]);
+ string_db_base_address_out[i] = MLX5_GET(mtrc_string_db_param,
+ mtrc_cap_sp,
+ string_db_base_address);
+ string_db_size_out[i] = MLX5_GET(mtrc_string_db_param,
+ mtrc_cap_sp, string_db_size);
+ }
+
+ return err;
+}
+
+static int mlx5_set_mtrc_caps_trace_owner(struct mlx5_fw_tracer *tracer,
+ u32 *out, u32 out_size,
+ u8 trace_owner)
+{
+ struct mlx5_core_dev *dev = tracer->dev;
+ u32 in[MLX5_ST_SZ_DW(mtrc_cap)] = {0};
+
+ MLX5_SET(mtrc_cap, in, trace_owner, trace_owner);
+
+ return mlx5_core_access_reg(dev, in, sizeof(in), out, out_size,
+ MLX5_REG_MTRC_CAP, 0, 1);
+}
+
+static int mlx5_fw_tracer_ownership_acquire(struct mlx5_fw_tracer *tracer)
+{
+ struct mlx5_core_dev *dev = tracer->dev;
+ u32 out[MLX5_ST_SZ_DW(mtrc_cap)] = {0};
+ int err;
+
+ err = mlx5_set_mtrc_caps_trace_owner(tracer, out, sizeof(out),
+ MLX5_FW_TRACER_ACQUIRE_OWNERSHIP);
+ if (err) {
+ mlx5_core_warn(dev, "FWTracer: Acquire tracer ownership failed %d\n",
+ err);
+ return err;
+ }
+
+ tracer->owner = !!MLX5_GET(mtrc_cap, out, trace_owner);
+
+ if (!tracer->owner)
+ return -EBUSY;
+
+ return 0;
+}
+
+static void mlx5_fw_tracer_ownership_release(struct mlx5_fw_tracer *tracer)
+{
+ u32 out[MLX5_ST_SZ_DW(mtrc_cap)] = {0};
+
+ mlx5_set_mtrc_caps_trace_owner(tracer, out, sizeof(out),
+ MLX5_FW_TRACER_RELEASE_OWNERSHIP);
+ tracer->owner = false;
+}
+
+static void mlx5_fw_tracer_ownership_change(struct work_struct *work)
+{
+ struct mlx5_fw_tracer *tracer = container_of(work, struct mlx5_fw_tracer,
+ ownership_change_work);
+ struct mlx5_core_dev *dev = tracer->dev;
+ int err;
+
+ if (tracer->owner) {
+ mlx5_fw_tracer_ownership_release(tracer);
+ return;
+ }
+
+ err = mlx5_fw_tracer_ownership_acquire(tracer);
+ if (err) {
+ mlx5_core_dbg(dev, "FWTracer: Ownership was not granted %d\n", err);
+ return;
+ }
+}
+
+struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev)
+{
+ struct mlx5_fw_tracer *tracer = NULL;
+ int err;
+
+ if (!MLX5_CAP_MCAM_REG(dev, tracer_registers)) {
+ mlx5_core_dbg(dev, "FWTracer: Tracer capability not present\n");
+ return NULL;
+ }
+
+ tracer = kzalloc(sizeof(*tracer), GFP_KERNEL);
+ if (!tracer)
+ return ERR_PTR(-ENOMEM);
+
+ tracer->work_queue = create_singlethread_workqueue("mlx5_fw_tracer");
+ if (!tracer->work_queue) {
+ err = -ENOMEM;
+ goto free_tracer;
+ }
+
+ tracer->dev = dev;
+
+ INIT_WORK(&tracer->ownership_change_work, mlx5_fw_tracer_ownership_change);
+
+ err = mlx5_query_mtrc_caps(tracer);
+ if (err) {
+ mlx5_core_dbg(dev, "FWTracer: Failed to query capabilities %d\n", err);
+ goto destroy_workqueue;
+ }
+
+ mlx5_fw_tracer_ownership_change(&tracer->ownership_change_work);
+
+ return tracer;
+
+destroy_workqueue:
+ tracer->dev = NULL;
+ destroy_workqueue(tracer->work_queue);
+free_tracer:
+ kfree(tracer);
+ return ERR_PTR(err);
+}
+
+void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer)
+{
+ if (!tracer)
+ return;
+
+ cancel_work_sync(&tracer->ownership_change_work);
+
+ if (tracer->owner)
+ mlx5_fw_tracer_ownership_release(tracer);
+
+ flush_workqueue(tracer->work_queue);
+ destroy_workqueue(tracer->work_queue);
+ kfree(tracer);
+}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h
new file mode 100644
index 000000000000..721c41a5e827
--- /dev/null
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Mellanox Technologies. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef __LIB_TRACER_H__
+#define __LIB_TRACER_H__
+
+#include <linux/mlx5/driver.h>
+#include "mlx5_core.h"
+
+#define STRINGS_DB_SECTIONS_NUM 8
+
+struct mlx5_fw_tracer {
+ struct mlx5_core_dev *dev;
+ bool owner;
+ u8 trc_ver;
+ struct workqueue_struct *work_queue;
+ struct work_struct ownership_change_work;
+
+ /* Strings DB */
+ struct {
+ u8 first_string_trace;
+ u8 num_string_trace;
+ u32 num_string_db;
+ u32 base_address_out[STRINGS_DB_SECTIONS_NUM];
+ u32 size_out[STRINGS_DB_SECTIONS_NUM];
+ } str_db;
+};
+
+enum mlx5_fw_tracer_ownership_state {
+ MLX5_FW_TRACER_RELEASE_OWNERSHIP,
+ MLX5_FW_TRACER_ACQUIRE_OWNERSHIP,
+};
+
+struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev);
+void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer);
+
+#endif
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 957199c20a0f..86cb0ebf92fa 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -816,6 +816,8 @@ struct mlx5_clock {
struct mlx5_pps pps_info;
};
+struct mlx5_fw_tracer;
+
struct mlx5_core_dev {
struct pci_dev *pdev;
/* sync pci state */
@@ -860,6 +862,7 @@ struct mlx5_core_dev {
struct mlx5_clock clock;
struct mlx5_ib_clock_info *clock_info;
struct page *clock_info_page;
+ struct mlx5_fw_tracer *tracer;
};
struct mlx5_db {
--
2.17.0
^ permalink raw reply related
* [net-next 03/16] net/mlx5: FW tracer, register log buffer memory key
From: Saeed Mahameed @ 2018-07-19 1:00 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Saeed Mahameed
In-Reply-To: <20180719010107.22363-1-saeedm@mellanox.com>
Create a memory key and protection domain for the tracer log buffer.
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
.../mellanox/mlx5/core/diag/fw_tracer.c | 64 ++++++++++++++++++-
1 file changed, 61 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
index 35107b8f76df..d6cc27b0ff34 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
@@ -169,6 +169,48 @@ static void mlx5_fw_tracer_destroy_log_buf(struct mlx5_fw_tracer *tracer)
free_pages((unsigned long)tracer->buff.log_buf, get_order(tracer->buff.size));
}
+static int mlx5_fw_tracer_create_mkey(struct mlx5_fw_tracer *tracer)
+{
+ struct mlx5_core_dev *dev = tracer->dev;
+ int err, inlen, i;
+ __be64 *mtt;
+ void *mkc;
+ u32 *in;
+
+ inlen = MLX5_ST_SZ_BYTES(create_mkey_in) +
+ sizeof(*mtt) * round_up(TRACER_BUFFER_PAGE_NUM, 2);
+
+ in = kvzalloc(inlen, GFP_KERNEL);
+ if (!in)
+ return -ENOMEM;
+
+ MLX5_SET(create_mkey_in, in, translations_octword_actual_size,
+ DIV_ROUND_UP(TRACER_BUFFER_PAGE_NUM, 2));
+ mtt = (u64 *)MLX5_ADDR_OF(create_mkey_in, in, klm_pas_mtt);
+ for (i = 0 ; i < TRACER_BUFFER_PAGE_NUM ; i++)
+ mtt[i] = cpu_to_be64(tracer->buff.dma + i * PAGE_SIZE);
+
+ mkc = MLX5_ADDR_OF(create_mkey_in, in, memory_key_mkey_entry);
+ MLX5_SET(mkc, mkc, access_mode_1_0, MLX5_MKC_ACCESS_MODE_MTT);
+ MLX5_SET(mkc, mkc, lr, 1);
+ MLX5_SET(mkc, mkc, lw, 1);
+ MLX5_SET(mkc, mkc, pd, tracer->buff.pdn);
+ MLX5_SET(mkc, mkc, bsf_octword_size, 0);
+ MLX5_SET(mkc, mkc, qpn, 0xffffff);
+ MLX5_SET(mkc, mkc, log_page_size, PAGE_SHIFT);
+ MLX5_SET(mkc, mkc, translations_octword_size,
+ DIV_ROUND_UP(TRACER_BUFFER_PAGE_NUM, 2));
+ MLX5_SET64(mkc, mkc, start_addr, tracer->buff.dma);
+ MLX5_SET64(mkc, mkc, len, tracer->buff.size);
+ err = mlx5_core_create_mkey(dev, &tracer->buff.mkey, in, inlen);
+ if (err)
+ mlx5_core_warn(dev, "FWTracer: Failed to create mkey, %d\n", err);
+
+ kvfree(in);
+
+ return err;
+}
+
static void mlx5_fw_tracer_free_strings_db(struct mlx5_fw_tracer *tracer)
{
u32 num_string_db = tracer->str_db.num_string_db;
@@ -363,13 +405,26 @@ int mlx5_fw_tracer_init(struct mlx5_fw_tracer *tracer)
if (!tracer->str_db.loaded)
queue_work(tracer->work_queue, &tracer->read_fw_strings_work);
- err = mlx5_fw_tracer_ownership_acquire(tracer);
+ err = mlx5_core_alloc_pd(dev, &tracer->buff.pdn);
if (err) {
- mlx5_core_dbg(dev, "FWTracer: Ownership was not granted %d\n", err);
- return 0; /* return 0 since ownership can be acquired on a later FW event */
+ mlx5_core_warn(dev, "FWTracer: Failed to allocate PD %d\n", err);
+ return err;
}
+ err = mlx5_fw_tracer_create_mkey(tracer);
+ if (err) {
+ mlx5_core_warn(dev, "FWTracer: Failed to create mkey %d\n", err);
+ goto err_dealloc_pd;
+ }
+
+ err = mlx5_fw_tracer_ownership_acquire(tracer);
+ if (err) /* Don't fail since ownership can be acquired on a later FW event */
+ mlx5_core_dbg(dev, "FWTracer: Ownership was not granted %d\n", err);
+
return 0;
+err_dealloc_pd:
+ mlx5_core_dealloc_pd(dev, tracer->buff.pdn);
+ return err;
}
void mlx5_fw_tracer_cleanup(struct mlx5_fw_tracer *tracer)
@@ -381,6 +436,9 @@ void mlx5_fw_tracer_cleanup(struct mlx5_fw_tracer *tracer)
if (tracer->owner)
mlx5_fw_tracer_ownership_release(tracer);
+
+ mlx5_core_destroy_mkey(tracer->dev, &tracer->buff.mkey);
+ mlx5_core_dealloc_pd(tracer->dev, tracer->buff.pdn);
}
void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer)
--
2.17.0
^ permalink raw reply related
* [net-next 02/16] net/mlx5: FW tracer, create trace buffer and copy strings database
From: Saeed Mahameed @ 2018-07-19 1:00 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Feras Daoud, Saeed Mahameed
In-Reply-To: <20180719010107.22363-1-saeedm@mellanox.com>
From: Feras Daoud <ferasda@mellanox.com>
For each PF do the following:
1- Allocate memory for the tracer strings database and read the
strings from the FW to the SW. These strings will be used later for
parsing traces.
2- Allocate and dma map tracer buffers.
Traces that will be written into the buffer will be parsed as a group
of one or more traces, referred to as trace message. The trace message
represents a C-like printf string.
First trace of a message holds the pointer to the correct string in
strings database. The following traces holds the variables of the
message.
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
.../mellanox/mlx5/core/diag/fw_tracer.c | 209 +++++++++++++++++-
.../mellanox/mlx5/core/diag/fw_tracer.h | 18 ++
2 files changed, 224 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
index 3ecbf06b4d71..35107b8f76df 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
@@ -119,6 +119,163 @@ static void mlx5_fw_tracer_ownership_release(struct mlx5_fw_tracer *tracer)
tracer->owner = false;
}
+static int mlx5_fw_tracer_create_log_buf(struct mlx5_fw_tracer *tracer)
+{
+ struct mlx5_core_dev *dev = tracer->dev;
+ struct device *ddev = &dev->pdev->dev;
+ dma_addr_t dma;
+ void *buff;
+ gfp_t gfp;
+ int err;
+
+ tracer->buff.size = TRACE_BUFFER_SIZE_BYTE;
+
+ gfp = GFP_KERNEL | __GFP_ZERO;
+ buff = (void *)__get_free_pages(gfp,
+ get_order(tracer->buff.size));
+ if (!buff) {
+ err = -ENOMEM;
+ mlx5_core_warn(dev, "FWTracer: Failed to allocate pages, %d\n", err);
+ return err;
+ }
+ tracer->buff.log_buf = buff;
+
+ dma = dma_map_single(ddev, buff, tracer->buff.size, DMA_FROM_DEVICE);
+ if (dma_mapping_error(ddev, dma)) {
+ mlx5_core_warn(dev, "FWTracer: Unable to map DMA: %d\n",
+ dma_mapping_error(ddev, dma));
+ err = -ENOMEM;
+ goto free_pages;
+ }
+ tracer->buff.dma = dma;
+
+ return 0;
+
+free_pages:
+ free_pages((unsigned long)tracer->buff.log_buf, get_order(tracer->buff.size));
+
+ return err;
+}
+
+static void mlx5_fw_tracer_destroy_log_buf(struct mlx5_fw_tracer *tracer)
+{
+ struct mlx5_core_dev *dev = tracer->dev;
+ struct device *ddev = &dev->pdev->dev;
+
+ if (!tracer->buff.log_buf)
+ return;
+
+ dma_unmap_single(ddev, tracer->buff.dma, tracer->buff.size, DMA_FROM_DEVICE);
+ free_pages((unsigned long)tracer->buff.log_buf, get_order(tracer->buff.size));
+}
+
+static void mlx5_fw_tracer_free_strings_db(struct mlx5_fw_tracer *tracer)
+{
+ u32 num_string_db = tracer->str_db.num_string_db;
+ int i;
+
+ for (i = 0; i < num_string_db; i++) {
+ kfree(tracer->str_db.buffer[i]);
+ tracer->str_db.buffer[i] = NULL;
+ }
+}
+
+static int mlx5_fw_tracer_allocate_strings_db(struct mlx5_fw_tracer *tracer)
+{
+ u32 *string_db_size_out = tracer->str_db.size_out;
+ u32 num_string_db = tracer->str_db.num_string_db;
+ int i;
+
+ for (i = 0; i < num_string_db; i++) {
+ tracer->str_db.buffer[i] = kzalloc(string_db_size_out[i], GFP_KERNEL);
+ if (!tracer->str_db.buffer[i])
+ goto free_strings_db;
+ }
+
+ return 0;
+
+free_strings_db:
+ mlx5_fw_tracer_free_strings_db(tracer);
+ return -ENOMEM;
+}
+
+static void mlx5_tracer_read_strings_db(struct work_struct *work)
+{
+ struct mlx5_fw_tracer *tracer = container_of(work, struct mlx5_fw_tracer,
+ read_fw_strings_work);
+ u32 num_of_reads, num_string_db = tracer->str_db.num_string_db;
+ struct mlx5_core_dev *dev = tracer->dev;
+ u32 in[MLX5_ST_SZ_DW(mtrc_cap)] = {0};
+ u32 leftovers, offset;
+ int err = 0, i, j;
+ u32 *out, outlen;
+ void *out_value;
+
+ outlen = MLX5_ST_SZ_BYTES(mtrc_stdb) + STRINGS_DB_READ_SIZE_BYTES;
+ out = kzalloc(outlen, GFP_KERNEL);
+ if (!out) {
+ err = -ENOMEM;
+ goto out;
+ }
+
+ for (i = 0; i < num_string_db; i++) {
+ offset = 0;
+ MLX5_SET(mtrc_stdb, in, string_db_index, i);
+ num_of_reads = tracer->str_db.size_out[i] /
+ STRINGS_DB_READ_SIZE_BYTES;
+ leftovers = (tracer->str_db.size_out[i] %
+ STRINGS_DB_READ_SIZE_BYTES) /
+ STRINGS_DB_LEFTOVER_SIZE_BYTES;
+
+ MLX5_SET(mtrc_stdb, in, read_size, STRINGS_DB_READ_SIZE_BYTES);
+ for (j = 0; j < num_of_reads; j++) {
+ MLX5_SET(mtrc_stdb, in, start_offset, offset);
+
+ err = mlx5_core_access_reg(dev, in, sizeof(in), out,
+ outlen, MLX5_REG_MTRC_STDB,
+ 0, 1);
+ if (err) {
+ mlx5_core_dbg(dev, "FWTracer: Failed to read strings DB %d\n",
+ err);
+ goto out_free;
+ }
+
+ out_value = MLX5_ADDR_OF(mtrc_stdb, out, string_db_data);
+ memcpy(tracer->str_db.buffer[i] + offset, out_value,
+ STRINGS_DB_READ_SIZE_BYTES);
+ offset += STRINGS_DB_READ_SIZE_BYTES;
+ }
+
+ /* Strings database is aligned to 64, need to read leftovers*/
+ MLX5_SET(mtrc_stdb, in, read_size,
+ STRINGS_DB_LEFTOVER_SIZE_BYTES);
+ for (j = 0; j < leftovers; j++) {
+ MLX5_SET(mtrc_stdb, in, start_offset, offset);
+
+ err = mlx5_core_access_reg(dev, in, sizeof(in), out,
+ outlen, MLX5_REG_MTRC_STDB,
+ 0, 1);
+ if (err) {
+ mlx5_core_dbg(dev, "FWTracer: Failed to read strings DB %d\n",
+ err);
+ goto out_free;
+ }
+
+ out_value = MLX5_ADDR_OF(mtrc_stdb, out, string_db_data);
+ memcpy(tracer->str_db.buffer[i] + offset, out_value,
+ STRINGS_DB_LEFTOVER_SIZE_BYTES);
+ offset += STRINGS_DB_LEFTOVER_SIZE_BYTES;
+ }
+ }
+
+ tracer->str_db.loaded = true;
+
+out_free:
+ kfree(out);
+out:
+ return;
+}
+
static void mlx5_fw_tracer_ownership_change(struct work_struct *work)
{
struct mlx5_fw_tracer *tracer = container_of(work, struct mlx5_fw_tracer,
@@ -161,6 +318,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev)
tracer->dev = dev;
INIT_WORK(&tracer->ownership_change_work, mlx5_fw_tracer_ownership_change);
+ INIT_WORK(&tracer->read_fw_strings_work, mlx5_tracer_read_strings_db);
err = mlx5_query_mtrc_caps(tracer);
if (err) {
@@ -168,10 +326,22 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev)
goto destroy_workqueue;
}
- mlx5_fw_tracer_ownership_change(&tracer->ownership_change_work);
+ err = mlx5_fw_tracer_create_log_buf(tracer);
+ if (err) {
+ mlx5_core_warn(dev, "FWTracer: Create log buffer failed %d\n", err);
+ goto destroy_workqueue;
+ }
+
+ err = mlx5_fw_tracer_allocate_strings_db(tracer);
+ if (err) {
+ mlx5_core_warn(dev, "FWTracer: Allocate strings database failed %d\n", err);
+ goto free_log_buf;
+ }
return tracer;
+free_log_buf:
+ mlx5_fw_tracer_destroy_log_buf(tracer);
destroy_workqueue:
tracer->dev = NULL;
destroy_workqueue(tracer->work_queue);
@@ -180,17 +350,50 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev)
return ERR_PTR(err);
}
-void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer)
+int mlx5_fw_tracer_init(struct mlx5_fw_tracer *tracer)
{
- if (!tracer)
+ struct mlx5_core_dev *dev;
+ int err;
+
+ if (IS_ERR_OR_NULL(tracer))
+ return 0;
+
+ dev = tracer->dev;
+
+ if (!tracer->str_db.loaded)
+ queue_work(tracer->work_queue, &tracer->read_fw_strings_work);
+
+ err = mlx5_fw_tracer_ownership_acquire(tracer);
+ if (err) {
+ mlx5_core_dbg(dev, "FWTracer: Ownership was not granted %d\n", err);
+ return 0; /* return 0 since ownership can be acquired on a later FW event */
+ }
+
+ return 0;
+}
+
+void mlx5_fw_tracer_cleanup(struct mlx5_fw_tracer *tracer)
+{
+ if (IS_ERR_OR_NULL(tracer))
return;
cancel_work_sync(&tracer->ownership_change_work);
if (tracer->owner)
mlx5_fw_tracer_ownership_release(tracer);
+}
+void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer)
+{
+ if (IS_ERR_OR_NULL(tracer))
+ return;
+
+ cancel_work_sync(&tracer->read_fw_strings_work);
+ mlx5_fw_tracer_free_strings_db(tracer);
+ mlx5_fw_tracer_destroy_log_buf(tracer);
flush_workqueue(tracer->work_queue);
destroy_workqueue(tracer->work_queue);
kfree(tracer);
}
+
+EXPORT_TRACEPOINT_SYMBOL(mlx5_fw);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h
index 721c41a5e827..66cb7e7ada28 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h
@@ -37,6 +37,11 @@
#include "mlx5_core.h"
#define STRINGS_DB_SECTIONS_NUM 8
+#define STRINGS_DB_READ_SIZE_BYTES 256
+#define STRINGS_DB_LEFTOVER_SIZE_BYTES 64
+#define TRACER_BUFFER_PAGE_NUM 64
+#define TRACER_BUFFER_CHUNK 4096
+#define TRACE_BUFFER_SIZE_BYTE (TRACER_BUFFER_PAGE_NUM * TRACER_BUFFER_CHUNK)
struct mlx5_fw_tracer {
struct mlx5_core_dev *dev;
@@ -44,6 +49,7 @@ struct mlx5_fw_tracer {
u8 trc_ver;
struct workqueue_struct *work_queue;
struct work_struct ownership_change_work;
+ struct work_struct read_fw_strings_work;
/* Strings DB */
struct {
@@ -52,7 +58,19 @@ struct mlx5_fw_tracer {
u32 num_string_db;
u32 base_address_out[STRINGS_DB_SECTIONS_NUM];
u32 size_out[STRINGS_DB_SECTIONS_NUM];
+ void *buffer[STRINGS_DB_SECTIONS_NUM];
+ bool loaded;
} str_db;
+
+ /* Log Buffer */
+ struct {
+ u32 pdn;
+ void *log_buf;
+ dma_addr_t dma;
+ u32 size;
+ struct mlx5_core_mkey mkey;
+
+ } buff;
};
enum mlx5_fw_tracer_ownership_state {
--
2.17.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox