git: d5d6949031cc - main - mlx5en(4): Allow RX TLS to be enabled and disabled by ifconfig(8).
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 08 Jun 2022 11:54:56 UTC
The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=d5d6949031ccf19318b03d479605d54c55762453 commit d5d6949031ccf19318b03d479605d54c55762453 Author: Hans Petter Selasky <hselasky@FreeBSD.org> AuthorDate: 2022-06-08 11:22:32 +0000 Commit: Hans Petter Selasky <hselasky@FreeBSD.org> CommitDate: 2022-06-08 11:53:26 +0000 mlx5en(4): Allow RX TLS to be enabled and disabled by ifconfig(8). While at it, fix double initialization of the "drv_ioctl_data_d" structure and the "mask" variable. Reviewed by: kib@ MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 075c677f32e1..0cae0696a180 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3434,9 +3434,9 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) struct ifi2creq i2c; struct ifrsskey *ifrk; struct ifrsshash *ifrh; - struct siocsifcapnv_driver_data *drv_ioctl_data, drv_ioctl_data_d = {}; + struct siocsifcapnv_driver_data *drv_ioctl_data, drv_ioctl_data_d; int error = 0; - int mask = 0; + int mask; int size_read = 0; int module_status; int module_num; @@ -3521,7 +3521,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) drv_ioctl_data = &drv_ioctl_data_d; drv_ioctl_data->reqcap = ifr->ifr_reqcap; PRIV_LOCK(priv); - drv_ioctl_data->reqcap2 = ifp->if_capabilities2; + drv_ioctl_data->reqcap2 = ifp->if_capenable2; drv_ioctl_data->nvcap = NULL; goto siocsifcap_driver; case SIOCSIFCAPNV: @@ -3663,6 +3663,11 @@ siocsifcap_driver: priv->clbr_done = 0; } } + mask = drv_ioctl_data->reqcap2 ^ ifp->if_capenable2; + if (mask & IFCAP2_RXTLS4) + ifp->if_capenable2 ^= IFCAP2_RXTLS4; + if (mask & IFCAP2_RXTLS6) + ifp->if_capenable2 ^= IFCAP2_RXTLS6; out: PRIV_UNLOCK(priv); break;