On Mon, Jun 7, 2021 at 11:37 PM Nithin Dabilpuram
<ndabilpu...@marvell.com> wrote:
>
> From: Sunil Kumar Kori <sk...@marvell.com>
>
> Patch implements set and get operations for flow control.
>
> Signed-off-by: Sunil Kumar Kori <sk...@marvell.com>
> ---

> +
> +       /* Check if TX pause frame is already enabled or not */
> +       if (fc->tx_pause ^ tx_pause) {
> +               if (roc_model_is_cn96_Ax() && data->dev_started) {
> +                       /* On Ax, CQ should be in disabled state
> +                        * while setting flow control configuration.
> +                        */
> +                       plt_info("Stop the port=%d for setting flow control",
> +                                data->port_id);
> +                       return 0;
> +               }
> +
> +               for (i = 0; i < data->nb_rx_queues; i++) {

>From here:

> +                       memset(&fc_cfg, 0, sizeof(struct roc_nix_fc_cfg));
> +                       rxq = ((struct cnxk_eth_rxq_sp *)
> +                               data->rx_queues[i]) - 1;
> +                       cq = &dev->cqs[rxq->qid];
> +                       fc_cfg.cq_cfg_valid = true;
> +                       fc_cfg.cq_cfg.enable = tx_pause;
> +                       fc_cfg.cq_cfg.rq = rxq->qid;
> +                       fc_cfg.cq_cfg.cq_drop = cq->drop_thresh;
> +                       rc = roc_nix_fc_config_set(nix, &fc_cfg);
> +                       if (rc)
> +                               return rc;

Better to move this separate static function.

> +               }
> +       }
> +
> +       rc = roc_nix_fc_mode_set(nix, mode_map[fc_conf->mode]);
> +       if (rc)
> +               return rc;
> +
> +       fc->rx_pause = rx_pause;
> +       fc->tx_pause = tx_pause;
> +       fc->mode = fc_conf->mode;
> +
> +       return rc;
> +}
> +
> +int
>  cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr 
> *addr)
>  {
>         struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
> --
> 2.8.4
>

Reply via email to