net: ethernet: am65-cpsw: Add mqprio, frame pre-emption & coalescing
Subsystems (4)
v6 cover net: ethernet: am65-cpsw: Add mqprio, frame pre-emption & coalescing
Hi,
This series adds mqprio qdisc offload in channel mode, Frame Pre-emption MAC merge support and RX/TX coalesing for AM65 CPSW driver.
Changelog information in each patch file.
cheers,
-roger
Grygorii Strashko (2):
net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode
net: ethernet: ti: am65-cpsw: add sw tx/rx irq coalescing based on
hrtimers
Roger Quadros (5):
net: ethernet: am65-cpsw: Build am65-cpsw-qos only if required
net: ethernet: am65-cpsw: cleanup TAPRIO handling
net: ethernet: ti: am65-cpsw: Move code to avoid forward declaration
net: ethernet: am65-cpsw: Move register definitions to header file
net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge
support
drivers/net/ethernet/ti/Makefile | 3 +- drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 234 +++++++ drivers/net/ethernet/ti/am65-cpsw-nuss.c | 64 +- drivers/net/ethernet/ti/am65-cpsw-nuss.h | 9 + drivers/net/ethernet/ti/am65-cpsw-qos.c | 730 +++++++++++++++----- drivers/net/ethernet/ti/am65-cpsw-qos.h | 184 +++++ 6 files changed, 1046 insertions(+), 178 deletions(-)
base-commit: 94c81c62668954269ec852ab0284256db20ed9b4
Signature · 1 line
2.34.1
PATCH v6 1/7 net: ethernet: am65-cpsw: Build am65-cpsw-qos only if required
Build am65-cpsw-qos only if CONFIG_TI_AM65_CPSW_TAS is enabled.
--- drivers/net/ethernet/ti/Makefile | 3 ++- drivers/net/ethernet/ti/am65-cpsw-qos.c | 12 ------------ drivers/net/ethernet/ti/am65-cpsw-qos.h | 26 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 13 deletions(-)
Changelog:
v6: initial commit
drivers/net/ethernet/ti/Makefile +2 -1
@@ -26,7 +26,8 @@ keystone_netcp_ethss-y := netcp_ethss.o netcp_sgmii.o netcp_xgbepcsr.o cpsw_ale. obj-$(CONFIG_TI_K3_CPPI_DESC_POOL) += k3-cppi-desc-pool.o obj-$(CONFIG_TI_K3_AM65_CPSW_NUSS) += ti-am65-cpsw-nuss.o -ti-am65-cpsw-nuss-y := am65-cpsw-nuss.o cpsw_sl.o am65-cpsw-ethtool.o cpsw_ale.o am65-cpsw-qos.o +ti-am65-cpsw-nuss-y := am65-cpsw-nuss.o cpsw_sl.o am65-cpsw-ethtool.o cpsw_ale.o +ti-am65-cpsw-nuss-$(CONFIG_TI_AM65_CPSW_TAS) += am65-cpsw-qos.o ti-am65-cpsw-nuss-$(CONFIG_TI_K3_AM65_CPSW_SWITCHDEV) += am65-cpsw-switchdev.o obj-$(CONFIG_TI_K3_AM65_CPTS) += am65-cpts.o
drivers/net/ethernet/ti/am65-cpsw-qos.c +0 -12
@@ -571,9 +571,6 @@ static int am65_cpsw_setup_taprio(struct net_device *ndev, void *type_data) taprio->cmd != TAPRIO_CMD_DESTROY)return -EOPNOTSUPP ; -if (!IS_ENABLED (CONFIG_TI_AM65_CPSW_TAS )) -return -ENODEV ; -if (!netif_running (ndev)) {dev_err (&ndev->dev,"interface is down, link speed unknown\n" );return -ENETDOWN ;
@@ -599,9 +596,6 @@ static int am65_cpsw_tc_query_caps(struct net_device *ndev, void *type_data)case TC_SETUP_QDISC_TAPRIO : {struct tc_taprio_caps *caps = base->caps; -if (!IS_ENABLED (CONFIG_TI_AM65_CPSW_TAS )) -return -EOPNOTSUPP ; - caps->gate_mask_per_txq = true;return 0 ;
@@ -806,9 +800,6 @@ void am65_cpsw_qos_link_up(struct net_device *ndev, int link_speed) {struct am65_cpsw_port *port =am65_ndev_to_port (ndev); -if (!IS_ENABLED (CONFIG_TI_AM65_CPSW_TAS )) -return ; -am65_cpsw_est_link_up (ndev, link_speed); port->qos.link_down_time =0 ; }
@@ -817,9 +808,6 @@ void am65_cpsw_qos_link_down(struct net_device *ndev) {struct am65_cpsw_port *port =am65_ndev_to_port (ndev); -if (!IS_ENABLED (CONFIG_TI_AM65_CPSW_TAS )) -return ; -if (!port->qos.link_down_time) port->qos.link_down_time =ktime_get ();
drivers/net/ethernet/ti/am65-cpsw-qos.h +26 -0
@@ -31,11 +31,37 @@ struct am65_cpsw_qos {struct am65_cpsw_ale_ratelimit ale_mc_ratelimit; }; +#if IS_ENABLED (CONFIG_TI_AM65_CPSW_TAS )int am65_cpsw_qos_ndo_setup_tc (struct net_device *ndev,enum tc_setup_type type,void *type_data);void am65_cpsw_qos_link_up (struct net_device *ndev,int link_speed);void am65_cpsw_qos_link_down (struct net_device *ndev);int am65_cpsw_qos_ndo_tx_p0_set_maxrate (struct net_device *ndev,int queue,u32 rate_mbps);void am65_cpsw_qos_tx_p0_rate_init (struct am65_cpsw_common *common); +#else +static inline int am65_cpsw_qos_ndo_setup_tc (struct net_device *ndev, +enum tc_setup_type type, +void *type_data) +{ +return -EOPNOTSUPP ; +} + +static inline void am65_cpsw_qos_link_up (struct net_device *ndev, +int link_speed) +{ } + +static inline void am65_cpsw_qos_link_down (struct net_device *ndev) +{ } + +static inline int am65_cpsw_qos_ndo_tx_p0_set_maxrate (struct net_device *ndev, +int queue, +u32 rate_mbps) +{ +return 0 ; +} + +static inline void am65_cpsw_qos_tx_p0_rate_init (struct am65_cpsw_common *common) +{ } +#endif #endif /* AM65_CPSW_QOS_H_ */
Signature · 1 line
2.34.1
PATCH v6 2/7 net: ethernet: am65-cpsw: cleanup TAPRIO handling
In reply to Roger QuadrosHandle offloading commands using switch-case inam65_cpsw_setup_taprio().
Move checks to am65_cpsw_taprio_replace().
Use NL_SET_ERR_MSG_MOD for error messages.
Change error message from "Failed to set cycle time extension" to "cycle time extension not supported"
--- drivers/net/ethernet/ti/am65-cpsw-qos.c | 149 +++++++++++------------- 1 file changed, 70 insertions(+), 79 deletions(-)
Changelog:
v6: initial commit
drivers/net/ethernet/ti/am65-cpsw-qos.c +70 -79
@@ -428,7 +428,7 @@ static void am65_cpsw_stop_est(struct net_device *ndev)am65_cpsw_timer_stop (ndev); } -static void am65_cpsw_purge_est (struct net_device *ndev) +static void am65_cpsw_taprio_destroy (struct net_device *ndev) {struct am65_cpsw_port *port =am65_ndev_to_port (ndev);
@@ -441,29 +441,66 @@ static void am65_cpsw_purge_est(struct net_device *ndev) port->qos.est_admin =NULL ; } -static int am65_cpsw_configure_taprio (struct net_device *ndev, -struct am65_cpsw_est *est_new) +static void am65_cpsw_cp_taprio (struct tc_taprio_qopt_offload *from, +struct tc_taprio_qopt_offload *to) +{ +int i; + + *to = *from; +for (i =0 ; i < from->num_entries; i++) + to->entries[i] = from->entries[i]; +} + +static int am65_cpsw_taprio_replace (struct net_device *ndev, +struct tc_taprio_qopt_offload *taprio) {struct am65_cpsw_common *common =am65_ndev_to_common (ndev); +struct netlink_ext_ack *extack = taprio->mqprio.extack; +struct am65_cpsw_port *port =am65_ndev_to_port (ndev);struct am65_cpts *cpts = common->cpts;int ret =0 , tact =TACT_PROG ; +struct am65_cpsw_est *est_new; -am65_cpsw_est_update_state (ndev); +if (!netif_running (ndev)) { +NL_SET_ERR_MSG_MOD (extack,"interface is down, link speed unknown\n" ); +return -ENETDOWN ; + } -if (est_new->taprio.cmd ==TAPRIO_CMD_DESTROY ) { -am65_cpsw_stop_est (ndev); -return ret; +if (common->pf_p0_rx_ptype_rrobin) { +NL_SET_ERR_MSG_MOD (extack, +"p0-rx-ptype-rrobin flag conflicts with taprio qdisc\n" ); +return -EINVAL ; + } + +if (port->qos.link_speed ==SPEED_UNKNOWN ) +return -ENOLINK ; + +if (taprio->cycle_time_extension) { +NL_SET_ERR_MSG_MOD (extack, +"cycle time extension not supported" ); +return -EOPNOTSUPP ; } + est_new =devm_kzalloc (&ndev->dev, +struct_size (est_new, taprio.entries, taprio->num_entries), +GFP_KERNEL ); +if (!est_new) +return -ENOMEM ; + +am65_cpsw_cp_taprio (taprio, &est_new->taprio); + +am65_cpsw_est_update_state (ndev); + ret =am65_cpsw_est_check_scheds (ndev, est_new);if (ret <0 ) -return ret; + goto fail; tact =am65_cpsw_timer_act (ndev, est_new);if (tact ==TACT_NEED_STOP ) { -dev_err (&ndev->dev, -"Can't toggle estf timer, stop taprio first" ); -return -EINVAL ; +NL_SET_ERR_MSG_MOD (extack, +"Can't toggle estf timer, stop taprio first" ); + ret = -EINVAL ; + goto fail; }if (tact ==TACT_PROG )
@@ -476,62 +513,24 @@ static int am65_cpsw_configure_taprio(struct net_device *ndev,am65_cpsw_est_set_sched_list (ndev, est_new);am65_cpsw_port_est_assign_buf_num (ndev, est_new->buf); -am65_cpsw_est_set (ndev, est_new->taprio.cmd ==TAPRIO_CMD_REPLACE ); +am65_cpsw_est_set (ndev,1 );if (tact ==TACT_PROG ) { ret =am65_cpsw_timer_set (ndev, est_new);if (ret) { -dev_err (&ndev->dev,"Failed to set cycle time" ); -return ret; +NL_SET_ERR_MSG_MOD (extack, +"Failed to set cycle time" ); + goto fail; } } -return ret; -} - -static void am65_cpsw_cp_taprio (struct tc_taprio_qopt_offload *from, -struct tc_taprio_qopt_offload *to) -{ -int i; - - *to = *from; -for (i =0 ; i < from->num_entries; i++) - to->entries[i] = from->entries[i]; -} - -static int am65_cpsw_set_taprio (struct net_device *ndev,void *type_data) -{ -struct am65_cpsw_port *port =am65_ndev_to_port (ndev); -struct tc_taprio_qopt_offload *taprio = type_data; -struct am65_cpsw_est *est_new; -int ret =0 ; - -if (taprio->cycle_time_extension) { -dev_err (&ndev->dev,"Failed to set cycle time extension" ); -return -EOPNOTSUPP ; - } - - est_new =devm_kzalloc (&ndev->dev, -struct_size (est_new, taprio.entries, taprio->num_entries), -GFP_KERNEL ); -if (!est_new) -return -ENOMEM ; - -am65_cpsw_cp_taprio (taprio, &est_new->taprio); - ret =am65_cpsw_configure_taprio (ndev, est_new); -if (!ret) { -if (taprio->cmd ==TAPRIO_CMD_REPLACE ) { -devm_kfree (&ndev->dev, port->qos.est_admin); +devm_kfree (&ndev->dev, port->qos.est_admin); + port->qos.est_admin = est_new; - port->qos.est_admin = est_new; - }else { -devm_kfree (&ndev->dev, est_new); -am65_cpsw_purge_est (ndev); - } - }else { -devm_kfree (&ndev->dev, est_new); - } +return 0 ; +fail: +devm_kfree (&ndev->dev, est_new);return ret; }
@@ -558,34 +557,26 @@ static void am65_cpsw_est_link_up(struct net_device *ndev, int link_speed)return ; purge_est: -am65_cpsw_purge_est (ndev); +am65_cpsw_taprio_destroy (ndev); }static int am65_cpsw_setup_taprio (struct net_device *ndev,void *type_data) { -struct am65_cpsw_port *port =am65_ndev_to_port (ndev);struct tc_taprio_qopt_offload *taprio = type_data; -struct am65_cpsw_common *common = port->common; - -if (taprio->cmd !=TAPRIO_CMD_REPLACE && - taprio->cmd !=TAPRIO_CMD_DESTROY ) -return -EOPNOTSUPP ; - -if (!netif_running (ndev)) { -dev_err (&ndev->dev,"interface is down, link speed unknown\n" ); -return -ENETDOWN ; - } - -if (common->pf_p0_rx_ptype_rrobin) { -dev_err (&ndev->dev, -"p0-rx-ptype-rrobin flag conflicts with taprio qdisc\n" ); -return -EINVAL ; +int err =0 ; + +switch (taprio->cmd) { +case TAPRIO_CMD_REPLACE : + err =am65_cpsw_taprio_replace (ndev, taprio); +break ; +case TAPRIO_CMD_DESTROY : +am65_cpsw_taprio_destroy (ndev); +break ; +default : + err = -EOPNOTSUPP ; } -if (port->qos.link_speed ==SPEED_UNKNOWN ) -return -ENOLINK ; - -return am65_cpsw_set_taprio (ndev, type_data); +return err; }static int am65_cpsw_tc_query_caps (struct net_device *ndev,void *type_data)
Signature · 1 line
2.34.1
Re: [PATCH v6 net-next 2/7] net: ethernet: am65-cpsw: cleanup TAPRIO handling
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 452
Quoted 11 lines · Roger Quadros
drivers/net/ethernet/ti/am65-cpsw-qos.c +9
-2-static int am65_cpsw_configure_taprio (struct net_device *ndev, -struct am65_cpsw_est *est_new) +static void am65_cpsw_cp_taprio (struct tc_taprio_qopt_offload *from, +struct tc_taprio_qopt_offload *to) +{ +int i; + + *to = *from; +for (i =0 ; i < from->num_entries; i++) + to->entries[i] = from->entries[i]; +}
I think I mentioned this before: have you looked at taprio_offload_get() and taprio_offload_put()?
Quoted 4 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +3
-0+ +static int am65_cpsw_taprio_replace (struct net_device *ndev, +struct tc_taprio_qopt_offload *taprio) {
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 465
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +5
-1struct am65_cpsw_common *common =am65_ndev_to_common (ndev); +struct netlink_ext_ack *extack = taprio->mqprio.extack; +struct am65_cpsw_port *port =am65_ndev_to_port (ndev);struct am65_cpts *cpts = common->cpts;int ret =0 , tact =TACT_PROG ; +struct am65_cpsw_est *est_new; -am65_cpsw_est_update_state (ndev); +if (!netif_running (ndev)) { +NL_SET_ERR_MSG_MOD (extack,"interface is down, link speed unknown\n" );
The extack message doesn't need a \n.
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 471
Quoted 9 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +5
-3+return -ENETDOWN ; + } -if (est_new->taprio.cmd ==TAPRIO_CMD_DESTROY ) { -am65_cpsw_stop_est (ndev); -return ret; +if (common->pf_p0_rx_ptype_rrobin) { +NL_SET_ERR_MSG_MOD (extack, +"p0-rx-ptype-rrobin flag conflicts with taprio qdisc\n" );
Also here.
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 480
Quoted 9 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +9
-0+return -EINVAL ; + } + +if (port->qos.link_speed ==SPEED_UNKNOWN ) +return -ENOLINK ; + +if (taprio->cycle_time_extension) { +NL_SET_ERR_MSG_MOD (extack, +"cycle time extension not supported" );
Here it's ok.
Quoted 2 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +1
-0+return -EOPNOTSUPP ; }
Re: [PATCH v6 net-next 2/7] net: ethernet: am65-cpsw: cleanup TAPRIO handling
Quoted 15 lines · Vladimir Oltean
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 452
Quoted 11 lines · Roger Quadros
drivers/net/ethernet/ti/am65-cpsw-qos.c +9
-2-static int am65_cpsw_configure_taprio (struct net_device *ndev, -struct am65_cpsw_est *est_new) +static void am65_cpsw_cp_taprio (struct tc_taprio_qopt_offload *from, +struct tc_taprio_qopt_offload *to) +{ +int i; + + *to = *from; +for (i =0 ; i < from->num_entries; i++) + to->entries[i] = from->entries[i]; +}I think I mentioned this before: have you looked at
taprio_offload_get()andtaprio_offload_put()?
I'm sorry that I missed this. I'll take a look.
Quoted 12 lines
Quoted 12 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +6
-0+ +static int am65_cpsw_taprio_replace (struct net_device *ndev, +struct tc_taprio_qopt_offload *taprio) {struct am65_cpsw_common *common =am65_ndev_to_common (ndev); +struct netlink_ext_ack *extack = taprio->mqprio.extack; +struct am65_cpsw_port *port =am65_ndev_to_port (ndev);struct am65_cpts *cpts = common->cpts;int ret =0 , tact =TACT_PROG ; +struct am65_cpsw_est *est_new;
Quoted 5 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 465
Quoted 3 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +2
-1-am65_cpsw_est_update_state (ndev); +if (!netif_running (ndev)) { +NL_SET_ERR_MSG_MOD (extack,"interface is down, link speed unknown\n" );The extack message doesn't need a \n.
OK.
Quoted 25 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 471
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +5
-3+return -ENETDOWN ; + } -if (est_new->taprio.cmd ==TAPRIO_CMD_DESTROY ) { -am65_cpsw_stop_est (ndev); -return ret; +if (common->pf_p0_rx_ptype_rrobin) { +NL_SET_ERR_MSG_MOD (extack, +"p0-rx-ptype-rrobin flag conflicts with taprio qdisc\n" );Also here.
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 480
Quoted 9 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +9
-0+return -EINVAL ; + } + +if (port->qos.link_speed ==SPEED_UNKNOWN ) +return -ENOLINK ; + +if (taprio->cycle_time_extension) { +NL_SET_ERR_MSG_MOD (extack, +"cycle time extension not supported" );Here it's ok.
Quoted 2 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 482
Quoted 2 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +1
-0+return -EOPNOTSUPP ; }
Thanks for the detailed review!
Signature · 2 lines
cheers, -roger
Re: [PATCH v6 net-next 2/7] net: ethernet: am65-cpsw: cleanup TAPRIO handling
Quoted 19 lines · Roger Quadros
Quoted 15 lines · Vladimir Oltean
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 452
Quoted 11 lines · Roger Quadros
drivers/net/ethernet/ti/am65-cpsw-qos.c +9
-2-static int am65_cpsw_configure_taprio (struct net_device *ndev, -struct am65_cpsw_est *est_new) +static void am65_cpsw_cp_taprio (struct tc_taprio_qopt_offload *from, +struct tc_taprio_qopt_offload *to) +{ +int i; + + *to = *from; +for (i =0 ; i < from->num_entries; i++) + to->entries[i] = from->entries[i]; +}I think I mentioned this before: have you looked at
taprio_offload_get()andtaprio_offload_put()?
Quoted 1 line
I'm sorry that I missed this. I'll take a look.
Now I recollect. You mentioned this in a different series review
https://lore.kernel.org/all/20231011102536.r65xyzmh5kap2cf2@skbuf/
Since this patch is more trivial cleanups I will do the taprio_offload_get/free() change to a separate patch.
Quoted 51 lines
Quoted 13 lines
Quoted 13 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +6
-0+ +static int am65_cpsw_taprio_replace (struct net_device *ndev, +struct tc_taprio_qopt_offload *taprio) {struct am65_cpsw_common *common =am65_ndev_to_common (ndev); +struct netlink_ext_ack *extack = taprio->mqprio.extack; +struct am65_cpsw_port *port =am65_ndev_to_port (ndev);struct am65_cpts *cpts = common->cpts;int ret =0 , tact =TACT_PROG ; +struct am65_cpsw_est *est_new;Quoted 5 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 465
Quoted 3 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +2
-1-am65_cpsw_est_update_state (ndev); +if (!netif_running (ndev)) { +NL_SET_ERR_MSG_MOD (extack,"interface is down, link speed unknown\n" );The extack message doesn't need a \n.
OK.
Quoted 25 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 471
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +5
-3+return -ENETDOWN ; + } -if (est_new->taprio.cmd ==TAPRIO_CMD_DESTROY ) { -am65_cpsw_stop_est (ndev); -return ret; +if (common->pf_p0_rx_ptype_rrobin) { +NL_SET_ERR_MSG_MOD (extack, +"p0-rx-ptype-rrobin flag conflicts with taprio qdisc\n" );Also here.
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 480
Quoted 9 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +9
-0+return -EINVAL ; + } + +if (port->qos.link_speed ==SPEED_UNKNOWN ) +return -ENOLINK ; + +if (taprio->cycle_time_extension) { +NL_SET_ERR_MSG_MOD (extack, +"cycle time extension not supported" );Here it's ok.
Quoted 2 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c static void am65_cpsw_purge_est(struct net_device *ndev) · line 482
Quoted 2 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +1
-0+return -EOPNOTSUPP ; }Thanks for the detailed review!
Signature · 2 lines
cheers, -roger
PATCH v6 3/7 net: ethernet: ti: am65-cpsw: Move code to avoid forward declaration
In reply to Roger QuadrosMove this code to the end to avoid forward declaration. No functional change.
--- drivers/net/ethernet/ti/am65-cpsw-qos.c | 66 ++++++++++++------------- 1 file changed, 33 insertions(+), 33 deletions(-)
v6: no change
v5: no change
v4: initial commit
drivers/net/ethernet/ti/am65-cpsw-qos.c +33 -33
@@ -772,39 +772,6 @@ static int am65_cpsw_qos_setup_tc_block(struct net_device *ndev, struct flow_blo port, port, true); } -int am65_cpsw_qos_ndo_setup_tc (struct net_device *ndev,enum tc_setup_type type, -void *type_data) -{ -switch (type) { -case TC_QUERY_CAPS : -return am65_cpsw_tc_query_caps (ndev, type_data); -case TC_SETUP_QDISC_TAPRIO : -return am65_cpsw_setup_taprio (ndev, type_data); -case TC_SETUP_BLOCK : -return am65_cpsw_qos_setup_tc_block (ndev, type_data); -default : -return -EOPNOTSUPP ; - } -} - -void am65_cpsw_qos_link_up (struct net_device *ndev,int link_speed) -{ -struct am65_cpsw_port *port =am65_ndev_to_port (ndev); - -am65_cpsw_est_link_up (ndev, link_speed); - port->qos.link_down_time =0 ; -} - -void am65_cpsw_qos_link_down (struct net_device *ndev) -{ -struct am65_cpsw_port *port =am65_ndev_to_port (ndev); - -if (!port->qos.link_down_time) - port->qos.link_down_time =ktime_get (); - - port->qos.link_speed =SPEED_UNKNOWN ; -} -static u32 am65_cpsw_qos_tx_rate_calc (u32 rate_mbps,unsigned long bus_freq) {
@@ -916,3 +883,36 @@ void am65_cpsw_qos_tx_p0_rate_init(struct am65_cpsw_common *common) host->port_base + AM65_CPSW_PN_REG_PRI_CIR(tx_ch)); } } + +int am65_cpsw_qos_ndo_setup_tc (struct net_device *ndev,enum tc_setup_type type, +void *type_data) +{ +switch (type) { +case TC_QUERY_CAPS : +return am65_cpsw_tc_query_caps (ndev, type_data); +case TC_SETUP_QDISC_TAPRIO : +return am65_cpsw_setup_taprio (ndev, type_data); +case TC_SETUP_BLOCK : +return am65_cpsw_qos_setup_tc_block (ndev, type_data); +default : +return -EOPNOTSUPP ; + } +} + +void am65_cpsw_qos_link_up (struct net_device *ndev,int link_speed) +{ +struct am65_cpsw_port *port =am65_ndev_to_port (ndev); + +am65_cpsw_est_link_up (ndev, link_speed); + port->qos.link_down_time =0 ; +} + +void am65_cpsw_qos_link_down (struct net_device *ndev) +{ +struct am65_cpsw_port *port =am65_ndev_to_port (ndev); + +if (!port->qos.link_down_time) + port->qos.link_down_time =ktime_get (); + + port->qos.link_speed =SPEED_UNKNOWN ; +}
Signature · 1 line
2.34.1
PATCH v6 4/7 net: ethernet: am65-cpsw: Move register definitions to header file
In reply to Roger QuadrosMove register definitions to header file. No functional change.
--- drivers/net/ethernet/ti/am65-cpsw-qos.c | 35 ------------------------- drivers/net/ethernet/ti/am65-cpsw-qos.h | 35 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-)
Changelog:
v6: initial commit
drivers/net/ethernet/ti/am65-cpsw-qos.c +0 -35
@@ -15,41 +15,6 @@#include "am65-cpts.h" #include "cpsw_ale.h" -#define AM65_CPSW_REG_CTL 0x004 -#define AM65_CPSW_PN_REG_CTL 0x004 -#define AM65_CPSW_PN_REG_FIFO_STATUS 0x050 -#define AM65_CPSW_PN_REG_EST_CTL 0x060 -#define AM65_CPSW_PN_REG_PRI_CIR (pri) (0x140 + 4 * (pri)) - -/* AM65_CPSW_REG_CTL register fields */ -#define AM65_CPSW_CTL_EST_EN BIT(18) - -/* AM65_CPSW_PN_REG_CTL register fields */ -#define AM65_CPSW_PN_CTL_EST_PORT_EN BIT(17) - -/* AM65_CPSW_PN_REG_EST_CTL register fields */ -#define AM65_CPSW_PN_EST_ONEBUF BIT(0) -#define AM65_CPSW_PN_EST_BUFSEL BIT(1) -#define AM65_CPSW_PN_EST_TS_EN BIT(2) -#define AM65_CPSW_PN_EST_TS_FIRST BIT(3) -#define AM65_CPSW_PN_EST_ONEPRI BIT(4) -#define AM65_CPSW_PN_EST_TS_PRI_MSK GENMASK(7, 5) - -/* AM65_CPSW_PN_REG_FIFO_STATUS register fields */ -#define AM65_CPSW_PN_FST_TX_PRI_ACTIVE_MSK GENMASK(7, 0) -#define AM65_CPSW_PN_FST_TX_E_MAC_ALLOW_MSK GENMASK(15, 8) -#define AM65_CPSW_PN_FST_EST_CNT_ERR BIT(16) -#define AM65_CPSW_PN_FST_EST_ADD_ERR BIT(17) -#define AM65_CPSW_PN_FST_EST_BUFACT BIT(18) - -/* EST FETCH COMMAND RAM */ -#define AM65_CPSW_FETCH_RAM_CMD_NUM 0x80 -#define AM65_CPSW_FETCH_CNT_MSK GENMASK(21, 8) -#define AM65_CPSW_FETCH_CNT_MAX (AM65_CPSW_FETCH_CNT_MSK >> 8) -#define AM65_CPSW_FETCH_CNT_OFFSET 8 -#define AM65_CPSW_FETCH_ALLOW_MSK GENMASK(7, 0) -#define AM65_CPSW_FETCH_ALLOW_MAX AM65_CPSW_FETCH_ALLOW_MSK -enum timer_act {TACT_PROG ,/* need program timer */ TACT_NEED_STOP ,/* need stop first */
drivers/net/ethernet/ti/am65-cpsw-qos.h +35 -0
@@ -31,6 +31,41 @@ struct am65_cpsw_qos {struct am65_cpsw_ale_ratelimit ale_mc_ratelimit; }; +#define AM65_CPSW_REG_CTL 0x004 +#define AM65_CPSW_PN_REG_CTL 0x004 +#define AM65_CPSW_PN_REG_FIFO_STATUS 0x050 +#define AM65_CPSW_PN_REG_EST_CTL 0x060 +#define AM65_CPSW_PN_REG_PRI_CIR (pri) (0x140 + 4 * (pri)) + +/* AM65_CPSW_REG_CTL register fields */ +#define AM65_CPSW_CTL_EST_EN BIT(18) + +/* AM65_CPSW_PN_REG_CTL register fields */ +#define AM65_CPSW_PN_CTL_EST_PORT_EN BIT(17) + +/* AM65_CPSW_PN_REG_EST_CTL register fields */ +#define AM65_CPSW_PN_EST_ONEBUF BIT(0) +#define AM65_CPSW_PN_EST_BUFSEL BIT(1) +#define AM65_CPSW_PN_EST_TS_EN BIT(2) +#define AM65_CPSW_PN_EST_TS_FIRST BIT(3) +#define AM65_CPSW_PN_EST_ONEPRI BIT(4) +#define AM65_CPSW_PN_EST_TS_PRI_MSK GENMASK(7, 5) + +/* AM65_CPSW_PN_REG_FIFO_STATUS register fields */ +#define AM65_CPSW_PN_FST_TX_PRI_ACTIVE_MSK GENMASK(7, 0) +#define AM65_CPSW_PN_FST_TX_E_MAC_ALLOW_MSK GENMASK(15, 8) +#define AM65_CPSW_PN_FST_EST_CNT_ERR BIT(16) +#define AM65_CPSW_PN_FST_EST_ADD_ERR BIT(17) +#define AM65_CPSW_PN_FST_EST_BUFACT BIT(18) + +/* EST FETCH COMMAND RAM */ +#define AM65_CPSW_FETCH_RAM_CMD_NUM 0x80 +#define AM65_CPSW_FETCH_CNT_MSK GENMASK(21, 8) +#define AM65_CPSW_FETCH_CNT_MAX (AM65_CPSW_FETCH_CNT_MSK >> 8) +#define AM65_CPSW_FETCH_CNT_OFFSET 8 +#define AM65_CPSW_FETCH_ALLOW_MSK GENMASK(7, 0) +#define AM65_CPSW_FETCH_ALLOW_MAX AM65_CPSW_FETCH_ALLOW_MSK +#if IS_ENABLED (CONFIG_TI_AM65_CPSW_TAS )int am65_cpsw_qos_ndo_setup_tc (struct net_device *ndev,enum tc_setup_type type,void *type_data);
Signature · 1 line
2.34.1
PATCH v6 5/7 net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode
In reply to Roger QuadrosFrom: Grygorii Strashko <[email protected]>
This patch adds MQPRIO Qdisc offload in full 'channel' mode which allows not only setting up pri:tc mapping, but also configuring TX shapers (rate-limiting) on external port FIFOs.
The MQPRIO Qdisc offload is expected to work with or without VLAN/priority tagged packets.
The CPSW external Port FIFO has 8 Priority queues. The rate-limit can be set for each of these priority queues. Which Priority queue a packet is assigned to depends on PN_REG_TX_PRI_MAP register which maps header priority to switch priority.
The header priority of a packet is assigned via the RX_PRI_MAP_REG which maps packet priority to header priority.
The packet priority is either the VLAN priority (for VLAN tagged packets) or the thread/channel offset.
For simplicity, we assign the same priority queue to all queues of a Traffic Class so it can be rate-limited correctly.
Configuration example:
ethtool -L eth1 tx 5
ethtool --set-priv-flags eth1 p0-rx-ptype-rrobin off
tc qdisc add dev eth1 parent root handle 100: mqprio num_tc 3 \
map 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 \
queues 1@0 1@1 1@2 hw 1 mode channel \
shaper bw_rlimit min_rate 0 100mbit 200mbit max_rate 0 101mbit 202mbit
tc qdisc replace dev eth2 handle 100: parent root mqprio num_tc 1 \
map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 queues 1@0 hw 1
ip link add link eth1 name eth1.100 type vlan id 100
ip link set eth1.100 type vlan egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
In the above example two ports share the same TX CPPI queue 0 for low priority traffic. 3 traffic classes are defined for eth1 and mapped to:
TC0 - low priority, TX CPPI queue 0 -> ext Port 1 fifo0, no rate limit TC1 - prio 2, TX CPPI queue 1 -> ext Port 1 fifo1, CIR=100Mbit/s, EIR=1Mbit/s TC2 - prio 3, TX CPPI queue 2 -> ext Port 1 fifo2, CIR=200Mbit/s, EIR=2Mbit/s
--- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 3 + drivers/net/ethernet/ti/am65-cpsw-qos.c | 274 +++++++++++++++++++++-- drivers/net/ethernet/ti/am65-cpsw-qos.h | 20 ++ 3 files changed, 284 insertions(+), 13 deletions(-)
v6:
- fixed typo in comment "packet_priorit"->"packet_priority"
- don't call netif_set_real_num_tx_queues() from am65_cpsw_reset_tc_mqprio()
- reset TX queue priorities to zero at init. AM65_CPSW_PN_REG_TX_PRI_MAP = 0
- don't ignore return value in am65_cpsw_setup_mqprio()
v5:
- fix warning at NL_SET_ERR_MSG_FMT_MOD()
v4:
- use macro TO_MBPS()
- use bool for 'shaper_en'
- split code movement into separate patch
- drop rate vs link speed check as mqprio can be set at link down
- call am65_cpsw_reset_tc_mqprio() after pm_runtime_get_sync()
v2:
- clean up commit message
- avoid forward declarations
- use tc_mqprio_qopt_offload :: extack for error message reporting
- avoid unnecessary mqprio->qopt.hw == 0 checks
- set struct tc_mqprio_caps :: validate_queue_counts = true and get rid of am65_cpsw_mqprio_verify()
- do not modify AM65_CPSW_P0_REG_RX_PRI_MAP register.
drivers/net/ethernet/ti/am65-cpsw-nuss.c +3 -0
@@ -2127,6 +2127,9 @@ static int am65_cpsw_nuss_init_slave_ports(struct am65_cpsw_common *common)dev_err (dev,"Use random MAC address\n" ); } } + +/* Reset all Queue priorities to 0 */ +writel (0 , port->port_base +AM65_CPSW_PN_REG_TX_PRI_MAP ); }of_node_put (node);
drivers/net/ethernet/ti/am65-cpsw-qos.c +261 -13
340 lines not on this page · raw message
drivers/net/ethernet/ti/am65-cpsw-qos.h +20 -0
@@ -9,6 +9,7 @@#include <net/pkt_sched.h> struct am65_cpsw_common ; +struct am65_cpsw_port ;struct am65_cpsw_est {int buf;
@@ -16,6 +17,12 @@ struct am65_cpsw_est {struct tc_taprio_qopt_offload taprio; }; +struct am65_cpsw_mqprio { +struct tc_mqprio_qopt_offload mqprio_hw; +u64 max_rate_total; +bool shaper_en; +}; +struct am65_cpsw_ale_ratelimit {unsigned long cookie;u64 rate_packet_ps;
@@ -26,6 +33,7 @@ struct am65_cpsw_qos {struct am65_cpsw_est *est_oper;ktime_t link_down_time;int link_speed; +struct am65_cpsw_mqprio mqprio;struct am65_cpsw_ale_ratelimit ale_bc_ratelimit;struct am65_cpsw_ale_ratelimit ale_mc_ratelimit;
@@ -36,6 +44,15 @@ struct am65_cpsw_qos {#define AM65_CPSW_PN_REG_FIFO_STATUS 0x050#define AM65_CPSW_PN_REG_EST_CTL 0x060#define AM65_CPSW_PN_REG_PRI_CIR (pri) (0x140 + 4 * (pri)) +#define AM65_CPSW_P0_REG_PRI_EIR (pri) (0x160 + 4 * (pri)) + +#define AM65_CPSW_PN_REG_CTL 0x004 +#define AM65_CPSW_PN_REG_TX_PRI_MAP 0x018 +#define AM65_CPSW_PN_REG_RX_PRI_MAP 0x020 +#define AM65_CPSW_PN_REG_FIFO_STATUS 0x050 +#define AM65_CPSW_PN_REG_EST_CTL 0x060 +#define AM65_CPSW_PN_REG_PRI_CIR (pri) (0x140 + 4 * (pri)) +#define AM65_CPSW_PN_REG_PRI_EIR (pri) (0x160 + 4 * (pri))/* AM65_CPSW_REG_CTL register fields */ #define AM65_CPSW_CTL_EST_EN BIT(18)
@@ -66,6 +83,9 @@ struct am65_cpsw_qos {#define AM65_CPSW_FETCH_ALLOW_MSK GENMASK(7, 0)#define AM65_CPSW_FETCH_ALLOW_MAX AM65_CPSW_FETCH_ALLOW_MSK +/* number of priority queues per port FIFO */ +#define AM65_CPSW_PN_FIFO_PRIO_NUM 8 +#if IS_ENABLED (CONFIG_TI_AM65_CPSW_TAS )int am65_cpsw_qos_ndo_setup_tc (struct net_device *ndev,enum tc_setup_type type,void *type_data);
Signature · 1 line
2.34.1
Re: [PATCH v6 net-next 5/7] net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode
Quoted 12 lines · Roger Quadros
drivers/net/ethernet/ti/am65-cpsw-qos.c +12
-0+static int am65_cpsw_setup_mqprio (struct net_device *ndev,void *type_data) +{ +struct am65_cpsw_port *port =am65_ndev_to_port (ndev); +struct am65_cpsw_mqprio *p_mqprio = &port->qos.mqprio; +struct tc_mqprio_qopt_offload *mqprio = type_data; +struct am65_cpsw_common *common = port->common; +struct tc_mqprio_qopt *qopt = &mqprio->qopt; +int i, tc, offset, count, prio, ret; +u8 num_tc = qopt->num_tc; +u32 tx_prio_map =0 ; + +memcpy (&p_mqprio->mqprio_hw, mqprio,sizeof (*mqprio));
drivers/net/ethernet/ti/am65-cpsw-qos.c line 216
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +10
-0+ + ret =pm_runtime_get_sync (common->dev); +if (ret <0 ) { +pm_runtime_put_noidle (common->dev); +return ret; + } + +if (!num_tc) { +am65_cpsw_reset_tc_mqprio (ndev); + ret = -EINVAL ;
num_tc == 0 is what signals the deletion of the mqprio qdisc. Why return -EINVAL?
Quoted 52 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +45
-0+ goto exit_put; + } + + ret =am65_cpsw_mqprio_verify_shaper (port, mqprio); +if (ret) + goto exit_put; + +netdev_set_num_tc (ndev, num_tc); + +/* Multiple Linux priorities can map to a Traffic Class +* A Traffic Class can have multiple contiguous Queues, +* Queues get mapped to Channels (thread_id), +* if not VLAN tagged, thread_id is used as packet_priority +* if VLAN tagged. VLAN priority is used as packet_priority +* packet_priority gets mapped to header_priority in p0_rx_pri_map, +* header_priority gets mapped to switch_priority in pn_tx_pri_map. +* As p0_rx_pri_map is left at defaults (0x76543210), we can +* assume that Queue_n gets mapped to header_priority_n. We can then +* set the switch priority in pn_tx_pri_map. +*/ + +for (tc =0 ; tc < num_tc; tc++) { + prio = tc; + +/* For simplicity we assign the same priority (TCn) to +* all queues of a Traffic Class. +*/ +for (i = qopt->offset[tc]; i < qopt->offset[tc] + qopt->count[tc]; i++) + tx_prio_map |= prio << (4 * i); + + count = qopt->count[tc]; + offset = qopt->offset[tc]; +netdev_set_tc_queue (ndev, tc, count, offset); + } + +writel (tx_prio_map, port->port_base +AM65_CPSW_PN_REG_TX_PRI_MAP ); + +am65_cpsw_tx_pn_shaper_apply (port); + +exit_put: +pm_runtime_put (common->dev); + +return ret; +} +static int am65_cpsw_port_est_enabled (struct am65_cpsw_port *port) {return port->qos.est_oper || port->qos.est_admin;@@ -737,16 +989,6 @@ static int am65_cpsw_qos_setup_tc_block(struct net_device *ndev, struct flow_blo port, port, true); }
drivers/net/ethernet/ti/am65-cpsw-qos.c static int am65_cpsw_qos_setup_tc_block(struct net_device *ndev, struct flow_blo · line 749
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +0
-10-static u32 -am65_cpsw_qos_tx_rate_calc (u32 rate_mbps,unsigned long bus_freq) -{ -u32 ir; - - bus_freq /=1000000 ; - ir =DIV_ROUND_UP (((u64 )rate_mbps *32768 ), bus_freq); -return ir; -} -
Insufficient code movement in the previous patch?
Re: [PATCH v6 net-next 5/7] net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode
Quoted 18 lines · Vladimir Oltean
Quoted 17 lines · Roger Quadros
drivers/net/ethernet/ti/am65-cpsw-qos.c +17
-0+static int am65_cpsw_setup_mqprio (struct net_device *ndev,void *type_data) +{ +struct am65_cpsw_port *port =am65_ndev_to_port (ndev); +struct am65_cpsw_mqprio *p_mqprio = &port->qos.mqprio; +struct tc_mqprio_qopt_offload *mqprio = type_data; +struct am65_cpsw_common *common = port->common; +struct tc_mqprio_qopt *qopt = &mqprio->qopt; +int i, tc, offset, count, prio, ret; +u8 num_tc = qopt->num_tc; +u32 tx_prio_map =0 ; + +memcpy (&p_mqprio->mqprio_hw, mqprio,sizeof (*mqprio)); + + ret =pm_runtime_get_sync (common->dev); +if (ret <0 ) { +pm_runtime_put_noidle (common->dev); +return ret;
Quoted 8 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c line 216
Quoted 5 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +5
-0+ } + +if (!num_tc) { +am65_cpsw_reset_tc_mqprio (ndev); + ret = -EINVAL ;
num_tc== 0 is what signals the deletion of the mqprio qdisc. Why return-EINVAL?
Right. I'll drop the -EINVAL.
Quoted 53 lines
Quoted 53 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +45
-0+ goto exit_put; + } + + ret =am65_cpsw_mqprio_verify_shaper (port, mqprio); +if (ret) + goto exit_put; + +netdev_set_num_tc (ndev, num_tc); + +/* Multiple Linux priorities can map to a Traffic Class +* A Traffic Class can have multiple contiguous Queues, +* Queues get mapped to Channels (thread_id), +* if not VLAN tagged, thread_id is used as packet_priority +* if VLAN tagged. VLAN priority is used as packet_priority +* packet_priority gets mapped to header_priority in p0_rx_pri_map, +* header_priority gets mapped to switch_priority in pn_tx_pri_map. +* As p0_rx_pri_map is left at defaults (0x76543210), we can +* assume that Queue_n gets mapped to header_priority_n. We can then +* set the switch priority in pn_tx_pri_map. +*/ + +for (tc =0 ; tc < num_tc; tc++) { + prio = tc; + +/* For simplicity we assign the same priority (TCn) to +* all queues of a Traffic Class. +*/ +for (i = qopt->offset[tc]; i < qopt->offset[tc] + qopt->count[tc]; i++) + tx_prio_map |= prio << (4 * i); + + count = qopt->count[tc]; + offset = qopt->offset[tc]; +netdev_set_tc_queue (ndev, tc, count, offset); + } + +writel (tx_prio_map, port->port_base +AM65_CPSW_PN_REG_TX_PRI_MAP ); + +am65_cpsw_tx_pn_shaper_apply (port); + +exit_put: +pm_runtime_put (common->dev); + +return ret; +} +static int am65_cpsw_port_est_enabled (struct am65_cpsw_port *port) {return port->qos.est_oper || port->qos.est_admin;@@ -737,16 +989,6 @@ static int am65_cpsw_qos_setup_tc_block(struct net_device *ndev, struct flow_blo port, port, true); }
Quoted 12 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c static int am65_cpsw_qos_setup_tc_block(struct net_device *ndev, struct flow_blo · line 749
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +0
-10-static u32 -am65_cpsw_qos_tx_rate_calc (u32 rate_mbps,unsigned long bus_freq) -{ -u32 ir; - - bus_freq /=1000000 ; - ir =DIV_ROUND_UP (((u64 )rate_mbps *32768 ), bus_freq); -return ir; -} -Insufficient code movement in the previous patch?
Let me move it to patch 3.
Signature · 2 lines
cheers, -roger
PATCH v6 6/7 net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
In reply to Roger QuadrosAdd driver support for viewing / changing the MAC Merge sublayer parameters and seeing the verification state machine's current state via ethtool.
As hardware does not support interrupt notification for verification events we resort to polling on link up. On link up we try a couple of times for verification success and if unsuccessful then give up.
The Frame Preemption feature is described in the Technical Reference Manual [1] in section:
12.3.1.4.6.7 Intersperced Express Traffic (IET – P802.3br/D2.0)
Due to Silicon Errata i2208 [2] we set limit min IET fragment size to 124.
[1] AM62x TRM - https://www.ti.com/lit/ug/spruiv7a/spruiv7a.pdf
[2] AM62x Silicon Errata - https://www.ti.com/lit/er/sprz487c/sprz487c.pdf
--- drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 155 +++++++++++++++ drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 + drivers/net/ethernet/ti/am65-cpsw-nuss.h | 5 + drivers/net/ethernet/ti/am65-cpsw-qos.c | 200 ++++++++++++++++++++ drivers/net/ethernet/ti/am65-cpsw-qos.h | 103 ++++++++++ 5 files changed, 465 insertions(+)
Changelog:
v6:
- get mutex around am65_cpsw_iet_commit_preemptible_tcs() in am65_cpsw_iet_change_preemptible_tcs()
- use "preemption" instead of "pre-emption"
- call am65_cpsw_setup_mqprio() from within am65_cpsw_setup_taprio()
- Now works with kselftest except the last test which fails
root@am62xx:~/kselftest# ./run_kselftest.sh -t net/forwarding:ethtool_mm.sh # TEST: Manual configuration with verification: eth0 to eth1 [ OK ] # TEST: Manual configuration with verification: eth1 to eth0 [ OK ] # TEST: Manual configuration without verification: eth0 to eth1 [ OK ] # TEST: Manual configuration without verification: eth1 to eth0 [ OK ] # TEST: Manual configuration with failed verification: eth0 to eth1 [ OK ] # TEST: Manual configuration with failed verification: eth1 to eth0 [ OK ] # Warning: Stopping lldpad.service, but it can still be activated by: # lldpad.socket # TEST: LLDP [FAIL] # eth0 pMAC TX is not active
v5:
- No change
v4:
- Rebase and include in the same series as mqprio support.
v3:
- Rebase on top of v6.6-rc1 and mqprio support [1]
- Support ethtool_ops :: get_mm_stats()
- drop unused variables cmn_ctrl and verify_cnt
- make am65_cpsw_iet_link_state_update() and am65_cpsw_iet_change_preemptible_tcs() static
[1] https://lore.kernel.org/all/[email protected]/
v2:
- Use proper control bits for PMAC enable (AM65_CPSW_PN_CTL_IET_PORT_EN) and TX enable (AM65_CPSW_PN_IET_MAC_PENABLE)
- Common IET Enable (AM65_CPSW_CTL_IET_EN) is set if any port has AM65_CPSW_PN_CTL_IET_PORT_EN set.
- Fix workaround for erratum i2208. i.e. Limit rx_min_frag_size to 124
- Fix am65_cpsw_iet_get_verify_timeout_ms() to default to timeout for 1G link if link is inactive.
- resize the RX FIFO based on pmac_enabled, not tx_enabled.
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +155 -0
@@ -11,6 +11,7 @@#include <linux/pm_runtime.h> #include "am65-cpsw-nuss.h" +#include "am65-cpsw-qos.h" #include "cpsw_ale.h" #include "am65-cpts.h"
@@ -740,6 +741,157 @@ static int am65_cpsw_set_ethtool_priv_flags(struct net_device *ndev, u32 flags)return 0 ; } +static void am65_cpsw_port_iet_rx_enable (struct am65_cpsw_port *port,bool enable) +{ +u32 val; + + val =readl (port->port_base +AM65_CPSW_PN_REG_CTL ); +if (enable) + val |=AM65_CPSW_PN_CTL_IET_PORT_EN ; +else + val &= ~AM65_CPSW_PN_CTL_IET_PORT_EN ; + +writel (val, port->port_base +AM65_CPSW_PN_REG_CTL ); +am65_cpsw_iet_common_enable (port->common); +} + +static void am65_cpsw_port_iet_tx_enable (struct am65_cpsw_port *port,bool enable) +{ +u32 val; + + val =readl (port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); +if (enable) + val |=AM65_CPSW_PN_IET_MAC_PENABLE ; +else + val &= ~AM65_CPSW_PN_IET_MAC_PENABLE ; + +writel (val, port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); +} + +static int am65_cpsw_get_mm (struct net_device *ndev,struct ethtool_mm_state *state) +{ +struct am65_cpsw_port *port =am65_ndev_to_port (ndev); +struct am65_cpsw_ndev_priv *priv =netdev_priv (ndev); +u32 port_ctrl, iet_ctrl, iet_status; +u32 add_frag_size; + +mutex_lock (&priv->mm_lock); + + iet_ctrl =readl (port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); + port_ctrl =readl (port->port_base +AM65_CPSW_PN_REG_CTL ); + + state->tx_enabled = !!(iet_ctrl &AM65_CPSW_PN_IET_MAC_PENABLE ); + state->pmac_enabled = !!(port_ctrl &AM65_CPSW_PN_CTL_IET_PORT_EN ); + + iet_status =readl (port->port_base +AM65_CPSW_PN_REG_IET_STATUS ); + +if (iet_ctrl &AM65_CPSW_PN_IET_MAC_DISABLEVERIFY ) + state->verify_status =ETHTOOL_MM_VERIFY_STATUS_DISABLED ; +else if (iet_status &AM65_CPSW_PN_MAC_VERIFIED ) + state->verify_status =ETHTOOL_MM_VERIFY_STATUS_SUCCEEDED ; +else if (iet_status &AM65_CPSW_PN_MAC_VERIFY_FAIL ) + state->verify_status =ETHTOOL_MM_VERIFY_STATUS_FAILED ; +else + state->verify_status =ETHTOOL_MM_VERIFY_STATUS_UNKNOWN ; + + add_frag_size =AM65_CPSW_PN_IET_MAC_GET_ADDFRAGSIZE (iet_ctrl); + state->tx_min_frag_size =ethtool_mm_frag_size_add_to_min (add_frag_size); + +/* Errata i2208: RX min fragment size cannot be less than 124 */ + state->rx_min_frag_size =124 ; + +/* FPE active if common tx_enabled and verification success or disabled (forced) */ + state->tx_active = state->tx_enabled && + (state->verify_status ==ETHTOOL_MM_VERIFY_STATUS_SUCCEEDED || + state->verify_status ==ETHTOOL_MM_VERIFY_STATUS_DISABLED ); + state->verify_enabled = !(iet_ctrl &AM65_CPSW_PN_IET_MAC_DISABLEVERIFY ); + + state->verify_time = port->qos.iet.verify_time_ms; + state->max_verify_time =am65_cpsw_iet_get_verify_timeout_ms (AM65_CPSW_PN_MAC_VERIFY_CNT_MASK , + port); +mutex_unlock (&priv->mm_lock); + +return 0 ; +} + +static int am65_cpsw_set_mm (struct net_device *ndev,struct ethtool_mm_cfg *cfg, +struct netlink_ext_ack *extack) +{ +struct am65_cpsw_port *port =am65_ndev_to_port (ndev); +struct am65_cpsw_ndev_priv *priv =netdev_priv (ndev); +struct am65_cpsw_iet *iet = &port->qos.iet; +u32 val, add_frag_size; +int err; + + err =ethtool_mm_frag_size_min_to_add (cfg->tx_min_frag_size, &add_frag_size, extack); +if (err) +return err; + +mutex_lock (&priv->mm_lock); + +if (cfg->pmac_enabled) { +/* change TX & RX FIFO MAX_BLKS as per TRM recommendation */ +if (!iet->original_max_blks) + iet->original_max_blks =readl (port->port_base +AM65_CPSW_PN_REG_MAX_BLKS ); + +writel (AM65_CPSW_PN_TX_RX_MAX_BLKS_IET , + port->port_base +AM65_CPSW_PN_REG_MAX_BLKS ); + }else { +/* restore RX & TX FIFO MAX_BLKS */ +if (iet->original_max_blks) { +writel (iet->original_max_blks, + port->port_base +AM65_CPSW_PN_REG_MAX_BLKS ); + } + } + +am65_cpsw_port_iet_rx_enable (port, cfg->pmac_enabled); +am65_cpsw_port_iet_tx_enable (port, cfg->tx_enabled); + + val =readl (port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); +if (cfg->verify_enabled) { + val &= ~AM65_CPSW_PN_IET_MAC_DISABLEVERIFY ; +/* Reset Verify state machine. Verification won't start here. +* Verification will be done once link-up. +*/ + val |=AM65_CPSW_PN_IET_MAC_LINKFAIL ; + }else { + val |=AM65_CPSW_PN_IET_MAC_DISABLEVERIFY ; +/* Clear LINKFAIL to allow verify/response packets */ + val &= ~AM65_CPSW_PN_IET_MAC_LINKFAIL ; + } + + val &= ~AM65_CPSW_PN_IET_MAC_MAC_ADDFRAGSIZE_MASK ; + val |=AM65_CPSW_PN_IET_MAC_SET_ADDFRAGSIZE (add_frag_size); +writel (val, port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); + +/* verify_timeout_count can only be set at valid link */ +if (cfg->verify_time >0 ) + port->qos.iet.verify_time_ms = cfg->verify_time; +else + port->qos.iet.verify_time_ms =10 ; + +/* enable/disable preemption based on link status */ +am65_cpsw_iet_commit_preemptible_tcs (port); + +mutex_unlock (&priv->mm_lock); + +return 0 ; +} + +static void am65_cpsw_get_mm_stats (struct net_device *ndev, +struct ethtool_mm_stats *s) +{ +struct am65_cpsw_port *port =am65_ndev_to_port (ndev); +void __iomem *base = port->stat_base; + + s->MACMergeFrameAssOkCount =readl (base +AM65_CPSW_STATN_IET_RX_ASSEMBLY_OK ); + s->MACMergeFrameAssErrorCount =readl (base +AM65_CPSW_STATN_IET_RX_ASSEMBLY_ERROR ); + s->MACMergeFrameSmdErrorCount =readl (base +AM65_CPSW_STATN_IET_RX_SMD_ERROR ); + s->MACMergeFragCountRx =readl (base +AM65_CPSW_STATN_IET_RX_FRAG ); + s->MACMergeFragCountTx =readl (base +AM65_CPSW_STATN_IET_TX_FRAG ); + s->MACMergeHoldCount =readl (base +AM65_CPSW_STATN_IET_TX_HOLD ); +} +const struct ethtool_ops am65_cpsw_ethtool_ops_slave = { .begin = am65_cpsw_ethtool_op_begin, .complete = am65_cpsw_ethtool_op_complete,
@@ -769,4 +921,7 @@ const struct ethtool_ops am65_cpsw_ethtool_ops_slave = { .get_eee = am65_cpsw_get_eee, .set_eee = am65_cpsw_set_eee, .nway_reset = am65_cpsw_nway_reset, + .get_mm = am65_cpsw_get_mm, + .set_mm = am65_cpsw_set_mm, + .get_mm_stats = am65_cpsw_get_mm_stats, };
drivers/net/ethernet/ti/am65-cpsw-nuss.c +2 -0
@@ -2194,6 +2194,8 @@ am65_cpsw_nuss_init_port_ndev(struct am65_cpsw_common *common, u32 port_idx) ndev_priv =netdev_priv (port->ndev); ndev_priv->port = port; ndev_priv->msg_enable =AM65_CPSW_DEBUG ; +mutex_init (&ndev_priv->mm_lock); + port->qos.link_speed =SPEED_UNKNOWN ;SET_NETDEV_DEV (port->ndev, dev);eth_hw_addr_set (port->ndev, port->slave.mac_addr);
drivers/net/ethernet/ti/am65-cpsw-nuss.h +5 -0
@@ -145,6 +145,7 @@ struct am65_cpsw_common {bool pf_p0_rx_ptype_rrobin;struct am65_cpts *cpts;int est_enabled; +bool iet_enabled;bool is_emac_mode;u16 br_members;
@@ -170,6 +171,10 @@ struct am65_cpsw_ndev_priv {struct am65_cpsw_port *port;struct am65_cpsw_ndev_stats __percpu *stats;bool offload_fwd_mark; +/* Serialize access to MAC Merge state between ethtool requests +* and link state updates +*/ +struct mutex mm_lock; };#define am65_ndev_to_priv (ndev) \
drivers/net/ethernet/ti/am65-cpsw-qos.c +200 -0
251 lines not on this page · raw message
drivers/net/ethernet/ti/am65-cpsw-qos.h +103 -0
119 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
Quoted 9 lines · Roger Quadros
Changelog:
v6:
- get mutex aroundam65_cpsw_iet_commit_preemptible_tcs()inam65_cpsw_iet_change_preemptible_tcs()
- use "preemption" instead of "pre-emption"
- callam65_cpsw_setup_mqprio()from withinam65_cpsw_setup_taprio()
- Now works with kselftest except the last test which fails
Quoted 11 lines
root@am62xx:~/kselftest# ./run_kselftest.sh -t net/forwarding:ethtool_mm.sh # TEST: Manual configuration with verification: eth0 to eth1 [ OK ] # TEST: Manual configuration with verification: eth1 to eth0 [ OK ] # TEST: Manual configuration without verification: eth0 to eth1 [ OK ] # TEST: Manual configuration without verification: eth1 to eth0 [ OK ] # TEST: Manual configuration with failed verification: eth0 to eth1 [ OK ] # TEST: Manual configuration with failed verification: eth1 to eth0 [ OK ] # Warning: Stopping lldpad.service, but it can still be activated by: # lldpad.socket # TEST: LLDP [FAIL] # eth0 pMAC TX is not active
Interesting, but why?
Could you disable all tests except the one that fails, then re-run with verbose shell output, spawn a child interactive shell right after the command that fails, run it by hand without the grep (copying it from the verbose output just one line above) and see what output it gives, compared to what it should?
tools/testing/selftests/net/forwarding/ethtool_mm.sh +6 -6
@@ -2,12 +2,6 @@ # SPDX-License-Identifier: GPL-2.0 ALL_TESTS=" - manual_with_verification_h1_to_h2 - manual_with_verification_h2_to_h1 - manual_without_verification_h1_to_h2 - manual_without_verification_h2_to_h1 - manual_failed_verification_h1_to_h2 - manual_failed_verification_h2_to_h1 lldp "
@@ -170,6 +164,8 @@ lldp() { RET=0 + set -x + systemctl start lldpad # Configure the interfaces to receive and transmit LLDPDUs
@@ -185,6 +181,10 @@ lldp() lldptool -i $h1 -t -n -V addEthCaps | \ grep -q "Preemption capability active" + + set +x + bash + check_err "$?" "$h1 pMAC TX is not active" lldptool -i $h2 -t -n -V addEthCaps | \
You have the openlldp compiled from the master branch so that it has preemption/MAC merge support, right? We just "require_command lldptool" but we don't probe for this functionality, as opposed to tc and ethtool.
Quoted 23 lines
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +15
-0@@ -740,6 +741,157 @@ static int am65_cpsw_set_ethtool_priv_flags(struct net_device *ndev, u32 flags)return 0 ; } +static int am65_cpsw_set_mm (struct net_device *ndev,struct ethtool_mm_cfg *cfg, +struct netlink_ext_ack *extack) +{ +struct am65_cpsw_port *port =am65_ndev_to_port (ndev); +struct am65_cpsw_ndev_priv *priv =netdev_priv (ndev); +struct am65_cpsw_iet *iet = &port->qos.iet; +u32 val, add_frag_size; +int err; + + err =ethtool_mm_frag_size_min_to_add (cfg->tx_min_frag_size, &add_frag_size, extack); +if (err) +return err; + +mutex_lock (&priv->mm_lock); +
drivers/net/ethernet/ti/am65-cpsw-ethtool.c static int am65_cpsw_set_ethtool_priv_flags(struct net_device *ndev, u32 flags) · line 768
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +10
-0+if (cfg->pmac_enabled) { +/* change TX & RX FIFO MAX_BLKS as per TRM recommendation */ +if (!iet->original_max_blks) + iet->original_max_blks =readl (port->port_base +AM65_CPSW_PN_REG_MAX_BLKS ); + +writel (AM65_CPSW_PN_TX_RX_MAX_BLKS_IET , + port->port_base +AM65_CPSW_PN_REG_MAX_BLKS ); + }else { +/* restore RX & TX FIFO MAX_BLKS */ +if (iet->original_max_blks) {
else {
if ()
}can be written as
else if () {
}
Quoted 43 lines
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +38
-0+writel (iet->original_max_blks, + port->port_base +AM65_CPSW_PN_REG_MAX_BLKS ); + } + } + +am65_cpsw_port_iet_rx_enable (port, cfg->pmac_enabled); +am65_cpsw_port_iet_tx_enable (port, cfg->tx_enabled); + + val =readl (port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); +if (cfg->verify_enabled) { + val &= ~AM65_CPSW_PN_IET_MAC_DISABLEVERIFY ; +/* Reset Verify state machine. Verification won't start here. +* Verification will be done once link-up. +*/ + val |=AM65_CPSW_PN_IET_MAC_LINKFAIL ; + }else { + val |=AM65_CPSW_PN_IET_MAC_DISABLEVERIFY ; +/* Clear LINKFAIL to allow verify/response packets */ + val &= ~AM65_CPSW_PN_IET_MAC_LINKFAIL ; + } + + val &= ~AM65_CPSW_PN_IET_MAC_MAC_ADDFRAGSIZE_MASK ; + val |=AM65_CPSW_PN_IET_MAC_SET_ADDFRAGSIZE (add_frag_size); +writel (val, port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); + +/* verify_timeout_count can only be set at valid link */ +if (cfg->verify_time >0 ) + port->qos.iet.verify_time_ms = cfg->verify_time; +else + port->qos.iet.verify_time_ms =10 ; + +/* enable/disable preemption based on link status */ +am65_cpsw_iet_commit_preemptible_tcs (port); + +mutex_unlock (&priv->mm_lock); + +return 0 ; +}drivers/net/ethernet/ti/am65-cpsw-qos.c +0
-0
drivers/net/ethernet/ti/am65-cpsw-qos.c line 11
Quoted 8 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +2
-0@@ -4,9 +4,11 @@* * quality of service module includes: * Enhanced Scheduler Traffic (EST - P802.1Qbv/D2.2) +* Interspersed Express Traffic (IET - P802.3br/D2.0) */ #include <linux/pm_runtime.h> +#include <linux/units.h>
If this was ordered alphabetically, u comes after t.
Quoted 16 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +9
-0#include <linux/time.h> #include <net/pkt_cls.h> @@ -259,6 +266,196 @@ static int am65_cpsw_setup_mqprio(struct net_device *ndev, void *type_data)return ret; } +static int am65_cpsw_iet_set_verify_timeout_count (struct am65_cpsw_port *port) +{ +int verify_time_ms = port->qos.iet.verify_time_ms; +int link_speed = port->qos.link_speed; +u32 val; + +if (WARN_ON (link_speed ==SPEED_UNKNOWN )) +return -ENODEV ; +
drivers/net/ethernet/ti/am65-cpsw-qos.c static int am65_cpsw_setup_mqprio(struct net_device *ndev, void *type_data) · line 287
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +10
-0+/* The number of wireside clocks contained in the verify +* timeout counter. The default is 0x1312d0 +* (10ms at 125Mhz in 1G mode). +*/ + val =125 *HZ_PER_MHZ ;/* assuming 125MHz wireside clock */ + + val /=MILLIHZ_PER_HZ ;/* count per ms timeout */ + val *= verify_time_ms;/* count for timeout ms */ +if (link_speed <SPEED_1000 ) + val <<=1 ;/* FIXME: Is this correct? */
Is there any way to find out and remove the FIXME? Like running the selftest at SPEED_100?
Quoted 6 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +6
-0+ +if (val >AM65_CPSW_PN_MAC_VERIFY_CNT_MASK ) +return -EINVAL ; + +writel (val, port->port_base +AM65_CPSW_PN_REG_IET_VERIFY ); +
drivers/net/ethernet/ti/am65-cpsw-qos.c static int am65_cpsw_setup_mqprio(struct net_device *ndev, void *type_data) · line 303
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +10
-0+return 0 ; +} + +/* CPSW does not have an IRQ to notify changes to the MAC Merge TX status +* (active/inactive), but the preemptible traffic classes should only be +* committed to hardware once TX is active. Resort to polling. +*/ +void am65_cpsw_iet_commit_preemptible_tcs (struct am65_cpsw_port *port) +{ +u8 preemptible_tcs =0 ;
I don't think the zero-initialization helps, since the value is later unconditionally overwritten.
Quoted 30 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +30
-0+int err; +u32 val; + +if (port->qos.link_speed ==SPEED_UNKNOWN ) +return ; + + val =readl (port->port_base +AM65_CPSW_PN_REG_CTL ); +if (!(val &AM65_CPSW_PN_CTL_IET_PORT_EN )) +return ; + +/* update common IET enable */ +am65_cpsw_iet_common_enable (port->common); + +/* update verify count */ + err =am65_cpsw_iet_set_verify_timeout_count (port); +if (err) { +netdev_err (port->ndev,"couldn't set verify count: %d\n" , err); +return ; + } + + val =readl (port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); +if (!(val &AM65_CPSW_PN_IET_MAC_DISABLEVERIFY )) { + err =am65_cpsw_iet_verify_wait (port); +if (err) +return ; + } + + preemptible_tcs = port->qos.iet.preemptible_tcs; +am65_cpsw_iet_set_preempt_mask (port, preemptible_tcs); +}
Re: [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
Quoted 68 lines · Vladimir Oltean
Quoted 9 lines · Roger Quadros
Changelog:
v6:
- get mutex aroundam65_cpsw_iet_commit_preemptible_tcs()inam65_cpsw_iet_change_preemptible_tcs()
- use "preemption" instead of "pre-emption"
- callam65_cpsw_setup_mqprio()from withinam65_cpsw_setup_taprio()
- Now works with kselftest except the last test which failsQuoted 11 lines
root@am62xx:~/kselftest# ./run_kselftest.sh -t net/forwarding:ethtool_mm.sh # TEST: Manual configuration with verification: eth0 to eth1 [ OK ] # TEST: Manual configuration with verification: eth1 to eth0 [ OK ] # TEST: Manual configuration without verification: eth0 to eth1 [ OK ] # TEST: Manual configuration without verification: eth1 to eth0 [ OK ] # TEST: Manual configuration with failed verification: eth0 to eth1 [ OK ] # TEST: Manual configuration with failed verification: eth1 to eth0 [ OK ] # Warning: Stopping lldpad.service, but it can still be activated by: # lldpad.socket # TEST: LLDP [FAIL] # eth0 pMAC TX is not activeInteresting, but why?
Could you disable all tests except the one that fails, then re-run with verbose shell output, spawn a child interactive shell right after the command that fails, run it by hand without the grep (copying it from the verbose output just one line above) and see what output it gives, compared to what it should?
tools/testing/selftests/net/forwarding/ethtool_mm.sh +6
-6@@ -2,12 +2,6 @@ # SPDX-License-Identifier: GPL-2.0 ALL_TESTS=" - manual_with_verification_h1_to_h2 - manual_with_verification_h2_to_h1 - manual_without_verification_h1_to_h2 - manual_without_verification_h2_to_h1 - manual_failed_verification_h1_to_h2 - manual_failed_verification_h2_to_h1 lldp "@@ -170,6 +164,8 @@ lldp() { RET=0 + set -x + systemctl start lldpad # Configure the interfaces to receive and transmit LLDPDUs@@ -185,6 +181,10 @@ lldp() lldptool -i $h1 -t -n -V addEthCaps | \ grep -q "Preemption capability active" + + set +x + bash + check_err "$?" "$h1 pMAC TX is not active" lldptool -i $h2 -t -n -V addEthCaps | \
Quoted 3 lines
You have the openlldp compiled from the master branch so that it has preemption/MAC merge support, right? We just "
require_commandlldptool" but we don't probe for this functionality, as opposed to tc and ethtool.
Yes I'm using openlldp master.
So I just dumped the "ethtool --show-mm" right before the "lldptool -i $h1 -t -n -V addEthCaps" and this is what I see
# MAC Merge layer state for eth0:
# pMAC enabled: on
# TX enabled: off
# TX active: off
# TX minimum fragment size: 252
# RX minimum fragment size: 124
# Verify enabled: off
# Verify time: 10
# Max verify time: 134
# Verification status: DISABLED
#
# MAC Merge layer state for eth1:
# pMAC enabled: on
# TX enabled: off
# TX active: off
# TX minimum fragment size: 124
# RX minimum fragment size: 124
# Verify enabled: off
# Verify time: 10
# Max verify time: 134
# Verification status: DISABLED
#
# Additional Ethernet Capabilities TLV
# Preemption capability supported # Preemption capability not enabled # Preemption capability not active # Additional fragment size: 3 (252 octets) # Additional Ethernet Capabilities TLV # Preemption capability supported # Preemption capability not enabled # Preemption capability not active # Additional fragment size: 1 (124 octets)
# Warning: Stopping lldpad.service, but it can still be activated by:
# lldpad.socket
# TEST: LLDP [FAIL]
If I add the following lines at the beginning of lldp() routine, then it works.
lldp()
{
RET=0+ ethtool --set-mm $h1 tx-enabled on verify-enabled on
+ ethtool --set-mm $h2 tx-enabled on verify-enabled on
...
}
Is lldp supposed to turn on tx-enabled and verify-enabled for us or it is test scritps responsibility?
The test fails later at "addFragSize 0", but that is because we don't support RX fragment size 60 due to errata.
If I skip that test then all the rest of the tests pass.
Quoted 39 lines
Quoted 24 lines
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +15
-0@@ -740,6 +741,157 @@ static int am65_cpsw_set_ethtool_priv_flags(struct net_device *ndev, u32 flags)return 0 ; } +static int am65_cpsw_set_mm (struct net_device *ndev,struct ethtool_mm_cfg *cfg, +struct netlink_ext_ack *extack) +{ +struct am65_cpsw_port *port =am65_ndev_to_port (ndev); +struct am65_cpsw_ndev_priv *priv =netdev_priv (ndev); +struct am65_cpsw_iet *iet = &port->qos.iet; +u32 val, add_frag_size; +int err; + + err =ethtool_mm_frag_size_min_to_add (cfg->tx_min_frag_size, &add_frag_size, extack); +if (err) +return err; + +mutex_lock (&priv->mm_lock); +drivers/net/ethernet/ti/am65-cpsw-ethtool.c static int am65_cpsw_set_ethtool_priv_flags(struct net_device *ndev, u32 flags) · line 768
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +10
-0+if (cfg->pmac_enabled) { +/* change TX & RX FIFO MAX_BLKS as per TRM recommendation */ +if (!iet->original_max_blks) + iet->original_max_blks =readl (port->port_base +AM65_CPSW_PN_REG_MAX_BLKS ); + +writel (AM65_CPSW_PN_TX_RX_MAX_BLKS_IET , + port->port_base +AM65_CPSW_PN_REG_MAX_BLKS ); + }else { +/* restore RX & TX FIFO MAX_BLKS */ +if (iet->original_max_blks) {else { if () }
Quoted 4 lines
can be written as
else if () {
}
ok.
Quoted 50 lines
Quoted 50 lines
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +38
-0+writel (iet->original_max_blks, + port->port_base +AM65_CPSW_PN_REG_MAX_BLKS ); + } + } + +am65_cpsw_port_iet_rx_enable (port, cfg->pmac_enabled); +am65_cpsw_port_iet_tx_enable (port, cfg->tx_enabled); + + val =readl (port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); +if (cfg->verify_enabled) { + val &= ~AM65_CPSW_PN_IET_MAC_DISABLEVERIFY ; +/* Reset Verify state machine. Verification won't start here. +* Verification will be done once link-up. +*/ + val |=AM65_CPSW_PN_IET_MAC_LINKFAIL ; + }else { + val |=AM65_CPSW_PN_IET_MAC_DISABLEVERIFY ; +/* Clear LINKFAIL to allow verify/response packets */ + val &= ~AM65_CPSW_PN_IET_MAC_LINKFAIL ; + } + + val &= ~AM65_CPSW_PN_IET_MAC_MAC_ADDFRAGSIZE_MASK ; + val |=AM65_CPSW_PN_IET_MAC_SET_ADDFRAGSIZE (add_frag_size); +writel (val, port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); + +/* verify_timeout_count can only be set at valid link */ +if (cfg->verify_time >0 ) + port->qos.iet.verify_time_ms = cfg->verify_time; +else + port->qos.iet.verify_time_ms =10 ; + +/* enable/disable preemption based on link status */ +am65_cpsw_iet_commit_preemptible_tcs (port); + +mutex_unlock (&priv->mm_lock); + +return 0 ; +}drivers/net/ethernet/ti/am65-cpsw-qos.c +1
-0@@ -4,9 +4,11 @@* * quality of service module includes: * Enhanced Scheduler Traffic (EST - P802.1Qbv/D2.2) +* Interspersed Express Traffic (IET - P802.3br/D2.0) */
Quoted 5 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c line 11
Quoted 2 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +1
-0#include <linux/pm_runtime.h> +#include <linux/units.h> If this was ordered alphabetically, u comes after t.
ok.
Quoted 21 lines
Quoted 21 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +14
-0#include <linux/time.h> #include <net/pkt_cls.h> @@ -259,6 +266,196 @@ static int am65_cpsw_setup_mqprio(struct net_device *ndev, void *type_data)return ret; } +static int am65_cpsw_iet_set_verify_timeout_count (struct am65_cpsw_port *port) +{ +int verify_time_ms = port->qos.iet.verify_time_ms; +int link_speed = port->qos.link_speed; +u32 val; + +if (WARN_ON (link_speed ==SPEED_UNKNOWN )) +return -ENODEV ; + +/* The number of wireside clocks contained in the verify +* timeout counter. The default is 0x1312d0 +* (10ms at 125Mhz in 1G mode). +*/ + val =125 *HZ_PER_MHZ ;/* assuming 125MHz wireside clock */
Quoted 8 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c static int am65_cpsw_setup_mqprio(struct net_device *ndev, void *type_data) · line 287
Quoted 5 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +5
-0+ + val /=MILLIHZ_PER_HZ ;/* count per ms timeout */ + val *= verify_time_ms;/* count for timeout ms */ +if (link_speed <SPEED_1000 ) + val <<=1 ;/* FIXME: Is this correct? */ Is there any way to find out and remove the FIXME? Like running the selftest at
SPEED_100?
I will give this a try.
Quoted 12 lines
Quoted 12 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +11
-0+ +if (val >AM65_CPSW_PN_MAC_VERIFY_CNT_MASK ) +return -EINVAL ; + +writel (val, port->port_base +AM65_CPSW_PN_REG_IET_VERIFY ); + +return 0 ; +} + +/* CPSW does not have an IRQ to notify changes to the MAC Merge TX status +* (active/inactive), but the preemptible traffic classes should only be
Quoted 8 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c static int am65_cpsw_setup_mqprio(struct net_device *ndev, void *type_data) · line 303
Quoted 5 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +5
-0+* committed to hardware once TX is active. Resort to polling. +*/ +void am65_cpsw_iet_commit_preemptible_tcs (struct am65_cpsw_port *port) +{ +u8 preemptible_tcs =0 ;I don't think the zero-initialization helps, since the value is later unconditionally overwritten.
OK, will drop it.
Quoted 31 lines
Quoted 31 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +30
-0+int err; +u32 val; + +if (port->qos.link_speed ==SPEED_UNKNOWN ) +return ; + + val =readl (port->port_base +AM65_CPSW_PN_REG_CTL ); +if (!(val &AM65_CPSW_PN_CTL_IET_PORT_EN )) +return ; + +/* update common IET enable */ +am65_cpsw_iet_common_enable (port->common); + +/* update verify count */ + err =am65_cpsw_iet_set_verify_timeout_count (port); +if (err) { +netdev_err (port->ndev,"couldn't set verify count: %d\n" , err); +return ; + } + + val =readl (port->port_base +AM65_CPSW_PN_REG_IET_CTRL ); +if (!(val &AM65_CPSW_PN_IET_MAC_DISABLEVERIFY )) { + err =am65_cpsw_iet_verify_wait (port); +if (err) +return ; + } + + preemptible_tcs = port->qos.iet.preemptible_tcs; +am65_cpsw_iet_set_preempt_mask (port, preemptible_tcs); +}
Signature · 2 lines
cheers, -roger
Re: [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
Quoted 54 lines · Roger Quadros
Yes I'm using openlldp master.
So I just dumped the "ethtool --show-mm" right before the "lldptool -i $h1 -t -n -V addEthCaps" and this is what I see
# MAC Merge layer state for eth0:
# pMAC enabled: on
# TX enabled: off
# TX active: off
# TX minimum fragment size: 252
# RX minimum fragment size: 124
# Verify enabled: off
# Verify time: 10
# Max verify time: 134
# Verification status: DISABLED
#
# MAC Merge layer state for eth1:
# pMAC enabled: on
# TX enabled: off
# TX active: off
# TX minimum fragment size: 124
# RX minimum fragment size: 124
# Verify enabled: off
# Verify time: 10
# Max verify time: 134
# Verification status: DISABLED
#
# Additional Ethernet Capabilities TLV# Preemption capability supported # Preemption capability not enabled # Preemption capability not active # Additional fragment size: 3 (252 octets) # Additional Ethernet Capabilities TLV # Preemption capability supported # Preemption capability not enabled # Preemption capability not active # Additional fragment size: 1 (124 octets)# Warning: Stopping lldpad.service, but it can still be activated by:
# lldpad.socket
# TEST: LLDP [FAIL]If I add the following lines at the beginning of
lldp()routine, then it works.
lldp(){ RET=0(quoted diff) +2
-0+ ethtool --set-mm $h1 tx-enabled on verify-enabled on + ethtool --set-mm $h2 tx-enabled on verify-enabled on}
Quoted 2 lines
Is lldp supposed to turn on tx-enabled and verify-enabled for us or it is test scritps responsibility?
lldpad should absolutely do that.
https://github.com/intel/openlldp/blob/master/lldp_8023.c#L701
Try to see what goes on and if there isn't, in fact, an error during the netlink communication with the kernel.
Edit /usr/local/lib/systemd/system/lldpad.service:
ExecStart=/usr/local/sbin/lldpad -t -V 7
~~~~~
increases log level
Then run:
$ systemctl daemon-reload $ journalctl -u lldpad.service -f & $ ./ethtool_mm.sh eno0 swp0
During the test you should see:
lldpad[4764]: eno0: Link partner preemption capability supported lldpad[4764]: eno0: Link partner preemption capability not enabled lldpad[4764]: eno0: Link partner preemption capability not active lldpad[4764]: eno0: Link partner minimum fragment size: 252 octets lldpad[4764]: eno0: initiating MM verification with a retry interval of 127 ms... lldpad[4764]: rxProcessFrame: allocated TLV 0 was not stored! 0xaaaafd7cfbe0 lldpad[4764]: swp0: Link partner preemption capability supported lldpad[4764]: swp0: Link partner preemption capability not enabled lldpad[4764]: swp0: Link partner preemption capability not active lldpad[4764]: swp0: Link partner minimum fragment size: 60 octets lldpad[4764]: swp0: initiating MM verification with a retry interval of 128 ms... lldpad[4764]: rxProcessFrame: allocated TLV 0 was not stored! 0xaaaafd7cfd30
Quoted 4 lines
The test fails later at "addFragSize 0", but that is because we don't support RX fragment size 60 due to errata.
If I skip that test then all the rest of the tests pass.
Hmm, yeah, the test is dumb. lldpad has this logic, so if we request 0 it should still advertise 1.
if (config_add_frag_size < add_frag_size) {
LLDPAD_WARN("%s: Configured addFragSize (%d) smaller than the minimum value requested by kernel (%d). Using the latter\n",
bd->ifname, config_add_frag_size, add_frag_size);
config_add_frag_size = add_frag_size;
}I guess that logic does engage, but the selftest doesn't expect that it will, because it expects that lldpad will report back exactly the requested value - and it will report the true value instead.
Luckily I know what to do here, see the patch below.
From 0ed218345f16a0f2c0efd5eba1838ccb3d8e4921 Mon Sep 17 00:00:00 2001
From: Vladimir Oltean <[email protected]>
Date: Tue, 21 Nov 2023 13:42:14 +0200
Subject: [PATCH] selftests: forwarding: ethtool_mm: support devices with
higher rx-min-frag-size
Some devices have errata due to which they cannot report ETH_ZLEN (60) in the rx-min-frag-size. This was foreseen of course, and lldpad has logic that when we request it to advertise addFragSize 0, it will round it up to the lowest value that is _actually_ supported by the hardware.
The problem is that the selftest expects lldpad to report back to us the same value as we requested.
Make the selftest smarter by figuring out on its own what is a reasonable value to expect.
--- .../selftests/net/forwarding/ethtool_mm.sh | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-)
tools/testing/selftests/net/forwarding/ethtool_mm.sh +35 -2
@@ -155,15 +155,48 @@ manual_failed_verification_h2_to_h1() manual_failed_verification $h2 $h1 } +smallest_supported_add_frag_size() +{ + local iface=$1 + local rx_min_frag_size= + + rx_min_frag_size=$(ethtool --json --show-mm $iface | \ + jq '.[]."rx-min-frag-size"') + + if [ $rx_min_frag_size -le 60 ]; then + echo 0 + elif [ $rx_min_frag_size -le 124 ]; then + echo 1 + elif [ $rx_min_frag_size -le 188 ]; then + echo 2 + elif [ $rx_min_frag_size -le 252 ]; then + echo 3 + else + echo "$iface: RX min frag size $rx_min_frag_size cannot be advertised over LLDP" + exit 1 + fi +} + +expected_add_frag_size() +{ + local iface=$1 + local requested=$2 + local min=$(smallest_supported_add_frag_size $iface) + + [ $requested -le $min ] && echo $min || echo $requested +} + lldp_change_add_frag_size() { local add_frag_size=$1 + local pattern= lldptool -T -i $h1 -V addEthCaps addFragSize=$add_frag_size >/dev/null # Wait for TLVs to be received sleep 2 - lldptool -i $h2 -t -n -V addEthCaps | \ - grep -q "Additional fragment size: $add_frag_size" + pattern=$(printf "Additional fragment size: %d" \ + $(expected_add_frag_size $h1 $add_frag_size)) + lldptool -i $h2 -t -n -V addEthCaps | grep -q "$pattern" } lldp()
Signature · 1 line
2.34.1
Re: [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
Hi Vladimir,
Quoted 76 lines · Vladimir Oltean
Quoted 54 lines · Roger Quadros
Yes I'm using openlldp master.
So I just dumped the "ethtool --show-mm" right before the "lldptool -i $h1 -t -n -V addEthCaps" and this is what I see
# MAC Merge layer state for eth0:
# pMAC enabled: on
# TX enabled: off
# TX active: off
# TX minimum fragment size: 252
# RX minimum fragment size: 124
# Verify enabled: off
# Verify time: 10
# Max verify time: 134
# Verification status: DISABLED
#
# MAC Merge layer state for eth1:
# pMAC enabled: on
# TX enabled: off
# TX active: off
# TX minimum fragment size: 124
# RX minimum fragment size: 124
# Verify enabled: off
# Verify time: 10
# Max verify time: 134
# Verification status: DISABLED
#
# Additional Ethernet Capabilities TLV# Preemption capability supported # Preemption capability not enabled # Preemption capability not active # Additional fragment size: 3 (252 octets) # Additional Ethernet Capabilities TLV # Preemption capability supported # Preemption capability not enabled # Preemption capability not active # Additional fragment size: 1 (124 octets)# Warning: Stopping lldpad.service, but it can still be activated by:
# lldpad.socket
# TEST: LLDP [FAIL]If I add the following lines at the beginning of
lldp()routine, then it works.
lldp(){ RET=0(quoted diff) +2
-0+ ethtool --set-mm $h1 tx-enabled on verify-enabled on + ethtool --set-mm $h2 tx-enabled on verify-enabled on}
Quoted 2 lines
Is lldp supposed to turn on tx-enabled and verify-enabled for us or it is test scritps responsibility?
lldpad should absolutely do that.
https://github.com/intel/openlldp/blob/master/lldp_8023.c#L701Try to see what goes on and if there isn't, in fact, an error during the netlink communication with the kernel.
Edit
/usr/local/lib/systemd/system/lldpad.service:
ExecStart=/usr/local/sbin/lldpad -t -V 7
~~~~~
increases log level
Then run:$ systemctl daemon-reload $ journalctl -u lldpad.service -f & $ ./ethtool_mm.sh eno0 swp0During the test you should see:
Quoted 13 lines
lldpad[4764]: eno0: Link partner preemption capability supported lldpad[4764]: eno0: Link partner preemption capability not enabled lldpad[4764]: eno0: Link partner preemption capability not active lldpad[4764]: eno0: Link partner minimum fragment size: 252 octets lldpad[4764]: eno0: initiating MM verification with a retry interval of 127 ms... lldpad[4764]: rxProcessFrame: allocated TLV 0 was not stored!
0xaaaafd7cfbe0lldpad[4764]: swp0: Link partner preemption capability supported lldpad[4764]: swp0: Link partner preemption capability not enabled lldpad[4764]: swp0: Link partner preemption capability not active lldpad[4764]: swp0: Link partner minimum fragment size: 60 octets lldpad[4764]: swp0: initiating MM verification with a retry interval of 128 ms... lldpad[4764]: rxProcessFrame: allocated TLV 0 was not stored!0xaaaafd7cfd30
Thanks for the debug instructions. Indeed lldpad tries to enable MM TX and the network drivers set_mm() hook gets called and returns success but still lldpad sees some error.
I've also confirmed that ethnl_set_mm() runs successfully and returns 1. I suppose something is going wrong in user-space with libnl?
Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability supported Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability not enabled Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability not active Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner minimum fragment size: 124 octets Nov 21 11:50:02 am62xx lldpad[708]: eth0: initiating MM verification with a retry interval of 134 ms... Nov 21 11:50:02 am62xx lldpad[708]: ethtool: kernel reports: integer out of range
full debug log is below.
Signature · 483 lines
cheers, -roger root@am62xx:~/kselftest# ./run_kselftest.sh -t net/forwarding:ethtool_mm.sh [ 207.146038] kselftest: Running tests in net/forwarding TAP version 13 1..1 # timeout set to 0 # selftests: net/forwarding: ethtool_mm.sh # Error: Exclusivity flag on, cannot modify. Nov 21 11:49:54 am62xx systemd[1]: Started lldpad.service - Link Layer Discovery Protocol Agent Daemon.. Nov 21 11:49:54 am62xx lldpad[708]: setsockopt nearest_bridge: Invalid argument Nov 21 11:49:54 am62xx lldpad[708]: setsockopt nearest_bridge: Invalid argument Nov 21 11:49:54 am62xx lldpad[708]: setsockopt nearest_bridge: Invalid argument Nov 21 11:49:54 am62xx lldpad[708]: setsockopt nearest_bridge: Invalid argument Nov 21 11:49:54 am62xx lldpad[708]: using fd 3 from systemd Nov 21 11:49:54 am62xx lldpad[708]: event_iface_init_user_space(484): socket 4. Nov 21 11:49:54 am62xx lldpad[708]: mand_register:done Nov 21 11:49:54 am62xx lldpad[708]: basman_register:done Nov 21 11:49:54 am62xx lldpad[708]: dcbx_register: dcbx register done Nov 21 11:49:54 am62xx lldpad[708]: med_register:done Nov 21 11:49:54 am62xx lldpad[708]: ieee8023_register:done Nov 21 11:49:54 am62xx lldpad[708]: evb_register:done Nov 21 11:49:54 am62xx lldpad[708]: evb22_register:done Nov 21 11:49:54 am62xx lldpad[708]: vdp_register: done Nov 21 11:49:54 am62xx lldpad[708]: vdp22_register:done Nov 21 11:49:54 am62xx lldpad[708]: ecp22_register: done Nov 21 11:49:54 am62xx lldpad[708]: ieee8021qaz_register: ieee8021qaz_register SUCCESS Nov 21 11:49:54 am62xx lldpad[708]: can0 mac:00:00:00:00:00:00 perm:00:00:00:00:00:00 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:54 am62xx lldpad[708]: Failed to open register layer 2 access to ETH_P_LLDP Nov 21 11:49:54 am62xx lldpad[708]: init_ports: Error adding device can0 Nov 21 11:49:54 am62xx lldpad[708]: can1 mac:00:00:00:00:00:00 perm:00:00:00:00:00:00 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:54 am62xx lldpad[708]: Failed to open register layer 2 access to ETH_P_LLDP Nov 21 11:49:54 am62xx lldpad[708]: init_ports: Error adding device can1 Nov 21 11:49:54 am62xx lldpad[708]: can2 mac:00:00:00:00:00:00 perm:00:00:00:00:00:00 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:54 am62xx lldpad[708]: Failed to open register layer 2 access to ETH_P_LLDP Nov 21 11:49:54 am62xx lldpad[708]: init_ports: Error adding device can2 Nov 21 11:49:54 am62xx lldpad[708]: can3 mac:00:00:00:00:00:00 perm:00:00:00:00:00:00 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:54 am62xx lldpad[708]: Failed to open register layer 2 access to ETH_P_LLDP Nov 21 11:49:54 am62xx lldpad[708]: init_ports: Error adding device can3 Nov 21 11:49:54 am62xx lldpad[708]: eth0 mac:78:db:2f:e5:74:d3 perm:78:db:2f:e5:74:d3 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:54 am62xx lldpad[708]: eth0 MAC address is 78:db:2f:e5:74:d3 Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: creating new agent for port eth0. Nov 21 11:49:54 am62xx lldpad[708]: lldp_init_agent: creating new agent for eth0 (01:80:C2:00:00:0E). Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: 0 agents on if eth0. Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: creating new agent for port eth0. Nov 21 11:49:54 am62xx lldpad[708]: lldp_init_agent: creating new agent for eth0 (01:80:C2:00:00:03). Nov 21 11:49:54 am62xx lldpad[708]: lldp_init_agent: agent->adminStatus = disabled. Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: 1 agents on if eth0. Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: creating new agent for port eth0. Nov 21 11:49:54 am62xx lldpad[708]: lldp_init_agent: creating new agent for eth0 (01:80:C2:00:00:00). Nov 21 11:49:54 am62xx lldpad[708]: lldp_init_agent: agent->adminStatus = disabled. Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: 2 agents on if eth0. Nov 21 11:49:54 am62xx lldpad[708]: init_ports: calling ifup for agent 0xaaaade68e3f0. Nov 21 11:49:54 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:54 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:54 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:49:54 am62xx lldpad[708]: mand_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:49:54 am62xx lldpad[708]: med_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: ieee8023_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: evb_ifup:eth0 agent 2 called Nov 21 11:49:54 am62xx lldpad[708]: evb_init_tlv:eth0 agent 2 EVB tx is currently disabled Nov 21 11:49:54 am62xx lldpad[708]: evb_conf_string:eth0 agent 2 loading EVB policy for fmode failed, using default (128) Nov 21 11:49:54 am62xx lldpad[708]: evb_conf_string:eth0 agent 2 loading EVB policy for capabilities failed, using default (0) Nov 21 11:49:54 am62xx lldpad[708]: evb_conf_string:eth0 agent 2 loading EVB policy for rte failed, using default (15) Nov 21 11:49:54 am62xx lldpad[708]: evb_conf_string:eth0 agent 2 loading EVB policy for vsis failed, using default (3295) Nov 21 11:49:54 am62xx lldpad[708]: evb_ifup:eth0 agent 2 added Nov 21 11:49:54 am62xx lldpad[708]: evb22_ifup:eth0 agent 2 called Nov 21 11:49:54 am62xx lldpad[708]: evb22_init_tlv:eth0 agent 2 EVB tx is currently disabled Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_string:eth0 agent 2 loading EVB policy for evbmode failed, using default (2) Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_evbmode:eth0 agent 2 policy evbmode station(0x2) Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth0 agent 2 loading EVB policy for vdprwd failed, using default (20) Nov 21 11:49:54 am62xx lldpad[708]: exponent:eth0 agent 2 policy vdprwd 20 Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth0 agent 2 loading EVB policy for evbrrreq failed, using default (0) Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_rrreq:eth0 agent 2 policy evbrrreq false Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth0 agent 2 loading EVB policy for evbgpid failed, using default (0) Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_gid:eth0 agent 2 policy evbgpid false Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth0 agent 2 loading EVB policy for ecpretries failed, using default (3) Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_retries:eth0 agent 2 policy ecpretries 3 Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth0 agent 2 loading EVB policy for ecprte failed, using default (8) Nov 21 11:49:54 am62xx lldpad[708]: exponent:eth0 agent 2 policy ecprte 8 Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth0 agent 2 loading EVB policy for vdprka failed, using default (20) Nov 21 11:49:54 am62xx lldpad[708]: exponent:eth0 agent 2 policy vdprka 20 Nov 21 11:49:54 am62xx lldpad[708]: evb22_ifup:eth0 agent 2 added Nov 21 11:49:54 am62xx lldpad[708]: init_ports: calling ifup for agent 0xaaaade68e320. Nov 21 11:49:54 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:54 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:54 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:49:54 am62xx lldpad[708]: mand_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:49:54 am62xx lldpad[708]: med_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: ieee8023_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: init_ports: calling ifup for agent 0xaaaade68e250. Nov 21 11:49:54 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:54 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:54 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:49:54 am62xx lldpad[708]: mand_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:49:54 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:49:54 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:49:54 am62xx lldpad[708]: med_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: ieee8023_ifup:port eth0 added Nov 21 11:49:54 am62xx lldpad[708]: get_dcbx_hw: eth0: nlmsg_find_attr failed, no GDCBX support Nov 21 11:49:54 am62xx lldpad[708]: eth1 mac:70:ff:76:1d:8d:c4 perm:70:ff:76:1d:8d:c4 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:54 am62xx lldpad[708]: eth1 MAC address is 70:ff:76:1d:8d:c4 Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: creating new agent for port eth1. Nov 21 11:49:54 am62xx lldpad[708]: lldp_init_agent: creating new agent for eth1 (01:80:C2:00:00:0E). Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: 0 agents on if eth1. Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: creating new agent for port eth1. Nov 21 11:49:54 am62xx lldpad[708]: lldp_init_agent: creating new agent for eth1 (01:80:C2:00:00:03). Nov 21 11:49:54 am62xx lldpad[708]: lldp_init_agent: agent->adminStatus = disabled. Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: 1 agents on if eth1. Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: creating new agent for port eth1. Nov 21 11:49:54 am62xx lldpad[708]: lldp_init_agent: creating new agent for eth1 (01:80:C2:00:00:00). Nov 21 11:49:54 am62xx lldpad[708]: lldp_init_agent: agent->adminStatus = disabled. Nov 21 11:49:54 am62xx lldpad[708]: lldp_add_agent: 2 agents on if eth1. Nov 21 11:49:54 am62xx lldpad[708]: init_ports: calling ifup for agent 0xaaaade6943b0. Nov 21 11:49:54 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:54 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:54 am62xx lldpad[708]: mand_bld_ttl_tlv:eth1:done:type=3 length=2 ttl=120 Nov 21 11:49:54 am62xx lldpad[708]: mand_ifup:port eth1 added Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth1:Port Description disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_sysname_tlv:eth1:System Name disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth1:System Description disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth1:System Capabilities disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth1:Management Address disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_ifup:port eth1 added Nov 21 11:49:54 am62xx lldpad[708]: med_bld_tlv:eth1:LLDP-MED is not enabled Nov 21 11:49:54 am62xx lldpad[708]: med_ifup:port eth1 added Nov 21 11:49:54 am62xx lldpad[708]: ieee8023_ifup:port eth1 added Nov 21 11:49:54 am62xx lldpad[708]: evb_ifup:eth1 agent 2 called Nov 21 11:49:54 am62xx lldpad[708]: evb_init_tlv:eth1 agent 2 EVB tx is currently disabled Nov 21 11:49:54 am62xx lldpad[708]: evb_conf_string:eth1 agent 2 loading EVB policy for fmode failed, using default (128) Nov 21 11:49:54 am62xx lldpad[708]: evb_conf_string:eth1 agent 2 loading EVB policy for capabilities failed, using default (0) Nov 21 11:49:54 am62xx lldpad[708]: evb_conf_string:eth1 agent 2 loading EVB policy for rte failed, using default (15) Nov 21 11:49:54 am62xx lldpad[708]: evb_conf_string:eth1 agent 2 loading EVB policy for vsis failed, using default (3295) Nov 21 11:49:54 am62xx lldpad[708]: evb_ifup:eth1 agent 2 added Nov 21 11:49:54 am62xx lldpad[708]: evb22_ifup:eth1 agent 2 called Nov 21 11:49:54 am62xx lldpad[708]: evb22_init_tlv:eth1 agent 2 EVB tx is currently disabled Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_string:eth1 agent 2 loading EVB policy for evbmode failed, using default (2) Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_evbmode:eth1 agent 2 policy evbmode station(0x2) Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth1 agent 2 loading EVB policy for vdprwd failed, using default (20) Nov 21 11:49:54 am62xx lldpad[708]: exponent:eth1 agent 2 policy vdprwd 20 Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth1 agent 2 loading EVB policy for evbrrreq failed, using default (0) Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_rrreq:eth1 agent 2 policy evbrrreq false Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth1 agent 2 loading EVB policy for evbgpid failed, using default (0) Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_gid:eth1 agent 2 policy evbgpid false Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth1 agent 2 loading EVB policy for ecpretries failed, using default (3) Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_retries:eth1 agent 2 policy ecpretries 3 Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth1 agent 2 loading EVB policy for ecprte failed, using default (8) Nov 21 11:49:54 am62xx lldpad[708]: exponent:eth1 agent 2 policy ecprte 8 Nov 21 11:49:54 am62xx lldpad[708]: evb22_conf_int:eth1 agent 2 loading EVB policy for vdprka failed, using default (20) Nov 21 11:49:54 am62xx lldpad[708]: exponent:eth1 agent 2 policy vdprka 20 Nov 21 11:49:54 am62xx lldpad[708]: evb22_ifup:eth1 agent 2 added Nov 21 11:49:54 am62xx lldpad[708]: init_ports: calling ifup for agent 0xaaaade6942e0. Nov 21 11:49:54 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:54 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:54 am62xx lldpad[708]: mand_bld_ttl_tlv:eth1:done:type=3 length=2 ttl=120 Nov 21 11:49:54 am62xx lldpad[708]: mand_ifup:port eth1 added Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth1:Port Description disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_sysname_tlv:eth1:System Name disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth1:System Description disabled Nov 21 11:49:54 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth1:System Capabilities disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth1:Management Address disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_ifup:port eth1 added Nov 21 11:49:55 am62xx lldpad[708]: med_bld_tlv:eth1:LLDP-MED is not enabled Nov 21 11:49:55 am62xx lldpad[708]: med_ifup:port eth1 added Nov 21 11:49:55 am62xx lldpad[708]: ieee8023_ifup:port eth1 added Nov 21 11:49:55 am62xx lldpad[708]: init_ports: calling ifup for agent 0xaaaade694210. Nov 21 11:49:55 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:55 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:55 am62xx lldpad[708]: mand_bld_ttl_tlv:eth1:done:type=3 length=2 ttl=120 Nov 21 11:49:55 am62xx lldpad[708]: mand_ifup:port eth1 added Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth1:Port Description disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_sysname_tlv:eth1:System Name disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth1:System Description disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth1:System Capabilities disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth1:Management Address disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_ifup:port eth1 added Nov 21 11:49:55 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:49:55 am62xx lldpad[708]: Adapter eth1 does not support DCB. Nov 21 11:49:55 am62xx lldpad[708]: med_bld_tlv:eth1:LLDP-MED is not enabled Nov 21 11:49:55 am62xx lldpad[708]: med_ifup:port eth1 added Nov 21 11:49:55 am62xx lldpad[708]: ieee8023_ifup:port eth1 added Nov 21 11:49:55 am62xx lldpad[708]: get_dcbx_hw: eth1: nlmsg_find_attr failed, no GDCBX support Nov 21 11:49:55 am62xx lldpad[708]: eth2 mac:70:ff:76:1d:8d:c5 perm:70:ff:76:1d:8d:c5 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:55 am62xx lldpad[708]: eth2 MAC address is 70:ff:76:1d:8d:c5 Nov 21 11:49:55 am62xx lldpad[708]: eth3 mac:70:ff:76:1d:8d:c6 perm:70:ff:76:1d:8d:c6 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:55 am62xx lldpad[708]: eth3 MAC address is 70:ff:76:1d:8d:c6 Nov 21 11:49:55 am62xx lldpad[708]: eth4 mac:70:ff:76:1d:8d:c7 perm:70:ff:76:1d:8d:c7 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:55 am62xx lldpad[708]: eth4 MAC address is 70:ff:76:1d:8d:c7 Nov 21 11:49:55 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:55 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:55 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:55 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:49:55 am62xx lldpad[708]: evb22_start_modules:eth1 START role:2 Nov 21 11:49:55 am62xx lldpad[708]: ecp22_start:eth1 start ecp Nov 21 11:49:55 am62xx lldpad[708]: eth1 mac:70:ff:76:1d:8d:c4 perm:70:ff:76:1d:8d:c4 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:55 am62xx lldpad[708]: eth1 MAC address is 70:ff:76:1d:8d:c4 Nov 21 11:49:55 am62xx lldpad[708]: ecp22_create:eth1 create ecp data Nov 21 11:49:55 am62xx lldpad[708]: ecp22_set_rx_state:eth1 state ECP22_RX_BEGIN Nov 21 11:49:55 am62xx lldpad[708]: ecp22_rx_change_state:eth1 state change ECP22_RX_BEGIN -> ECP22_RX_WAIT Nov 21 11:49:55 am62xx lldpad[708]: ecp22_es_wait:eth1 state ECP22_RX_WAIT Nov 21 11:49:55 am62xx lldpad[708]: ecp22_set_rx_state:eth1 state ECP22_RX_WAIT Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_change_state:eth1 state change ECP22_TX_BEGIN -> ECP22_TX_INIT Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_run_sm:eth1 state ECP22_TX_INIT Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_change_state:eth1 state change ECP22_TX_INIT -> ECP22_TX_WAIT_FORREQ Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_run_sm:eth1 state ECP22_TX_WAIT_FORREQ Nov 21 11:49:55 am62xx lldpad[708]: ecp22_es_waitforreq:eth1 seqno 0x1 Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_change_state:eth1 state change ECP22_TX_WAIT_FORREQ -> ECP22_TX_WAIT_ONDATA Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_run_sm:eth1 state ECP22_TX_WAIT_ONDATA Nov 21 11:49:55 am62xx lldpad[708]: vdp22_start:eth1 start vdp Nov 21 11:49:55 am62xx lldpad[708]: vdp22_create:eth1 role:2 Nov 21 11:49:55 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth1 mac 01:80:C2:00:00:0E type 0. Nov 21 11:49:55 am62xx lldpad[708]: mand_bld_ttl_tlv:eth1:done:type=3 length=2 ttl=120 Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth1:Port Description disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_sysname_tlv:eth1:System Name disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth1:System Description disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth1:System Capabilities disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth1:Management Address disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_gettlv:eth1: failed Nov 21 11:49:55 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:49:55 am62xx lldpad[708]: Adapter eth1 does not support DCB. Nov 21 11:49:55 am62xx lldpad[708]: config.c: eth1 dcb mode is OFF. Nov 21 11:49:55 am62xx lldpad[708]: med_bld_tlv:eth1:LLDP-MED is not enabled Nov 21 11:49:55 am62xx lldpad[708]: med_gettlv:eth1: failed Nov 21 11:49:55 am62xx lldpad[708]: evb22_start_modules:eth0 START role:2 Nov 21 11:49:55 am62xx lldpad[708]: ecp22_start:eth0 start ecp Nov 21 11:49:55 am62xx lldpad[708]: eth0 mac:78:db:2f:e5:74:d3 perm:78:db:2f:e5:74:d3 san:ff:ff:ff:ff:ff:ff Nov 21 11:49:55 am62xx lldpad[708]: eth0 MAC address is 78:db:2f:e5:74:d3 Nov 21 11:49:55 am62xx lldpad[708]: ecp22_create:eth0 create ecp data Nov 21 11:49:55 am62xx lldpad[708]: ecp22_set_rx_state:eth0 state ECP22_RX_BEGIN Nov 21 11:49:55 am62xx lldpad[708]: ecp22_rx_change_state:eth0 state change ECP22_RX_BEGIN -> ECP22_RX_WAIT Nov 21 11:49:55 am62xx lldpad[708]: ecp22_es_wait:eth0 state ECP22_RX_WAIT Nov 21 11:49:55 am62xx lldpad[708]: ecp22_set_rx_state:eth0 state ECP22_RX_WAIT Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_change_state:eth0 state change ECP22_TX_BEGIN -> ECP22_TX_INIT Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_run_sm:eth0 state ECP22_TX_INIT Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_change_state:eth0 state change ECP22_TX_INIT -> ECP22_TX_WAIT_FORREQ Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_run_sm:eth0 state ECP22_TX_WAIT_FORREQ Nov 21 11:49:55 am62xx lldpad[708]: ecp22_es_waitforreq:eth0 seqno 0x1 Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_change_state:eth0 state change ECP22_TX_WAIT_FORREQ -> ECP22_TX_WAIT_ONDATA Nov 21 11:49:55 am62xx lldpad[708]: ecp22_tx_run_sm:eth0 state ECP22_TX_WAIT_ONDATA Nov 21 11:49:55 am62xx lldpad[708]: vdp22_start:eth0 start vdp Nov 21 11:49:55 am62xx lldpad[708]: vdp22_create:eth0 role:2 Nov 21 11:49:55 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. Nov 21 11:49:55 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:49:55 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:49:55 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:49:55 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:49:55 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:02 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:02 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability supported Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability not enabled Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability not active Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner minimum fragment size: 124 octets Nov 21 11:50:02 am62xx lldpad[708]: eth0: initiating MM verification with a retry interval of 134 ms... Nov 21 11:50:02 am62xx lldpad[708]: ethtool: kernel reports: integer out of range Nov 21 11:50:02 am62xx lldpad[708]: rxProcessFrame: allocated TLV 0 was not stored! 0xaaaade698510 Nov 21 11:50:02 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. Nov 21 11:50:02 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:02 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:02 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:02 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:02 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:50:02 am62xx lldpad[708]: arg_path "tlvid00120f07.addFragSize" Nov 21 11:50:02 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. Nov 21 11:50:02 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:02 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:02 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:02 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:02 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. Nov 21 11:50:02 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:02 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:02 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:02 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:02 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:50:02 am62xx lldpad[708]: arg_path "tlvid00120f07.addFragSize" Nov 21 11:50:02 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. Nov 21 11:50:02 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:02 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:02 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:02 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:02 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. Nov 21 11:50:02 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:02 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:02 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:02 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:02 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:50:02 am62xx lldpad[708]: arg_path "tlvid00120f07.addFragSize" Nov 21 11:50:02 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. Nov 21 11:50:02 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:50:02 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:02 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:02 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:02 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:02 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:02 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. # Warning: Stopping lldpad.service, but it can still be activated by: # lldpad.socket # TEST: LLDP [FAIL] # eth0 pMAC TX is not active [ 223.838009] am65-cpsw-nuss 46000000.ethernet eth0: Link is Down # Error: Cannot delete qdisc with handle of zero. not ok 1 selftests: net/forwarding: ethtool_mm.sh # exit=1 root@am62xx:~/kselftest# Nov 21 11:50:05 am62xx systemd[1]: Stopping lldpad.service - Link Layer Discovery Protocol Agent Daemon.... Nov 21 11:50:05 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:50:05 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:05 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:05 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:05 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:05 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:05 am62xx lldpad[708]: set_config_setting(577): Nov 21 11:50:05 am62xx lldpad[708]: arg_path "tlvid00120f07.addFragSize" Nov 21 11:50:05 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. Nov 21 11:50:05 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:50:05 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:05 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:05 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:05 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:05 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:05 am62xx lldpad[708]: eth0: Configured addFragSize (0) smaller than the minimum value requested by kernel (1). Using the latter Nov 21 11:50:05 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. Nov 21 11:50:05 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:50:05 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:05 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:05 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:05 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:05 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:05 am62xx lldpad[708]: eth0: Configured addFragSize (0) smaller than the minimum value requested by kernel (1). Using the latter Nov 21 11:50:05 am62xx lldpad[708]: mibConstrInfoLLDPDU: port eth0 mac 01:80:C2:00:00:0E type 0. Nov 21 11:50:05 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_portdesc_tlv:eth0:Port Description disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_sysname_tlv:eth0:System Name disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_sysdesc_tlv:eth0:System Description disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_syscaps_tlv:eth0:System Capabilities disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_bld_manaddr_tlv:eth0:Management Address disabled Nov 21 11:50:05 am62xx lldpad[708]: basman_gettlv:eth0: failed Nov 21 11:50:05 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:05 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:05 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:05 am62xx lldpad[708]: med_bld_tlv:eth0:LLDP-MED is not enabled Nov 21 11:50:05 am62xx lldpad[708]: med_gettlv:eth0: failed Nov 21 11:50:05 am62xx lldpad[708]: eth0: Configured addFragSize (0) smaller than the minimum value requested by kernel (1). Using the latter Nov 21 11:50:05 am62xx lldpad[708]: Signal 15 received - terminating Nov 21 11:50:05 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:05 am62xx lldpad[708]: Adapter eth4 does not support DCB. Nov 21 11:50:05 am62xx lldpad[708]: config.c: eth4 dcb mode is OFF. Nov 21 11:50:05 am62xx lldpad[708]: Send shutdown frame on port eth4 Nov 21 11:50:05 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:05 am62xx lldpad[708]: Adapter eth3 does not support DCB. Nov 21 11:50:05 am62xx lldpad[708]: config.c: eth3 dcb mode is OFF. Nov 21 11:50:05 am62xx lldpad[708]: Send shutdown frame on port eth3 Nov 21 11:50:05 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:05 am62xx lldpad[708]: Adapter eth2 does not support DCB. Nov 21 11:50:05 am62xx lldpad[708]: config.c: eth2 dcb mode is OFF. Nov 21 11:50:05 am62xx lldpad[708]: Send shutdown frame on port eth2 Nov 21 11:50:05 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:05 am62xx lldpad[708]: Adapter eth1 does not support DCB. Nov 21 11:50:05 am62xx lldpad[708]: config.c: eth1 dcb mode is OFF. Nov 21 11:50:05 am62xx lldpad[708]: Send shutdown frame on port eth1 Nov 21 11:50:05 am62xx lldpad[708]: mibConstrShutdownLLDPDU: mac 01:80:C2:00:00:0E. Nov 21 11:50:05 am62xx lldpad[708]: mand_bld_ttl_tlv:eth1:done:type=3 length=2 ttl=120 Nov 21 11:50:05 am62xx lldpad[708]: send_msg: sendto = 32 Nov 21 11:50:05 am62xx lldpad[708]: Adapter eth0 does not support DCB. Nov 21 11:50:05 am62xx lldpad[708]: config.c: eth0 dcb mode is OFF. Nov 21 11:50:05 am62xx lldpad[708]: Send shutdown frame on port eth0 Nov 21 11:50:05 am62xx lldpad[708]: mibConstrShutdownLLDPDU: mac 01:80:C2:00:00:0E. Nov 21 11:50:05 am62xx lldpad[708]: mand_bld_ttl_tlv:eth0:done:type=3 length=2 ttl=120 Nov 21 11:50:05 am62xx lldpad[708]: mand_unregister:done Nov 21 11:50:05 am62xx lldpad[708]: basman_unregister:done Nov 21 1[ 224.608232] am65-cpsw-nuss c000000.ethernet eth1: Link is Down 1:50:05 am62xx lldpad[708]: dcbx_unregister: unregister dcbx complete. Nov 21 11:50:05 am62xx lldpad[708]: med_unregister:done Nov 21 11:50:05 am62xx lldpad[708]: ieee8023_unregister:done Nov 21 11:50:05 am62xx lldpad[708]: evb_unregister:done Nov 21 11:50:05 am62xx lldpad[708]: evb22_unregister:done Nov 21 11:50:05 am62xx lldpad[708]: vdp_unregister: done Nov 21 11:50:05 am62xx lldpad[708]: vdp22_unregister:done Nov 21 11:50:05 am62xx lldpad[708]: ecp22_remove:eth0 remove ecp Nov 21 11:50:05 am62xx lldpad[708]: ecp22_remove:eth1 remove ecp Nov 21 11:50:05 am62xx lldpad[708]: ecp22_unregister: done Nov 21 11:50:05 am62xx lldpad[708]: In remove_port: Found port eth4 Nov 21 11:50:05 am62xx lldpad[708]: In remove_port: Found port eth4 Nov 21 11:50:05 am62xx lldpad[708]: In remove_port: Found port eth3 Nov 21 11:50:05 am62xx lldpad[708]: In remove_port: Found port eth3 Nov 21 11:50:05 am62xx lldpad[708]: In remove_port: Found port eth2 Nov 21 11:50:05 am62xx lldpad[708]: In remove_port: Found port eth2 Nov 21 11:50:05 am62xx lldpad[708]: In remove_port: Found port eth1 Nov 21 11:50:05 am62xx lldpad[708]: In remove_port: Found port eth1 Nov 21 11:50:05 am62xx lldpad[708]: In remove_port: Found port eth0 Nov 21 11:50:05 am62xx lldpad[708]: In remove_port: Found port eth0 Nov 21 11:50:05 am62xx systemd[1]: lldpad.service: Deactivated successfully. Nov 21 11:50:05 am62xx systemd[1]: Stopped lldpad.service - Link Layer Discovery Protocol Agent Daemon..
Re: [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
Quoted 15 lines · Roger Quadros
Thanks for the debug instructions. Indeed lldpad tries to enable MM TX and the network drivers
set_mm()hook gets called and returns success but still lldpad sees some error.I've also confirmed that
ethnl_set_mm()runs successfully and returns 1. I suppose something is going wrong in user-space with libnl?Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability supported Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability not enabled Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability not active Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner minimum fragment size: 124 octets Nov 21 11:50:02 am62xx lldpad[708]: eth0: initiating MM verification with a retry interval of 134 ms... Nov 21 11:50:02 am62xx lldpad[708]: ethtool: kernel reports: integer out of range
Quoted 1 line
full debug log is below.
Ah, you got confused. Openlldp issues multiple ETHTOOL_MSG_MM_SET netlink messages. What you observe is that one of them succeeds, and then another one returns -ERANGE before even calling the driver's set_mm() method.
And that comes from here in net/ethtool/mm.c:
149 const struct nla_policy ethnl_mm_set_policy[ETHTOOL_A_MM_MAX + 1] = {
150 » [ETHTOOL_A_MM_HEADER]» » = NLA_POLICY_NESTED(ethnl_header_policy), 151 » [ETHTOOL_A_MM_VERIFY_ENABLED]» = NLA_POLICY_MAX(NLA_U8, 1), 152 » [ETHTOOL_A_MM_VERIFY_TIME]» = NLA_POLICY_RANGE(NLA_U32, 1, 128), // <---- here 153 » [ETHTOOL_A_MM_TX_ENABLED]» = NLA_POLICY_MAX(NLA_U8, 1), 154 » [ETHTOOL_A_MM_PMAC_ENABLED]» = NLA_POLICY_MAX(NLA_U8, 1), 155 » [ETHTOOL_A_MM_TX_MIN_FRAG_SIZE]»= NLA_POLICY_RANGE(NLA_U32, 60, 252),
156 };
You are reporting in .get_mm() a maximum verify time which is larger than the core ethtool is willing to accept in a further .set_mm() call. And openlldp will try to max out on the verify time. Hence the -ERANGE.
The range I chose for the policy comes from 802.3-2018 clause 30.14.1.6, which says that the aMACMergeVerifyTime variable has a range between 1 and 128 ms inclusive.
Re: [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
Quoted 32 lines · Vladimir Oltean
Quoted 15 lines · Roger Quadros
Thanks for the debug instructions. Indeed lldpad tries to enable MM TX and the network drivers
set_mm()hook gets called and returns success but still lldpad sees some error.I've also confirmed that
ethnl_set_mm()runs successfully and returns 1. I suppose something is going wrong in user-space with libnl?Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability supported Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability not enabled Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability not active Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner minimum fragment size: 124 octets Nov 21 11:50:02 am62xx lldpad[708]: eth0: initiating MM verification with a retry interval of 134 ms... Nov 21 11:50:02 am62xx lldpad[708]: ethtool: kernel reports: integer out of rangeQuoted 1 line
full debug log is below.
Ah, you got confused. Openlldp issues multiple
ETHTOOL_MSG_MM_SETnetlink messages. What you observe is that one of them succeeds, and then another one returns-ERANGEbefore even calling the driver'sset_mm()method.And that comes from here in
net/ethtool/mm.c:149 const struct
nla_policyethnl_mm_set_policy[ETHTOOL_A_MM_MAX + 1] = {150 » [ETHTOOL_A_MM_HEADER]» » = NLA_POLICY_NESTED(ethnl_header_policy), 151 » [ETHTOOL_A_MM_VERIFY_ENABLED]» = NLA_POLICY_MAX(NLA_U8, 1), 152 » [ETHTOOL_A_MM_VERIFY_TIME]» = NLA_POLICY_RANGE(NLA_U32, 1, 128), // <---- here 153 » [ETHTOOL_A_MM_TX_ENABLED]» = NLA_POLICY_MAX(NLA_U8, 1), 154 » [ETHTOOL_A_MM_PMAC_ENABLED]» = NLA_POLICY_MAX(NLA_U8, 1), 155 » [ETHTOOL_A_MM_TX_MIN_FRAG_SIZE]»= NLA_POLICY_RANGE(NLA_U32, 60, 252),
Quoted 5 lines
156 };
You are reporting in .get_mm() a maximum verify time which is larger than the core ethtool is willing to accept in a further .set_mm() call. And openlldp will try to max out on the verify time. Hence the
-ERANGE.
You are spot on on this. Thanks. :)
Quoted 4 lines
The range I chose for the policy comes from 802.3-2018 clause 30.14.1.6, which says that the aMACMergeVerifyTime variable has a range between 1 and 128 ms inclusive.
I forced driver state->max_verify_time = 128; and now that -ERANGE error is gone and the lldp test case passes.
I also applied your patch to ethtool_mm.sh and don't see the error with 'addFragSize 0' anymore
Should I include your patch in the next revision of this series?
Signature · 2 lines
cheers, -roger
Re: [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
Quoted 1 line · Roger Quadros
Should I include your patch in the next revision of this series?
Yeah, please do.
Re: [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
In reply to Vladimir OlteanQuoted 10 lines · Vladimir Oltean
Quoted 9 lines · Roger Quadros
Changelog:
v6:
- get mutex aroundam65_cpsw_iet_commit_preemptible_tcs()inam65_cpsw_iet_change_preemptible_tcs()
- use "preemption" instead of "pre-emption"
- callam65_cpsw_setup_mqprio()from withinam65_cpsw_setup_taprio()
- Now works with kselftest except the last test which fails
<snip>
Quoted 37 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c line 11
Quoted 13 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +2
-0@@ -4,9 +4,11 @@* * quality of service module includes: * Enhanced Scheduler Traffic (EST - P802.1Qbv/D2.2) +* Interspersed Express Traffic (IET - P802.3br/D2.0) */ #include <linux/pm_runtime.h> +#include <linux/units.h> If this was ordered alphabetically, u comes after t.
Quoted 21 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +14
-0#include <linux/time.h> #include <net/pkt_cls.h> @@ -259,6 +266,196 @@ static int am65_cpsw_setup_mqprio(struct net_device *ndev, void *type_data)return ret; } +static int am65_cpsw_iet_set_verify_timeout_count (struct am65_cpsw_port *port) +{ +int verify_time_ms = port->qos.iet.verify_time_ms; +int link_speed = port->qos.link_speed; +u32 val; + +if (WARN_ON (link_speed ==SPEED_UNKNOWN )) +return -ENODEV ; + +/* The number of wireside clocks contained in the verify +* timeout counter. The default is 0x1312d0 +* (10ms at 125Mhz in 1G mode). +*/ + val =125 *HZ_PER_MHZ ;/* assuming 125MHz wireside clock */
Quoted 8 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c static int am65_cpsw_setup_mqprio(struct net_device *ndev, void *type_data) · line 287
Quoted 5 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +5
-0+ + val /=MILLIHZ_PER_HZ ;/* count per ms timeout */ + val *= verify_time_ms;/* count for timeout ms */ +if (link_speed <SPEED_1000 ) + val <<=1 ;/* FIXME: Is this correct? */ Is there any way to find out and remove the FIXME? Like running the selftest at
SPEED_100?
I checked at SPEED_100 without the above if condition and it works so I'll drop it in next revision.
Quoted 10 lines
Quoted 10 lines
drivers/net/ethernet/ti/am65-cpsw-qos.c +9
-0+ +if (val >AM65_CPSW_PN_MAC_VERIFY_CNT_MASK ) +return -EINVAL ; + +writel (val, port->port_base +AM65_CPSW_PN_REG_IET_VERIFY ); + +return 0 ; +} +
Signature · 2 lines
cheers, -roger
PATCH v6 7/7 net: ethernet: ti: am65-cpsw: add sw tx/rx irq coalescing based on hrtimers
In reply to Roger QuadrosFrom: Grygorii Strashko <[email protected]>
Add SW IRQ coalescing based on hrtimers for TX and RX data path which can be enabled by ethtool commands:
- RX coalescing
ethtool -C eth1 rx-usecs 50
- TX coalescing can be enabled per TX queue
- by default enables coalesing for TX0
ethtool -C eth1 tx-usecs 50
- configure TX0
ethtool -Q eth0 queue_mask 1 --coalesce tx-usecs 100
- configure TX1
ethtool -Q eth0 queue_mask 2 --coalesce tx-usecs 100
- configure TX0 and TX1
ethtool -Q eth0 queue_mask 3 --coalesce tx-usecs 100 --coalesce tx-usecs 100
show configuration for TX0 and TX1:
ethtool -Q eth0 queue_mask 3 --show-coalesce
Comparing to gro_flush_timeout and napi_defer_hard_irqs, this patch allows to enable IRQ coalesing for RX path separately.
--- drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 79 +++++++++++++++++++++ drivers/net/ethernet/ti/am65-cpsw-nuss.c | 59 ++++++++++++--- drivers/net/ethernet/ti/am65-cpsw-nuss.h | 4 ++ 3 files changed, 134 insertions(+), 8 deletions(-)
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +79 -0
@@ -892,6 +892,80 @@ static void am65_cpsw_get_mm_stats(struct net_device *ndev, s->MACMergeHoldCount =readl (base +AM65_CPSW_STATN_IET_TX_HOLD ); } +static int am65_cpsw_get_coalesce (struct net_device *ndev,struct ethtool_coalesce *coal, +struct kernel_ethtool_coalesce *kernel_coal, +struct netlink_ext_ack *extack) +{ +struct am65_cpsw_common *common =am65_ndev_to_common (ndev); +struct am65_cpsw_tx_chn *tx_chn; + + tx_chn = &common->tx_chns[0 ]; + + coal->rx_coalesce_usecs = common->rx_pace_timeout /1000 ; + coal->tx_coalesce_usecs = tx_chn->tx_pace_timeout /1000 ; + +return 0 ; +} + +static int am65_cpsw_get_per_queue_coalesce (struct net_device *ndev,u32 queue, +struct ethtool_coalesce *coal) +{ +struct am65_cpsw_common *common =am65_ndev_to_common (ndev); +struct am65_cpsw_tx_chn *tx_chn; + +if (queue >=AM65_CPSW_MAX_TX_QUEUES ) +return -EINVAL ; + + tx_chn = &common->tx_chns[queue]; + + coal->tx_coalesce_usecs = tx_chn->tx_pace_timeout /1000 ; + +return 0 ; +} + +static int am65_cpsw_set_coalesce (struct net_device *ndev,struct ethtool_coalesce *coal, +struct kernel_ethtool_coalesce *kernel_coal, +struct netlink_ext_ack *extack) +{ +struct am65_cpsw_common *common =am65_ndev_to_common (ndev); +struct am65_cpsw_tx_chn *tx_chn; + + tx_chn = &common->tx_chns[0 ]; + +if (coal->rx_coalesce_usecs && coal->rx_coalesce_usecs <20 ) +return -EINVAL ; + +if (coal->tx_coalesce_usecs && coal->tx_coalesce_usecs <20 ) +return -EINVAL ; + + common->rx_pace_timeout = coal->rx_coalesce_usecs *1000 ; + tx_chn->tx_pace_timeout = coal->tx_coalesce_usecs *1000 ; + +return 0 ; +} + +static int am65_cpsw_set_per_queue_coalesce (struct net_device *ndev,u32 queue, +struct ethtool_coalesce *coal) +{ +struct am65_cpsw_common *common =am65_ndev_to_common (ndev); +struct am65_cpsw_tx_chn *tx_chn; + +if (queue >=AM65_CPSW_MAX_TX_QUEUES ) +return -EINVAL ; + + tx_chn = &common->tx_chns[queue]; + +if (coal->tx_coalesce_usecs && coal->tx_coalesce_usecs <20 ) { +dev_info (common->dev,"defaulting to min value of 20us for tx-usecs for tx-%u\n" , + queue); + coal->tx_coalesce_usecs =20 ; + } + + tx_chn->tx_pace_timeout = coal->tx_coalesce_usecs *1000 ; + +return 0 ; +} +const struct ethtool_ops am65_cpsw_ethtool_ops_slave = { .begin = am65_cpsw_ethtool_op_begin, .complete = am65_cpsw_ethtool_op_complete,
@@ -910,6 +984,11 @@ const struct ethtool_ops am65_cpsw_ethtool_ops_slave = { .get_ts_info = am65_cpsw_get_ethtool_ts_info, .get_priv_flags = am65_cpsw_get_ethtool_priv_flags, .set_priv_flags = am65_cpsw_set_ethtool_priv_flags, + .supported_coalesce_params = ETHTOOL_COALESCE_USECS, + .get_coalesce = am65_cpsw_get_coalesce, + .set_coalesce = am65_cpsw_set_coalesce, + .get_per_queue_coalesce = am65_cpsw_get_per_queue_coalesce, + .set_per_queue_coalesce = am65_cpsw_set_per_queue_coalesce, .get_link = ethtool_op_get_link, .get_link_ksettings = am65_cpsw_get_link_ksettings,
drivers/net/ethernet/ti/am65-cpsw-nuss.c +51 -8
137 lines not on this page · raw message
drivers/net/ethernet/ti/am65-cpsw-nuss.h +4 -0
@@ -75,6 +75,8 @@ struct am65_cpsw_tx_chn {struct k3_cppi_desc_pool *desc_pool;struct k3_udma_glue_tx_channel *tx_chn;spinlock_t lock;/* protect TX rings in multi-port mode */ +struct hrtimer tx_hrtimer; +unsigned long tx_pace_timeout;int irq;u32 id;u32 descs_num;
@@ -138,6 +140,8 @@ struct am65_cpsw_common {struct napi_struct napi_rx;bool rx_irq_disabled; +struct hrtimer rx_hrtimer; +unsigned long rx_pace_timeout;u32 nuss_ver;u32 cpsw_ver;
Signature · 1 line
2.34.1