diff mbox series

[API-NEXT,v1,2/3] linux-gen: pktio: tap: implement link status operation

Message ID 1508155207-5041-3-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v1,1/3] linux-gen: pktio: tap: implement start/stop operations | expand

Commit Message

Github ODP bot Oct. 16, 2017, noon UTC
From: Bogdan Pricope <bogdan.pricope@linaro.org>


Implement link status tap pktio operation.

Signed-off-by: Bogdan Pricope <bogdan.pricope@linaro.org>

---
/** Email created from pull request 232 (bogdanPricope:tap_set_mac_pr)
 ** https://github.com/Linaro/odp/pull/232
 ** Patch: https://github.com/Linaro/odp/pull/232.patch
 ** Base sha: afeda4d14bb6f449cb269680cdbd56b26726eedf
 ** Merge commit sha: 8726d6c7a814c3380aacd18250194eae85ababb3
 **/
 platform/linux-generic/pktio/tap.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c
index 8ddd757d9..2fda0b814 100644
--- a/platform/linux-generic/pktio/tap.c
+++ b/platform/linux-generic/pktio/tap.c
@@ -406,6 +406,12 @@  static int tap_mac_addr_get(pktio_entry_t *pktio_entry, void *mac_addr)
 	return ETH_ALEN;
 }
 
+static int tap_link_status(pktio_entry_t *pktio_entry)
+{
+	return link_status_fd(pktio_entry->s.pkt_tap.skfd,
+			      pktio_entry->s.name + 4);
+}
+
 static int tap_capability(pktio_entry_t *pktio_entry ODP_UNUSED,
 			  odp_pktio_capability_t *capa)
 {
@@ -438,6 +444,7 @@  const pktio_if_ops_t tap_pktio_ops = {
 	.promisc_mode_get = tap_promisc_mode_get,
 	.mac_get = tap_mac_addr_get,
 	.mac_set = NULL,
+	.link_status = tap_link_status,
 	.capability = tap_capability,
 	.pktin_ts_res = NULL,
 	.pktin_ts_from_ns = NULL,