net/octeontx: add MAC addr set op
authorJerin Jacob <jerin.jacob@caviumnetworks.com>
Sun, 8 Oct 2017 12:44:22 +0000 (18:14 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 12 Oct 2017 00:36:58 +0000 (01:36 +0100)
Implement "mac_addr_set" op and mark "Unicast MAC filter" feature as "P"
as "mac_addr_add" and "mac_addr_remove" are not implemented.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
doc/guides/nics/features/octeontx.ini
drivers/net/octeontx/octeontx_ethdev.c

index a7eabc4..a8f38e0 100644 (file)
@@ -9,6 +9,7 @@ Link status          = Y
 Lock-free Tx queue   = Y
 Jumbo frame          = Y
 Promiscuous mode     = Y
+Unicast MAC filter   = P
 CRC offload          = Y
 Basic stats          = Y
 Linux VFIO           = Y
index 8eb6bdd..49755fd 100644 (file)
@@ -451,6 +451,19 @@ octeontx_dev_stats_reset(struct rte_eth_dev *dev)
        octeontx_port_stats_clr(nic);
 }
 
+static void
+octeontx_dev_default_mac_addr_set(struct rte_eth_dev *dev,
+                                       struct ether_addr *addr)
+{
+       struct octeontx_nic *nic = octeontx_pmd_priv(dev);
+       int ret;
+
+       ret = octeontx_bgx_port_mac_set(nic->port_id, addr->addr_bytes);
+       if (ret != 0)
+               octeontx_log_err("failed to set MAC address on port %d",
+                               nic->port_id);
+}
+
 static void
 octeontx_dev_info(struct rte_eth_dev *dev,
                struct rte_eth_dev_info *dev_info)
@@ -496,6 +509,7 @@ static const struct eth_dev_ops octeontx_dev_ops = {
        .link_update             = octeontx_dev_link_update,
        .stats_get               = octeontx_dev_stats_get,
        .stats_reset             = octeontx_dev_stats_reset,
+       .mac_addr_set            = octeontx_dev_default_mac_addr_set,
 };
 
 /* Create Ethdev interface per BGX LMAC ports */