mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
RDMA/rxe: Remove deliver net device event
Since the netdev events of link status is now handled in ib_core, remove the related code in drivers. In addition, remove the setting of port->attr.state in rxe_port_up() and rxe_port_down(), as it is only used in rxe_query_port(), and it can be replaced by ib_get_curr_port_state(). Signed-off-by: Yuyu Li <liyuyu6@huawei.com> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
4c354c02d5
commit
958152336c
|
|
@ -563,11 +563,6 @@ static void rxe_port_event(struct rxe_dev *rxe,
|
|||
/* Caller must hold net_info_lock */
|
||||
void rxe_port_up(struct rxe_dev *rxe)
|
||||
{
|
||||
struct rxe_port *port;
|
||||
|
||||
port = &rxe->port;
|
||||
port->attr.state = IB_PORT_ACTIVE;
|
||||
|
||||
rxe_port_event(rxe, IB_EVENT_PORT_ACTIVE);
|
||||
dev_info(&rxe->ib_dev.dev, "set active\n");
|
||||
}
|
||||
|
|
@ -575,11 +570,6 @@ void rxe_port_up(struct rxe_dev *rxe)
|
|||
/* Caller must hold net_info_lock */
|
||||
void rxe_port_down(struct rxe_dev *rxe)
|
||||
{
|
||||
struct rxe_port *port;
|
||||
|
||||
port = &rxe->port;
|
||||
port->attr.state = IB_PORT_DOWN;
|
||||
|
||||
rxe_port_event(rxe, IB_EVENT_PORT_ERR);
|
||||
rxe_counter_inc(rxe, RXE_CNT_LINK_DOWNED);
|
||||
dev_info(&rxe->ib_dev.dev, "set down\n");
|
||||
|
|
@ -587,7 +577,7 @@ void rxe_port_down(struct rxe_dev *rxe)
|
|||
|
||||
void rxe_set_port_state(struct rxe_dev *rxe)
|
||||
{
|
||||
if (netif_running(rxe->ndev) && netif_carrier_ok(rxe->ndev))
|
||||
if (ib_get_curr_port_state(rxe->ndev) == IB_PORT_ACTIVE)
|
||||
rxe_port_up(rxe);
|
||||
else
|
||||
rxe_port_down(rxe);
|
||||
|
|
@ -607,18 +597,14 @@ static int rxe_notify(struct notifier_block *not_blk,
|
|||
case NETDEV_UNREGISTER:
|
||||
ib_unregister_device_queued(&rxe->ib_dev);
|
||||
break;
|
||||
case NETDEV_UP:
|
||||
rxe_port_up(rxe);
|
||||
break;
|
||||
case NETDEV_DOWN:
|
||||
rxe_port_down(rxe);
|
||||
break;
|
||||
case NETDEV_CHANGEMTU:
|
||||
rxe_dbg_dev(rxe, "%s changed mtu to %d\n", ndev->name, ndev->mtu);
|
||||
rxe_set_mtu(rxe, ndev->mtu);
|
||||
break;
|
||||
case NETDEV_DOWN:
|
||||
case NETDEV_CHANGE:
|
||||
rxe_set_port_state(rxe);
|
||||
if (ib_get_curr_port_state(ndev) == IB_PORT_DOWN)
|
||||
rxe_counter_inc(rxe, RXE_CNT_LINK_DOWNED);
|
||||
break;
|
||||
case NETDEV_REBOOT:
|
||||
case NETDEV_GOING_DOWN:
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ static int rxe_query_port(struct ib_device *ibdev,
|
|||
ret = ib_get_eth_speed(ibdev, port_num, &attr->active_speed,
|
||||
&attr->active_width);
|
||||
|
||||
attr->state = ib_get_curr_port_state(rxe->ndev);
|
||||
if (attr->state == IB_PORT_ACTIVE)
|
||||
attr->phys_state = IB_PORT_PHYS_STATE_LINK_UP;
|
||||
else if (dev_get_flags(rxe->ndev) & IFF_UP)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user