Suggested by Leon, remove the rxe_ib_device_get_netdev() wrapper and
the RXE_PORT definition. These additions do not improve readability,
and RXE has always had only a single port.
Signed-off-by: zhenwei pi <zhenwei.pi@linux.dev>
Link: https://patch.msgid.link/20260414062948.671658-2-zhenwei.pi@linux.dev
Signed-off-by: Leon Romanovsky <leon@kernel.org>
struct net_device *ndev;
int ret;
- ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ ndev = ib_device_get_netdev(&rxe->ib_dev, 1);
if (!ndev)
return -ENODEV;
struct net_device *ndev;
int ret;
- ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ ndev = ib_device_get_netdev(&rxe->ib_dev, 1);
if (!ndev)
return -ENODEV;
struct net_device *ndev;
char *ndev_name;
- ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ ndev = ib_device_get_netdev(&rxe->ib_dev, 1);
if (!ndev)
return NULL;
ndev_name = ndev->name;
void rxe_net_del(struct ib_device *dev)
{
- struct rxe_dev *rxe = container_of(dev, struct rxe_dev, ib_dev);
struct net_device *ndev;
struct sock *sk;
struct net *net;
- ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ ndev = ib_device_get_netdev(dev, 1);
if (!ndev)
return;
{
struct net_device *ndev;
- ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ ndev = ib_device_get_netdev(&rxe->ib_dev, 1);
if (!ndev)
return;
goto err_out;
}
- ndev = rxe_ib_device_get_netdev(ibdev);
+ ndev = ib_device_get_netdev(ibdev, 1);
if (!ndev) {
err = -ENODEV;
goto err_out;
struct rxe_dev *rxe = container_of(ib_dev, struct rxe_dev, ib_dev);
struct net_device *ndev;
- ndev = rxe_ib_device_get_netdev(ib_dev);
+ ndev = ib_device_get_netdev(ib_dev, 1);
if (!ndev)
return -ENODEV;
u32 qp_gsi_index;
};
-#define RXE_PORT 1
struct rxe_dev {
struct ib_device ib_dev;
struct ib_device_attr attr;
struct rxe_port port;
};
-static inline struct net_device *rxe_ib_device_get_netdev(struct ib_device *dev)
-{
- return ib_device_get_netdev(dev, RXE_PORT);
-}
-
static inline void rxe_counter_inc(struct rxe_dev *rxe, enum rxe_counters index)
{
atomic64_inc(&rxe->stats_counters[index]);