Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion aq_dash.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,12 @@ static int doit_dash_cfg_fwreq(struct sk_buff *skb, struct genl_info *info)
RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7, 2)
static int aq_dash_pre_doit(struct genl_ops *ops, struct sk_buff *skb,
struct genl_info *info)
#else
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int aq_dash_pre_doit(const struct genl_ops *ops, struct sk_buff *skb,
struct genl_info *info)
#else
static int aq_dash_pre_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
struct genl_info *info)
#endif
{
printk(KERN_INFO "Inside %s function\n", __func__);
Expand Down
46 changes: 38 additions & 8 deletions aq_macsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,10 @@ static int aq_mdo_dev_open(struct macsec_context *ctx)
struct aq_nic_s *nic = netdev_priv(ctx->netdev);
int ret = 0;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

if (netif_carrier_ok(nic->ndev))
ret = aq_apply_secy_cfg(nic, ctx->secy);
Expand All @@ -307,8 +309,10 @@ static int aq_mdo_dev_stop(struct macsec_context *ctx)
struct aq_nic_s *nic = netdev_priv(ctx->netdev);
int i;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

for (i = 0; i < AQ_MACSEC_MAX_SC; i++) {
if (nic->macsec_cfg->txsc_idx_busy & BIT(i))
Expand Down Expand Up @@ -469,8 +473,10 @@ static int aq_mdo_add_secy(struct macsec_context *ctx)
if (txsc_idx == AQ_MACSEC_MAX_SC)
return -ENOSPC;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

cfg->sc_sa = sc_sa;
cfg->aq_txsc[txsc_idx].hw_sc_idx = aq_to_hw_sc_idx(txsc_idx, sc_sa);
Expand All @@ -495,8 +501,7 @@ static int aq_mdo_upd_secy(struct macsec_context *ctx)
if (txsc_idx < 0)
return -ENOENT;

if (ctx->prepare)
return 0;


if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev))
ret = aq_set_txsc(nic, txsc_idx);
Expand Down Expand Up @@ -546,8 +551,10 @@ static int aq_mdo_del_secy(struct macsec_context *ctx)
struct aq_nic_s *nic = netdev_priv(ctx->netdev);
int ret = 0;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

if (!nic->macsec_cfg)
return 0;
Expand Down Expand Up @@ -608,8 +615,10 @@ static int aq_mdo_add_txsa(struct macsec_context *ctx)
if (txsc_idx < 0)
return -EINVAL;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

aq_txsc = &cfg->aq_txsc[txsc_idx];
set_bit(ctx->sa.assoc_num, &aq_txsc->tx_sa_idx_busy);
Expand Down Expand Up @@ -638,8 +647,10 @@ static int aq_mdo_upd_txsa(struct macsec_context *ctx)
if (txsc_idx < 0)
return -EINVAL;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

aq_txsc = &cfg->aq_txsc[txsc_idx];
if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev))
Expand Down Expand Up @@ -688,8 +699,10 @@ static int aq_mdo_del_txsa(struct macsec_context *ctx)
if (txsc_idx < 0)
return -EINVAL;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

ret = aq_clear_txsa(nic, &cfg->aq_txsc[txsc_idx], ctx->sa.assoc_num,
AQ_CLEAR_ALL);
Expand Down Expand Up @@ -787,8 +800,10 @@ static int aq_mdo_add_rxsc(struct macsec_context *ctx)
if (rxsc_idx >= rxsc_idx_max)
return -ENOSPC;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

cfg->aq_rxsc[rxsc_idx].hw_sc_idx = aq_to_hw_sc_idx(rxsc_idx,
cfg->sc_sa);
Expand Down Expand Up @@ -816,8 +831,10 @@ static int aq_mdo_upd_rxsc(struct macsec_context *ctx)
if (rxsc_idx < 0)
return -ENOENT;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

if (netif_carrier_ok(nic->ndev) && netif_running(ctx->secy->netdev))
ret = aq_set_rxsc(nic, rxsc_idx);
Expand Down Expand Up @@ -883,8 +900,10 @@ static int aq_mdo_del_rxsc(struct macsec_context *ctx)
if (rxsc_idx < 0)
return -ENOENT;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

if (netif_carrier_ok(nic->ndev))
clear_type = AQ_CLEAR_ALL;
Expand Down Expand Up @@ -959,8 +978,10 @@ static int aq_mdo_add_rxsa(struct macsec_context *ctx)
if (rxsc_idx < 0)
return -EINVAL;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

aq_rxsc = &nic->macsec_cfg->aq_rxsc[rxsc_idx];
set_bit(ctx->sa.assoc_num, &aq_rxsc->rx_sa_idx_busy);
Expand Down Expand Up @@ -989,8 +1010,10 @@ static int aq_mdo_upd_rxsa(struct macsec_context *ctx)
if (rxsc_idx < 0)
return -EINVAL;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

if (netif_carrier_ok(nic->ndev) && netif_running(secy->netdev))
ret = aq_update_rxsa(nic, cfg->aq_rxsc[rxsc_idx].hw_sc_idx,
Expand Down Expand Up @@ -1040,8 +1063,10 @@ static int aq_mdo_del_rxsa(struct macsec_context *ctx)
if (rxsc_idx < 0)
return -EINVAL;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

ret = aq_clear_rxsa(nic, &cfg->aq_rxsc[rxsc_idx], ctx->sa.assoc_num,
AQ_CLEAR_ALL);
Expand All @@ -1055,8 +1080,7 @@ static int aq_mdo_get_dev_stats(struct macsec_context *ctx)
struct aq_macsec_common_stats *stats = &nic->macsec_cfg->stats;
struct aq_hw_s *hw = nic->aq_hw;

if (ctx->prepare)
return 0;


aq_get_macsec_common_stats(hw, stats);

Expand Down Expand Up @@ -1084,9 +1108,10 @@ static int aq_mdo_get_tx_sc_stats(struct macsec_context *ctx)
if (txsc_idx < 0)
return -ENOENT;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;

#endif
aq_txsc = &nic->macsec_cfg->aq_txsc[txsc_idx];
stats = &aq_txsc->stats;
aq_get_txsc_stats(hw, aq_txsc->hw_sc_idx, stats);
Expand Down Expand Up @@ -1117,9 +1142,10 @@ static int aq_mdo_get_tx_sa_stats(struct macsec_context *ctx)
if (txsc_idx < 0)
return -EINVAL;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;

#endif
aq_txsc = &cfg->aq_txsc[txsc_idx];
sa_idx = aq_txsc->hw_sc_idx | ctx->sa.assoc_num;
stats = &aq_txsc->tx_sa_stats[ctx->sa.assoc_num];
Expand Down Expand Up @@ -1157,10 +1183,10 @@ static int aq_mdo_get_rx_sc_stats(struct macsec_context *ctx)
rxsc_idx = aq_get_rxsc_idx_from_rxsc(cfg, ctx->rx_sc);
if (rxsc_idx < 0)
return -ENOENT;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;

#endif
aq_rxsc = &cfg->aq_rxsc[rxsc_idx];
for (i = 0; i < MACSEC_NUM_AN; i++) {
if (!test_bit(i, &aq_rxsc->rx_sa_idx_busy))
Expand Down Expand Up @@ -1207,8 +1233,10 @@ static int aq_mdo_get_rx_sa_stats(struct macsec_context *ctx)
if (rxsc_idx < 0)
return -EINVAL;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
if (ctx->prepare)
return 0;
#endif

aq_rxsc = &cfg->aq_rxsc[rxsc_idx];
stats = &aq_rxsc->rx_sa_stats[ctx->sa.assoc_num];
Expand Down Expand Up @@ -1452,7 +1480,9 @@ static void aq_check_txsa_expiration(struct aq_nic_s *nic)
}

tx_sa = rcu_dereference_bh(secy->tx_sc.sa[an]);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
macsec_pn_wrapped((struct macsec_secy *)secy, tx_sa);
#endif
}
}

Expand Down
5 changes: 5 additions & 0 deletions aq_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2127,8 +2127,13 @@ int aq_ptp_init(struct aq_nic_s *aq_nic, unsigned int idx_ptp_vec, unsigned int
atomic_set(&aq_ptp->offset_egress, 0);
atomic_set(&aq_ptp->offset_ingress, 0);

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
netif_napi_add(aq_nic_get_ndev(aq_nic), &aq_ptp->napi,
aq_ptp_poll, AQ_CFG_NAPI_WEIGHT);
#else
netif_napi_add(aq_nic_get_ndev(aq_nic), &aq_ptp->napi,
aq_ptp_poll);
#endif

aq_ptp->idx_ptp_vector = idx_ptp_vec;
aq_ptp->idx_gpio_vector = idx_ext_vec;
Expand Down
7 changes: 5 additions & 2 deletions aq_vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,13 @@ struct aq_vec_s *aq_vec_alloc(struct aq_nic_s *aq_nic, unsigned int idx,

cpumask_set_cpu(self->aq_ring_param.cpu,
&self->aq_ring_param.affinity_mask);

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
netif_napi_add(aq_nic_get_ndev(aq_nic), &self->napi,
aq_vec_poll, AQ_CFG_NAPI_WEIGHT);

#else
netif_napi_add(aq_nic_get_ndev(aq_nic), &self->napi,
aq_vec_poll);
#endif
err_exit:
return self;
}
Expand Down