nvethernet: macsec:DT param enables VLAN in clear

Issue: No config option to place the vlan tag before or after sectag

Fix: Add a DT param to decide the position of VLAN tag respective to
sectag

Bug 4134079

Change-Id: I1b5d674ea289e905cad6ae6cc9c7c0bb7fef004d
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3231494
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Sanath Kumar Gampa
2023-06-07 07:28:10 +00:00
committed by Jon Hunter
parent 48a651f8b4
commit 5e947589fe
2 changed files with 16 additions and 0 deletions

View File

@@ -590,6 +590,7 @@ static int macsec_dis_rx_sa(struct sk_buff *skb, struct genl_info *info)
rx_sa.curr_an, rx_sa.next_pn);
dev_info(dev, "\tkey: " KEYSTR, KEY2STR(rx_sa.sak));
rx_sa.vlan_in_clear = macsec_pdata->vlan_in_clear;
mutex_lock(&macsec_pdata->lock);
ret = osi_macsec_config(pdata->osi_core, &rx_sa, OSI_DISABLE,
OSI_CTLR_SEL_RX, &kt_idx);
@@ -696,6 +697,7 @@ static int macsec_create_rx_sa(struct sk_buff *skb, struct genl_info *info)
}
rx_sa.pn_window = macsec_pdata->pn_window;
rx_sa.vlan_in_clear = macsec_pdata->vlan_in_clear;
dev_info(dev, "%s:\n"
"\tsci: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n"
"\tan: %u\n"
@@ -788,6 +790,7 @@ static int macsec_en_rx_sa(struct sk_buff *skb, struct genl_info *info)
}
rx_sa.pn_window = macsec_pdata->pn_window;
rx_sa.vlan_in_clear = macsec_pdata->vlan_in_clear;
rx_sa.flags = OSI_ENABLE_SA;
mutex_lock(&macsec_pdata->lock);
ret = osi_macsec_config(pdata->osi_core, &rx_sa, OSI_ENABLE,
@@ -854,6 +857,7 @@ static int macsec_dis_tx_sa(struct sk_buff *skb, struct genl_info *info)
tx_sa.curr_an, tx_sa.next_pn);
dev_info(dev, "\tkey: " KEYSTR, KEY2STR(tx_sa.sak));
tx_sa.vlan_in_clear = macsec_pdata->vlan_in_clear;
mutex_lock(&macsec_pdata->lock);
ret = osi_macsec_config(pdata->osi_core, &tx_sa, OSI_DISABLE,
OSI_CTLR_SEL_TX, &kt_idx);
@@ -927,6 +931,7 @@ static int macsec_create_tx_sa(struct sk_buff *skb, struct genl_info *info)
}
tx_sa.pn_window = macsec_pdata->pn_window;
tx_sa.vlan_in_clear = macsec_pdata->vlan_in_clear;
dev_info(dev, "%s:\n"
"\tsci: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n"
"\tan: %u\n"
@@ -1018,6 +1023,7 @@ static int macsec_en_tx_sa(struct sk_buff *skb, struct genl_info *info)
tx_sa.pn_window = macsec_pdata->pn_window;
tx_sa.flags = OSI_ENABLE_SA;
tx_sa.vlan_in_clear = macsec_pdata->vlan_in_clear;
mutex_lock(&macsec_pdata->lock);
ret = osi_macsec_config(pdata->osi_core, &tx_sa, OSI_ENABLE,
OSI_CTLR_SEL_TX, &kt_idx);
@@ -1401,6 +1407,14 @@ int macsec_probe(struct ether_priv_data *pdata)
goto init_err;
}
ret = of_property_read_u32(np, "nvidia,macsec_vlan_in_clear",
&macsec_pdata->vlan_in_clear);
if (ret != 0) {
dev_info(dev,
"DT info about vlan in clear is missing setting default-disabled\n");
macsec_pdata->vlan_in_clear = OSI_DISABLE;
}
mutex_init(&pdata->macsec_pdata->lock);
/* Read MAC instance id and used in TZ api's */