Thread (167 messages) 167 messages, 19 authors, 2016-04-06

Re: [PATCH v11 2/8] ethdev: use constants for link duplex

From: Thomas Monjalon <hidden>
Date: 2016-03-23 08:36:30

2016-03-23 02:44, Zhang, Helin:
quoted
 struct rte_eth_link {
      uint16_t link_speed;      /**< ETH_LINK_SPEED_[10, 100, 1000, 10000]
*/
-     uint16_t link_duplex;     /**< ETH_LINK_[HALF_DUPLEX,
FULL_DUPLEX] */
+     uint16_t link_duplex;     /**< ETH_LINK_[HALF/FULL]_DUPLEX */
      uint8_t  link_status : 1; /**< ETH_LINK_[DOWN/UP] */
 }__attribute__((aligned(8)));     /**< aligned for atomic64 read/write */
For link speed and link duplex, I'd suggest to add one more status of 'UNKNOWN'.
Because, sometimes it cannot get all the information from hardware.
For link stauts, assume it in DOWN state is acceptable, while for other two, I don't think so.

Currently it can be seen that a default link speed and duplex will be set if it cannot
get the accurate info from hardware. That's not good, and I think UNKNOWN could be better.

What do you think?
OK, please provide a patch on top of this one to set ETH_LINK_UNKNOWN_DUPLEX
in the drivers where appropriate.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help