Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next] sctp: remove unused var from sctp_process_asconf
From: David Miller @ 2017-01-16 18:52 UTC (permalink / raw)
  To: marcelo.leitner; +Cc: netdev, linux-sctp, vyasevich, nhorman
In-Reply-To: <5da2cda90a7489b22ae98703d7543c5316bae375.1484336552.git.marcelo.leitner@gmail.com>

From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Fri, 13 Jan 2017 18:27:33 -0200

> Assigned but not used.
> 
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Applied.

^ permalink raw reply

* [PATCH] qed: Replace memset with eth_zero_addr
From: Shyam Saini @ 2017-01-16 18:51 UTC (permalink / raw)
  To: Yuval.Mintz; +Cc: Ariel.Elior, everest-linux-l2, netdev, Shyam Saini

Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Also, it makes the code clearer

Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
---
 drivers/net/ethernet/qlogic/qed/qed_l2.c    | 2 +-
 drivers/net/ethernet/qlogic/qed/qed_sriov.c | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c
index 6a3727c..778c52c 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_l2.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c
@@ -1776,7 +1776,7 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
 	qed_fill_dev_info(cdev, &info->common);
 
 	if (IS_VF(cdev))
-		memset(info->common.hw_mac, 0, ETH_ALEN);
+		eth_zero_addr(info->common.hw_mac);
 
 	return 0;
 }
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
index 85b09dd..a15fff4 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
@@ -1199,7 +1199,7 @@ static void qed_iov_clean_vf(struct qed_hwfn *p_hwfn, u8 vfid)
 		return;
 
 	/* Clear the VF mac */
-	memset(vf_info->mac, 0, ETH_ALEN);
+	eth_zero_addr(vf_info->mac);
 }
 
 static void qed_iov_vf_cleanup(struct qed_hwfn *p_hwfn,
@@ -2539,8 +2539,7 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn,
 		for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++) {
 			if (ether_addr_equal(p_vf->shadow_config.macs[i],
 					     p_params->mac)) {
-				memset(p_vf->shadow_config.macs[i], 0,
-				       ETH_ALEN);
+				eth_zero_addr(p_vf->shadow_config.macs[i]);
 				break;
 			}
 		}
@@ -2553,7 +2552,7 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn,
 	} else if (p_params->opcode == QED_FILTER_REPLACE ||
 		   p_params->opcode == QED_FILTER_FLUSH) {
 		for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++)
-			memset(p_vf->shadow_config.macs[i], 0, ETH_ALEN);
+			eth_zero_addr(p_vf->shadow_config.macs[i]);
 	}
 
 	/* List the new MAC address */
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCHv3 net-next 1/7] sctp: add a common helper function to generate stream reconf chunk
From: David Miller @ 2017-01-16 18:50 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman, vyasevich
In-Reply-To: <5f8a7d818b5db99f2ff2a791a451b311c09fad7f.1484334002.git.lucien.xin@gmail.com>

From: Xin Long <lucien.xin@gmail.com>
Date: Sat, 14 Jan 2017 03:15:35 +0800

> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index a15d824..fd58097 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -3526,3 +3526,36 @@ struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc,
>  
>  	return retval;
>  }
> +
> +/* RE-CONFIG 3.1 (RE-CONFIG chunk)
> + *   0                   1                   2                   3
> + *   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> + *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> + *  | Type = 130    |  Chunk Flags  |      Chunk Length             |
> + *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> + *  \                                                               \
> + *  /                  Re-configuration Parameter                   /
> + *  \                                                               \
> + *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> + *  \                                                               \
> + *  /             Re-configuration Parameter (optional)             /
> + *  \                                                               \
> + *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> + */
> +static struct sctp_chunk *sctp_make_reconf(
> +				const struct sctp_association *asoc,
> +				int length)
> +{
> +	struct sctp_reconf_chunk *reconf;

This patch will cause a warning because this new static function is unused.

All patch series must be fully bisectable, that measn at each step of
the patch series the tree must work properly and not introduce new
build warnings or build failures.

^ permalink raw reply

* Re: [PATCH][V2] flow dissector: check if arp_eth is null rather than arp
From: David Miller @ 2017-01-16 18:49 UTC (permalink / raw)
  To: colin.king
  Cc: aduyck, jiri, tom, edumazet, hadarh, simon.horman, fgao, amir,
	netdev, linux-kernel
In-Reply-To: <20170113184820.823-1-colin.king@canonical.com>

From: Colin King <colin.king@canonical.com>
Date: Fri, 13 Jan 2017 18:48:20 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> arp is being checked instead of arp_eth to see if the call to
> __skb_header_pointer failed. Fix this by checking arp_eth is
> null instead of arp.   Also fix to use length hlen rather than
> hlen - sizeof(_arp); thanks to Eric Dumazet for spotting
> this latter issue.
> 
> CoverityScan CID#1396428 ("Logically dead code") on 2nd
> arp comparison (which should be arp_eth instead).
> 
> Fixes: commit 55733350e5e8b70c5 ("flow disector: ARP support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] net: constify mdiobb_ops structures
From: David Miller @ 2017-01-16 18:47 UTC (permalink / raw)
  To: bhumirks
  Cc: julia.lawall, pantelis.antoniou, vbordug, sergei.shtylyov,
	f.fainelli, netdev, linux-kernel, linuxppc-dev, linux-renesas-soc
In-Reply-To: <1484330546-16569-1-git-send-email-bhumirks@gmail.com>

From: Bhumika Goyal <bhumirks@gmail.com>
Date: Fri, 13 Jan 2017 23:32:26 +0530

> Declare mdiobb_ops structures as const as they are only stored in the
> ops field of mdiobb_ctrl structures. This field is of type const, so
> mdiobb_ops structures having this property can be declared const too.

This patch doesn't apply cleanly to net-next, please respin.

^ permalink raw reply

* Re: [PATCH net-next] netlink: do not enter direct reclaim from netlink_trim()
From: David Miller @ 2017-01-16 18:39 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1484327482.13165.38.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 13 Jan 2017 09:11:22 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> In commit d35c99ff77ecb ("netlink: do not enter direct reclaim from
> netlink_dump()") we made sure to not trigger expensive memory reclaim.
> 
> Problem is that a bit later, netlink_trim() might be called and
> trigger memory reclaim.
> 
> netlink_trim() should be best effort, and really as fast as possible.
> Under memory pressure, it is fine to not trim this skb.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks Eric.

^ permalink raw reply

* Re: [PATCH 1/3] powerpc: bpf: remove redundant check for non-null image
From: David Miller @ 2017-01-16 18:38 UTC (permalink / raw)
  To: naveen.n.rao; +Cc: mpe, linuxppc-dev, netdev, ast, daniel
In-Reply-To: <e73efe6facf6c06932b4a87707e5978172ee773e.1484326337.git.naveen.n.rao@linux.vnet.ibm.com>


I'm assuming these patches will go via the powerpc tree.

If you want them to go into net-next, I kindly ask that you always
explicitly say so, and furthermore always submit a patch series with
a proper "[PATCH 0/N] ..." header posting.

Thanks.

^ permalink raw reply

* Re: [PATCH net-next] cxgb4: Shutdown adapter if firmware times out or errors out
From: David Miller @ 2017-01-16 18:35 UTC (permalink / raw)
  To: hariprasad; +Cc: netdev, leedom, nirranjan, ganeshgr
In-Reply-To: <1484324726-29590-1-git-send-email-hariprasad@chelsio.com>

From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Fri, 13 Jan 2017 21:55:26 +0530

> Perform an emergency shutdown of the adapter and stop it from
> continuing any further communication on the ports or DMA to the
> host. This is typically used when the adapter and/or firmware
> have crashed and we want to prevent any further accidental
> communication with the rest of the world. This will also force
> the port Link Status to go down -- if register writes work --
> which should help our peers figure out that we're down.
> 
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH net v1 1/1] tipc: allocate user memory with GFP_KERNEL flag
From: David Miller @ 2017-01-16 18:32 UTC (permalink / raw)
  To: parthasarathy.bhuvaragan; +Cc: netdev, tipc-discussion, jon.maloy
In-Reply-To: <1484318785-20749-1-git-send-email-parthasarathy.bhuvaragan@ericsson.com>

From: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Date: Fri, 13 Jan 2017 15:46:25 +0100

> Until now, we allocate memory always with GFP_ATOMIC flag.
> When the system is under memory pressure and a user tries to send,
> the send fails due to low memory. However, the user application
> can wait for free memory if we allocate it using GFP_KERNEL flag.
> 
> In this commit, we use allocate memory with GFP_KERNEL for all user
> allocation.
> 
> Reported-by: Rune Torgersen <runet@innovsys.com>
> Acked-by: Jon Maloy <jon.maloy@ericsson.com>
> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>

Applied.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

^ permalink raw reply

* Re: [PATCH net-next] afs: Conditionalise a new unused variable
From: David Miller @ 2017-01-16 18:31 UTC (permalink / raw)
  To: dhowells; +Cc: netdev, linux-afs, linux-kernel
In-Reply-To: <148431877922.23745.3756091538832610041.stgit@warthog.procyon.org.uk>

From: David Howells <dhowells@redhat.com>
Date: Fri, 13 Jan 2017 14:46:19 +0000

> From: Arnd Bergmann <arnd@arndb.de>
> 
> The bulk readpages support introduced a harmless warning:
> 
> fs/afs/file.c: In function 'afs_readpages_page_done':
> fs/afs/file.c:270:20: error: unused variable 'vnode' [-Werror=unused-variable]
> 
> This adds an #ifdef to match the user of that variable.  The user of the
> variable has to be conditional because it accesses a member of a struct
> that is also conditional.
> 
> Fixes: 91b467e0a3f5 ("afs: Make afs_readpages() fetch data in bulk")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: David Howells <dhowells@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH] net: phy: dp83867: allow RGMII_TXID/RGMII_RXID interface types
From: David Miller @ 2017-01-16 18:30 UTC (permalink / raw)
  To: m-karicheri2-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	f.fainelli-Re5JQEeQqe8AvxtiuMwx3w, netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, nsekhar-l0cyMroinI0
In-Reply-To: <1484317954-27871-1-git-send-email-m-karicheri2-l0cyMroinI0@public.gmane.org>

From: Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>
Date: Fri, 13 Jan 2017 09:32:34 -0500

> Currently dp83867 driver returns error if phy interface type
> PHY_INTERFACE_MODE_RGMII_RXID is used to set the rx only internal
> delay. Similarly issue happens for PHY_INTERFACE_MODE_RGMII_TXID.
> Fix this by checking also the interface type if a particular delay
> value is missing in the phy dt bindings. Also update the DT document
> accordingly.
> 
> Signed-off-by: Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>
> Signed-off-by: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH V2] audit: log 32-bit socketcalls
From: David Miller @ 2017-01-16 18:27 UTC (permalink / raw)
  To: rgb; +Cc: netdev, linux-kernel, linux-audit, aixer77, eparis, pmoore,
	sgrubb
In-Reply-To: <dd937da01da72da9277e44ed79abd1f4618c14c5.1484297765.git.rgb@redhat.com>

From: Richard Guy Briggs <rgb@redhat.com>
Date: Fri, 13 Jan 2017 04:51:48 -0500

> diff --git a/include/linux/audit.h b/include/linux/audit.h
> index 9d4443f..43d8003 100644
> --- a/include/linux/audit.h
> +++ b/include/linux/audit.h
> @@ -387,6 +387,18 @@ static inline int audit_socketcall(int nargs, unsigned long *args)
>  		return __audit_socketcall(nargs, args);
>  	return 0;
>  }
> +static inline int audit_socketcall_compat(int nargs, u32 *args)
> +{

Please put an empty line between function definitions.

> +	if (unlikely(!audit_dummy_context())) {
> +		int i;
> +		unsigned long a[AUDITSC_ARGS];

Please order local variable declarations from longest to shortest line.

> +
> +		for (i=0; i<nargs; i++)

Please put a space around operators such as "=" and "<".

> +			a[i] = (unsigned long)args[i];
> +		return __audit_socketcall(nargs, a);
> +	}
> +	return 0;
> +}
>  static inline int audit_sockaddr(int len, void *addr)

Again, empty line between function definitions please.

> @@ -781,14 +782,24 @@ COMPAT_SYSCALL_DEFINE5(recvmmsg, int, fd, struct compat_mmsghdr __user *, mmsg,
>  
>  COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args)
>  {
> +	unsigned int len;
>  	int ret;
> -	u32 a[6];
> +	u32 a[AUDITSC_ARGS];
>  	u32 a0, a1;

Longest to shortest line for local variable declarations please.

^ permalink raw reply

* Re: [PATCH] qed: Replace memset with eth_zero_addr
From: David Miller @ 2017-01-16 18:25 UTC (permalink / raw)
  To: mayhs11saini; +Cc: Yuval.Mintz, Ariel.Elior, everest-linux-l2, netdev
In-Reply-To: <1484589810-13723-1-git-send-email-mayhs11saini@gmail.com>

From: Shyam Saini <mayhs11saini@gmail.com>
Date: Mon, 16 Jan 2017 23:33:30 +0530

> Use eth_zero_addr to assign zero address to the given address array
> instead of memset when the second argument in memset is address
> of zero. Also, it makes the code clearer
> 
> Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>

This doesn't apply cleanly to net-next, please respin.

^ permalink raw reply

* Re: [PATCH net] ip6_tunnel: Account for tunnel header in tunnel MTU
From: David Miller @ 2017-01-16 18:23 UTC (permalink / raw)
  To: jkbs; +Cc: netdev, tom
In-Reply-To: <1484298740-29199-1-git-send-email-jkbs@redhat.com>

From: Jakub Sitnicki <jkbs@redhat.com>
Date: Fri, 13 Jan 2017 10:12:20 +0100

> With ip6gre we have a tunnel header which also makes the tunnel MTU
> smaller. We need to reserve room for it. Previously we were using up
> space reserved for the Tunnel Encapsulation Limit option
> header (RFC 2473).
> 
> Also, after commit b05229f44228 ("gre6: Cleanup GREv6 transmit path,
> call common GRE functions") our contract with the caller has
> changed. Now we check if the packet length exceeds the tunnel MTU after
> the tunnel header has been pushed, unlike before.
> 
> This is reflected in the check where we look at the packet length minus
> the size of the tunnel header, which is already accounted for in tunnel
> MTU.
> 
> Fixes: b05229f44228 ("gre6: Cleanup GREv6 transmit path, call common GRE functions")
> Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: [PATCH v2] net/irda: fix lockdep annotation
From: kbuild test robot @ 2017-01-16 18:09 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: kbuild-all, davej, samuel, davem, glider, andreyknvl,
	Dmitry Vyukov, netdev
In-Reply-To: <20170116145129.102159-1-dvyukov@google.com>

[-- Attachment #1: Type: text/plain, Size: 5629 bytes --]

Hi Dmitry,

[auto build test ERROR on tip/locking/core]
[also build test ERROR on v4.10-rc4 next-20170116]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Vyukov/net-irda-fix-lockdep-annotation/20170117-001737
config: i386-defconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/mmzone.h:7:0,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:14,
                    from drivers/gpu/drm/i915/i915_sw_fence.c:10:
   drivers/gpu/drm/i915/i915_sw_fence.c: In function '__i915_sw_fence_wake_up_all':
>> include/linux/spinlock.h:217:3: error: void value not ignored as it ought to be
      (void)subclass;      \
       
>> include/linux/spinlock.h:335:2: note: in expansion of macro 'raw_spin_lock_irqsave_nested'
     raw_spin_lock_irqsave_nested(spinlock_check(lock), flags, subclass); \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/i915_sw_fence.c:68:2: note: in expansion of macro 'spin_lock_irqsave_nested'
     spin_lock_irqsave_nested(&x->lock, flags, 1 + !!continuation);
     ^~~~~~~~~~~~~~~~~~~~~~~~

vim +217 include/linux/spinlock.h

   211			typecheck(unsigned long, flags);			\
   212			flags = _raw_spin_lock_irqsave_nested(lock, subclass);	\
   213		} while (0)
   214	#else
   215	#define raw_spin_lock_irqsave_nested(lock, flags, subclass)		\
   216		do {								\
 > 217			(void)subclass;						\
   218			typecheck(unsigned long, flags);			\
   219			flags = _raw_spin_lock_irqsave(lock);			\
   220		} while (0)
   221	#endif
   222	
   223	#else
   224	
   225	#define raw_spin_lock_irqsave(lock, flags)		\
   226		do {						\
   227			typecheck(unsigned long, flags);	\
   228			_raw_spin_lock_irqsave(lock, flags);	\
   229		} while (0)
   230	
   231	#define raw_spin_lock_irqsave_nested(lock, flags, subclass)	\
   232		raw_spin_lock_irqsave(lock, flags)
   233	
   234	#endif
   235	
   236	#define raw_spin_lock_irq(lock)		_raw_spin_lock_irq(lock)
   237	#define raw_spin_lock_bh(lock)		_raw_spin_lock_bh(lock)
   238	#define raw_spin_unlock(lock)		_raw_spin_unlock(lock)
   239	#define raw_spin_unlock_irq(lock)	_raw_spin_unlock_irq(lock)
   240	
   241	#define raw_spin_unlock_irqrestore(lock, flags)		\
   242		do {							\
   243			typecheck(unsigned long, flags);		\
   244			_raw_spin_unlock_irqrestore(lock, flags);	\
   245		} while (0)
   246	#define raw_spin_unlock_bh(lock)	_raw_spin_unlock_bh(lock)
   247	
   248	#define raw_spin_trylock_bh(lock) \
   249		__cond_lock(lock, _raw_spin_trylock_bh(lock))
   250	
   251	#define raw_spin_trylock_irq(lock) \
   252	({ \
   253		local_irq_disable(); \
   254		raw_spin_trylock(lock) ? \
   255		1 : ({ local_irq_enable(); 0;  }); \
   256	})
   257	
   258	#define raw_spin_trylock_irqsave(lock, flags) \
   259	({ \
   260		local_irq_save(flags); \
   261		raw_spin_trylock(lock) ? \
   262		1 : ({ local_irq_restore(flags); 0; }); \
   263	})
   264	
   265	/**
   266	 * raw_spin_can_lock - would raw_spin_trylock() succeed?
   267	 * @lock: the spinlock in question.
   268	 */
   269	#define raw_spin_can_lock(lock)	(!raw_spin_is_locked(lock))
   270	
   271	/* Include rwlock functions */
   272	#include <linux/rwlock.h>
   273	
   274	/*
   275	 * Pull the _spin_*()/_read_*()/_write_*() functions/declarations:
   276	 */
   277	#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
   278	# include <linux/spinlock_api_smp.h>
   279	#else
   280	# include <linux/spinlock_api_up.h>
   281	#endif
   282	
   283	/*
   284	 * Map the spin_lock functions to the raw variants for PREEMPT_RT=n
   285	 */
   286	
   287	static __always_inline raw_spinlock_t *spinlock_check(spinlock_t *lock)
   288	{
   289		return &lock->rlock;
   290	}
   291	
   292	#define spin_lock_init(_lock)				\
   293	do {							\
   294		spinlock_check(_lock);				\
   295		raw_spin_lock_init(&(_lock)->rlock);		\
   296	} while (0)
   297	
   298	static __always_inline void spin_lock(spinlock_t *lock)
   299	{
   300		raw_spin_lock(&lock->rlock);
   301	}
   302	
   303	static __always_inline void spin_lock_bh(spinlock_t *lock)
   304	{
   305		raw_spin_lock_bh(&lock->rlock);
   306	}
   307	
   308	static __always_inline int spin_trylock(spinlock_t *lock)
   309	{
   310		return raw_spin_trylock(&lock->rlock);
   311	}
   312	
   313	#define spin_lock_nested(lock, subclass)			\
   314	do {								\
   315		raw_spin_lock_nested(spinlock_check(lock), subclass);	\
   316	} while (0)
   317	
   318	#define spin_lock_nest_lock(lock, nest_lock)				\
   319	do {									\
   320		raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock);	\
   321	} while (0)
   322	
   323	static __always_inline void spin_lock_irq(spinlock_t *lock)
   324	{
   325		raw_spin_lock_irq(&lock->rlock);
   326	}
   327	
   328	#define spin_lock_irqsave(lock, flags)				\
   329	do {								\
   330		raw_spin_lock_irqsave(spinlock_check(lock), flags);	\
   331	} while (0)
   332	
   333	#define spin_lock_irqsave_nested(lock, flags, subclass)			\
   334	do {									\
 > 335		raw_spin_lock_irqsave_nested(spinlock_check(lock), flags, subclass); \
   336	} while (0)
   337	
   338	static __always_inline void spin_unlock(spinlock_t *lock)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25439 bytes --]

^ permalink raw reply

* [PATCH] qed: Replace memset with eth_zero_addr
From: Shyam Saini @ 2017-01-16 18:03 UTC (permalink / raw)
  To: Yuval.Mintz; +Cc: Ariel.Elior, everest-linux-l2, netdev, Shyam Saini

Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Also, it makes the code clearer

Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
---
 drivers/net/ethernet/qlogic/qed/qed_l2.c    | 2 +-
 drivers/net/ethernet/qlogic/qed/qed_sriov.c | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c
index 6a3727c..778c52c 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_l2.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c
@@ -1776,7 +1776,7 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
 	qed_fill_dev_info(cdev, &info->common);
 
 	if (IS_VF(cdev))
-		memset(info->common.hw_mac, 0, ETH_ALEN);
+		eth_zero_addr(info->common.hw_mac);
 
 	return 0;
 }
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
index 85b09dd..a15fff4 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
@@ -1199,7 +1199,7 @@ static void qed_iov_clean_vf(struct qed_hwfn *p_hwfn, u8 vfid)
 		return;
 
 	/* Clear the VF mac */
-	memset(vf_info->mac, 0, ETH_ALEN);
+	eth_zero_addr(vf_info->mac);
 }
 
 static void qed_iov_vf_cleanup(struct qed_hwfn *p_hwfn,
@@ -2539,8 +2539,7 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn,
 		for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++) {
 			if (ether_addr_equal(p_vf->shadow_config.macs[i],
 					     p_params->mac)) {
-				memset(p_vf->shadow_config.macs[i], 0,
-				       ETH_ALEN);
+				eth_zero_addr(p_vf->shadow_config.macs[i]);
 				break;
 			}
 		}
@@ -2553,7 +2552,7 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn,
 	} else if (p_params->opcode == QED_FILTER_REPLACE ||
 		   p_params->opcode == QED_FILTER_FLUSH) {
 		for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++)
-			memset(p_vf->shadow_config.macs[i], 0, ETH_ALEN);
+			eth_zero_addr(p_vf->shadow_config.macs[i]);
 	}
 
 	/* List the new MAC address */
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH iproute2 1/1] utils: make hex2mem available to all users
From: Stephen Hemminger @ 2017-01-16 17:51 UTC (permalink / raw)
  To: Jamal Hadi Salim; +Cc: netdev
In-Reply-To: <b7ca90ca-dd72-3f20-7509-7732742941a7@mojatatu.com>

On Sat, 14 Jan 2017 17:09:58 -0500
Jamal Hadi Salim <jhs@mojatatu.com> wrote:

> Sorry, messed up Stephen's address. Resending..
> 
> cheers,
> jamal

No problem. I get almost all patches only from patchwork anyway.

^ permalink raw reply

* Re: [PATCH] net: marvell: skge: use new api ethtool_{get|set}_link_ksettings
From: Stephen Hemminger @ 2017-01-16 17:50 UTC (permalink / raw)
  To: David Miller; +Cc: tremyfr, mlindner, netdev, linux-kernel
In-Reply-To: <20170116.123617.1891198374111644473.davem@davemloft.net>

On Mon, 16 Jan 2017 12:36:17 -0500 (EST)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Mon, 16 Jan 2017 09:29:51 -0800
> 
> > On Sat, 14 Jan 2017 13:08:28 +0100
> > Philippe Reynes <tremyfr@gmail.com> wrote:
> >   
> >> The ethtool api {get|set}_settings is deprecated.
> >> We move this driver to new api {get|set}_link_ksettings.
> >> 
> >> The callback set_link_ksettings no longer update the value
> >> of advertising, as the struct ethtool_link_ksettings is
> >> defined as const.
> >> 
> >> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>  
> > 
> > Did you test this on real hardware?  
> 
> Philippe probably doesn't have physical access to most of the
> drivers he is converting.
> 
> But, he is the only person working on converting all of the drivers,
> and therefore when the change looks straightforward I am going to
> reward his work and effort by applying his changes and hope there
> isn't any fallout.
> 
> Those who really care can test his patches and give a Tested-by:
> 
> Thanks.

Yes, it looks mechanical and should be applied. There are lots of pieces of
old hardware that no developer is running, and if we required full test suite runs
on all drivers, then no refactoring would ever be possible.

My preference is to always add commit note that the patch was compile
tested only so that if someone has a problem with real hardware then they know
what to suspect.

^ permalink raw reply

* Re: [PATCH net] mld: do not remove mld souce list info when set link down
From: David Miller @ 2017-01-16 17:45 UTC (permalink / raw)
  To: liuhangbin; +Cc: netdev
In-Reply-To: <1484227177-7857-1-git-send-email-liuhangbin@gmail.com>

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Thu, 12 Jan 2017 21:19:37 +0800

> This is an IPv6 version of commit 24803f38a5c0 ("igmp: do not remove igmp
> souce list..."). In mld_del_delrec(), we will restore back all source filter
> info instead of flush them.
> 
> Move mld_clear_delrec() from ipv6_mc_down() to ipv6_mc_destroy_dev() since
> we should not remove source list info when set link down. Remove
> igmp6_group_dropped() in ipv6_mc_destroy_dev() since we have called it in
> ipv6_mc_down().
> 
> Also clear all source info after igmp6_group_dropped() instead of in it
> because ipv6_mc_down() will call igmp6_group_dropped().
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 3/3] net: ipv6: Add option to dump multipath routes via RTA_MULTIPATH attribute
From: David Ahern @ 2017-01-16 17:40 UTC (permalink / raw)
  To: netdev; +Cc: ddutt, roopa
In-Reply-To: <1484510826-2723-4-git-send-email-dsa@cumulusnetworks.com>

upon further review ...

On 1/15/17 1:07 PM, David Ahern wrote:
> To maintain backwards compatibility, a user has to request the change
> in behavior. Unfortunately, adding a flag to the header similar to a
> previous patch does not work here as the netlink header for route dumps
> can be either rtgenmsg or ifinfomsg. sysctl is the other commonly used
> option for backwards compatibility but it is overly abused and is not
> really appropriate for this situation since each request should be able
> to specify the preference for the RTA_MULTIPATH attribute (e.g, one
> command may understand RTA_MULTIPATH for IPv6 while another may not).

The ancillary header is supposed to be struct rtmsg, so the change in behavior can be done by requiring the rtmsg struct and then passing the RTM_F_ALL_NEXTHOPS flag in rtm_flags. This makes the user api for delete requests and dumps consistent.

...

> @@ -422,9 +436,22 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
>  		cb->args[2] = (long)w;
>  	}
>  
> +	hdrlen = nlmsg_len(cb->nlh) < sizeof(struct ifinfomsg) ?
> +		 sizeof(struct rtgenmsg) : sizeof(struct ifinfomsg);
> +
> +	if (nlmsg_parse(cb->nlh, hdrlen, nlattr, RTA_MAX, NULL) >= 0) {
> +		/* existence of RTA_MULTIPATH attribute in dump
> +		 * request means user wants multipath routes
> +		 * returned using RTA_MULTIPATH attribute
> +		 */
> +		if (nlattr[RTA_MULTIPATH])
> +			flags |= RTM_F_ALL_NEXTHOPS;
> +	}
> +

And the above becomes:

+       /* sadly, the size of the ancillary header can vary: the correct
+        * header is struct rtmsg as passed by libnl. iproute2 sends
+        * ifinfomsg [+ filter]. Technically, passing only rtgenmsg is
+        * sufficient since the header has not been parsed before. Luckily,
+        * the struct sizes sufficiently vary to detect the permutations.
+        * For the dump request to contain flags require rtmsg header.
+        */
+       if (nlmsg_len(cb->nlh) == sizeof(struct rtmsg)) {
+               struct rtmsg *rtm = nlmsg_data(cb->nlh);
+
+               flags = rtm->rtm_flags;
+       }

^ permalink raw reply

* Re: [PATCH 1/2] qed: Replace memset with eth_zero_addr
From: Shyam Saini @ 2017-01-16 17:40 UTC (permalink / raw)
  To: David Miller; +Cc: Yuval.Mintz, Ariel.Elior, everest-linux-l2, netdev
In-Reply-To: <20170116.114606.1692928906878877115.davem@davemloft.net>

On Mon, Jan 16, 2017 at 11:46:06AM -0500, David Miller wrote:
> From: Shyam Saini <mayhs11saini@gmail.com>
> Date: Mon, 16 Jan 2017 14:54:35 +0530
> 
> > On Sun, Jan 15, 2017 at 11:38:30PM -0500, David Miller wrote:
> >> 
> >> Please do not ever submit two patches which have the same exact commit
> >> header line, as these two patches do.
> >> 
> >> When someone looks into the shortlog of GIT history all they will see
> >> is "qed: Replace memset with eth_zero_addr" twice.
> >> 
> >> This gives the reader no idea what might be different between those
> >> two changes.
> >> 
> >> Therefore you must give unique a commit header text for each change,
> >> which communicates sufficiently what is different in each change.
> > 
> > Thanks a lot for correcting me. I'll take care of this thing.
> > 
> > I'm resending these two patches as 
> > 	1). qed: Replace memset with eth_zero_addr
> > 	2). qed: Use eth_zero_addr
> > 	
> > I hope it resolves same commit header line conflict.
> 
> You aren't understanding the point.
> 
> Those two lines still say exactly the same thing.
> 
> What is different about these two changes?  The answer to that question
> must propagate into those lines of text.

I got your point now. As pointed by you and Mintz,  I'll resend it
as a single patch. 

I sincerely appreciate your efforts for making things clearer and
correcting me.

Thanks a lot,
Shyam

^ permalink raw reply

* Re: [PATCH] net: marvell: skge: use new api ethtool_{get|set}_link_ksettings
From: David Miller @ 2017-01-16 17:36 UTC (permalink / raw)
  To: stephen; +Cc: tremyfr, mlindner, netdev, linux-kernel
In-Reply-To: <20170116092951.3b577463@xeon-e3>

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 16 Jan 2017 09:29:51 -0800

> On Sat, 14 Jan 2017 13:08:28 +0100
> Philippe Reynes <tremyfr@gmail.com> wrote:
> 
>> The ethtool api {get|set}_settings is deprecated.
>> We move this driver to new api {get|set}_link_ksettings.
>> 
>> The callback set_link_ksettings no longer update the value
>> of advertising, as the struct ethtool_link_ksettings is
>> defined as const.
>> 
>> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
> 
> Did you test this on real hardware?

Philippe probably doesn't have physical access to most of the
drivers he is converting.

But, he is the only person working on converting all of the drivers,
and therefore when the change looks straightforward I am going to
reward his work and effort by applying his changes and hope there
isn't any fallout.

Those who really care can test his patches and give a Tested-by:

Thanks.

^ permalink raw reply

* [PATCH net-next 2/9] net/mlx4_core: Device revision support
From: Tariq Toukan @ 2017-01-16 17:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Yishai Hadas, Tariq Toukan
In-Reply-To: <1484587805-12666-1-git-send-email-tariqt@mellanox.com>

From: Yishai Hadas <yishaih@mellanox.com>

The device revision field returned by the NodeInfo MAD is incorrect
on ConnectX3 devices.

This patch is driver side handling to complete a FW fix added at 2.11.1172.
INIT_HCA - bit at offset 0x0C.12 is set to 1 so that FW will report
correct device revision.

Older FW versions won't be affected from turning on that bit,
no capability bit is needed.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index 25b5b32e958f..de39a5db4a6f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -1875,7 +1875,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param)
 	*((u8 *) mailbox->buf + INIT_HCA_VERSION_OFFSET) = INIT_HCA_VERSION;
 
 	*((u8 *) mailbox->buf + INIT_HCA_CACHELINE_SZ_OFFSET) =
-		(ilog2(cache_line_size()) - 4) << 5;
+		((ilog2(cache_line_size()) - 4) << 5) | (1 << 4);
 
 #if defined(__LITTLE_ENDIAN)
 	*(inbox + INIT_HCA_FLAGS_OFFSET / 4) &= ~cpu_to_be32(1 << 1);
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH net-next 5/9] net/mlx4_core: Get num_tc using netdev_get_num_tc
From: Tariq Toukan @ 2017-01-16 17:30 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Alaa Hleihel, Tariq Toukan
In-Reply-To: <1484587805-12666-1-git-send-email-tariqt@mellanox.com>

From: Alaa Hleihel <alaa@mellanox.com>

Avoid reading num_tc directly from struct net_device, but use
the helper function netdev_get_num_tc.

Fixes: bc6a4744b827 ("net/mlx4_en: num cores tx rings for every UP")
Fixes: f5b6345ba8da ("net/mlx4_en: User prio mapping gets corrupted when changing number of channels")
Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 2 +-
 drivers/net/ethernet/mellanox/mlx4/en_tx.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index 63f5b0ab95d6..0ab644b6c2e6 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -1793,7 +1793,7 @@ static int mlx4_en_set_channels(struct net_device *dev,
 	netif_set_real_num_tx_queues(dev, priv->tx_ring_num[TX]);
 	netif_set_real_num_rx_queues(dev, priv->rx_ring_num);
 
-	if (dev->num_tc)
+	if (netdev_get_num_tc(dev))
 		mlx4_en_setup_tc(dev, MLX4_EN_NUM_UP);
 
 	en_warn(priv, "Using %d TX rings\n", priv->tx_ring_num[TX]);
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index 5886ad78058f..3ed42199d3f1 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -710,7 +710,7 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb,
 	u16 rings_p_up = priv->num_tx_rings_p_up;
 	u8 up = 0;
 
-	if (dev->num_tc)
+	if (netdev_get_num_tc(dev))
 		return skb_tx_hash(dev, skb);
 
 	if (skb_vlan_tag_present(skb))
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH net-next 9/9] net/mlx4_en: Check the enabling pptx/pprx flags in SET_PORT wrapper flow
From: Tariq Toukan @ 2017-01-16 17:30 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Shaker Daibes, Tariq Toukan
In-Reply-To: <1484587805-12666-1-git-send-email-tariqt@mellanox.com>

From: Shaker Daibes <shakerd@mellanox.com>

Make sure pptx/pprx mask flag is set using new fields upon set port
request. In addition, move this code into a helper function for better
code readability.

Signed-off-by: Shaker Daibes <shakerd@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_port.h |  1 -
 drivers/net/ethernet/mellanox/mlx4/mlx4.h    |  4 ++-
 drivers/net/ethernet/mellanox/mlx4/port.c    | 42 ++++++++++++++++++----------
 3 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_port.h b/drivers/net/ethernet/mellanox/mlx4/en_port.h
index 040da4b16b1c..930f961fee42 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_port.h
+++ b/drivers/net/ethernet/mellanox/mlx4/en_port.h
@@ -35,7 +35,6 @@
 #define _MLX4_EN_PORT_H_
 
 
-#define SET_PORT_GEN_ALL_VALID	0x7
 #define SET_PORT_PROMISC_SHIFT	31
 #define SET_PORT_MC_PROMISC_SHIFT	30
 
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index 1132d76ddfdf..7a495090b0bc 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -776,7 +776,9 @@ struct mlx4_vlan_table {
 	int			max;
 };
 
-#define SET_PORT_GEN_ALL_VALID		0x7
+#define SET_PORT_GEN_ALL_VALID	(MLX4_FLAG_V_MTU_MASK	| \
+				 MLX4_FLAG_V_PPRX_MASK	| \
+				 MLX4_FLAG_V_PPTX_MASK)
 #define SET_PORT_PROMISC_SHIFT		31
 #define SET_PORT_MC_PROMISC_SHIFT	30
 
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 57a10575a7aa..5053c949148f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -53,6 +53,8 @@
 #define MLX4_FLAG2_V_IGNORE_FCS_MASK		BIT(1)
 #define MLX4_FLAG2_V_USER_MTU_MASK		BIT(5)
 #define MLX4_FLAG_V_MTU_MASK			BIT(0)
+#define MLX4_FLAG_V_PPRX_MASK			BIT(1)
+#define MLX4_FLAG_V_PPTX_MASK			BIT(2)
 #define MLX4_IGNORE_FCS_MASK			0x1
 #define MLX4_TC_MAX_NUMBER			8
 
@@ -1305,12 +1307,32 @@ void mlx4_reset_roce_gids(struct mlx4_dev *dev, int slave)
 	gen_context->user_mtu = cpu_to_be16(master->max_user_mtu[port]);
 }
 
+static void
+mlx4_en_set_port_global_pause(struct mlx4_dev *dev, int slave,
+			      struct mlx4_set_port_general_context *gen_context)
+{
+	struct mlx4_priv *priv = mlx4_priv(dev);
+	struct mlx4_mfunc_master_ctx *master = &priv->mfunc.master;
+
+	/* Slave cannot change Global Pause configuration */
+	if (slave != mlx4_master_func_num(dev) &&
+	    (gen_context->pptx != master->pptx ||
+	     gen_context->pprx != master->pprx)) {
+		gen_context->pptx = master->pptx;
+		gen_context->pprx = master->pprx;
+		mlx4_warn(dev, "denying Global Pause change for slave:%d\n",
+			  slave);
+	} else {
+		master->pptx = gen_context->pptx;
+		master->pprx = gen_context->pprx;
+	}
+}
+
 static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod,
 				u8 op_mod, struct mlx4_cmd_mailbox *inbox)
 {
 	struct mlx4_priv *priv = mlx4_priv(dev);
 	struct mlx4_port_info *port_info;
-	struct mlx4_mfunc_master_ctx *master = &priv->mfunc.master;
 	struct mlx4_set_port_rqp_calc_context *qpn_context;
 	struct mlx4_set_port_general_context *gen_context;
 	struct mlx4_roce_gid_entry *gid_entry_tbl, *gid_entry_mbox, *gid_entry_mb1;
@@ -1372,19 +1394,11 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod,
 				mlx4_en_set_port_user_mtu(dev, slave, port,
 							  gen_context);
 
-			/* Slave cannot change Global Pause configuration */
-			if (slave != mlx4_master_func_num(dev) &&
-			    ((gen_context->pptx != master->pptx) ||
-			     (gen_context->pprx != master->pprx))) {
-				gen_context->pptx = master->pptx;
-				gen_context->pprx = master->pprx;
-				mlx4_warn(dev,
-					  "denying Global Pause change for slave:%d\n",
-					  slave);
-			} else {
-				master->pptx = gen_context->pptx;
-				master->pprx = gen_context->pprx;
-			}
+			if (gen_context->flags &
+			    (MLX4_FLAG_V_PPRX_MASK || MLX4_FLAG_V_PPTX_MASK))
+				mlx4_en_set_port_global_pause(dev, slave,
+							      gen_context);
+
 			break;
 		case MLX4_SET_PORT_GID_TABLE:
 			/* change to MULTIPLE entries: number of guest's gids
-- 
1.8.3.1

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox