]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: refactor for function hclge_fd_convert_tuple
authorJian Shen <shenjian15@huawei.com>
Mon, 22 Mar 2021 03:51:58 +0000 (11:51 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Mar 2021 20:04:18 +0000 (13:04 -0700)
commitd60094c193175931e0b0e17713d8c109dea0f964
treec4b188ea0e787368cdc98f271bf9ede6a41d8e7a
parentf857e35bb26fe53c5852a2eba942dd7d183eece1
net: hns3: refactor for function hclge_fd_convert_tuple

Currently, there are too many branches for hclge_fd_convert_tuple().
And it may be more when add new tuples. Refactor it by sorting the
tuples according to their length. So it only needs several KEY_OPT
now, and being flexible to add new tuples.

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_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h