|
@@ -67,6 +67,7 @@
|
|
#include <net/pkt_cls.h>
|
|
#include <net/pkt_cls.h>
|
|
#include <net/vxlan.h>
|
|
#include <net/vxlan.h>
|
|
|
|
|
|
|
|
+#include "nfpcore/nfp_nsp_eth.h"
|
|
#include "nfp_net_ctrl.h"
|
|
#include "nfp_net_ctrl.h"
|
|
#include "nfp_net.h"
|
|
#include "nfp_net.h"
|
|
|
|
|
|
@@ -2831,6 +2832,26 @@ nfp_net_features_check(struct sk_buff *skb, struct net_device *dev,
|
|
return features;
|
|
return features;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int
|
|
|
|
+nfp_net_get_phys_port_name(struct net_device *netdev, char *name, size_t len)
|
|
|
|
+{
|
|
|
|
+ struct nfp_net *nn = netdev_priv(netdev);
|
|
|
|
+ int err;
|
|
|
|
+
|
|
|
|
+ if (!nn->eth_port)
|
|
|
|
+ return -EOPNOTSUPP;
|
|
|
|
+
|
|
|
|
+ if (!nn->eth_port->is_split)
|
|
|
|
+ err = snprintf(name, len, "p%d", nn->eth_port->label_port);
|
|
|
|
+ else
|
|
|
|
+ err = snprintf(name, len, "p%ds%d", nn->eth_port->label_port,
|
|
|
|
+ nn->eth_port->label_subport);
|
|
|
|
+ if (err >= len)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* nfp_net_set_vxlan_port() - set vxlan port in SW and reconfigure HW
|
|
* nfp_net_set_vxlan_port() - set vxlan port in SW and reconfigure HW
|
|
* @nn: NFP Net device to reconfigure
|
|
* @nn: NFP Net device to reconfigure
|
|
@@ -3009,6 +3030,7 @@ static const struct net_device_ops nfp_net_netdev_ops = {
|
|
.ndo_set_mac_address = eth_mac_addr,
|
|
.ndo_set_mac_address = eth_mac_addr,
|
|
.ndo_set_features = nfp_net_set_features,
|
|
.ndo_set_features = nfp_net_set_features,
|
|
.ndo_features_check = nfp_net_features_check,
|
|
.ndo_features_check = nfp_net_features_check,
|
|
|
|
+ .ndo_get_phys_port_name = nfp_net_get_phys_port_name,
|
|
.ndo_udp_tunnel_add = nfp_net_add_vxlan_port,
|
|
.ndo_udp_tunnel_add = nfp_net_add_vxlan_port,
|
|
.ndo_udp_tunnel_del = nfp_net_del_vxlan_port,
|
|
.ndo_udp_tunnel_del = nfp_net_del_vxlan_port,
|
|
.ndo_xdp = nfp_net_xdp,
|
|
.ndo_xdp = nfp_net_xdp,
|