Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf534588 authored by Vijaya Mohan Guvva's avatar Vijaya Mohan Guvva Committed by David S. Miller
Browse files

liquidio: Fix an issue with multiple switchdev enable disables



Return success if the same dispatch function is being registered for
a given opcode and subcode, there by allow multiple switchdev enable
and disables.

Signed-off-by: default avatarVijaya Mohan Guvva <vijaya.guvva@cavium.com>
Signed-off-by: default avatarSatanand Burla <satananda.burla@cavium.com>
Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de4cc8bd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1180,6 +1180,10 @@ octeon_register_dispatch_fn(struct octeon_device *oct,
		spin_unlock_bh(&oct->dispatch.lock);

	} else {
		if (pfn == fn &&
		    octeon_get_dispatch_arg(oct, opcode, subcode) == fn_arg)
			return 0;

		dev_err(&oct->pci_dev->dev,
			"Found previously registered dispatch fn for opcode/subcode: %x/%x\n",
			opcode, subcode);
+2 −2
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ struct __dispatch {
 *  @return  Failure: NULL
 *
 */
static inline void *octeon_get_dispatch_arg(struct octeon_device *octeon_dev,
void *octeon_get_dispatch_arg(struct octeon_device *octeon_dev,
			      u16 opcode, u16 subcode)
{
	int idx;
+3 −0
Original line number Diff line number Diff line
@@ -400,6 +400,9 @@ int octeon_register_dispatch_fn(struct octeon_device *oct,
				u16 subcode,
				octeon_dispatch_fn_t fn, void *fn_arg);

void *octeon_get_dispatch_arg(struct octeon_device *oct,
			      u16 opcode, u16 subcode);

void octeon_droq_print_stats(void);

u32 octeon_droq_check_hw_for_pkts(struct octeon_droq *droq);