lkml.org 
[lkml]   [2022]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] octeontx2-pf: Add egress PFC support
> -int otx2_txschq_config(struct otx2_nic *pfvf, int lvl)
> +int otx2_txschq_config(struct otx2_nic *pfvf, int lvl, int prio, bool txschq_for_pfc)
> {
> struct otx2_hw *hw = &pfvf->hw;
> struct nix_txschq_config *req;
> @@ -602,7 +602,13 @@ int otx2_txschq_config(struct otx2_nic *pfvf, int lvl)
> req->lvl = lvl;
> req->num_regs = 1;
>
> - schq = hw->txschq_list[lvl][0];
> +#ifdef CONFIG_DCB
> + if (txschq_for_pfc)
> + schq = pfvf->pfc_schq_list[lvl][prio];
> + else
> +#endif

Please could you try to remove as many of these #ifdef CONFIG_DCB as
possible. It makes build testing less efficient at finding build
problems. Can you do:

> + if (IS_ENABLED(CONFIG_DCB) && txschq_for_pfc)
> + schq = pfvf->pfc_schq_list[lvl][prio];

> +#ifdef CONFIG_DCB
> +int otx2_pfc_txschq_config(struct otx2_nic *pfvf)
> +{
> + u8 pfc_en, pfc_bit_set;
> + int prio, lvl, err;
> +
> + pfc_en = pfvf->pfc_en;
> + for (prio = 0; prio < NIX_PF_PFC_PRIO_MAX; prio++) {
> + pfc_bit_set = pfc_en & (1 << prio);
> +

Maybe put all of this into a file of its own, and provide stubs for
when it is not enabled?

Andrew

\
 
 \ /
  Last update: 2022-08-23 19:52    [W:0.068 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site