Commit 3e201abc authored by Peiyang Wang's avatar Peiyang Wang Committed by Jiantao Xiao
Browse files

net: hns3: add arp proxy switch in ethtool

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9A3QT


CVE: NA

----------------------------------------------------------------------

To use arp proxy more conviency, add an arp proxy switch in ethool. Use
followed command to open or close arp proxy:
ethtool --set-priv-flags <device_name> roh_arp_proxy_enable <on/off>

Use followed command to find current state of arp proxy switch:
ethtool --show-priv-flags <device_name>

The results are showed as followed:
...
roh_arp_proxy_enable: on

Signed-off-by: default avatarPeiyang Wang <wangpeiyang1@huawei.com>
Signed-off-by: default avatarJiantao Xiao <xiaojiantao1@h-partners.com>
parent ac104890
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -917,6 +917,7 @@ struct hnae3_roce_private_info {
enum hnae3_pflag {
	HNAE3_PFLAG_LIMIT_PROMISC,
	HNAE3_PFLAG_FD_QB_ENABLE,
	HNAE3_PFLAG_ROH_ARP_PROXY_ENABLE,
	HNAE3_PFLAG_MAX
};

+6 −0
Original line number Diff line number Diff line
@@ -5354,6 +5354,12 @@ static void hns3_state_init(struct hnae3_handle *handle)

	if (hnae3_ae_dev_rxd_adv_layout_supported(ae_dev))
		set_bit(HNS3_NIC_STATE_RXD_ADV_LAYOUT_ENABLE, &priv->state);

	if (hnae3_check_roh_mac_type(handle)) {
		set_bit(HNAE3_PFLAG_ROH_ARP_PROXY_ENABLE,
			&handle->supported_pflags);
		set_bit(HNAE3_PFLAG_ROH_ARP_PROXY_ENABLE, &handle->priv_flags);
	}
}

static void hns3_state_uninit(struct hnae3_handle *handle)
+8 −0
Original line number Diff line number Diff line
@@ -477,9 +477,17 @@ static void hns3_update_fd_qb_state(struct net_device *netdev, bool enable)
	handle->ae_algo->ops->request_flush_qb_config(handle);
}

static void hns3_update_roh_arp_proxy_enable(struct net_device *netdev,
					     bool enable)
{
	netdev_info(netdev, "%s roh arp proxy\n",
		    enable ? "enable" : "disable");
}

static const struct hns3_pflag_desc hns3_priv_flags[HNAE3_PFLAG_MAX] = {
	{ "limit_promisc",	hns3_update_limit_promisc_mode },
	{ "qb_enable",		hns3_update_fd_qb_state },
	{ "roh_arp_proxy_enable",	hns3_update_roh_arp_proxy_enable },
};

static int hns3_get_sset_count(struct net_device *netdev, int stringset)