From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 08D9F4324D; Tue, 31 Oct 2023 09:21:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 364CB4064C; Tue, 31 Oct 2023 09:21:37 +0100 (CET) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) by mails.dpdk.org (Postfix) with ESMTP id 077A540282; Tue, 31 Oct 2023 09:21:36 +0100 (CET) Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-41cbd1d7e04so35663081cf.1; Tue, 31 Oct 2023 01:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698740495; x=1699345295; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Uocy0wqfZdYOUDGvR4lu4WgMGHjGk/BjNQloG8FGDSI=; b=XlRjtxZWeSmw9kexcMwUoU7FxuvN4lE9GYQDXzaX5ETv4OcnUy4eyQ6qQvdSDOlqYL SJ8TrTUQXHjLzSb9EqyVfeRxZWEms/9JgWr/C7CMG001D47bVPTEZOLEixdOFdQwciDW OsC7ti2g815e3fFLMuRTHD7oiuwCTYAOINMJlazHAhzHP5eOVuQbmwOrNAqiokbjCoS8 +XSxhljjCQ2aSOYZVEaPlmQljFhPlhadhjy2+6YdABtUbS7g9BNd56ppgz7XaGatEwHs 2oL+fZ75qq+iy4a0fZHa73ao4HyhdIcKQ5uhfwmMQv9CWOeNdcgTUxGAiD0qKB6+P2h3 U34A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698740495; x=1699345295; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Uocy0wqfZdYOUDGvR4lu4WgMGHjGk/BjNQloG8FGDSI=; b=B+Y0YKsyYUPq1HfrCXsmvcpKoyCjg/koPDsYYQQmUMVf7Eemt13Eq+8/+NFH2knub8 Kx2YitMLBGbUFaczwqssQVfEDx37ohH2WdYbehsM6Uo40IhOWsPwZYUa8gAuxJkAzO3D 75z3euSvzfKoGNWwOlILsPPDGF1zfTz7S0FV9jKgVdxt8hpvtBBi59CBmgrUUNtuusCO fv957hHbvShDVCIIhd4Xj791vkXNaGMl5rlKqGs3IC/nHFwckIZJvNCB7aoCrYVb7d+X TDe4IzfefZ0T5MqHAmyOq70s/r0fgL34/umjPUrYrPpyUeVM2PZgTPGc1iMk1wjha//N V2/g== X-Gm-Message-State: AOJu0YzEVW/ex0LJIipBrlgdVv4dGOgW8bIySwuKOh5pfcw2S3UyTxMv KfGLeUFT/xm2WyPebNlTHACeS+NtvRB1f6NFuVw= X-Google-Smtp-Source: AGHT+IEDuPVJIMq8wWw+61S52BmSmvGtk8y7j3Mxa3pCHgPJnlQs+2c87WMm1LVZ1CnvF4D74MpI5QRcuyokGyHn/EM= X-Received: by 2002:a05:622a:5c9:b0:418:1179:9195 with SMTP id d9-20020a05622a05c900b0041811799195mr13728280qtb.66.1698740495352; Tue, 31 Oct 2023 01:21:35 -0700 (PDT) MIME-Version: 1.0 References: <20230607210050.107944-1-abdullah.sevincer@intel.com> <20231030211244.2516043-1-abdullah.sevincer@intel.com> In-Reply-To: <20231030211244.2516043-1-abdullah.sevincer@intel.com> From: Jerin Jacob Date: Tue, 31 Oct 2023 13:51:09 +0530 Message-ID: Subject: Re: [PATCH v3] event/dlb2: fix disable PASID for kernel 6.2 To: Abdullah Sevincer Cc: dev@dpdk.org, jerinj@marvell.com, mike.ximing.chen@intel.com, bruce.richardson@intel.com, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Oct 31, 2023 at 4:12=E2=80=AFAM Abdullah Sevincer wrote: > > vfio-pci driver in Linux kernel 6.2 enables PASID by default. > In DLB hardware, enabling PASID puts DLB in SIOV mode. This > breaks DLB PF-PMD mode. For DLB PF-PMD mode to function properly > PASID needs to be disabled for kernel 6.2. > > In this commit this issue is addressed and PASID is disabled > by writing a zero to PASID control register. > > Fixes: 5433956d5185 ("event/dlb2: add eventdev probe") > Cc: stable@dpdk.org > > Signed-off-by: Abdullah Sevincer > --- > drivers/event/dlb2/pf/dlb2_main.c | 27 +++++++++++++++++++++++++++ > lib/pci/rte_pci.h | 5 +++++ > 2 files changed, 32 insertions(+) > > diff --git a/drivers/event/dlb2/pf/dlb2_main.c b/drivers/event/dlb2/pf/dl= b2_main.c > index aa03e4c311..34e47a4e33 100644 > --- a/drivers/event/dlb2/pf/dlb2_main.c > +++ b/drivers/event/dlb2/pf/dlb2_main.c > @@ -190,6 +190,7 @@ dlb2_pf_reset(struct dlb2_dev *dlb2_dev) > uint16_t rt_ctl_word; > uint32_t pri_reqs_dword; > uint16_t pri_ctrl_word; > + uint16_t pasid_ctrl; > > off_t pcie_cap_offset; > int pri_cap_offset; > @@ -197,6 +198,7 @@ dlb2_pf_reset(struct dlb2_dev *dlb2_dev) > int err_cap_offset; > int acs_cap_offset; > int wait_count; > + int pasid_cap_offset; > > uint16_t devsta_busy_word; > uint16_t devctl_word; > @@ -514,6 +516,31 @@ dlb2_pf_reset(struct dlb2_dev *dlb2_dev) > } > } > > + /* TODO - The current Linux kernel 6.2 vfio driver does not expos= e PASID capability to > + * users. It also enables PASID by default, which breaks DLB PF P= MD. We have > + * to use the hardcoded offset for now to disable PASID. It may b= e different for > + * other device drivers since they may have different design. Whe= n PASID capability > + * is exposed to users, please revise this part and add api to di= sable PASID through > + * pci common code. > + */ > + pasid_cap_offset =3D RTE_PCI_PASID_CAP_OFFSET; > + > + off =3D pasid_cap_offset + RTE_PCI_PASID_CTRL; > + if (rte_pci_read_config(pdev, &pasid_ctrl, 2, off) !=3D 2) > + pasid_ctrl =3D 0; > + > + if (pasid_ctrl) { > + DLB2_INFO(dlb2_dev, "DLB2 disabling pasid...\n"); > + > + pasid_ctrl =3D 0; > + ret =3D rte_pci_write_config(pdev, &pasid_ctrl, 2, off); > + if (ret !=3D 2) { > + DLB2_LOG_ERR("[%s()] failed to write the pcie con= fig space at offset %d\n", > + __func__, (int)off); > + return ret; > + } > + } > + > return 0; > } This patch can be splited as two, 1) Generic PCIe function to enable/disable PASID 2) Call generic function to disable PASID in drivers/event/dlb2/. Also mention which Linux kernel commit is introducing this issue in the git commit log.