Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'macsec-vlan'

Emeel Hakim says:

====================
Support MACsec VLAN

This patch series introduces support for hardware (HW) offload MACsec
devices with VLAN configuration. The patches address both scenarios
where the VLAN header is both the inner and outer header for MACsec.

The changes include:

1. Adding MACsec offload operation for VLAN.
2. Considering VLAN when accessing MACsec net device.
3. Currently offloading MACsec when it's configured over VLAN with
current MACsec TX steering rules would wrongly insert the MACsec sec tag
after inserting the VLAN header. This resulted in an ETHERNET | SECTAG |
VLAN packet when ETHERNET | VLAN | SECTAG is configured. The patche
handles this issue when configuring steering rules.
4. Adding MACsec rx_handler change support in case of a marked skb and a
mismatch on the dst MAC address.

Please review these changes and let me know if you have any feedback or
concerns.

Updates since v1:
- Consult vlan_features when adding NETIF_F_HW_MACSEC.
- Allow grep for the functions.
- Add helper function to get the macsec operation to allow the compiler
to make some choice.

Updates since v2:
- Don't use macros to allow direct navigattion from mdo functions to its
implementation.
- Make the vlan_get_macsec_ops argument a const.
- Check if the specific mdo function is available before calling it.
- Enable NETIF_F_HW_MACSEC by default when the lower device has it enabled
and in case the lower device currently has NETIF_F_HW_MACSEC but disabled
let the new vlan device also have it disabled.

Updates since v3:
- Split patch ("vlan: Add MACsec offload operations for VLAN interface")
to prevent mixing generic vlan code changes with driver changes.
- Add mdo_open, stop and stats to support drivers which have those.
- Don't fail if macsec offload operations are available but a specific
function is not, to support drivers which does not implement all
macsec offload operations.
- Don't call find_rx_sc twice in the same loop, instead save the result
in a parameter and re-use it.
- Completely remove _BUILD_VLAN_MACSEC_MDO macro, to prevent returning
from a macro.
- Reorder the functions inside struct macsec_ops to match the struct
decleration.

Updates since v4:
- Change subject line of ("macsec: Add MACsec rx_handler change support") and adapt commit message.
- Don't separate the new check in patch ("macsec: Add MACsec rx_handler change support")
from the previous if/else if.
- Drop"_found" from the parameter naming "rx_sc_found" and move the definition to
the relevant block.
- Remove "{}" since not needed around a single line.

Updates since v5:
- Consider promiscuous mode case.

Updates since v6:
- Use IS_ENABLED instead of checking for ifdef.
- Don't add inline keywork in c files, let the compiler make its own decisions.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+288 -18
+26 -16
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
··· 4 4 #include <linux/mlx5/device.h> 5 5 #include <linux/mlx5/mlx5_ifc.h> 6 6 #include <linux/xarray.h> 7 + #include <linux/if_vlan.h> 7 8 8 9 #include "en.h" 9 10 #include "lib/aso.h" ··· 349 348 sa->macsec_rule = NULL; 350 349 } 351 350 351 + static struct mlx5e_priv *macsec_netdev_priv(const struct net_device *dev) 352 + { 353 + #if IS_ENABLED(CONFIG_VLAN_8021Q) 354 + if (is_vlan_dev(dev)) 355 + return netdev_priv(vlan_dev_priv(dev)->real_dev); 356 + #endif 357 + return netdev_priv(dev); 358 + } 359 + 352 360 static int mlx5e_macsec_init_sa(struct macsec_context *ctx, 353 361 struct mlx5e_macsec_sa *sa, 354 362 bool encrypt, 355 363 bool is_tx) 356 364 { 357 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 365 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 358 366 struct mlx5e_macsec *macsec = priv->macsec; 359 367 struct mlx5_macsec_rule_attrs rule_attrs; 360 368 struct mlx5_core_dev *mdev = priv->mdev; ··· 437 427 struct mlx5e_macsec_sa *rx_sa, 438 428 bool active) 439 429 { 440 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 430 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 441 431 struct mlx5e_macsec *macsec = priv->macsec; 442 432 int err = 0; 443 433 ··· 518 508 519 509 static int mlx5e_macsec_add_txsa(struct macsec_context *ctx) 520 510 { 511 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 521 512 const struct macsec_tx_sc *tx_sc = &ctx->secy->tx_sc; 522 513 const struct macsec_tx_sa *ctx_tx_sa = ctx->sa.tx_sa; 523 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 524 514 const struct macsec_secy *secy = ctx->secy; 525 515 struct mlx5e_macsec_device *macsec_device; 526 516 struct mlx5_core_dev *mdev = priv->mdev; ··· 593 583 594 584 static int mlx5e_macsec_upd_txsa(struct macsec_context *ctx) 595 585 { 586 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 596 587 const struct macsec_tx_sc *tx_sc = &ctx->secy->tx_sc; 597 588 const struct macsec_tx_sa *ctx_tx_sa = ctx->sa.tx_sa; 598 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 599 589 struct mlx5e_macsec_device *macsec_device; 600 590 u8 assoc_num = ctx->sa.assoc_num; 601 591 struct mlx5e_macsec_sa *tx_sa; ··· 655 645 656 646 static int mlx5e_macsec_del_txsa(struct macsec_context *ctx) 657 647 { 658 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 648 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 659 649 struct mlx5e_macsec_device *macsec_device; 660 650 u8 assoc_num = ctx->sa.assoc_num; 661 651 struct mlx5e_macsec_sa *tx_sa; ··· 706 696 static int mlx5e_macsec_add_rxsc(struct macsec_context *ctx) 707 697 { 708 698 struct mlx5e_macsec_rx_sc_xarray_element *sc_xarray_element; 709 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 699 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 710 700 const struct macsec_rx_sc *ctx_rx_sc = ctx->rx_sc; 711 701 struct mlx5e_macsec_device *macsec_device; 712 702 struct mlx5e_macsec_rx_sc *rx_sc; ··· 786 776 787 777 static int mlx5e_macsec_upd_rxsc(struct macsec_context *ctx) 788 778 { 789 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 779 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 790 780 const struct macsec_rx_sc *ctx_rx_sc = ctx->rx_sc; 791 781 struct mlx5e_macsec_device *macsec_device; 792 782 struct mlx5e_macsec_rx_sc *rx_sc; ··· 864 854 865 855 static int mlx5e_macsec_del_rxsc(struct macsec_context *ctx) 866 856 { 867 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 857 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 868 858 struct mlx5e_macsec_device *macsec_device; 869 859 struct mlx5e_macsec_rx_sc *rx_sc; 870 860 struct mlx5e_macsec *macsec; ··· 900 890 901 891 static int mlx5e_macsec_add_rxsa(struct macsec_context *ctx) 902 892 { 893 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 903 894 const struct macsec_rx_sa *ctx_rx_sa = ctx->sa.rx_sa; 904 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 905 895 struct mlx5e_macsec_device *macsec_device; 906 896 struct mlx5_core_dev *mdev = priv->mdev; 907 897 u8 assoc_num = ctx->sa.assoc_num; ··· 986 976 987 977 static int mlx5e_macsec_upd_rxsa(struct macsec_context *ctx) 988 978 { 979 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 989 980 const struct macsec_rx_sa *ctx_rx_sa = ctx->sa.rx_sa; 990 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 991 981 struct mlx5e_macsec_device *macsec_device; 992 982 u8 assoc_num = ctx->sa.assoc_num; 993 983 struct mlx5e_macsec_rx_sc *rx_sc; ··· 1043 1033 1044 1034 static int mlx5e_macsec_del_rxsa(struct macsec_context *ctx) 1045 1035 { 1046 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 1036 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 1047 1037 struct mlx5e_macsec_device *macsec_device; 1048 1038 sci_t sci = ctx->sa.rx_sa->sc->sci; 1049 1039 struct mlx5e_macsec_rx_sc *rx_sc; ··· 1095 1085 1096 1086 static int mlx5e_macsec_add_secy(struct macsec_context *ctx) 1097 1087 { 1098 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 1088 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 1099 1089 const struct net_device *dev = ctx->secy->netdev; 1100 1090 const struct net_device *netdev = ctx->netdev; 1101 1091 struct mlx5e_macsec_device *macsec_device; ··· 1147 1137 static int macsec_upd_secy_hw_address(struct macsec_context *ctx, 1148 1138 struct mlx5e_macsec_device *macsec_device) 1149 1139 { 1150 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 1140 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 1151 1141 const struct net_device *dev = ctx->secy->netdev; 1152 1142 struct mlx5e_macsec *macsec = priv->macsec; 1153 1143 struct mlx5e_macsec_rx_sc *rx_sc, *tmp; ··· 1194 1184 */ 1195 1185 static int mlx5e_macsec_upd_secy(struct macsec_context *ctx) 1196 1186 { 1187 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 1197 1188 const struct macsec_tx_sc *tx_sc = &ctx->secy->tx_sc; 1198 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 1199 1189 const struct net_device *dev = ctx->secy->netdev; 1200 1190 struct mlx5e_macsec_device *macsec_device; 1201 1191 struct mlx5e_macsec_sa *tx_sa; ··· 1250 1240 1251 1241 static int mlx5e_macsec_del_secy(struct macsec_context *ctx) 1252 1242 { 1253 - struct mlx5e_priv *priv = netdev_priv(ctx->netdev); 1243 + struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev); 1254 1244 struct mlx5e_macsec_device *macsec_device; 1255 1245 struct mlx5e_macsec_rx_sc *rx_sc, *tmp; 1256 1246 struct mlx5e_macsec_sa *tx_sa; ··· 1751 1741 { 1752 1742 struct mlx5e_macsec_rx_sc_xarray_element *sc_xarray_element; 1753 1743 u32 macsec_meta_data = be32_to_cpu(cqe->ft_metadata); 1754 - struct mlx5e_priv *priv = netdev_priv(netdev); 1744 + struct mlx5e_priv *priv = macsec_netdev_priv(netdev); 1755 1745 struct mlx5e_macsec_rx_sc *rx_sc; 1756 1746 struct mlx5e_macsec *macsec; 1757 1747 u32 fs_id;
+7
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c
··· 4 4 #include <net/macsec.h> 5 5 #include <linux/netdevice.h> 6 6 #include <linux/mlx5/qp.h> 7 + #include <linux/if_vlan.h> 7 8 #include "fs_core.h" 8 9 #include "en/fs.h" 9 10 #include "en_accel/macsec_fs.h" ··· 509 508 macsec_fs_tx_ft_put(macsec_fs); 510 509 } 511 510 511 + #define MLX5_REFORMAT_PARAM_ADD_MACSEC_OFFSET_4_BYTES 1 512 + 512 513 static union mlx5e_macsec_rule * 513 514 macsec_fs_tx_add_rule(struct mlx5e_macsec_fs *macsec_fs, 514 515 const struct macsec_context *macsec_ctx, ··· 556 553 reformat_params.type = MLX5_REFORMAT_TYPE_ADD_MACSEC; 557 554 reformat_params.size = reformat_size; 558 555 reformat_params.data = reformatbf; 556 + 557 + if (is_vlan_dev(macsec_ctx->netdev)) 558 + reformat_params.param_0 = MLX5_REFORMAT_PARAM_ADD_MACSEC_OFFSET_4_BYTES; 559 + 559 560 flow_act.pkt_reformat = mlx5_packet_reformat_alloc(macsec_fs->mdev, 560 561 &reformat_params, 561 562 MLX5_FLOW_NAMESPACE_EGRESS_MACSEC);
+1
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 5109 5109 5110 5110 netdev->vlan_features |= NETIF_F_SG; 5111 5111 netdev->vlan_features |= NETIF_F_HW_CSUM; 5112 + netdev->vlan_features |= NETIF_F_HW_MACSEC; 5112 5113 netdev->vlan_features |= NETIF_F_GRO; 5113 5114 netdev->vlan_features |= NETIF_F_TSO; 5114 5115 netdev->vlan_features |= NETIF_F_TSO6;
+12 -2
drivers/net/macsec.c
··· 1021 1021 * the SecTAG, so we have to deduce which port to deliver to. 1022 1022 */ 1023 1023 if (macsec_is_offloaded(macsec) && netif_running(ndev)) { 1024 - if (md_dst && md_dst->type == METADATA_MACSEC && 1025 - (!find_rx_sc(&macsec->secy, md_dst->u.macsec_info.sci))) 1024 + struct macsec_rx_sc *rx_sc = NULL; 1025 + 1026 + if (md_dst && md_dst->type == METADATA_MACSEC) 1027 + rx_sc = find_rx_sc(&macsec->secy, md_dst->u.macsec_info.sci); 1028 + 1029 + if (md_dst && md_dst->type == METADATA_MACSEC && !rx_sc) 1026 1030 continue; 1027 1031 1028 1032 if (ether_addr_equal_64bits(hdr->h_dest, ··· 1051 1047 nskb->pkt_type = PACKET_MULTICAST; 1052 1048 1053 1049 __netif_rx(nskb); 1050 + } else if (rx_sc || ndev->flags & IFF_PROMISC) { 1051 + skb->dev = ndev; 1052 + skb->pkt_type = PACKET_HOST; 1053 + ret = RX_HANDLER_ANOTHER; 1054 + goto out; 1054 1055 } 1056 + 1055 1057 continue; 1056 1058 } 1057 1059
+242
net/8021q/vlan_dev.c
··· 26 26 #include <linux/ethtool.h> 27 27 #include <linux/phy.h> 28 28 #include <net/arp.h> 29 + #include <net/macsec.h> 29 30 30 31 #include "vlan.h" 31 32 #include "vlanproc.h" ··· 573 572 NETIF_F_HIGHDMA | NETIF_F_SCTP_CRC | 574 573 NETIF_F_ALL_FCOE; 575 574 575 + if (real_dev->vlan_features & NETIF_F_HW_MACSEC) 576 + dev->hw_features |= NETIF_F_HW_MACSEC; 577 + 576 578 dev->features |= dev->hw_features | NETIF_F_LLTX; 577 579 netif_inherit_tso_max(dev, real_dev); 578 580 if (dev->features & NETIF_F_VLAN_FEATURES) ··· 807 803 return 0; 808 804 } 809 805 806 + #if IS_ENABLED(CONFIG_MACSEC) 807 + 808 + static const struct macsec_ops *vlan_get_macsec_ops(const struct macsec_context *ctx) 809 + { 810 + return vlan_dev_priv(ctx->netdev)->real_dev->macsec_ops; 811 + } 812 + 813 + static int vlan_macsec_offload(int (* const func)(struct macsec_context *), 814 + struct macsec_context *ctx) 815 + { 816 + if (unlikely(!func)) 817 + return 0; 818 + 819 + return (*func)(ctx); 820 + } 821 + 822 + static int vlan_macsec_dev_open(struct macsec_context *ctx) 823 + { 824 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 825 + 826 + if (!ops) 827 + return -EOPNOTSUPP; 828 + 829 + return vlan_macsec_offload(ops->mdo_dev_open, ctx); 830 + } 831 + 832 + static int vlan_macsec_dev_stop(struct macsec_context *ctx) 833 + { 834 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 835 + 836 + if (!ops) 837 + return -EOPNOTSUPP; 838 + 839 + return vlan_macsec_offload(ops->mdo_dev_stop, ctx); 840 + } 841 + 842 + static int vlan_macsec_add_secy(struct macsec_context *ctx) 843 + { 844 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 845 + 846 + if (!ops) 847 + return -EOPNOTSUPP; 848 + 849 + return vlan_macsec_offload(ops->mdo_add_secy, ctx); 850 + } 851 + 852 + static int vlan_macsec_upd_secy(struct macsec_context *ctx) 853 + { 854 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 855 + 856 + if (!ops) 857 + return -EOPNOTSUPP; 858 + 859 + return vlan_macsec_offload(ops->mdo_upd_secy, ctx); 860 + } 861 + 862 + static int vlan_macsec_del_secy(struct macsec_context *ctx) 863 + { 864 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 865 + 866 + if (!ops) 867 + return -EOPNOTSUPP; 868 + 869 + return vlan_macsec_offload(ops->mdo_del_secy, ctx); 870 + } 871 + 872 + static int vlan_macsec_add_rxsc(struct macsec_context *ctx) 873 + { 874 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 875 + 876 + if (!ops) 877 + return -EOPNOTSUPP; 878 + 879 + return vlan_macsec_offload(ops->mdo_add_rxsc, ctx); 880 + } 881 + 882 + static int vlan_macsec_upd_rxsc(struct macsec_context *ctx) 883 + { 884 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 885 + 886 + if (!ops) 887 + return -EOPNOTSUPP; 888 + 889 + return vlan_macsec_offload(ops->mdo_upd_rxsc, ctx); 890 + } 891 + 892 + static int vlan_macsec_del_rxsc(struct macsec_context *ctx) 893 + { 894 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 895 + 896 + if (!ops) 897 + return -EOPNOTSUPP; 898 + 899 + return vlan_macsec_offload(ops->mdo_del_rxsc, ctx); 900 + } 901 + 902 + static int vlan_macsec_add_rxsa(struct macsec_context *ctx) 903 + { 904 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 905 + 906 + if (!ops) 907 + return -EOPNOTSUPP; 908 + 909 + return vlan_macsec_offload(ops->mdo_add_rxsa, ctx); 910 + } 911 + 912 + static int vlan_macsec_upd_rxsa(struct macsec_context *ctx) 913 + { 914 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 915 + 916 + if (!ops) 917 + return -EOPNOTSUPP; 918 + 919 + return vlan_macsec_offload(ops->mdo_upd_rxsa, ctx); 920 + } 921 + 922 + static int vlan_macsec_del_rxsa(struct macsec_context *ctx) 923 + { 924 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 925 + 926 + if (!ops) 927 + return -EOPNOTSUPP; 928 + 929 + return vlan_macsec_offload(ops->mdo_del_rxsa, ctx); 930 + } 931 + 932 + static int vlan_macsec_add_txsa(struct macsec_context *ctx) 933 + { 934 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 935 + 936 + if (!ops) 937 + return -EOPNOTSUPP; 938 + 939 + return vlan_macsec_offload(ops->mdo_add_txsa, ctx); 940 + } 941 + 942 + static int vlan_macsec_upd_txsa(struct macsec_context *ctx) 943 + { 944 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 945 + 946 + if (!ops) 947 + return -EOPNOTSUPP; 948 + 949 + return vlan_macsec_offload(ops->mdo_upd_txsa, ctx); 950 + } 951 + 952 + static int vlan_macsec_del_txsa(struct macsec_context *ctx) 953 + { 954 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 955 + 956 + if (!ops) 957 + return -EOPNOTSUPP; 958 + 959 + return vlan_macsec_offload(ops->mdo_del_txsa, ctx); 960 + } 961 + 962 + static int vlan_macsec_get_dev_stats(struct macsec_context *ctx) 963 + { 964 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 965 + 966 + if (!ops) 967 + return -EOPNOTSUPP; 968 + 969 + return vlan_macsec_offload(ops->mdo_get_dev_stats, ctx); 970 + } 971 + 972 + static int vlan_macsec_get_tx_sc_stats(struct macsec_context *ctx) 973 + { 974 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 975 + 976 + if (!ops) 977 + return -EOPNOTSUPP; 978 + 979 + return vlan_macsec_offload(ops->mdo_get_tx_sc_stats, ctx); 980 + } 981 + 982 + static int vlan_macsec_get_tx_sa_stats(struct macsec_context *ctx) 983 + { 984 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 985 + 986 + if (!ops) 987 + return -EOPNOTSUPP; 988 + 989 + return vlan_macsec_offload(ops->mdo_get_tx_sa_stats, ctx); 990 + } 991 + 992 + static int vlan_macsec_get_rx_sc_stats(struct macsec_context *ctx) 993 + { 994 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 995 + 996 + if (!ops) 997 + return -EOPNOTSUPP; 998 + 999 + return vlan_macsec_offload(ops->mdo_get_rx_sc_stats, ctx); 1000 + } 1001 + 1002 + static int vlan_macsec_get_rx_sa_stats(struct macsec_context *ctx) 1003 + { 1004 + const struct macsec_ops *ops = vlan_get_macsec_ops(ctx); 1005 + 1006 + if (!ops) 1007 + return -EOPNOTSUPP; 1008 + 1009 + return vlan_macsec_offload(ops->mdo_get_rx_sa_stats, ctx); 1010 + } 1011 + 1012 + static const struct macsec_ops macsec_offload_ops = { 1013 + /* Device wide */ 1014 + .mdo_dev_open = vlan_macsec_dev_open, 1015 + .mdo_dev_stop = vlan_macsec_dev_stop, 1016 + /* SecY */ 1017 + .mdo_add_secy = vlan_macsec_add_secy, 1018 + .mdo_upd_secy = vlan_macsec_upd_secy, 1019 + .mdo_del_secy = vlan_macsec_del_secy, 1020 + /* Security channels */ 1021 + .mdo_add_rxsc = vlan_macsec_add_rxsc, 1022 + .mdo_upd_rxsc = vlan_macsec_upd_rxsc, 1023 + .mdo_del_rxsc = vlan_macsec_del_rxsc, 1024 + /* Security associations */ 1025 + .mdo_add_rxsa = vlan_macsec_add_rxsa, 1026 + .mdo_upd_rxsa = vlan_macsec_upd_rxsa, 1027 + .mdo_del_rxsa = vlan_macsec_del_rxsa, 1028 + .mdo_add_txsa = vlan_macsec_add_txsa, 1029 + .mdo_upd_txsa = vlan_macsec_upd_txsa, 1030 + .mdo_del_txsa = vlan_macsec_del_txsa, 1031 + /* Statistics */ 1032 + .mdo_get_dev_stats = vlan_macsec_get_dev_stats, 1033 + .mdo_get_tx_sc_stats = vlan_macsec_get_tx_sc_stats, 1034 + .mdo_get_tx_sa_stats = vlan_macsec_get_tx_sa_stats, 1035 + .mdo_get_rx_sc_stats = vlan_macsec_get_rx_sc_stats, 1036 + .mdo_get_rx_sa_stats = vlan_macsec_get_rx_sa_stats, 1037 + }; 1038 + 1039 + #endif 1040 + 810 1041 static const struct ethtool_ops vlan_ethtool_ops = { 811 1042 .get_link_ksettings = vlan_ethtool_get_link_ksettings, 812 1043 .get_drvinfo = vlan_ethtool_get_drvinfo, ··· 1108 869 dev->priv_destructor = vlan_dev_free; 1109 870 dev->ethtool_ops = &vlan_ethtool_ops; 1110 871 872 + #if IS_ENABLED(CONFIG_MACSEC) 873 + dev->macsec_ops = &macsec_offload_ops; 874 + #endif 1111 875 dev->min_mtu = 0; 1112 876 dev->max_mtu = ETH_MAX_MTU; 1113 877