Thread (33 messages) 33 messages, 5 authors, 2022-10-11
STALE1350d
Revisions (7)
  1. v4 current
  2. v7 [diff vs current]
  3. v8 [diff vs current]
  4. v9 [diff vs current]
  5. v10 [diff vs current]
  6. v11 [diff vs current]
  7. v12 [diff vs current]

[RFC PATCH net-next v4 5/6] ice: Export Tx scheduler configuration to devlink-rate

From: Michal Wilczynski <hidden>
Date: 2022-09-15 13:44:38
Subsystem: intel ethernet drivers, networking drivers, the rest · Maintainers: Tony Nguyen, Przemek Kitszel, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

There is a need to export Tx scheduler configuration to devlink-rate
kernel mechanism. We also need a complete list of queues in the
scheduling topology. Unfortunately, when the reset happens
ice_sched_node objects that represents queues are re-created. This
forces us to re-initialize devlink-rate representation of the driver Tx
scheduler tree.

Signed-off-by: Michal Wilczynski <redacted>
---
 drivers/net/ethernet/intel/ice/ice_virtchnl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
index 2b4c791b6cba..0f0a03b7725e 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
@@ -12,6 +12,7 @@
 #include "ice_vlan.h"
 #include "ice_flex_pipe.h"
 #include "ice_dcb_lib.h"
+#include "ice_devlink.h"
 
 #define FIELD_SELECTOR(proto_hdr_field) \
 		BIT((proto_hdr_field) & PROTO_HDR_FIELD_MASK)
@@ -1597,6 +1598,7 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
 	    (struct virtchnl_vsi_queue_config_info *)msg;
 	struct virtchnl_queue_pair_info *qpi;
 	struct ice_pf *pf = vf->pf;
+	struct devlink *devlink;
 	struct ice_vsi *vsi;
 	int i = -1, q_idx;
 
@@ -1655,6 +1657,14 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
 			}
 		}
 
+		devlink = priv_to_devlink(pf);
+
+		devl_lock(devlink);
+		devl_rate_objects_destroy(devlink);
+		devl_unlock(devlink);
+
+		ice_devlink_rate_init_tx_topology(devlink, ice_get_main_vsi(pf));
+
 		/* copy Rx queue info from VF into VSI */
 		if (qpi->rxq.ring_len > 0) {
 			u16 max_frame_size = ice_vc_get_max_frame_size(vf);
-- 
2.37.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help