All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fm10k: enable PCIe port level Loopback Suppression
@ 2016-01-28  5:48 Shaopeng He
  2016-02-03  7:18 ` Chen, Jing D
  0 siblings, 1 reply; 3+ messages in thread
From: Shaopeng He @ 2016-01-28  5:48 UTC (permalink / raw)
  To: dev

A PCIe port may represent within it multiple logical ports
(for example when SR-IOV is enabled, or when a VMDQ type logical
port scheme is employed assigning ports to sets of queues).
For this reason each RX queue in each PCIe port is given a source
GLORT that is used for loopback suppression.
This patch assigns a SGLORT for each RX queue, and enables PCIe
port level Loopback Suppression.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index f6eb05d..60f821a 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -690,12 +690,15 @@ static int
 fm10k_dev_rx_init(struct rte_eth_dev *dev)
 {
 	struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct fm10k_macvlan_filter_info *macvlan;
 	int i, ret;
 	struct fm10k_rx_queue *rxq;
 	uint64_t base_addr;
 	uint32_t size;
 	uint32_t rxdctl = FM10K_RXDCTL_WRITE_BACK_MIN_DELAY;
+	uint32_t logic_port = hw->mac.dglort_map;
 	uint16_t buf_size;
+	uint16_t queue_stride = 0;
 
 	/* Disable RXINT to avoid possible interrupt */
 	for (i = 0; i < hw->mac.max_queues; i++)
@@ -735,7 +738,8 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev)
 		buf_size -= FM10K_RX_DATABUF_ALIGN;
 
 		FM10K_WRITE_REG(hw, FM10K_SRRCTL(i),
-				buf_size >> FM10K_SRRCTL_BSIZEPKT_SHIFT);
+				(buf_size >> FM10K_SRRCTL_BSIZEPKT_SHIFT) |
+				FM10K_SRRCTL_LOOPBACK_SUPPRESS);
 
 		/* It adds dual VLAN length for supporting dual VLAN */
 		if ((dev->data->dev_conf.rxmode.max_rx_pkt_len +
@@ -762,6 +766,18 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev)
 	/* Decide the best RX function */
 	fm10k_set_rx_function(dev);
 
+	/* update RX_SGLORT for loopback suppress*/
+	if (hw->mac.type != fm10k_mac_pf)
+		return 0;
+	macvlan = FM10K_DEV_PRIVATE_TO_MACVLAN(dev->data->dev_private);
+	if (macvlan->nb_queue_pools)
+		queue_stride = dev->data->nb_rx_queues / macvlan->nb_queue_pools;
+	for (i = 0; i < dev->data->nb_rx_queues; ++i) {
+		if (i && queue_stride && !(i % queue_stride))
+			logic_port++;
+		FM10K_WRITE_REG(hw, FM10K_RX_SGLORT(i), logic_port);
+	}
+
 	return 0;
 }
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fm10k: enable PCIe port level Loopback Suppression
  2016-01-28  5:48 [PATCH] fm10k: enable PCIe port level Loopback Suppression Shaopeng He
@ 2016-02-03  7:18 ` Chen, Jing D
  2016-02-04  0:40   ` He, Shaopeng
  0 siblings, 1 reply; 3+ messages in thread
From: Chen, Jing D @ 2016-02-03  7:18 UTC (permalink / raw)
  To: He, Shaopeng, dev

Hi,

Best Regards,
Mark


> -----Original Message-----
> From: He, Shaopeng
> Sent: Thursday, January 28, 2016 1:49 PM
> To: dev@dpdk.org
> Cc: Chen, Jing D; Wang, Xiao W; He, Shaopeng
> Subject: [PATCH] fm10k: enable PCIe port level Loopback Suppression
> 
> A PCIe port may represent within it multiple logical ports
> (for example when SR-IOV is enabled, or when a VMDQ type logical
> port scheme is employed assigning ports to sets of queues).
> For this reason each RX queue in each PCIe port is given a source
> GLORT that is used for loopback suppression.
> This patch assigns a SGLORT for each RX queue, and enables PCIe
> port level Loopback Suppression.
> 

The log message is a little obscure for me. Maybe you can wrote:
In FM10K, a single PF device can derive out a few logical ports, like SRIOV
VF device, VMDQ object. To better manage them, FM10K silicon assigned a
Unique GLORT ID to each logical ports. 
When a logical port sends a broadcast packet, the silicon will flood it to all
Logical ports, including the one sent the broadcast packet. To prevent this,
silicon has a rxq register to fill the glort id of the logical port that queue binds 
to....

> Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
> ---
>  drivers/net/fm10k/fm10k_ethdev.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> b/drivers/net/fm10k/fm10k_ethdev.c
> index f6eb05d..60f821a 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -690,12 +690,15 @@ static int
>  fm10k_dev_rx_init(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fm10k: enable PCIe port level Loopback Suppression
  2016-02-03  7:18 ` Chen, Jing D
@ 2016-02-04  0:40   ` He, Shaopeng
  0 siblings, 0 replies; 3+ messages in thread
From: He, Shaopeng @ 2016-02-04  0:40 UTC (permalink / raw)
  To: Chen, Jing D, dev

Hi Mark,

> -----Original Message-----
> From: Chen, Jing D
> Sent: Wednesday, February 03, 2016 3:18 PM
> To: He, Shaopeng; dev@dpdk.org
> Cc: Wang, Xiao W
> Subject: RE: [PATCH] fm10k: enable PCIe port level Loopback Suppression
> 
> Hi,
> 
> Best Regards,
> Mark
> 
> 
> > -----Original Message-----
> > From: He, Shaopeng
> > Sent: Thursday, January 28, 2016 1:49 PM
> > To: dev@dpdk.org
> > Cc: Chen, Jing D; Wang, Xiao W; He, Shaopeng
> > Subject: [PATCH] fm10k: enable PCIe port level Loopback Suppression
> >
> > A PCIe port may represent within it multiple logical ports
> > (for example when SR-IOV is enabled, or when a VMDQ type logical
> > port scheme is employed assigning ports to sets of queues).
> > For this reason each RX queue in each PCIe port is given a source
> > GLORT that is used for loopback suppression.
> > This patch assigns a SGLORT for each RX queue, and enables PCIe
> > port level Loopback Suppression.
> >
> 
> The log message is a little obscure for me. Maybe you can wrote:
> In FM10K, a single PF device can derive out a few logical ports, like SRIOV
> VF device, VMDQ object. To better manage them, FM10K silicon assigned a
> Unique GLORT ID to each logical ports.
> When a logical port sends a broadcast packet, the silicon will flood it to all
> Logical ports, including the one sent the broadcast packet. To prevent this,
> silicon has a rxq register to fill the glort id of the logical port that queue binds
> to....

Thanks for the suggestion, I will reword and send another version.

Thanks,
--Shaopeng
> 
> > Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
> > ---
> >  drivers/net/fm10k/fm10k_ethdev.c | 18 +++++++++++++++++-
> >  1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> > b/drivers/net/fm10k/fm10k_ethdev.c
> > index f6eb05d..60f821a 100644
> > --- a/drivers/net/fm10k/fm10k_ethdev.c
> > +++ b/drivers/net/fm10k/fm10k_ethdev.c
> > @@ -690,12 +690,15 @@ static int
> >  fm10k_dev_rx_init(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-04  0:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28  5:48 [PATCH] fm10k: enable PCIe port level Loopback Suppression Shaopeng He
2016-02-03  7:18 ` Chen, Jing D
2016-02-04  0:40   ` He, Shaopeng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.