[PATCH V4 1/4 resend] PCI: introduce helper functions for device flag operation

2014-09-08 Thread Ethan Zhao
This patch introduced three helper functions to hide direct device flag operation. void pci_set_dev_assigned(struct pci_dev *pdev); void pci_clear_dev_assigned(struct pci_dev *pdev); bool pci_is_dev_assigned(struct pci_dev *pdev); Signed-off-by: Ethan Zhao --- v2: simplify unnecessory ternary

[PATCH v4 0/4 resend] Introduce device assignment flag operation helper function

2014-09-08 Thread Ethan Zhao
: amend helper function naming. v4: fix incorrect type in return expression warning found by Fengguang Wu. Appreciate suggestion from alex.william...@redhat.com, david.vra...@citrix.com, alexander.h.du...@intel.com Resend for v3.18 building. Thanks, Ethan --- Ethan Zhao (4): PCI: introduce helper

[PATCH V4 2/4 resend] KVM: use pci device flag operation helper functions

2014-09-08 Thread Ethan Zhao
Use helper function instead of direct operation to pci device flag when set device to assigned or deassigned. Acked-by: Paolo Bonzini Signed-off-by: Ethan Zhao --- virt/kvm/assigned-dev.c |2 +- virt/kvm/iommu.c|4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff

[PATCH V4 3/4 resend] xen-pciback: use pci device flag operation helper function

2014-09-08 Thread Ethan Zhao
Use pci device flag operation helper functions when set device to assigned or deassigned state. Acked-by: David Vrabel Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Ethan Zhao --- drivers/xen/xen-pciback/pci_stub.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH V4 4/4 resend] PCI: use device flag operation helper function in iov.c

2014-09-08 Thread Ethan Zhao
Use device flag operation helper functions when check device assignment status. Signed-off-by: Ethan Zhao --- drivers/pci/iov.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index cb6f247..4d109c0 100644 --- a/drivers/pci/iov.c

Re: [PATCH v3 0/4 resend] Introduce device assignment flag operation helper function

2014-09-08 Thread ethan zhao
Bjorn, Thanks, will fix the building issue for new version and resend. Ethan On 2014/9/9 1:08, Bjorn Helgaas wrote: On Fri, Sep 05, 2014 at 11:15:22AM -0600, Bjorn Helgaas wrote: On Fri, Aug 08, 2014 at 01:36:03PM +0800, Ethan Zhao wrote: This patch set introduces three PCI device flag

[PATCH v3 0/4 resend] Introduce device assignment flag operation helper function

2014-08-07 Thread Ethan Zhao
: amend helper function naming. Appreciate suggestion from alex.william...@redhat.com, david.vra...@citrix.com, alexander.h.du...@intel.com Resend for v3.16 building. Thanks, Ethan --- Ethan Zhao (4): PCI: introduce helper functions for device flag operation KVM: use pci device flag operation

[PATCH 3/4] xen-pciback: use pci device flag operation helper function

2014-08-07 Thread Ethan Zhao
Use pci device flag operation helper functions when set device to assigned or deassigned state. Acked-by: David Vrabel Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Ethan Zhao --- drivers/xen/xen-pciback/pci_stub.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 1/4] PCI: introduce helper functions for device flag operation

2014-08-07 Thread Ethan Zhao
This patch introduced three helper functions to hide direct device flag operation. void pci_set_dev_assigned(struct pci_dev *pdev); void pci_clear_dev_assigned(struct pci_dev *pdev); bool pci_is_dev_assigned(struct pci_dev *pdev); Signed-off-by: Ethan Zhao --- v2: simplify unnecessory ternary

[PATCH 2/4] KVM: use pci device flag operation helper functions

2014-08-07 Thread Ethan Zhao
Use helper function instead of direct operation to pci device flag when set device to assigned or deassigned. Acked-by: Paolo Bonzini Signed-off-by: Ethan Zhao --- virt/kvm/assigned-dev.c |2 +- virt/kvm/iommu.c|4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff

[PATCH 4/4] PCI: use device flag operation helper function in iov.c

2014-08-07 Thread Ethan Zhao
Use device flag operation helper functions when check device assignment status. Signed-off-by: Ethan Zhao --- drivers/pci/iov.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index cb6f247..4d109c0 100644 --- a/drivers/pci/iov.c

Re: [PATCH 3/4 v3] xen-pciback: use pci device flag operation helper function

2014-07-29 Thread Ethan Zhao
On Tue, Jul 29, 2014 at 6:07 PM, David Vrabel wrote: > On 29/07/14 05:06, Ethan Zhao wrote: >> Use pci device flag operation helper functions when set device >> to assigned or deassigned state. >> >> Signed-off-by: Ethan Zhao > > Konrad already reviewed this but

Re: [PATCH 2/4 v3] KVM: use pci device flag operation helper functions

2014-07-29 Thread Ethan Zhao
This patch was already Acked-by: Paolo Bonzini I forgot to add the Ack tag. Thanks, Ethan Sorry for last post in HTML format with ipad. On Tue, Jul 29, 2014 at 12:06 PM, Ethan Zhao wrote: > Use helper function instead of direct operation to pci device > flag when set device to assig

Re: [PATCH 3/4 v3] xen-pciback: use pci device flag operation helper function

2014-07-29 Thread Ethan Zhao
> 在 2014年7月29日,下午6:07,David Vrabel 写道: > >> On 29/07/14 05:06, Ethan Zhao wrote: >> Use pci device flag operation helper functions when set device >> to assigned or deassigned state. >> >> Signed-off-by: Ethan Zhao > > Konrad already reviewed this b

[PATCH 2/4 v3] KVM: use pci device flag operation helper functions

2014-07-28 Thread Ethan Zhao
Use helper function instead of direct operation to pci device flag when set device to assigned or deassigned. Signed-off-by: Ethan Zhao --- v3: amend helper functions naming. virt/kvm/assigned-dev.c |2 +- virt/kvm/iommu.c|4 ++-- 2 files changed, 3 insertions(+), 3 deletions

[PATCH 0/4 v3] Introduce device assignment flag operation helper function

2014-07-28 Thread Ethan Zhao
This patch set introduces three PCI device flag operation helper functions when set pci device PF/VF to assigned or deassigned status also check it. and patch 2,3,4 apply these helper functions to KVM,XEN and PCI. v2: simplify unnecessory ternary operation in function pci_is_dev_assigned(). v3: am

[PATCH 4/4 v3] PCI: use device flag operation helper function in iov.c

2014-07-28 Thread Ethan Zhao
Use device flag operation helper functions when check device assignment status. Signed-off-by: Ethan Zhao --- v3: amend helper functions naming. drivers/pci/iov.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index de7a747

[PATCH 1/4 v3] PCI: introduce helper functions for device flag operation

2014-07-28 Thread Ethan Zhao
This patch introduced three helper functions to hide direct device flag operation. void pci_set_dev_assigned(struct pci_dev *pdev); void pci_clear_dev_assigned(struct pci_dev *pdev); bool pci_is_dev_assigned(struct pci_dev *pdev); Signed-off-by: Ethan Zhao --- v2: simplify unnecessory ternary

[PATCH 3/4 v3] xen-pciback: use pci device flag operation helper function

2014-07-28 Thread Ethan Zhao
Use pci device flag operation helper functions when set device to assigned or deassigned state. Signed-off-by: Ethan Zhao --- v3: amend helper functions naming. drivers/xen/xen-pciback/pci_stub.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/xen/xen

Re: [PATCH 1/4] PCI: introduce helper functions for device flag operation

2014-07-28 Thread Ethan Zhao
Both of you and Alex W prefer the 'Verb' , Ok, I accept the suggestion. Thanks, Ethan On Tue, Jul 29, 2014 at 11:37 AM, Alexander Duyck wrote: > On 07/28/2014 07:43 PM, ethan zhao wrote: >> >> On 2014/7/29 10:31, Alex Williamson wrote: >>> On Tue, 2014-07-2

Re: [PATCH 1/4] PCI: introduce helper functions for device flag operation

2014-07-28 Thread ethan zhao
On 2014/7/29 10:31, Alex Williamson wrote: On Tue, 2014-07-29 at 09:53 +0800, ethan zhao wrote: On 2014/7/29 5:00, Alex Williamson wrote: On Wed, 2014-07-23 at 00:19 +0800, Ethan Zhao wrote: This patch introduced three helper functions to hide direct device flag operation. void

[PATCH 1/4 v2] PCI: introduce helper functions for device flag operation

2014-07-28 Thread Ethan Zhao
This patch introduced three helper functions to hide direct device flag operation. void pci_set_dev_assigned(struct pci_dev *pdev); void pci_set_dev_deassigned(struct pci_dev *pdev); bool pci_is_dev_assigned(struct pci_dev *pdev); Signed-off-by: Ethan Zhao --- v2: simplify unnecessory ternary

Re: [PATCH 1/4] PCI: introduce helper functions for device flag operation

2014-07-28 Thread ethan zhao
On 2014/7/29 5:00, Alex Williamson wrote: On Wed, 2014-07-23 at 00:19 +0800, Ethan Zhao wrote: This patch introduced three helper functions to hide direct device flag operation. void pci_set_dev_assigned(struct pci_dev *pdev); void pci_set_dev_deassigned(struct pci_dev *pdev); bool

[PATCH 3/4] xen-pciback: use pci device flag operation helper function

2014-07-22 Thread Ethan Zhao
Use pci device flag operation helper functions when set device to assigned or deassigned state. Signed-off-by: Ethan Zhao --- drivers/xen/xen-pciback/pci_stub.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen

[PATCH 1/4] PCI: introduce helper functions for device flag operation

2014-07-22 Thread Ethan Zhao
This patch introduced three helper functions to hide direct device flag operation. void pci_set_dev_assigned(struct pci_dev *pdev); void pci_set_dev_deassigned(struct pci_dev *pdev); bool pci_is_dev_assigned(struct pci_dev *pdev); Signed-off-by: Ethan Zhao --- include/linux/pci.h | 13

[PATCH 2/4] KVM: use pci device flag operation helper functions

2014-07-22 Thread Ethan Zhao
Use helper function instead of direct operation to pci device flag when set device to assigned or deassigned. Signed-off-by: Ethan Zhao --- virt/kvm/assigned-dev.c |2 +- virt/kvm/iommu.c|4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/virt/kvm/assigned

[PATCH 0/4] Introduce device assignment flag operation helper function

2014-07-22 Thread Ethan Zhao
This patch set introduces three PCI device flag operation helper functions when set pci device PF/VF to assigned or deassigned status also check it. and patch 2,3,4 apply these helper functions to KVM,XEN and PCI. Much thanks to suggestion from alex.william...@redhat.com, david.vra...@citrix.com,

[PATCH 4/4] PCI: use device flag operation helper function in iov.c

2014-07-22 Thread Ethan Zhao
Use device flag operation helper functions when check device assignment status. Signed-off-by: Ethan Zhao --- drivers/pci/iov.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index de7a747..61fad36 100644 --- a/drivers/pci/iov.c

[PATCH 2/2 V3] PCI: implement VFs assignment reference counter

2014-07-11 Thread Ethan Zhao
-by: Ethan Zhao --- drivers/pci/iov.c | 42 -- drivers/pci/pci.h |1 + 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 090f827..10efe43 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c

[PATCH 1/2 V3] PCI: introduce device assignment interface and refactory related code

2014-07-11 Thread Ethan Zhao
atomic, steps clear between interface defination and implemenation according to the suggestion from alex.william...@redhat.com Signed-off-by: Ethan Zhao --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 17 ++--- drivers/pci/iov.c | 20

[PATCH 1/2 V2] PCI: introduce device assignment interface and refactory related code

2014-07-10 Thread Ethan Zhao
: Ethan Zhao --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 17 ++--- drivers/pci/iov.c | 20 drivers/xen/xen-pciback/pci_stub.c |4 ++-- include/linux/pci.h|4

[PATCH 2/2 V2] PCI: implement VFs assignment reference counter

2014-07-10 Thread Ethan Zhao
struct pci_sriov. and simplify the code in pci_vfs_assigned(). v2: reorder the patchset according to the suggestion from alex.william...@redhat.com Signed-off-by: Ethan Zhao --- drivers/pci/iov.c | 45 + drivers/pci/pci.h |1 + 2 files changed, 18

Re: [PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread ethan zhao
On 2014/7/11 10:33, Alex Williamson wrote: On Fri, 2014-07-11 at 10:29 +0800, ethan zhao wrote: On 2014/7/11 10:22, Alex Williamson wrote: On Fri, 2014-07-11 at 10:10 +0800, ethan zhao wrote: Alex, Thanks for your reviewing, when I create the patch order, I thought about the question

Re: [PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread ethan zhao
On 2014/7/11 10:22, Alex Williamson wrote: On Fri, 2014-07-11 at 10:10 +0800, ethan zhao wrote: Alex, Thanks for your reviewing, when I create the patch order, I thought about the question you concerned for quit a while, make every patch be independent to each other as possible as I could

Re: [PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread ethan zhao
r. Thanks, Alex On Fri, 2014-07-11 at 08:47 +0800, Ethan Zhao wrote: Current implementation of helper function pci_vfs_assigned() is a little complex, to get sum of VFs that assigned to VM, access low level configuration space register and then loop in traversing device tree. This patch in

[PATCH 4/4] i40e: use PCI VFs assignment helper function simplify i40e_vfs_are_assigned()

2014-07-10 Thread Ethan Zhao
New VFs reference counter mechanism and VFs assignment helper functions are introduced to PCI SRIOV, use them instead of manipulating device flag directly. Signed-off-by: Ethan Zhao --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 17 ++--- 1 files changed, 2 insertions

[PATCH 3/4] KVM: use PCI VFs assignment helper functions

2014-07-10 Thread Ethan Zhao
New VFs reference counter mechanism and VFs assignment helper functions are introduced to PCI SRIOV, use them instead of manipulating device flag directly. Signed-off-by: Ethan Zhao --- virt/kvm/assigned-dev.c |2 +- virt/kvm/iommu.c|4 ++-- 2 files changed, 3 insertions(+), 3

[PATCH 2/4] xen-pciback: use PCI VFs assignment helper functions

2014-07-10 Thread Ethan Zhao
New VFs reference counter mechanism and VFs assignment helper functions are introduced to PCI SRIOV, use them instead of manipulating device flag directly. Signed-off-by: Ethan Zhao --- drivers/xen/xen-pciback/pci_stub.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread Ethan Zhao
pci_sriov, and compose two more helper functions pci_sriov_assign_device(), pci_sriov_deassign_device() to replace manipulation to device flag and the meanwhile increase and decease the counter. Passed building on 3.15.5 Signed-off-by: Ethan Zhao --- drivers/pci/iov.c | 65