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
ipa net: ipa: only reset hashed tables when supported 2023-08-11 12:08:09 +02:00
ipvlan
mctp
mdio
netdevsim netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write() 2023-07-23 13:49:27 +02:00
pcs
phy net: phy: at803x: fix the wol setting functions 2023-08-23 17:52:18 +02:00
plip
ppp
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
vxlan drivers: vxlan: vnifilter: free percpu vni stats on error path 2023-08-16 18:27:27 +02:00
wan
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
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
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
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