Nvethernet: changes to receive lpn in enable SA

Enhancement to receive lowest_pn from supplicant
as part of receive AN enable.
Also accept pn_window as 0 from supplicant

Bug 3371004

Change-Id: Ic9b90ea902b9f450fc29a397f93be5cca01e9e87
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2619948
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Sanath Kumar Gampa
2021-11-02 09:20:43 +05:30
committed by Revanth Kumar Uppala
parent 5a66fdbf00
commit a43d0166c5
2 changed files with 8 additions and 6 deletions

View File

@@ -599,6 +599,9 @@ static int parse_sa_config(struct nlattr **attrs, struct nlattr **tb_sa,
if (tb_sa[NV_MACSEC_SA_ATTR_PN]) {
sc_info->next_pn = nla_get_u32(tb_sa[NV_MACSEC_SA_ATTR_PN]);
}
if (tb_sa[NV_MACSEC_SA_ATTR_LOWEST_PN]) {
sc_info->lowest_pn = nla_get_u32(tb_sa[NV_MACSEC_SA_ATTR_LOWEST_PN]);
}
if (tb_sa[NV_MACSEC_SA_ATTR_KEY]) {
memcpy(sc_info->sak, nla_data(tb_sa[NV_MACSEC_SA_ATTR_KEY]),
sizeof(sc_info->sak));
@@ -731,11 +734,12 @@ static int macsec_en_rx_sa(struct sk_buff *skb, struct genl_info *info)
"\tsci: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n"
"\tan: %u\n"
"\tpn: %u\n"
"\tlowest pn: %u\n"
"\twindow: %u",
__func__,
rx_sa.sci[0], rx_sa.sci[1], rx_sa.sci[2], rx_sa.sci[3],
rx_sa.sci[4], rx_sa.sci[5], rx_sa.sci[6], rx_sa.sci[7],
rx_sa.curr_an, rx_sa.next_pn, rx_sa.pn_window);
rx_sa.curr_an, rx_sa.next_pn, rx_sa.lowest_pn, rx_sa.pn_window);
pr_err("\tkey: ");
for (i = 0; i < 16; i++) {
pr_cont(" %02x", rx_sa.sak[i]);
@@ -1124,11 +1128,7 @@ static int macsec_set_replay_prot(struct sk_buff *skb, struct genl_info *info)
goto exit;
}
if (window != 0) {
macsec_pdata->pn_window = window;
} else {
macsec_pdata->pn_window = OSI_PN_MAX_DEFAULT;
}
macsec_pdata->pn_window = window;
exit:
PRINT_EXIT();