#include "../nfpcore/nfp_cpp.h"
#include "../nfp_app.h"
+#include "../nfp_abi.h"
#include "../nfp_main.h"
#include "../nfp_net.h"
#include "main.h"
+int nfp_abm_ctrl_qm_enable(struct nfp_abm *abm)
+{
+ return nfp_mbox_cmd(abm->app->pf, NFP_MBOX_PCIE_ABM_ENABLE,
+ NULL, 0, NULL, 0);
+}
+
+int nfp_abm_ctrl_qm_disable(struct nfp_abm *abm)
+{
+ return nfp_mbox_cmd(abm->app->pf, NFP_MBOX_PCIE_ABM_DISABLE,
+ NULL, 0, NULL, 0);
+}
+
void nfp_abm_ctrl_read_params(struct nfp_abm_link *alink)
{
alink->queue_base = nn_readl(alink->vnic, NFP_NET_CFG_START_RXQ);
static int nfp_abm_eswitch_set_legacy(struct nfp_abm *abm)
{
nfp_abm_kill_reprs_all(abm);
+ nfp_abm_ctrl_qm_disable(abm);
abm->eswitch_mode = DEVLINK_ESWITCH_MODE_LEGACY;
return 0;
struct nfp_net *nn;
int err;
+ err = nfp_abm_ctrl_qm_enable(abm);
+ if (err)
+ return err;
+
list_for_each_entry(nn, &pf->vnics, vnic_list) {
struct nfp_abm_link *alink = nn->app_priv;
err_kill_all_reprs:
nfp_abm_kill_reprs_all(abm);
+ nfp_abm_ctrl_qm_disable(abm);
return err;
}
if (err)
goto err_free_abm;
+ /* We start in legacy mode, make sure advanced queuing is disabled */
+ err = nfp_abm_ctrl_qm_disable(abm);
+ if (err)
+ goto err_free_abm;
+
err = -ENOMEM;
reprs = nfp_reprs_alloc(pf->max_data_vnics);
if (!reprs)
void nfp_abm_ctrl_read_params(struct nfp_abm_link *alink);
int nfp_abm_ctrl_find_addrs(struct nfp_abm *abm);
+int nfp_abm_ctrl_qm_enable(struct nfp_abm *abm);
+int nfp_abm_ctrl_qm_disable(struct nfp_abm *abm);
#endif
* @NFP_MBOX_POOL_SET: set shared buffer pool info/config
* Input - struct nfp_shared_buf_pool_info_set
* Output - None
+ *
+ * @NFP_MBOX_PCIE_ABM_ENABLE: enable PCIe-side advanced buffer management
+ * Enable advanced buffer management of the PCIe block. If ABM is disabled
+ * PCIe block maintains a very short queue of buffers and does tail drop.
+ * ABM allows more advanced buffering and priority control.
+ * Input - None
+ * Output - None
+ *
+ * @NFP_MBOX_PCIE_ABM_DISABLE: disable PCIe-side advanced buffer management
+ * Input - None
+ * Output - None
*/
enum nfp_mbox_cmd {
NFP_MBOX_NO_CMD = 0x00,
NFP_MBOX_POOL_GET = 0x01,
NFP_MBOX_POOL_SET = 0x02,
+
+ NFP_MBOX_PCIE_ABM_ENABLE = 0x03,
+ NFP_MBOX_PCIE_ABM_DISABLE = 0x04,
};
#define NFP_SHARED_BUF_COUNT_SYM_NAME "_abi_nfd_pf%u_sb_cnt"