diff mbox series

[net-next,4/6] ionic: ignore eexist on rx filter add

Message ID 20200320023153.48655-5-snelson@pensando.io
State Accepted
Delegated to: David Miller
Headers show
Series ionic error recovery fixes | expand

Commit Message

Shannon Nelson March 20, 2020, 2:31 a.m. UTC
Don't worry if the rx filter add firmware request fails on
EEXIST, at least we know the filter is there.  Same for
the delete request, at least we know it isn't there.

Fixes: 2a654540be10 ("ionic: Add Rx filter and rx_mode ndo support")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jakub Kicinski March 20, 2020, 3:43 a.m. UTC | #1
On Thu, 19 Mar 2020 19:31:51 -0700 Shannon Nelson wrote:
> Don't worry if the rx filter add firmware request fails on
> EEXIST, at least we know the filter is there.  Same for
> the delete request, at least we know it isn't there.
> 
> Fixes: 2a654540be10 ("ionic: Add Rx filter and rx_mode ndo support")
> Signed-off-by: Shannon Nelson <snelson@pensando.io>

Why could the filter be there? Seems like the FW shouldn't have filters
the driver didn't add, could a flush/reset command help to start from
clean state?

Just curious.
Shannon Nelson March 20, 2020, 5:21 a.m. UTC | #2
On 3/19/20 8:43 PM, Jakub Kicinski wrote:
> On Thu, 19 Mar 2020 19:31:51 -0700 Shannon Nelson wrote:
>> Don't worry if the rx filter add firmware request fails on
>> EEXIST, at least we know the filter is there.  Same for
>> the delete request, at least we know it isn't there.
>>
>> Fixes: 2a654540be10 ("ionic: Add Rx filter and rx_mode ndo support")
>> Signed-off-by: Shannon Nelson <snelson@pensando.io>
> Why could the filter be there? Seems like the FW shouldn't have filters
> the driver didn't add, could a flush/reset command help to start from
> clean state?
>
> Just curious.
Because there are use cases where the device is configured by an 
external centralized agent and may have already stuck the appropriate 
filters into the its list.

sln
Jakub Kicinski March 20, 2020, 5:16 p.m. UTC | #3
On Thu, 19 Mar 2020 22:21:35 -0700 Shannon Nelson wrote:
> On 3/19/20 8:43 PM, Jakub Kicinski wrote:
> > On Thu, 19 Mar 2020 19:31:51 -0700 Shannon Nelson wrote:  
> >> Don't worry if the rx filter add firmware request fails on
> >> EEXIST, at least we know the filter is there.  Same for
> >> the delete request, at least we know it isn't there.
> >>
> >> Fixes: 2a654540be10 ("ionic: Add Rx filter and rx_mode ndo support")
> >> Signed-off-by: Shannon Nelson <snelson@pensando.io>  
> > Why could the filter be there? Seems like the FW shouldn't have filters
> > the driver didn't add, could a flush/reset command help to start from
> > clean state?
> >
> > Just curious.  
> Because there are use cases where the device is configured by an 
> external centralized agent and may have already stuck the appropriate 
> filters into the its list.

Thanks, seems a little leaky for the host to be able to probe the state
installed by the agent, but it does explain the need.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index c62d3d01d5aa..ea44f510cb76 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -832,7 +832,7 @@  static int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr)
 
 	memcpy(ctx.cmd.rx_filter_add.mac.addr, addr, ETH_ALEN);
 	err = ionic_adminq_post_wait(lif, &ctx);
-	if (err)
+	if (err && err != -EEXIST)
 		return err;
 
 	return ionic_rx_filter_save(lif, 0, IONIC_RXQ_INDEX_ANY, 0, &ctx);
@@ -862,7 +862,7 @@  static int ionic_lif_addr_del(struct ionic_lif *lif, const u8 *addr)
 	spin_unlock_bh(&lif->rx_filters.lock);
 
 	err = ionic_adminq_post_wait(lif, &ctx);
-	if (err)
+	if (err && err != -EEXIST)
 		return err;
 
 	netdev_dbg(lif->netdev, "rx_filter del ADDR %pM (id %d)\n", addr,