Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64353af6 authored by Salil's avatar Salil Committed by David S. Miller
Browse files

net:hns: Add Hip06 "TSO(TCP Segment Offload)" support HNS Driver



This patch adds the support of "TSO (TCP Segment Offload)" feature
provided by the Hip06 ethernet hardware to the HNS ethernet
driver.

Enabling this feature would help offload the TCP Segmentation
process to the Hip06 ethernet hardware. This eventually would help
in saving precious cpu cycles.

Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarlisheng <lisheng011@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6bc0ce7d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -474,6 +474,7 @@ struct hnae_ae_ops {
	int (*set_mac_addr)(struct hnae_handle *handle, void *p);
	int (*set_mc_addr)(struct hnae_handle *handle, void *addr);
	int (*set_mtu)(struct hnae_handle *handle, int new_mtu);
	void (*set_tso_stats)(struct hnae_handle *handle, int enable);
	void (*update_stats)(struct hnae_handle *handle,
			     struct net_device_stats *net_stats);
	void (*get_stats)(struct hnae_handle *handle, u64 *data);
+8 −0
Original line number Diff line number Diff line
@@ -277,6 +277,13 @@ static int hns_ae_set_mtu(struct hnae_handle *handle, int new_mtu)
	return hns_mac_set_mtu(mac_cb, new_mtu);
}

static void hns_ae_set_tso_stats(struct hnae_handle *handle, int enable)
{
	struct hns_ppe_cb *ppe_cb = hns_get_ppe_cb(handle);

	hns_ppe_set_tso_enable(ppe_cb, enable);
}

static int hns_ae_start(struct hnae_handle *handle)
{
	int ret;
@@ -824,6 +831,7 @@ static struct hnae_ae_ops hns_dsaf_ops = {
	.set_mc_addr = hns_ae_set_multicast_one,
	.set_mtu = hns_ae_set_mtu,
	.update_stats = hns_ae_update_stats,
	.set_tso_stats = hns_ae_set_tso_stats,
	.get_stats = hns_ae_get_stats,
	.get_strings = hns_ae_get_strings,
	.get_sset_count = hns_ae_get_sset_count,
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,11 @@

#include "hns_dsaf_ppe.h"

void hns_ppe_set_tso_enable(struct hns_ppe_cb *ppe_cb, u32 value)
{
	dsaf_set_dev_bit(ppe_cb, PPEV2_CFG_TSO_EN_REG, 0, !!value);
}

void hns_ppe_set_rss_key(struct hns_ppe_cb *ppe_cb,
			 const u32 rss_key[HNS_PPEV2_RSS_KEY_NUM])
{
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ void hns_ppe_get_regs(struct hns_ppe_cb *ppe_cb, void *data);

void hns_ppe_get_strings(struct hns_ppe_cb *ppe_cb, int stringset, u8 *data);
void hns_ppe_get_stats(struct hns_ppe_cb *ppe_cb, u64 *data);

void hns_ppe_set_tso_enable(struct hns_ppe_cb *ppe_cb, u32 value);
void hns_ppe_set_rss_key(struct hns_ppe_cb *ppe_cb,
			 const u32 rss_key[HNS_PPEV2_RSS_KEY_NUM]);
void hns_ppe_set_indir_table(struct hns_ppe_cb *ppe_cb,
+1 −0
Original line number Diff line number Diff line
@@ -317,6 +317,7 @@
#define PPE_CFG_TAG_GEN_REG			0x90
#define PPE_CFG_PARSE_TAG_REG			0x94
#define PPE_CFG_PRO_CHECK_EN_REG		0x98
#define PPEV2_CFG_TSO_EN_REG                    0xA0
#define PPE_INTEN_REG				0x100
#define PPE_RINT_REG				0x104
#define PPE_INTSTS_REG				0x108
Loading