net/xsc: add dev link and MTU ops
PATCH 17/19 net/xsc: add dev link and MTU ops
XSC PMD does not support update link right now, in order to start device successfully link_update function always return 0.
Signed-off-by WanRenyong <[email protected]>
--- doc/guides/nics/features/xsc.ini | 1 + drivers/net/xsc/xsc_ethdev.c | 50 ++++++++++++++++++++++++++++++++ drivers/net/xsc/xsc_utils.c | 23 +++++++++++++++ drivers/net/xsc/xsc_utils.h | 1 + 4 files changed, 75 insertions(+)
doc/guides/nics/features/xsc.ini +1 -0
@@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +MTU update = Y RSS hash = Y RSS key update = Y RSS reta update = Y
drivers/net/xsc/xsc_ethdev.c +50 -0
74 lines not on this page · raw message
drivers/net/xsc/xsc_utils.c +23 -0
@@ -321,3 +321,26 @@ xsc_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac, uint32_t i dev->data->mac_addrs[index] = *mac;return 0 ; } + +int +xsc_link_process(struct rte_eth_dev *dev __rte_unused, +uint32_t ifindex,unsigned int flags) +{ +struct ifreq request; +struct ifreq *ifr = &request; +char ifname[sizeof (ifr->ifr_name)]; +int ret; +unsigned int keep = ~IFF_UP ; + +if (if_indextoname (ifindex, ifname) ==NULL ) +return -rte_errno; + + ret =xsc_ifreq_by_ifname (ifname,SIOCGIFFLAGS , &request); +if (ret) +return ret; + + request.ifr_flags &= keep; + request.ifr_flags |= flags & ~keep; + +return xsc_ifreq_by_ifname (ifname,SIOCSIFFLAGS , &request); +}
drivers/net/xsc/xsc_utils.h +1 -0
@@ -22,5 +22,6 @@ int xsc_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac, uint32int xsc_get_mtu (uint16_t *mtu,uint32_t ifindex);int xsc_set_mtu (uint16_t mtu,uint32_t ifindex);int xsc_get_mac (uint8_t *mac,uint32_t ifindex); +int xsc_link_process (struct rte_eth_dev *dev,uint32_t ifindex,unsigned int flags);#endif
Signature · 1 line
2.25.1