mirror-linux/drivers/net
Song Yoong Siang 48f0671be2 igc: read before write to SRRCTL register
[ Upstream commit 3ce29c17dc ]

igc_configure_rx_ring() function will be called as part of XDP program
setup. If Rx hardware timestamp is enabled prio to XDP program setup,
this timestamp enablement will be overwritten when buffer size is
written into SRRCTL register.

Thus, this commit read the register value before write to SRRCTL
register. This commit is tested by using xdp_hw_metadata bpf selftest
tool. The tool enables Rx hardware timestamp and then attach XDP program
to igc driver. It will display hardware timestamp of UDP packet with
port number 9092. Below are detail of test steps and results.

Command on DUT:
  sudo ./xdp_hw_metadata <interface name>

Command on Link Partner:
  echo -n skb | nc -u -q1 <destination IPv4 addr> 9092

Result before this patch:
  skb hwtstamp is not found!

Result after this patch:
  found skb hwtstamp = 1677800973.642836757

Optionally, read PHC to confirm the values obtained are almost the same:
Command:
  sudo ./testptp -d /dev/ptp0 -g
Result:
  clock time: 1677800973.913598978 or Fri Mar  3 07:49:33 2023

Fixes: fc9df2a0b5 ("igc: Enable RX via AF_XDP zero-copy")
Cc: <stable@vger.kernel.org> # 5.14+
Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jesper Dangaard Brouer <brouer@redhat.com>
Tested-by: Jesper Dangaard Brouer <brouer@redhat.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-23 17:52:27 +02:00
..
appletalk
arcnet
bonding bonding: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves 2023-08-16 18:27:27 +02:00
caif
can can: gs_usb: gs_can_close(): add missing set of CAN state to CAN_STATE_STOPPED 2023-08-03 10:24:09 +02:00
dsa net: dsa: ocelot: call dsa_tag_8021q_unregister() under rtnl_lock() on driver remove 2023-08-16 18:27:28 +02:00
ethernet igc: read before write to SRRCTL register 2023-08-23 17:52:27 +02:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154 ieee802154: hwsim: Fix possible memory leaks 2023-06-28 11:12:27 +02:00
ipa net: ipa: only reset hashed tables when supported 2023-08-11 12:08:09 +02:00
ipvlan ipvlan: Fix return value of ipvlan_queue_xmit() 2023-07-19 16:21:13 +02:00
mctp
mdio net: mdio: mvusb: Fix an error handling path in mvusb_mdio_probe() 2023-05-24 17:32:31 +01:00
netdevsim netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write() 2023-07-23 13:49:27 +02:00
pcs net: pcs: xpcs: fix C73 AN not getting enabled 2023-05-24 17:32:47 +01:00
phy net: phy: at803x: fix the wol setting functions 2023-08-23 17:52:18 +02:00
plip
ppp pptp: Fix fib lookup calls. 2023-07-19 16:22:06 +02:00
pse-pd
slip
team team: reset team's flags when down link is P2P device 2023-08-03 10:24:00 +02:00
usb net: usbnet: Fix WARNING in usbnet_start_xmit/usb_submit_urb 2023-08-11 12:08:24 +02:00
vmxnet3 vmxnet3: use gro callback when UPT is enabled 2023-04-06 12:10:52 +02:00
vxlan drivers: vxlan: vnifilter: free percpu vni stats on error path 2023-08-16 18:27:27 +02:00
wan net: lapbether: only support ethernet devices 2023-06-21 16:01:02 +02:00
wireguard wireguard: allowedips: expand maximum node depth 2023-08-16 18:27:20 +02:00
wireless wifi: rtw89: fix 8852AE disconnection caused by RX full flags 2023-08-16 18:27:20 +02:00
wwan net: wwan: t7xx: Ensure init is completed before system sleep 2023-06-09 10:34:15 +02:00
xen-netback xen/netback: Fix buffer overrun triggered by unusual packet 2023-08-08 20:03:51 +02:00
Kconfig
LICENSE.SRC
Makefile
Space.c
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c gtp: Fix use-after-free in __gtp_encap_destroy(). 2023-07-19 16:21:12 +02:00
ifb.c
loopback.c
macsec.c macsec: use DEV_STATS_INC() 2023-08-16 18:27:26 +02:00
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c net/net_failover: fix txq exceeding warning 2023-04-06 12:10:46 +02:00
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c net: tap_open(): set sk_uid from current_fsuid() 2023-08-11 12:08:20 +02:00
thunderbolt.c
tun.c drivers: net: prevent tun_build_skb() to exceed the packet size limit 2023-08-16 18:27:27 +02:00
veth.c
virtio_net.c virtio-net: fix race between set queues and probe 2023-08-03 10:24:14 +02:00
vrf.c
vsockmon.c
xen-netfront.c