mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-23 17:55:05 +03:00
nvethernet: macsec API cleanup
Cleanup of OSI macsec APIs, hence made relevant changes to OSD Bug 3709820 Change-Id: I33a77f31553d213e565a7f4ad346fe3c026fafde Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2738231 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Mahesh Patil <maheshp@nvidia.com> Reviewed-by: Bhadram Varka <vbhadram@nvidia.com> Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Revanth Kumar Uppala
parent
6104d5e348
commit
47185d2fc3
@@ -22,7 +22,7 @@ ccflags-y += -DLINUX_IVC -DUPDATED_PAD_CAL \
|
|||||||
-I$(srctree.nvidia)/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include \
|
-I$(srctree.nvidia)/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include \
|
||||||
-I$(srctree.nvidia)/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/common/include
|
-I$(srctree.nvidia)/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/common/include
|
||||||
|
|
||||||
ccflags-y += -DMACSEC_SUPPORT -DNET30 -DMACSEC_DEBUG -DOSI_DEBUG -DHSI_SUPPORT -DLINUX_OS
|
ccflags-y += -DMACSEC_SUPPORT -DNET30 -DDEBUG_MACSEC -DOSI_DEBUG -DHSI_SUPPORT -DLINUX_OS
|
||||||
|
|
||||||
nvethernet-objs:= ether_linux.o \
|
nvethernet-objs:= ether_linux.o \
|
||||||
osd.o \
|
osd.o \
|
||||||
|
|||||||
@@ -2983,15 +2983,6 @@ static int ether_close(struct net_device *ndev)
|
|||||||
if (pdata->osi_core->mac == OSI_MAC_HW_MGBE)
|
if (pdata->osi_core->mac == OSI_MAC_HW_MGBE)
|
||||||
pm_runtime_put_sync(pdata->dev);
|
pm_runtime_put_sync(pdata->dev);
|
||||||
|
|
||||||
#ifdef MACSEC_SUPPORT
|
|
||||||
#ifdef DEBUG_MACSEC
|
|
||||||
ret = macsec_close(pdata->macsec_pdata);
|
|
||||||
if (ret < 0) {
|
|
||||||
dev_err(pdata->dev, "Failed to close macsec");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif /* MACSEC_SUPPORT */
|
|
||||||
|
|
||||||
/* Reset stats since interface is going down */
|
/* Reset stats since interface is going down */
|
||||||
ether_reset_stats(pdata);
|
ether_reset_stats(pdata);
|
||||||
|
|
||||||
@@ -4023,12 +4014,6 @@ static int ether_change_mtu(struct net_device *ndev, int new_mtu)
|
|||||||
/* Macsec is supported, reduce MTU */
|
/* Macsec is supported, reduce MTU */
|
||||||
if ((osi_core->mac == OSI_MAC_HW_EQOS && osi_core->mac_ver == OSI_EQOS_MAC_5_30) ||
|
if ((osi_core->mac == OSI_MAC_HW_EQOS && osi_core->mac_ver == OSI_EQOS_MAC_5_30) ||
|
||||||
(osi_core->mac == OSI_MAC_HW_MGBE && osi_core->mac_ver == OSI_MGBE_MAC_3_10)) {
|
(osi_core->mac == OSI_MAC_HW_MGBE && osi_core->mac_ver == OSI_MGBE_MAC_3_10)) {
|
||||||
ret = osi_macsec_update_mtu(osi_core, new_mtu);
|
|
||||||
if (ret < 0) {
|
|
||||||
dev_err(pdata->dev, "Failed to set MACSEC MTU to %d\n",
|
|
||||||
new_mtu);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
ndev->mtu -= MACSEC_TAG_ICV_LEN;
|
ndev->mtu -= MACSEC_TAG_ICV_LEN;
|
||||||
netdev_info(pdata->ndev, "Macsec: Reduced MTU: %d Max: %d\n",
|
netdev_info(pdata->ndev, "Macsec: Reduced MTU: %d Max: %d\n",
|
||||||
ndev->mtu, ndev->max_mtu);
|
ndev->mtu, ndev->max_mtu);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ static irqreturn_t macsec_s_isr(int irq, void *data)
|
|||||||
struct macsec_priv_data *macsec_pdata = (struct macsec_priv_data *)data;
|
struct macsec_priv_data *macsec_pdata = (struct macsec_priv_data *)data;
|
||||||
struct ether_priv_data *pdata = macsec_pdata->ether_pdata;
|
struct ether_priv_data *pdata = macsec_pdata->ether_pdata;
|
||||||
|
|
||||||
osi_macsec_s_isr(pdata->osi_core);
|
osi_macsec_isr(pdata->osi_core);
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ static irqreturn_t macsec_ns_isr(int irq, void *data)
|
|||||||
struct ether_priv_data *pdata = macsec_pdata->ether_pdata;
|
struct ether_priv_data *pdata = macsec_pdata->ether_pdata;
|
||||||
int irq_ret = IRQ_HANDLED;
|
int irq_ret = IRQ_HANDLED;
|
||||||
|
|
||||||
osi_macsec_ns_isr(pdata->osi_core);
|
osi_macsec_isr(pdata->osi_core);
|
||||||
|
|
||||||
#ifdef HSI_SUPPORT
|
#ifdef HSI_SUPPORT
|
||||||
if (pdata->osi_core->hsi.enabled == OSI_ENABLE &&
|
if (pdata->osi_core->hsi.enabled == OSI_ENABLE &&
|
||||||
|
|||||||
@@ -238,13 +238,13 @@ int macsec_close(struct macsec_priv_data *macsec_pdata);
|
|||||||
int macsec_suspend(struct macsec_priv_data *macsec_pdata);
|
int macsec_suspend(struct macsec_priv_data *macsec_pdata);
|
||||||
int macsec_resume(struct macsec_priv_data *macsec_pdata);
|
int macsec_resume(struct macsec_priv_data *macsec_pdata);
|
||||||
|
|
||||||
#ifdef MACSEC_DEBUG
|
#ifdef DEBUG_MACSEC
|
||||||
#define PRINT_ENTRY() (printk(KERN_DEBUG "-->%s()\n", __func__))
|
#define PRINT_ENTRY() (printk(KERN_DEBUG "-->%s()\n", __func__))
|
||||||
#define PRINT_EXIT() (printk(KERN_DEBUG "<--%s()\n", __func__))
|
#define PRINT_EXIT() (printk(KERN_DEBUG "<--%s()\n", __func__))
|
||||||
#else
|
#else
|
||||||
#define PRINT_ENTRY()
|
#define PRINT_ENTRY()
|
||||||
#define PRINT_EXIT()
|
#define PRINT_EXIT()
|
||||||
#endif /* MACSEC_DEBUG */
|
#endif /* DEBUG_MACSEC */
|
||||||
|
|
||||||
#endif /* INCLUDED_MACSEC_H */
|
#endif /* INCLUDED_MACSEC_H */
|
||||||
|
|
||||||
|
|||||||
@@ -337,6 +337,7 @@ static DEVICE_ATTR(macsec_cipher, (S_IRUGO | S_IWUSR),
|
|||||||
macsec_cipher_show,
|
macsec_cipher_show,
|
||||||
macsec_cipher_store);
|
macsec_cipher_store);
|
||||||
|
|
||||||
|
#ifdef DEBUG_MACSEC
|
||||||
/**
|
/**
|
||||||
* @brief Shows the current setting of MACsec loopback
|
* @brief Shows the current setting of MACsec loopback
|
||||||
*
|
*
|
||||||
@@ -421,6 +422,7 @@ static ssize_t macsec_loopback_store(struct device *dev,
|
|||||||
static DEVICE_ATTR(macsec_loopback, (S_IRUGO | S_IWUSR),
|
static DEVICE_ATTR(macsec_loopback, (S_IRUGO | S_IWUSR),
|
||||||
macsec_loopback_show,
|
macsec_loopback_show,
|
||||||
macsec_loopback_store);
|
macsec_loopback_store);
|
||||||
|
#endif /* DEBUG_MACSEC */
|
||||||
|
|
||||||
#ifdef HSI_SUPPORT
|
#ifdef HSI_SUPPORT
|
||||||
/**
|
/**
|
||||||
@@ -1002,7 +1004,7 @@ static DEVICE_ATTR(macsec_mmc_counters, (S_IRUGO | S_IWUSR),
|
|||||||
macsec_mmc_counters_show,
|
macsec_mmc_counters_show,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
#ifdef DEBUG_MACSEC
|
||||||
static void dump_dbg_buffers(char **buf_p, unsigned short ctlr_sel,
|
static void dump_dbg_buffers(char **buf_p, unsigned short ctlr_sel,
|
||||||
struct osi_core_priv_data *osi_core)
|
struct osi_core_priv_data *osi_core)
|
||||||
{
|
{
|
||||||
@@ -1153,6 +1155,7 @@ exit:
|
|||||||
static DEVICE_ATTR(macsec_dbg_events, (S_IRUGO | S_IWUSR),
|
static DEVICE_ATTR(macsec_dbg_events, (S_IRUGO | S_IWUSR),
|
||||||
NULL,
|
NULL,
|
||||||
macsec_dbg_events_store);
|
macsec_dbg_events_store);
|
||||||
|
#endif /* DEBUG_MACSEC */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Shows the current SCI LUT configuration
|
* @brief Shows the current SCI LUT configuration
|
||||||
@@ -2626,11 +2629,13 @@ static struct attribute *ether_sysfs_attrs[] = {
|
|||||||
&dev_attr_macsec_sa_state_lut.attr,
|
&dev_attr_macsec_sa_state_lut.attr,
|
||||||
&dev_attr_macsec_sc_param_lut.attr,
|
&dev_attr_macsec_sc_param_lut.attr,
|
||||||
&dev_attr_macsec_cipher.attr,
|
&dev_attr_macsec_cipher.attr,
|
||||||
&dev_attr_macsec_loopback.attr,
|
|
||||||
&dev_attr_macsec_enable.attr,
|
&dev_attr_macsec_enable.attr,
|
||||||
&dev_attr_macsec_mmc_counters.attr,
|
&dev_attr_macsec_mmc_counters.attr,
|
||||||
|
#ifdef DEBUG_MACSEC
|
||||||
|
&dev_attr_macsec_loopback.attr,
|
||||||
&dev_attr_macsec_dbg_buffers.attr,
|
&dev_attr_macsec_dbg_buffers.attr,
|
||||||
&dev_attr_macsec_dbg_events.attr,
|
&dev_attr_macsec_dbg_events.attr,
|
||||||
|
#endif /* DEBUG_MACSEC */
|
||||||
#endif /* MACSEC_SUPPORT */
|
#endif /* MACSEC_SUPPORT */
|
||||||
&dev_attr_uphy_gbe_mode.attr,
|
&dev_attr_uphy_gbe_mode.attr,
|
||||||
&dev_attr_phy_iface_mode.attr,
|
&dev_attr_phy_iface_mode.attr,
|
||||||
|
|||||||
Reference in New Issue
Block a user