return 0;
 }
 
-/**
- * irdma_get_eth_speed_and_width - Get IB port speed and width from netdev speed
- * @link_speed: netdev phy link speed
- * @active_speed: IB port speed
- * @active_width: IB port width
- */
-static void irdma_get_eth_speed_and_width(u32 link_speed, u16 *active_speed,
-                                         u8 *active_width)
-{
-       if (link_speed <= SPEED_1000) {
-               *active_width = IB_WIDTH_1X;
-               *active_speed = IB_SPEED_SDR;
-       } else if (link_speed <= SPEED_10000) {
-               *active_width = IB_WIDTH_1X;
-               *active_speed = IB_SPEED_FDR10;
-       } else if (link_speed <= SPEED_20000) {
-               *active_width = IB_WIDTH_4X;
-               *active_speed = IB_SPEED_DDR;
-       } else if (link_speed <= SPEED_25000) {
-               *active_width = IB_WIDTH_1X;
-               *active_speed = IB_SPEED_EDR;
-       } else if (link_speed <= SPEED_40000) {
-               *active_width = IB_WIDTH_4X;
-               *active_speed = IB_SPEED_FDR10;
-       } else {
-               *active_width = IB_WIDTH_4X;
-               *active_speed = IB_SPEED_EDR;
-       }
-}
-
 /**
  * irdma_query_port - get port attributes
  * @ibdev: device pointer from stack
                props->state = IB_PORT_DOWN;
                props->phys_state = IB_PORT_PHYS_STATE_DISABLED;
        }
-       irdma_get_eth_speed_and_width(SPEED_100000, &props->active_speed,
-                                     &props->active_width);
+
+       ib_get_eth_speed(ibdev, port, &props->active_speed,
+                        &props->active_width);
 
        if (rdma_protocol_roce(ibdev, 1)) {
                props->gid_tbl_len = 32;