OSDN Git Service

net: hns3: add support for user-def data of flow director
authorJian Shen <shenjian15@huawei.com>
Mon, 22 Mar 2021 03:52:02 +0000 (11:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Mar 2021 20:04:18 +0000 (13:04 -0700)
commit67b0e1428e2f592c0fc2c7f682a5a049158782b8
tree072ab317fbd817b4e2c389ed6c75ec40cd9338f1
parentf07203b0180f62791371cb50fb1afacd826250fc
net: hns3: add support for user-def data of flow director

For DEVICE_VERSION_V3, the hardware supports to match specified
data in the specified offset of packet payload. Each layer can
have one offset, and can't be masked when configure flow director
rule by ethtool command. The layer is selected based on the
flow-type, ether for L2, ip4/ipv6 for L3, and tcp4/tcp6/udp4/udp6
for L4. For example, tcp4/tcp6/udp4/udp6 rules share the same
user-def offset, but each rule can have its own user-def value.

For the user-def field of ethtool -N/U command is 64 bits long.
The bit 0~15 is used for user-def value, and bit 32~47 for user-def
offset in HNS3 driver.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h