Skip to content

Commit 08437c5

Browse files
ferasdSaeed Mahameed
authored andcommitted
net/mlx5e: IPoIB, Add PTP ioctl support for child interface
Add support to control precision time protocol on child interfaces using ioctl. This commit changes the following: - Change parent ioctl function to be non static - Reuse the parent ioctl function in child devices Signed-off-by: Feras Daoud <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 36e564b commit 08437c5

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
static int mlx5i_open(struct net_device *netdev);
4242
static int mlx5i_close(struct net_device *netdev);
4343
static int mlx5i_change_mtu(struct net_device *netdev, int new_mtu);
44-
static int mlx5i_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
4544

4645
static const struct net_device_ops mlx5i_netdev_ops = {
4746
.ndo_open = mlx5i_open,
@@ -396,7 +395,7 @@ int mlx5i_dev_init(struct net_device *dev)
396395
return 0;
397396
}
398397

399-
static int mlx5i_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
398+
int mlx5i_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
400399
{
401400
struct mlx5e_priv *priv = mlx5i_epriv(dev);
402401

drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ struct net_device *mlx5i_pkey_get_netdev(struct net_device *netdev, u32 qpn);
7979
/* Shared ndo functionts */
8080
int mlx5i_dev_init(struct net_device *dev);
8181
void mlx5i_dev_cleanup(struct net_device *dev);
82+
int mlx5i_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
8283

8384
/* Parent profile functions */
8485
void mlx5i_init(struct mlx5_core_dev *mdev,

drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,15 @@ static int mlx5i_pkey_close(struct net_device *netdev);
140140
static int mlx5i_pkey_dev_init(struct net_device *dev);
141141
static void mlx5i_pkey_dev_cleanup(struct net_device *netdev);
142142
static int mlx5i_pkey_change_mtu(struct net_device *netdev, int new_mtu);
143+
static int mlx5i_pkey_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
143144

144145
static const struct net_device_ops mlx5i_pkey_netdev_ops = {
145146
.ndo_open = mlx5i_pkey_open,
146147
.ndo_stop = mlx5i_pkey_close,
147148
.ndo_init = mlx5i_pkey_dev_init,
148149
.ndo_uninit = mlx5i_pkey_dev_cleanup,
149150
.ndo_change_mtu = mlx5i_pkey_change_mtu,
151+
.ndo_do_ioctl = mlx5i_pkey_ioctl,
150152
};
151153

152154
/* Child NDOs */
@@ -174,6 +176,11 @@ static int mlx5i_pkey_dev_init(struct net_device *dev)
174176
return mlx5i_dev_init(dev);
175177
}
176178

179+
static int mlx5i_pkey_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
180+
{
181+
return mlx5i_ioctl(dev, ifr, cmd);
182+
}
183+
177184
static void mlx5i_pkey_dev_cleanup(struct net_device *netdev)
178185
{
179186
return mlx5i_dev_cleanup(netdev);

0 commit comments

Comments
 (0)