cxgb4vf: Add ethtool private flags for changing force_link_up
Subsystems (3)
PATCH 1/1 cxgb4vf: Add ethtool private flags for changing force_link_up
Forcing link up of virtual interfaces even when physical link is down causes packet drops and ping failures during bonding failover. Hence adding a ethtool private flag to toggle force_link_up whenever required.
--- drivers/net/ethernet/chelsio/cxgb4vf/adapter.h | 16 +++++++ .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 54 +++++++++++++++++++++- 2 files changed, 68 insertions(+), 2 deletions(-)
drivers/net/ethernet/chelsio/cxgb4vf/adapter.h +16 -0
@@ -78,6 +78,18 @@ enum { MAX_EGRQ = MAX_ETH_QSETS*2, }; +enum { +PRIV_FLAG_PORT_FORCE_LINKUP_BIT , +}; + +#define PRIV_FLAG_PORT_FORCE_LINKUP \ + BIT(PRIV_FLAG_PORT_FORCE_LINKUP_BIT) + +#define PRIV_FLAGS_ADAP 0x0 +#define DEFAULT_PRIV_FLAGS_ADAP 0x0 +#define PRIV_FLAGS_PORT PRIV_FLAG_PORT_FORCE_LINKUP +#define DEFAULT_PRIV_FLAGS_PORT PRIV_FLAG_PORT_FORCE_LINKUP +/* * Forward structure definition references. */
@@ -103,6 +115,7 @@ struct port_info {u8 port_id;/* physical port ID */ u8 nqsets;/* # of "Queue Sets" */ u8 first_qset;/* index of first "Queue Set" */ +u32 eth_flags;/* ethtool private flags */ struct link_config link_cfg;/* physical port configuration */ };
@@ -374,6 +387,9 @@ struct adapter {unsigned long flags;struct adapter_params params; +/* ethtool private flags */ +u32 eth_flags; +/* queue and interrupt resources */ struct {unsigned short vec;
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +52 -2
126 lines not on this page · raw message
Signature · 1 line
2.3.5
Quoted 7 lines · Arjun Vynipadath
Forcing link up of virtual interfaces even when physical link is down causes packet drops and ping failures during bonding failover. Hence adding a ethtool private flag to toggle
force_link_upwhenever required.Signed-off-by Arjun Vynipadath <[email protected]>Signed-off-by Casey Leedom <[email protected]>Signed-off-by Ganesh Goudar <[email protected]>
Could you describe how this mechanism relates to the existing ndo_set_vf_link_state, which you seem to not make use of:
$ git grep ndo_set_vf_link_state -- drivers/net/ethernet/chelsio/ $
I understand you're configuring the setting from the VF side, but the question, as always, is: why ;)
Quoted 9 lines · Jakub Kicinski
Quoted 7 lines · Arjun Vynipadath
Forcing link up of virtual interfaces even when physical link is down causes packet drops and ping failures during bonding failover. Hence adding a ethtool private flag to toggle
force_link_upwhenever required.Signed-off-by Arjun Vynipadath <[email protected]>Signed-off-by Casey Leedom <[email protected]>Signed-off-by Ganesh Goudar <[email protected]>
Quoted 8 lines
Could you describe how this mechanism relates to the existing
ndo_set_vf_link_state, which you seem to not make use of:$ git grep ndo_set_vf_link_state -- drivers/net/ethernet/chelsio/ $I understand you're configuring the setting from the VF side, but the question, as always, is: why ;)
Hi Jakub,ndo_set_vf_link_state can't be presently used in our case. We dont have firmware support to communicate the link flags set through ndo_set_vf_link_state from pf (cxgb4) driver to vf (cxgb4vf) driver.
Thanks,
Arjun.
Quoted 16 lines · Arjun Vynipadath
Quoted 15 lines · Jakub Kicinski
Quoted 7 lines · Arjun Vynipadath
Forcing link up of virtual interfaces even when physical link is down causes packet drops and ping failures during bonding failover. Hence adding a ethtool private flag to toggle
force_link_upwhenever required.Signed-off-by Arjun Vynipadath <[email protected]>Signed-off-by Casey Leedom <[email protected]>Signed-off-by Ganesh Goudar <[email protected]>Could you describe how this mechanism relates to the existing
ndo_set_vf_link_state, which you seem to not make use of:$ git grep ndo_set_vf_link_state -- drivers/net/ethernet/chelsio/ $
Quoted 6 lines
Quoted 2 lines
I understand you're configuring the setting from the VF side, but the question, as always, is: why ;)
Hi Jakub,
ndo_set_vf_link_statecan't be presently used in our case. We dont have firmware support to communicate the link flags set throughndo_set_vf_link_statefrom pf (cxgb4) driver to vf (cxgb4vf) driver.
FW is just SW that runs on a card :) Is that a HW limitation?
What I was thinking after a quick look at the code was this:
- add a new bit to GET_PORT_INFO to indicate that the VF driver should brink the link state up/down wtih netif_carrier_off()/ netif_carrier_on();
- in FW set this bit based on the ndo_set_vf_link_state policy and link state.
But you're saying that extending GET_PORT_INFO or communicating this info in other ways is not an option? It would be nice to stick to the existing kernel APIs, if they address exactly the kind of configuration you're trying to perform.