All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/i40e: fix VSI MAC filter on primary address change
@ 2018-01-03 14:29 Olivier Matz
  2018-01-04  5:39 ` Xing, Beilei
  2018-01-05 12:34 ` Igor Ryzhov
  0 siblings, 2 replies; 8+ messages in thread
From: Olivier Matz @ 2018-01-03 14:29 UTC (permalink / raw)
  To: dev, Jingjing Wu, Beilei Xing; +Cc: stable, Laurent Hardy

When primary address mac is changed, the mac filters were not updated in
the VSI with the new mac addr and incoming packets with this destination
address are dropped by the hardware filters.

This patch removes the VSI mac filter for the previous mac address and
adds a new one for new mac address.

Fixes: e18e01e92c29 ("i40e: support default MAC address setting")
Cc: stable@dpdk.org

Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---

Please, review the patch carefully since I'm not an i40e expert ;)

To reproduce the issue:

make config T=x86_64-native-linuxapp-gcc
make -j4
mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
echo 256 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo 256 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
modprobe uio_pci_generic
insmod ./build/kmod/igb_uio.ko
python usertools/dpdk-devbind.py -b igb_uio 0000:02:00.0
./build/app/testpmd -l 0,1 --log-level 8 -- --total-num-mbufs=65536 -i --port-topology=chained
# note: the MAC address of port is 68:05:CA:38:6D:C0

set promisc all off
show port info 0
set fwd rxonly
set verbose 1
start

# on a tester node, send a packet with scapy
# it is properly received by the PMD
sendp(Ether(dst='68:05:CA:38:6D:C0')/IP()/UDP()/Raw("x"*10), iface='ens3f2')

# back on DUT, change primary mac addr on port 0
stop
mac_addr set 0 00:00:01:02:03:04
start

# Without the patch, this packet is not received
sendp(Ether(dst='00:00:01:02:03:04')/IP()/UDP()/Raw("x"*10), iface='ens3f2')
# Without the patch, this packet with the old addr is received
sendp(Ether(dst='68:05:CA:38:6D:C0')/IP()/UDP()/Raw("x"*10), iface='ens3f2')


 drivers/net/i40e/i40e_ethdev.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 811cc9ffe..e7d070879 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -10818,12 +10818,41 @@ static void i40e_set_default_mac_addr(struct rte_eth_dev *dev,
 				      struct ether_addr *mac_addr)
 {
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	struct i40e_vsi *vsi = pf->main_vsi;
+	struct i40e_mac_filter_info mac_filter;
+	struct i40e_mac_filter *f;
+	int ret;
 
 	if (!is_valid_assigned_ether_addr(mac_addr)) {
 		PMD_DRV_LOG(ERR, "Tried to set invalid MAC address.");
 		return;
 	}
 
+	TAILQ_FOREACH(f, &vsi->mac_list, next) {
+		if (is_same_ether_addr(&pf->dev_addr, &f->mac_info.mac_addr))
+			break;
+	}
+
+	if (f == NULL) {
+		PMD_DRV_LOG(ERR, "Failed to find filter for default mac");
+		return;
+	}
+
+	mac_filter = f->mac_info;
+	ret = i40e_vsi_delete_mac(vsi, &mac_filter.mac_addr);
+	if (ret != I40E_SUCCESS) {
+		PMD_DRV_LOG(ERR, "Failed to delete mac filter");
+		return;
+	}
+	memcpy(&mac_filter.mac_addr, mac_addr, ETH_ADDR_LEN);
+	ret = i40e_vsi_add_mac(vsi, &mac_filter);
+	if (ret != I40E_SUCCESS) {
+		PMD_DRV_LOG(ERR, "Failed to add mac filter");
+		return;
+	}
+	memcpy(&pf->dev_addr, mac_addr, ETH_ADDR_LEN);
+
 	/* Flags: 0x3 updates port address */
 	i40e_aq_mac_address_write(hw, 0x3, mac_addr->addr_bytes, NULL);
 }
-- 
2.11.0

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

* Re: [PATCH] net/i40e: fix VSI MAC filter on primary address change
  2018-01-03 14:29 [PATCH] net/i40e: fix VSI MAC filter on primary address change Olivier Matz
@ 2018-01-04  5:39 ` Xing, Beilei
  2018-01-10 13:57   ` Zhang, Helin
  2018-01-05 12:34 ` Igor Ryzhov
  1 sibling, 1 reply; 8+ messages in thread
From: Xing, Beilei @ 2018-01-04  5:39 UTC (permalink / raw)
  To: Olivier Matz, dev, Wu, Jingjing; +Cc: stable, Laurent Hardy



> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Wednesday, January 3, 2018 10:29 PM
> To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Cc: stable@dpdk.org; Laurent Hardy <laurent.hardy@6wind.com>
> Subject: [PATCH] net/i40e: fix VSI MAC filter on primary address change
> 
> When primary address mac is changed, the mac filters were not updated in
> the VSI with the new mac addr and incoming packets with this destination
> address are dropped by the hardware filters.
> 
> This patch removes the VSI mac filter for the previous mac address and adds
> a new one for new mac address.
> 
> Fixes: e18e01e92c29 ("i40e: support default MAC address setting")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Thanks for the fix.
Acked-by: Beilei Xing <beilei.xing@intel.com>

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

* Re: [PATCH] net/i40e: fix VSI MAC filter on primary address change
  2018-01-03 14:29 [PATCH] net/i40e: fix VSI MAC filter on primary address change Olivier Matz
  2018-01-04  5:39 ` Xing, Beilei
@ 2018-01-05 12:34 ` Igor Ryzhov
  2018-01-08  6:36   ` Zhang, Helin
  1 sibling, 1 reply; 8+ messages in thread
From: Igor Ryzhov @ 2018-01-05 12:34 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Jingjing Wu, Beilei Xing, stable, Laurent Hardy

Thank you for the patch! Comments inline.

On Wed, Jan 3, 2018 at 5:29 PM, Olivier Matz <olivier.matz@6wind.com> wrote:
>
>  drivers/net/i40e/i40e_ethdev.c | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_
> ethdev.c
> index 811cc9ffe..e7d070879 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -10818,12 +10818,41 @@ static void i40e_set_default_mac_addr(struct
> rte_eth_dev *dev,
>                                       struct ether_addr *mac_addr)
>  {
>         struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->
> data->dev_private);
> +       struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->
> data->dev_private);
> +       struct i40e_vsi *vsi = pf->main_vsi;
> +       struct i40e_mac_filter_info mac_filter;
> +       struct i40e_mac_filter *f;
> +       int ret;
>
>         if (!is_valid_assigned_ether_addr(mac_addr)) {
>                 PMD_DRV_LOG(ERR, "Tried to set invalid MAC address.");
>                 return;
>         }
>
>
Is following check really necessary here?
i40e_vsi_delete_mac(vsi, &pf->dev_addr) will do absolutely the same.

+       TAILQ_FOREACH(f, &vsi->mac_list, next) {
> +               if (is_same_ether_addr(&pf->dev_addr,
> &f->mac_info.mac_addr))
> +                       break;
> +       }
> +
> +       if (f == NULL) {
> +               PMD_DRV_LOG(ERR, "Failed to find filter for default mac");
> +               return;
> +       }
> +
> +       mac_filter = f->mac_info;
> +       ret = i40e_vsi_delete_mac(vsi, &mac_filter.mac_addr);
> +       if (ret != I40E_SUCCESS) {
> +               PMD_DRV_LOG(ERR, "Failed to delete mac filter");
> +               return;
> +       }
> +       memcpy(&mac_filter.mac_addr, mac_addr, ETH_ADDR_LEN);
>

Shouldn't mac_filter.filter_type be set to RTE_MACVLAN_PERFECT_MATCH?


> +       ret = i40e_vsi_add_mac(vsi, &mac_filter);
> +       if (ret != I40E_SUCCESS) {
> +               PMD_DRV_LOG(ERR, "Failed to add mac filter");
> +               return;
> +       }
> +       memcpy(&pf->dev_addr, mac_addr, ETH_ADDR_LEN);
> +
>         /* Flags: 0x3 updates port address */
>

In Linux driver I40E_AQC_WRITE_TYPE_LAA_WOL is used as a flag instead of
0x3.
Shouldn't we use the same flag?


>         i40e_aq_mac_address_write(hw, 0x3, mac_addr->addr_bytes, NULL);
>  }
> --
> 2.11.0
>
>
Best regards,
Igor

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

* Re: [PATCH] net/i40e: fix VSI MAC filter on primary address change
  2018-01-05 12:34 ` Igor Ryzhov
@ 2018-01-08  6:36   ` Zhang, Helin
  0 siblings, 0 replies; 8+ messages in thread
From: Zhang, Helin @ 2018-01-08  6:36 UTC (permalink / raw)
  To: Igor Ryzhov, Olivier Matz, Xing, Beilei
  Cc: dev, Wu, Jingjing, stable, Laurent Hardy

Hi Developers and maintainers

Could you help to address the comments from Igor?

Regards,
Helin

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Igor Ryzhov
> Sent: Friday, January 5, 2018 8:35 PM
> To: Olivier Matz
> Cc: dev@dpdk.org; Wu, Jingjing; Xing, Beilei; stable@dpdk.org; Laurent Hardy
> Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix VSI MAC filter on primary address
> change
> 
> Thank you for the patch! Comments inline.
> 
> On Wed, Jan 3, 2018 at 5:29 PM, Olivier Matz <olivier.matz@6wind.com>
> wrote:
> >
> >  drivers/net/i40e/i40e_ethdev.c | 29 +++++++++++++++++++++++++++++
> >  1 file changed, 29 insertions(+)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_
> > ethdev.c index 811cc9ffe..e7d070879 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -10818,12 +10818,41 @@ static void i40e_set_default_mac_addr(struct
> > rte_eth_dev *dev,
> >                                       struct ether_addr *mac_addr)  {
> >         struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->
> > data->dev_private);
> > +       struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->
> > data->dev_private);
> > +       struct i40e_vsi *vsi = pf->main_vsi;
> > +       struct i40e_mac_filter_info mac_filter;
> > +       struct i40e_mac_filter *f;
> > +       int ret;
> >
> >         if (!is_valid_assigned_ether_addr(mac_addr)) {
> >                 PMD_DRV_LOG(ERR, "Tried to set invalid MAC address.");
> >                 return;
> >         }
> >
> >
> Is following check really necessary here?
> i40e_vsi_delete_mac(vsi, &pf->dev_addr) will do absolutely the same.
> 
> +       TAILQ_FOREACH(f, &vsi->mac_list, next) {
> > +               if (is_same_ether_addr(&pf->dev_addr,
> > &f->mac_info.mac_addr))
> > +                       break;
> > +       }
> > +
> > +       if (f == NULL) {
> > +               PMD_DRV_LOG(ERR, "Failed to find filter for default mac");
> > +               return;
> > +       }
> > +
> > +       mac_filter = f->mac_info;
> > +       ret = i40e_vsi_delete_mac(vsi, &mac_filter.mac_addr);
> > +       if (ret != I40E_SUCCESS) {
> > +               PMD_DRV_LOG(ERR, "Failed to delete mac filter");
> > +               return;
> > +       }
> > +       memcpy(&mac_filter.mac_addr, mac_addr, ETH_ADDR_LEN);
> >
> 
> Shouldn't mac_filter.filter_type be set to RTE_MACVLAN_PERFECT_MATCH?
> 
> 
> > +       ret = i40e_vsi_add_mac(vsi, &mac_filter);
> > +       if (ret != I40E_SUCCESS) {
> > +               PMD_DRV_LOG(ERR, "Failed to add mac filter");
> > +               return;
> > +       }
> > +       memcpy(&pf->dev_addr, mac_addr, ETH_ADDR_LEN);
> > +
> >         /* Flags: 0x3 updates port address */
> >
> 
> In Linux driver I40E_AQC_WRITE_TYPE_LAA_WOL is used as a flag instead of
> 0x3.
> Shouldn't we use the same flag?
> 
> 
> >         i40e_aq_mac_address_write(hw, 0x3, mac_addr->addr_bytes,
> > NULL);  }
> > --
> > 2.11.0
> >
> >
> Best regards,
> Igor

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

* Re: [PATCH] net/i40e: fix VSI MAC filter on primary address change
  2018-01-04  5:39 ` Xing, Beilei
@ 2018-01-10 13:57   ` Zhang, Helin
  2018-01-10 22:46     ` Igor Ryzhov
  0 siblings, 1 reply; 8+ messages in thread
From: Zhang, Helin @ 2018-01-10 13:57 UTC (permalink / raw)
  To: Xing, Beilei, Olivier Matz, dev, Wu, Jingjing; +Cc: stable, Laurent Hardy



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xing, Beilei
> Sent: Thursday, January 4, 2018 1:39 PM
> To: Olivier Matz; dev@dpdk.org; Wu, Jingjing
> Cc: stable@dpdk.org; Laurent Hardy
> Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix VSI MAC filter on primary address
> change
> 
> 
> 
> > -----Original Message-----
> > From: Olivier Matz [mailto:olivier.matz@6wind.com]
> > Sent: Wednesday, January 3, 2018 10:29 PM
> > To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> > <beilei.xing@intel.com>
> > Cc: stable@dpdk.org; Laurent Hardy <laurent.hardy@6wind.com>
> > Subject: [PATCH] net/i40e: fix VSI MAC filter on primary address
> > change
> >
> > When primary address mac is changed, the mac filters were not updated
> > in the VSI with the new mac addr and incoming packets with this
> > destination address are dropped by the hardware filters.
> >
> > This patch removes the VSI mac filter for the previous mac address and
> > adds a new one for new mac address.
> >
> > Fixes: e18e01e92c29 ("i40e: support default MAC address setting")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> 
> Thanks for the fix.
> Acked-by: Beilei Xing <beilei.xing@intel.com>
Applied to dpdk-next-net-intel, thanks!

/Helin

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

* Re: [PATCH] net/i40e: fix VSI MAC filter on primary address change
  2018-01-10 13:57   ` Zhang, Helin
@ 2018-01-10 22:46     ` Igor Ryzhov
  2018-01-11  8:21       ` Xing, Beilei
  0 siblings, 1 reply; 8+ messages in thread
From: Igor Ryzhov @ 2018-01-10 22:46 UTC (permalink / raw)
  To: Zhang, Helin
  Cc: Xing, Beilei, Olivier Matz, dev, Wu, Jingjing, stable, Laurent Hardy

Hello everyone.

It's sad that my comments were unanswered.
I'm ok with the first two – they were mostly style-related.
But I made an investigation on the third one and it is a bug.

This is a description (from X710 datasheet) of flags sent to
mac_address_write command:

By bits:
0-7 – Reserved
8 – MAC_MAG_EN
9 – LAA_WOL_PRESERVE
10-13 – Reserved
14-15 – Write type (00 – Update LAA only, 01 – Update LAA and WOL, 10 –
Update port address, 11 – Reserved, but used in Linux to enable multicast
magic packet wake up)

Current code uses 0x3 flag, apparently trying to update LAA, WOL and port
address, but it sets first two bits instead of last two.
These bits are reserved, that's why it doesn't break anything.
At the same time, last two bits are set to zero, and the command changes
LAA address only – it's enough to work in simple case.

The last question – which flag is correct to use – 01 (LAA + WOL) or 11
(LAA + WOL + port).
Linux driver uses the first one, and here is the patch to fix the issue:
https://dpdk.org/dev/patchwork/patch/33524/

Best regards,
Igor

On Wed, Jan 10, 2018 at 4:57 PM, Zhang, Helin <helin.zhang@intel.com> wrote:

>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xing, Beilei
> > Sent: Thursday, January 4, 2018 1:39 PM
> > To: Olivier Matz; dev@dpdk.org; Wu, Jingjing
> > Cc: stable@dpdk.org; Laurent Hardy
> > Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix VSI MAC filter on primary
> address
> > change
> >
> >
> >
> > > -----Original Message-----
> > > From: Olivier Matz [mailto:olivier.matz@6wind.com]
> > > Sent: Wednesday, January 3, 2018 10:29 PM
> > > To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> > > <beilei.xing@intel.com>
> > > Cc: stable@dpdk.org; Laurent Hardy <laurent.hardy@6wind.com>
> > > Subject: [PATCH] net/i40e: fix VSI MAC filter on primary address
> > > change
> > >
> > > When primary address mac is changed, the mac filters were not updated
> > > in the VSI with the new mac addr and incoming packets with this
> > > destination address are dropped by the hardware filters.
> > >
> > > This patch removes the VSI mac filter for the previous mac address and
> > > adds a new one for new mac address.
> > >
> > > Fixes: e18e01e92c29 ("i40e: support default MAC address setting")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
> > > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> >
> > Thanks for the fix.
> > Acked-by: Beilei Xing <beilei.xing@intel.com>
> Applied to dpdk-next-net-intel, thanks!
>
> /Helin
>

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

* Re: [PATCH] net/i40e: fix VSI MAC filter on primary address change
  2018-01-10 22:46     ` Igor Ryzhov
@ 2018-01-11  8:21       ` Xing, Beilei
  2018-01-11 10:08         ` Igor Ryzhov
  0 siblings, 1 reply; 8+ messages in thread
From: Xing, Beilei @ 2018-01-11  8:21 UTC (permalink / raw)
  To: Igor Ryzhov, Zhang, Helin
  Cc: Olivier Matz, dev, Wu, Jingjing, stable, Laurent Hardy

Hi Igor,

Thanks for the catch, and glad to see your patch☺ It resolves a potential problem in PMD.
The patch looks OK for me except some minor comments (in another mail thread).

Best Regards,
Beilei

From: Igor Ryzhov [mailto:iryzhov@nfware.com]
Sent: Thursday, January 11, 2018 6:47 AM
To: Zhang, Helin <helin.zhang@intel.com>
Cc: Xing, Beilei <beilei.xing@intel.com>; Olivier Matz <olivier.matz@6wind.com>; dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; stable@dpdk.org; Laurent Hardy <laurent.hardy@6wind.com>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix VSI MAC filter on primary address change

Hello everyone.

It's sad that my comments were unanswered.
I'm ok with the first two – they were mostly style-related.
But I made an investigation on the third one and it is a bug.

This is a description (from X710 datasheet) of flags sent to mac_address_write command:

By bits:
0-7 – Reserved
8 – MAC_MAG_EN
9 – LAA_WOL_PRESERVE
10-13 – Reserved
14-15 – Write type (00 – Update LAA only, 01 – Update LAA and WOL, 10 – Update port address, 11 – Reserved, but used in Linux to enable multicast magic packet wake up)

Current code uses 0x3 flag, apparently trying to update LAA, WOL and port address, but it sets first two bits instead of last two.
These bits are reserved, that's why it doesn't break anything.
At the same time, last two bits are set to zero, and the command changes LAA address only – it's enough to work in simple case.

The last question – which flag is correct to use – 01 (LAA + WOL) or 11 (LAA + WOL + port).
Linux driver uses the first one, and here is the patch to fix the issue:
https://dpdk.org/dev/patchwork/patch/33524/

Best regards,
Igor

On Wed, Jan 10, 2018 at 4:57 PM, Zhang, Helin <helin.zhang@intel.com<mailto:helin.zhang@intel.com>> wrote:


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org<mailto:dev-bounces@dpdk.org>] On Behalf Of Xing, Beilei
> Sent: Thursday, January 4, 2018 1:39 PM
> To: Olivier Matz; dev@dpdk.org<mailto:dev@dpdk.org>; Wu, Jingjing
> Cc: stable@dpdk.org<mailto:stable@dpdk.org>; Laurent Hardy
> Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix VSI MAC filter on primary address
> change
>
>
>
> > -----Original Message-----
> > From: Olivier Matz [mailto:olivier.matz@6wind.com<mailto:olivier.matz@6wind.com>]
> > Sent: Wednesday, January 3, 2018 10:29 PM
> > To: dev@dpdk.org<mailto:dev@dpdk.org>; Wu, Jingjing <jingjing.wu@intel.com<mailto:jingjing.wu@intel.com>>; Xing, Beilei
> > <beilei.xing@intel.com<mailto:beilei.xing@intel.com>>
> > Cc: stable@dpdk.org<mailto:stable@dpdk.org>; Laurent Hardy <laurent.hardy@6wind.com<mailto:laurent.hardy@6wind.com>>
> > Subject: [PATCH] net/i40e: fix VSI MAC filter on primary address
> > change
> >
> > When primary address mac is changed, the mac filters were not updated
> > in the VSI with the new mac addr and incoming packets with this
> > destination address are dropped by the hardware filters.
> >
> > This patch removes the VSI mac filter for the previous mac address and
> > adds a new one for new mac address.
> >
> > Fixes: e18e01e92c29 ("i40e: support default MAC address setting")
> > Cc: stable@dpdk.org<mailto:stable@dpdk.org>
> >
> > Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com<mailto:laurent.hardy@6wind.com>>
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com<mailto:olivier.matz@6wind.com>>
>
> Thanks for the fix.
> Acked-by: Beilei Xing <beilei.xing@intel.com<mailto:beilei.xing@intel.com>>
Applied to dpdk-next-net-intel, thanks!

/Helin


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

* Re: [PATCH] net/i40e: fix VSI MAC filter on primary address change
  2018-01-11  8:21       ` Xing, Beilei
@ 2018-01-11 10:08         ` Igor Ryzhov
  0 siblings, 0 replies; 8+ messages in thread
From: Igor Ryzhov @ 2018-01-11 10:08 UTC (permalink / raw)
  To: Xing, Beilei
  Cc: Zhang, Helin, Olivier Matz, dev, Wu, Jingjing, stable, Laurent Hardy

Sent v2: https://dpdk.org/dev/patchwork/patch/33570/

On Thu, Jan 11, 2018 at 11:21 AM, Xing, Beilei <beilei.xing@intel.com>
wrote:

> Hi Igor,
>
>
>
> Thanks for the catch, and glad to see your patchJ It resolves a potential
> problem in PMD.
>
> The patch looks OK for me except some minor comments (in another mail
> thread).
>
>
>
> Best Regards,
>
> Beilei
>
>
>
> *From:* Igor Ryzhov [mailto:iryzhov@nfware.com]
> *Sent:* Thursday, January 11, 2018 6:47 AM
> *To:* Zhang, Helin <helin.zhang@intel.com>
> *Cc:* Xing, Beilei <beilei.xing@intel.com>; Olivier Matz <
> olivier.matz@6wind.com>; dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>;
> stable@dpdk.org; Laurent Hardy <laurent.hardy@6wind.com>
>
> *Subject:* Re: [dpdk-dev] [PATCH] net/i40e: fix VSI MAC filter on primary
> address change
>
>
>
> Hello everyone.
>
>
>
> It's sad that my comments were unanswered.
>
> I'm ok with the first two – they were mostly style-related.
>
> But I made an investigation on the third one and it is a bug.
>
>
>
> This is a description (from X710 datasheet) of flags sent to
> mac_address_write command:
>
>
>
> By bits:
>
> 0-7 – Reserved
>
> 8 – MAC_MAG_EN
>
> 9 – LAA_WOL_PRESERVE
>
> 10-13 – Reserved
>
> 14-15 – Write type (00 – Update LAA only, 01 – Update LAA and WOL, 10 –
> Update port address, 11 – Reserved, but used in Linux to enable multicast
> magic packet wake up)
>
>
>
> Current code uses 0x3 flag, apparently trying to update LAA, WOL and port
> address, but it sets first two bits instead of last two.
>
> These bits are reserved, that's why it doesn't break anything.
>
> At the same time, last two bits are set to zero, and the command changes
> LAA address only – it's enough to work in simple case.
>
>
>
> The last question – which flag is correct to use – 01 (LAA + WOL) or 11
> (LAA + WOL + port).
>
> Linux driver uses the first one, and here is the patch to fix the issue:
>
> https://dpdk.org/dev/patchwork/patch/33524/
>
>
>
> Best regards,
>
> Igor
>
>
>
> On Wed, Jan 10, 2018 at 4:57 PM, Zhang, Helin <helin.zhang@intel.com>
> wrote:
>
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xing, Beilei
> > Sent: Thursday, January 4, 2018 1:39 PM
> > To: Olivier Matz; dev@dpdk.org; Wu, Jingjing
> > Cc: stable@dpdk.org; Laurent Hardy
> > Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix VSI MAC filter on primary
> address
> > change
> >
> >
> >
> > > -----Original Message-----
> > > From: Olivier Matz [mailto:olivier.matz@6wind.com]
> > > Sent: Wednesday, January 3, 2018 10:29 PM
> > > To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> > > <beilei.xing@intel.com>
> > > Cc: stable@dpdk.org; Laurent Hardy <laurent.hardy@6wind.com>
> > > Subject: [PATCH] net/i40e: fix VSI MAC filter on primary address
> > > change
> > >
> > > When primary address mac is changed, the mac filters were not updated
> > > in the VSI with the new mac addr and incoming packets with this
> > > destination address are dropped by the hardware filters.
> > >
> > > This patch removes the VSI mac filter for the previous mac address and
> > > adds a new one for new mac address.
> > >
> > > Fixes: e18e01e92c29 ("i40e: support default MAC address setting")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
> > > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> >
> > Thanks for the fix.
> > Acked-by: Beilei Xing <beilei.xing@intel.com>
>
> Applied to dpdk-next-net-intel, thanks!
>
> /Helin
>
>
>

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

end of thread, other threads:[~2018-01-11 10:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-03 14:29 [PATCH] net/i40e: fix VSI MAC filter on primary address change Olivier Matz
2018-01-04  5:39 ` Xing, Beilei
2018-01-10 13:57   ` Zhang, Helin
2018-01-10 22:46     ` Igor Ryzhov
2018-01-11  8:21       ` Xing, Beilei
2018-01-11 10:08         ` Igor Ryzhov
2018-01-05 12:34 ` Igor Ryzhov
2018-01-08  6:36   ` Zhang, Helin

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.