Netdev List
 help / color / mirror / Atom feed
* [PATCH 2/2] drivers: isdn: icn: icn.h Clean up trivial checkpatch errors.
From: Bas Peters @ 2015-02-07 15:56 UTC (permalink / raw)
  To: isdn; +Cc: dan.carpenter, davem, netdev, linux-kernel, Bas Peters
In-Reply-To: <1423324566-5538-1-git-send-email-baspeters93@gmail.com>

---
 drivers/isdn/icn/icn.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/isdn/icn/icn.h b/drivers/isdn/icn/icn.h
index b713466..05daed2 100644
--- a/drivers/isdn/icn/icn.h
+++ b/drivers/isdn/icn/icn.h
@@ -54,7 +54,7 @@ typedef struct icn_cdef {
 
 /* some useful macros for debugging */
 #ifdef ICN_DEBUG_PORT
-#define OUTB_P(v, p) {printk(KERN_DEBUG "icn: outb_p(0x%02x,0x%03x)\n", v, p); outb_p(v, p);}
+#define OUTB_P(v, p) {printk(KERN_DEBUG "icn: outb_p(0x%02x,0x%03x)\n", v, p); outb_p(v, p); }
 #else
 #define OUTB_P outb
 #endif
@@ -186,8 +186,7 @@ typedef icn_dev *icn_devptr;
 #ifdef __KERNEL__
 
 static icn_card *cards = (icn_card *) 0;
-static u_char chan2bank[] =
-{0, 4, 8, 12};                  /* for icn_map_channel() */
+static u_char chan2bank[] = {0, 4, 8, 12}; /* for icn_map_channel() */
 
 static icn_dev dev;
 
-- 
2.1.0

^ permalink raw reply related

* [PATCH 1/2] drivers: isdn: icn: icn.c: clean up all checkpatch errors
From: Bas Peters @ 2015-02-07 15:56 UTC (permalink / raw)
  To: isdn; +Cc: dan.carpenter, davem, netdev, linux-kernel, Bas Peters
In-Reply-To: <1423324566-5538-1-git-send-email-baspeters93@gmail.com>

This patch cleans up various trivial checkpatch errors such as variable
declarations in if statements, return values in parenthesis and a
wrongly placed brace.
---
 drivers/isdn/icn/icn.c | 52 ++++++++++++++++++++++++++++++--------------------
 1 file changed, 31 insertions(+), 21 deletions(-)

diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c
index 6a7447c..f499d5a 100644
--- a/drivers/isdn/icn/icn.c
+++ b/drivers/isdn/icn/icn.c
@@ -62,7 +62,8 @@ icn_free_queue(icn_card *card, int channel)
 	skb_queue_purge(queue);
 	card->xlen[channel] = 0;
 	card->sndcount[channel] = 0;
-	if ((skb = card->xskb[channel])) {
+	skb = card->xskb[channel];
+	if (skb) {
 		card->xskb[channel] = NULL;
 		dev_kfree_skb(skb);
 	}
@@ -272,8 +273,10 @@ icn_pollbchan_receive(int channel, icn_card *card)
 			rbnext;
 			icn_maprelease_channel(card, mch & 2);
 			if (!eflag) {
-				if ((cnt = card->rcvidx[channel])) {
-					if (!(skb = dev_alloc_skb(cnt))) {
+				cnt = card->rcvidx[channel];
+				if (cnt) {
+					skb = dev_alloc_skb(cnt);
+					if (!skb) {
 						printk(KERN_WARNING "icn: receive out of memory\n");
 						break;
 					}
@@ -409,8 +412,7 @@ typedef struct icn_stat {
 	int action;
 } icn_stat;
 /* *INDENT-OFF* */
-static icn_stat icn_stat_table[] =
-{
+static icn_stat icn_stat_table[] = {
 	{"BCON_",          ISDN_STAT_BCONN, 1},	/* B-Channel connected        */
 	{"BDIS_",          ISDN_STAT_BHUP,  2},	/* B-Channel disconnected     */
 	/*
@@ -807,7 +809,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
 #ifdef BOOT_DEBUG
 	printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) buffer);
 #endif
-	if (!(codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL))) {
+	codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL);
+	if (!codebuf) {
 		printk(KERN_WARNING "icn: Could not allocate code buffer\n");
 		ret = -ENOMEM;
 		goto out;
@@ -878,7 +881,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
 	}
 	SLEEP(1);
 	OUTB_P(0xff, ICN_RUN);  /* Start Boot-Code */
-	if ((ret = icn_check_loader(card->doubleS0 ? 2 : 1))) {
+	ret = icn_check_loader(card->doubleS0 ? 2 : 1);
+	if (ret) {
 		goto out_kfree;
 	}
 	if (!card->doubleS0) {
@@ -1246,10 +1250,11 @@ icn_command(isdn_ctrl *c, icn_card *card)
 				dev.firstload = 0;
 			}
 			icn_stopcard(card);
-			return (icn_loadboot(arg, card));
+			return icn_loadboot(arg, card);
 		case ICN_IOCTL_LOADPROTO:
 			icn_stopcard(card);
-			if ((i = (icn_loadproto(arg, card))))
+			i = icn_loadproto(arg, card);
+			if (i)
 				return i;
 			if (card->doubleS0)
 				i = icn_loadproto(arg + ICN_CODE_STAGE2, card->other);
@@ -1262,7 +1267,7 @@ icn_command(isdn_ctrl *c, icn_card *card)
 					   arg,
 					   sizeof(cdef)))
 				return -EFAULT;
-			return (icn_addcard(cdef.port, cdef.id1, cdef.id2));
+			return icn_addcard(cdef.port, cdef.id1, cdef.id2);
 			break;
 		case ICN_IOCTL_LEASEDCFG:
 			if (a) {
@@ -1458,7 +1463,7 @@ if_command(isdn_ctrl *c)
 	icn_card *card = icn_findcard(c->driver);
 
 	if (card)
-		return (icn_command(c, card));
+		return icn_command(c, card);
 	printk(KERN_ERR
 	       "icn: if_command %d called with invalid driverId %d!\n",
 	       c->command, c->driver);
@@ -1473,7 +1478,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel)
 	if (card) {
 		if (!(card->flags & ICN_FLAGS_RUNNING))
 			return -ENODEV;
-		return (icn_writecmd(buf, len, 1, card));
+		return icn_writecmd(buf, len, 1, card);
 	}
 	printk(KERN_ERR
 	       "icn: if_writecmd called with invalid driverId!\n");
@@ -1488,7 +1493,7 @@ if_readstatus(u_char __user *buf, int len, int id, int channel)
 	if (card) {
 		if (!(card->flags & ICN_FLAGS_RUNNING))
 			return -ENODEV;
-		return (icn_readstatus(buf, len, card));
+		return icn_readstatus(buf, len, card);
 	}
 	printk(KERN_ERR
 	       "icn: if_readstatus called with invalid driverId!\n");
@@ -1503,7 +1508,7 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff *skb)
 	if (card) {
 		if (!(card->flags & ICN_FLAGS_RUNNING))
 			return -ENODEV;
-		return (icn_sendbuf(channel, ack, skb, card));
+		return icn_sendbuf(channel, ack, skb, card);
 	}
 	printk(KERN_ERR
 	       "icn: if_sendbuf called with invalid driverId!\n");
@@ -1520,7 +1525,8 @@ icn_initcard(int port, char *id)
 	icn_card *card;
 	int i;
 
-	if (!(card = kzalloc(sizeof(icn_card), GFP_KERNEL))) {
+	card = kzalloc(sizeof(icn_card), GFP_KERNEL);
+	if (!card) {
 		printk(KERN_WARNING
 		       "icn: (%s) Could not allocate card-struct.\n", id);
 		return (icn_card *) 0;
@@ -1568,7 +1574,8 @@ icn_addcard(int port, char *id1, char *id2)
 	icn_card *card;
 	icn_card *card2;
 
-	if (!(card = icn_initcard(port, id1))) {
+	card = icn_initcard(port, id1);
+	if (!card) {
 		return -EIO;
 	}
 	if (!strlen(id2)) {
@@ -1577,7 +1584,8 @@ icn_addcard(int port, char *id1, char *id2)
 		       card->interface.id, port);
 		return 0;
 	}
-	if (!(card2 = icn_initcard(port, id2))) {
+	card2 = icn_initcard(port, id2);
+	if (!card2) {
 		printk(KERN_INFO
 		       "icn: (%s) half ICN-4B, port 0x%x added\n", id2, port);
 		return 0;
@@ -1611,13 +1619,14 @@ icn_setup(char *line)
 	if (str && *str) {
 		strcpy(sid, str);
 		icn_id = sid;
-		if ((p = strchr(sid, ','))) {
+		p = strchr(sid, ',');
+		if (p) {
 			*p++ = 0;
 			strcpy(sid2, p);
 			icn_id2 = sid2;
 		}
 	}
-	return (1);
+	return 1;
 }
 __setup("icn=", icn_setup);
 #endif /* MODULE */
@@ -1634,7 +1643,8 @@ static int __init icn_init(void)
 	dev.firstload = 1;
 	spin_lock_init(&dev.devlock);
 
-	if ((p = strchr(revision, ':'))) {
+	p = strchr(revision, ':');
+	if (p) {
 		strncpy(rev, p + 1, 20);
 		rev[20] = '\0';
 		p = strchr(rev, '$');
@@ -1644,7 +1654,7 @@ static int __init icn_init(void)
 		strcpy(rev, " ??? ");
 	printk(KERN_NOTICE "ICN-ISDN-driver Rev%smem=0x%08lx\n", rev,
 	       dev.memaddr);
-	return (icn_addcard(portbase, icn_id, icn_id2));
+	return icn_addcard(portbase, icn_id, icn_id2);
 }
 
 static void __exit icn_exit(void)
-- 
2.1.0

^ permalink raw reply related

* [PATCH 0/2] drivers: isdn: icn: fix checkpatch errors
From: Bas Peters @ 2015-02-07 15:56 UTC (permalink / raw)
  To: isdn; +Cc: dan.carpenter, davem, netdev, linux-kernel, Bas Peters

This patch cleans up all checkpatch errors in the icn directory.

Bas Peters (2):
  drivers: isdn: icn: icn.c: clean up all checkpatch errors
  drivers: isdn: icn: icn.h Clean up trivial checkpatch errors.

 drivers/isdn/icn/icn.c | 52 ++++++++++++++++++++++++++++++--------------------
 drivers/isdn/icn/icn.h |  5 ++---
 2 files changed, 33 insertions(+), 24 deletions(-)

-- 
2.1.0

^ permalink raw reply

* Re: Ethernet: how to disable gigabit support
From: Bruno Prémont @ 2015-02-07 14:35 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel, Florian Fainelli, netdev
In-Reply-To: <20150206135706.GB25683@amd>

On Fri, 06 February 2015 Pavel Machek wrote:
> On Thu 2015-02-05 14:44:55, Florian Fainelli wrote:
> > On 05/02/15 12:25, Pavel Machek wrote:
> > > This happened on more than one project: there's gigabit-capable chip,
> > > but the connector is not designed for gigabit speed.
> > > 
> > > I'd like to have speed autonegotiation, but not offer gigabit (as it
> > > will not work).
> > > 
> > > Is there way to do that without hacking the kernel? Should mii-tool do
> > > that?
> > 
> > Since you use the PHY library, you should be able to do something like
> > this in your PHY driver prior to starting the PHY state machine:
> > 
> > phydev->supported &= PHY_BASIC_FEATURES (effectively masking Gigabit
> > capability)
> 
> Thanks, that did the trick.
> 								Pavel
> (But still it would be nice to have a generic way of doing this,
> using something like mii-tool.)

You can use ethtool to do so:

  ethtool -s ethX advertise 0x0f

c.f. man ethtool:
  advertise N
    Sets the speed and duplex advertised by autonegotiation. The argument is
    a hexadecimal value using one or a combination of the following values:

      0x001     10 Half
      0x002     10 Full
      0x004     100 Half
      0x008     100 Full
      0x010     1000 Half        (not supported by IEEE standards)
      0x020     1000 Full
      0x8000    2500 Full        (not supported by IEEE standards)
      0x1000    10000 Full
      0x20000   20000MLD2 Full   (not supported by IEEE standards)
      0x40000   20000KR2 Full    (not supported by IEEE standards)

Bruno

^ permalink raw reply

* [PATCH v3] net: bluetooth: hci_sock: Use 'const u32 *' instead of 'void *' for 2nd parameter of hci_test_bit()
From: Chen Gang S @ 2015-02-07 13:24 UTC (permalink / raw)
  To: David Laight, Marcel Holtmann, Sergei Shtylyov, Joe Perches
  Cc: Gustavo F. Padovan, Johan Hedberg, David S. Miller,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org

hci_test_bit() does not modify 2nd parameter, so it is better to let it
be constant, or may cause build warning. The related warning (with
allmodconfig under xtensa):

  net/bluetooth/hci_sock.c: In function 'hci_sock_sendmsg':
  net/bluetooth/hci_sock.c:955:8: warning: passing argument 2 of 'hci_test_bit' discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
          &hci_sec_filter.ocf_mask[ogf])) &&
          ^
  net/bluetooth/hci_sock.c:49:19: note: expected 'void *' but argument is of type 'const __u32 (*)[4] {aka const unsigned int (*)[4]}'
   static inline int hci_test_bit(int nr, void *addr)
                     ^

hci_test_bit() always treats 2nd parameter is u32, and all callers also
know about it, so 2nd parameter of hci_test_bit() need use 'const u32 *'
instead of 'void *'.

C language treats the array function parameter as a pointer, so the
caller need not use '&' for the 2 demotion array, or it reports warning:
'const unsigned int (*)[4]' is different with 'const unsigned int *'.


Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 net/bluetooth/hci_sock.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 1d65c5b..04124ec 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -46,9 +46,9 @@ struct hci_pinfo {
 	unsigned short    channel;
 };
 
-static inline int hci_test_bit(int nr, void *addr)
+static inline int hci_test_bit(int nr, const u32 *addr)
 {
-	return *((__u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31));
+	return *(addr + (nr >> 5)) & ((u32) 1 << (nr & 31));
 }
 
 /* Security filter */
@@ -107,7 +107,7 @@ static bool is_filtered_packet(struct sock *sk, struct sk_buff *skb)
 
 	flt_event = (*(__u8 *)skb->data & HCI_FLT_EVENT_BITS);
 
-	if (!hci_test_bit(flt_event, &flt->event_mask))
+	if (!hci_test_bit(flt_event, (u32 *)&flt->event_mask))
 		return true;
 
 	/* Check filter only when opcode is set */
@@ -952,7 +952,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
 
 		if (((ogf > HCI_SFLT_MAX_OGF) ||
 		     !hci_test_bit(ocf & HCI_FLT_OCF_BITS,
-				   &hci_sec_filter.ocf_mask[ogf])) &&
+				   hci_sec_filter.ocf_mask[ogf])) &&
 		    !capable(CAP_NET_RAW)) {
 			err = -EPERM;
 			goto drop;
-- 
1.9.3

^ permalink raw reply related

* Re: [PATCH] vxlan: Wrong type passed to %pIS
From: Rasmus Villemoes @ 2015-02-07 12:38 UTC (permalink / raw)
  To: Joe Perches
  Cc: David S. Miller, Pravin B Shelar, Nicolas Dichtel, netdev,
	linux-kernel, Dan Carpenter
In-Reply-To: <1423280138.2933.3.camel@perches.com>

On Sat, Feb 07 2015, Joe Perches <joe@perches.com> wrote:

> On Sat, 2015-02-07 at 03:17 +0100, Rasmus Villemoes wrote:
>> src_ip is a pointer to a union vxlan_addr, one member of which is a
>> struct sockaddr. Passing a pointer to src_ip is wrong; one should pass
>> the value of src_ip itself. Since %pIS formally expects something of
>> type struct sockaddr*, let's pass a pointer to the appropriate union
>> member, though this of course doesn't change the generated code.
>
> Hello Rasmus
>
> Are you finding these mismatches by hand or
> are you using some tool?

I've extended smatch to do format checking (mostly for the %p
extensions; gcc already does all the other stuff just fine). I'll try
and see if I can get it on github sometime in the coming week.

Rasmus

^ permalink raw reply

* Re: [PATCH] vxlan: Wrong type passed to %pIS
From: Rasmus Villemoes @ 2015-02-07 12:34 UTC (permalink / raw)
  To: Cong Wang
  Cc: David S. Miller, Pravin B Shelar, Nicolas Dichtel,
	Linux Kernel Network Developers, LKML
In-Reply-To: <CAM_iQpWGR6zLrGLGsMPM1Y-z45Nd4XO3X_H1KDTedsz2=5mXng@mail.gmail.com>

On Sat, Feb 07 2015, Cong Wang <xiyou.wangcong@gmail.com> wrote:

> On Fri, Feb 6, 2015 at 6:17 PM, Rasmus Villemoes
> <linux@rasmusvillemoes.dk> wrote:
>> src_ip is a pointer to a union vxlan_addr, one member of which is a
>> struct sockaddr. Passing a pointer to src_ip is wrong; one should pass
>> the value of src_ip itself. Since %pIS formally expects something of
>> type struct sockaddr*, let's pass a pointer to the appropriate union
>> member, though this of course doesn't change the generated code.
>>
>
>
> It is a union, this doesn't harm.
>

Just to be clear: This fixes a real bug. The minimal fix had been

-                     src_mac, &rdst->remote_ip, &src_ip);
+                     src_mac, &rdst->remote_ip, src_ip);

but I through in the cosmetic improvements while the line needed
changing anyway.

> Since you are on it, there is another similar place in vxlan too.

... which is why I didn't change that other occurrence.

Rasmus

^ permalink raw reply

* Re: Implementing Deficit Round Robin for different irtual interfaces
From: ronald pina @ 2015-02-07 11:53 UTC (permalink / raw)
  To: netdev
In-Reply-To: <CAONBAaeKZNCv42a+HY4TtXtYxnAr6-fX1GXEndKJ=r3nZ-1LhQ@mail.gmail.com>

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

Hello
I am working for my Msc thesis on computer engineering,  my primary
goal is to introduce scheduling with priorities over different
networking interfaces, it can be very valuable on virtual machines
like Xen and as far as i have studied, Xen is scheduling the virtual
network interfaces  in round-robin fashion, i would like to improve
this and to use Deficit Round Robin, I think the better way is to
integrate the DRR in tc  and   to make the scheduling decisions based
on virtual network interfaces which belongs to different guests as
shown from the diagram in atach.

I would like to ask which function on source code may be a starting
point to realize that kind of scheduling? What are the opportunities
to involve the DRR as a standard scheduler in tc for later use?

Kind regards
Ronald

On Sat, Feb 7, 2015 at 12:52 PM, ronald pina <pinaronald@gmail.com> wrote:
> Hello
> I am working for my Msc thesis on computer engineering,  my primary
> goal is to introduce scheduling with priorities over different
> networking interfaces, it can be very valuable on virtual machines
> like Xen and as far as i have studied, Xen is scheduling the virtual
> network interfaces  in round-robin fashion, i would like to improve
> this and to use Deficit Round Robin, I think the better way is to
> integrate the DRR in tc  and   to make the scheduling decisions based
> on virtual network interfaces which belongs to different guests as
> shown from the diagram in atach.
>
> I would like to ask which function on source code may be a starting
> point to realize that kind of scheduling? What are the opportunities
> to involve the DRR as a standard scheduler in tc for later use?
>
> Kind regards
> Ronald

[-- Attachment #2: drr-on-xen.jpg --]
[-- Type: image/jpeg, Size: 27832 bytes --]

^ permalink raw reply

* Implementing Deficit Round Robin for different irtual interfaces
From: ronald pina @ 2015-02-07 11:52 UTC (permalink / raw)
  To: netdev

Hello
I am working for my Msc thesis on computer engineering,  my primary
goal is to introduce scheduling with priorities over different
networking interfaces, it can be very valuable on virtual machines
like Xen and as far as i have studied, Xen is scheduling the virtual
network interfaces  in round-robin fashion, i would like to improve
this and to use Deficit Round Robin, I think the better way is to
integrate the DRR in tc  and   to make the scheduling decisions based
on virtual network interfaces which belongs to different guests as
shown from the diagram in atach.

I would like to ask which function on source code may be a starting
point to realize that kind of scheduling? What are the opportunities
to involve the DRR as a standard scheduler in tc for later use?

Kind regards
Ronald

^ permalink raw reply

* pull-request: wireless-drivers-next 2015-02-07
From: Kalle Valo @ 2015-02-07 11:40 UTC (permalink / raw)
  To: David Miller
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

Hi Dave,

here's one more pull request for 3.20. I hope I'm not too late, I didn't
realise that the merge window is getting so close. Please note that I
had to merge from mac80211-next due to a build time dependency in a
patch but it should be ok as you had already pulled the same patches
into net-next. Also there are few bcma and ssb patches, we agreed with
John that I'll start taking them as well.

There's a small conflict in drivers/net/wireless/rtlwifi/pci.c, the fix
is to leave the two labels like this:

			schedule_work(&rtlpriv->works.lps_change_work);
		}
end:
		skb = new_skb;
no_new:
		if (rtlpriv->use_new_trx_flow) {


Please let me know if there are any issues and sorry for being late.

Kalle

The following changes since commit c5ed1df781cb544d4e4d189bb5b6ec7336d8888c:

  bcma: use standard bus scanning during early register (2015-01-23 21:47:55 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git tags/wireless-drivers-next-for-davem-2015-02-07

for you to fetch changes up to d53071143aa5a7cb37cf7db8101042e700b5413f:

  Merge ath-next from ath.git (2015-02-06 16:14:11 +0200)

----------------------------------------------------------------

Major changes:

iwlwifi:

* more work for new devices (4165 / 8260)
* cleanups / improvemnts in rate control
* fixes for TDLS
* major statistics work from Johannes - more to come
* improvements for the fw error dump infrastructure
* usual amount of small fixes here and there (scan, D0i3 etc...)
* add support for beamforming
* enable stuck queue detection for iwlmvm
* a few fixes for EBS scan
* fixes for various failure paths
* improvements for TDLS Offchannel

wil6210:

* performance tuning
* some AP features

brcm80211:

* rework some code in SDIO part of the brcmfmac driver related to
  suspend/resume that were found doing stress testing
* in PCIe part scheduling of worker thread needed to be relaxed
* minor fixes and exposing firmware revision information to
  user-space, ie. ethtool.

mwifiex:

* enhancements for change virtual interface handling
* remove coupling between netdev and FW supported interface
  combination, now conversion from any type of supported interface
  types to any other type is possible
* DFS support in AP mode

ath9k:

* fix calibration issues on some boards
* Wake-on-WLAN improvements

ath10k:

* add support for qca6174 hardware
* enable RX batching to reduce CPU load

----------------------------------------------------------------
Amitkumar Karwar (4):
      mwifiex: correction in wakeup timer handling
      mwifiex: fix memory leak in mwifiex_send_processed_packet()
      mwifiex: fix NULL packet downloading issues
      mwifiex: disable UAPSD mode when AP starts

Arend van Spriel (9):
      brcmfmac: pass DEAUTH/DISASSOC reason code to user-space
      brcmfmac: wait for driver to go idle during suspend
      brcmfmac: do not load firmware when device is already running
      brcmutil: use define for boardrev string function
      brcmfmac: determine chip info when not provided by bus layer
      brcmfmac: always obtain device revision info upon intialization
      brcmfmac: show firmware release info in ethtool driver info
      brcmfmac: store revinfo retrieval result
      brcmfmac: fix nvram processing

Arik Nemtsov (2):
      iwlwifi: mvm: improve TDLS ch-sw state machine
      iwlwifi: mvm: ignore stale TDLS ch-switch responses

Avinash Patil (19):
      mwifiex: selectively choose ext_scan support
      mwifiex: remove redundant nick_name variable
      mwifiex: set wiphy params only once
      mwifiex: do not declare wdev as pointer
      mwifiex: store permanant mac address in adapter structure
      mwifiex: add init parameter to init command routine
      mwifiex: manage virtual interface limits efficiently
      mwifiex: handle PS events on AP interface as well
      mwifiex: support conversion to any virtual interface type
      mwifiex: do not send regulatory update while starting AP
      mwifiex: store AP configuration in private structure
      mwifiex: update IEs after AP has started
      mwifiex: refactor start_ap handler
      mwifiex: separate function for parsing head and tail IEs
      mwifiex: add cfg80211 start_radar_detection handler
      mwifiex: support for channel report for radar detection
      mwifiex: handle radar detect event from FW
      mwifiex: channel switch support for mwifiex
      mwifiex: 11h handling for AP interface

Chun-Yeow Yeoh (1):
      rtl8192cu: fix the mesh beaconing

Dedy Lansky (2):
      wil6210: fix timing of netif_carrier_on indication
      wil6210: ignore firmware failure to gracefully stop AP

Emmanuel Grumbach (7):
      iwlwifi: mvm: check IWL_UCODE_TLV_API_SCD_CFG in API and not in capa
      iwlwifi: pcie: don't dump useless data when a TFD queue hangs
      iwlwifi: pcie: prepare the enablement of 31 TFD queues
      iwlwifi: pcie: disable the SCD_BASE_ADDR when we resume from WoWLAN
      iwlwifi: mvm: enable watchdog on Tx queues for mvm
      iwlwifi: allow to define the stuck queue timer per queue
      iwlwifi: mvm: don't send a command the firmware doesn't know

Eyal Shapira (2):
      iwlwifi: mvm: add beamformer support
      iwlwifi: mvm: rs: enable forcing single stream Tx decision

Haim Dreyfuss (2):
      iwlwifi: mvm: Fix a few EBS error handling bugs
      iwlwifi: mvm: Enable EBS also in single scan on umac interface

Hamad Kadmany (1):
      wil6210: Remove msm platform related code

Hante Meuleman (5):
      brcmfmac: Relax scheduling of msgbuf worker on high throughput.
      brcmfmac: prevent possible deadlock on resuming SDIO device.
      brcmfmac: use SDIO DPC for control frames.
      brcmfmac: SDIO: avoid using bus state for private states.
      brcmfmac: Reopen netdev queue on bus state data.

Helmut Schaa (1):
      ath10k: Use TX cksum offload only for CHECKSUM_PARTIAL

Hong Xu (1):
      ath9k and ath9k_htc: rename variable "led_blink"

Ilan Peer (1):
      iwlwifi: mvm: Fix building channels in scan_config_cmd

Janusz Dziedzic (2):
      ath10k: implement uapsd autotrigger command
      ath10k: implement sta keepalive command

Johannes Berg (3):
      mwifiex: set netif carrier off in ndo_open
      iwlwifi: mvm: remove space padding after sysassert description
      iwlwifi: mvm: reduce quota threshold

John W. Linville (1):
      ath10k: document switch case fall-through in __ath10k_scan_finish

Julia Lawall (1):
      ath10k: fix error return code

Kalle Valo (2):
      Merge tag 'iwlwifi-next-for-kalle-2015-02-03' of https://git.kernel.org/.../iwlwifi/iwlwifi-next
      Merge ath-next from ath.git

Larry Finger (1):
      rtlwifi: rtl8192ee: Fix problems with calculating free space in FIFO

Luciano Coelho (3):
      iwlwifi: mvm: don't reprobe if we fail during reconfig and fw_restart is false
      iwlwifi: mvm: always use mac color zero
      iwlwifi: mvm: fix failure path when power_update fails in add_interface

Marek Kwaczynski (2):
      ath10k: remove sw encryption for pmf
      ath10k: fix pmf for wmi-tlv on qca6174

Markus Elfring (6):
      cw1200: Delete an unnecessary check before the function call "release_firmware"
      cw1200: Less function calls in cw1200_load_firmware_cw1200() after error detection
      ath9k: Delete an unnecessary check before the function call "relay_close"
      orinoco: Delete an unnecessary check before the function call "kfree"
      hostap: Delete an unnecessary check before the function call "kfree"
      brcm80211: Delete unnecessary checks before two function calls

Michael Buesch (1):
      b43: Fix locking FIXME in beacon update top half

Michal Kazior (28):
      ath10k: fill max_num_vdevs for wmi-tlv
      ath10k: implement new beacon tx status event
      ath10k: implement beacon template command
      ath10k: implement prb tmpl wmi command
      ath10k: implement p2p bcn ie command
      ath10k: implement support for ap beacon offloading
      ath10k: prevent fw reg dump spam
      ath10k: implement diag data container event
      ath10k: implement diag event
      ath10k: introduce struct ath10k_skb_rxcb
      ath10k: implement rx reorder support
      ath10k: reset chip before reading chip_id in probe
      ath10k: add support for qca6174 Rx descriptors
      ath10k: add support for qca6174
      ath10k: split fw pdev stats parsing
      ath10k: fix 10.2 fw stats parsing
      ath10k: use idr api for msdu_ids
      ath10k: fix dtim period with beacon templates
      ath10k: fix nullfunc workaround
      ath10k: disable uapsd autotrigger
      ath10k: disable irqs after fw crash
      ath10k: move wmm param storage to vif
      ath10k: implement per-vdev wmm param setup command
      ath10k: use per-vif wmm param setup if possible
      ath10k: disable sta keepalive
      ath10k: change dma beacon cmd prototype
      ath10k: fix beacon deadlock
      ath10k: enable qca6174 hw3.2

Nicholas Mc Guire (5):
      ath10k: fixup wait_for_completion_timeout return handling
      cw1200: use msecs_to_jiffies for conversion
      orinoco: orinoco_plx use msecs_to_jiffies for conversion
      orinoco: orinoco_pci use msecs_to_jiffies for conversion
      orinoco: orinoco_tmd use msecs_to_jiffies for conversion

Pramod Gurav (1):
      ssb: Fix Sparse error in main

Rafał Miłecki (8):
      bcma: fix watchdog on some ARM chipsets
      bcma: simplify freeing cores (internal devices structs)
      bcma: detect SPROM revision 11
      bcma: add empty PCIe hostmode functions if support is disabled
      bcma: add early_init function for PCIe core and move some fix into it
      bcma: implement host code support for PCIe Gen 2 devices
      b43: support bcma core reset on AC-PHY hardware
      b43: AC-PHY: prepare place for developing new PHY support

Rajkumar Manoharan (12):
      ath10k: add wmi support for addba_clear_resp
      ath10k: add wmi support for addba_send
      ath10k: add wmi support for addba_set_resp
      ath10k: add wmi support for delba_send
      ath10k: Implement sta_add_debugfs
      ath10k: add support to send addba request
      ath10k: add support to send addba response
      ath10k: add support to send delba
      ath10k: fix config_enabled check for hwmon
      ath10k: fix duration calculation for quiet param
      ath10k: fix hwmon temperature input units
      ath10k: fix target wakeup timeout

SenthilKumar Jegadeesan (2):
      ath10k: prevent setting wrong key idx for station
      ath10k: add log level configuration for fw_dbglog

Sergey Ryazanov (1):
      ath5k: fix spontaneus AR5312 freezes

Sujith Manoharan (32):
      ath10k: Fix DMA burst size
      ath10k: Enable RX batching
      ath10k: Remove unused htt->max_throughput_mbps
      ath9k: Update QCA953x initvals
      ath9k: Update AR955x initvals
      ath9k: Add a macro to identify PCOEM chips
      ath9k: Fix manual peak calibration initialization
      ath9k: Set correct peak detect threshold
      ath9k: Enable manual peak detect calibration
      ath9k: Remove ATH9K_HW_WOW_DEVICE_CAPABLE
      ath9k: Return early for error conditions
      ath9k: Remove redundant device_can_wakeup() check
      ath9k: Check early for multi-vif/STA conditions
      ath9k: Check multi-channel context for WOW
      ath9k: Fix wow init/deinit
      ath9k: Check WOW triggers properly
      ath9k: Remove unused BMISS processing
      ath9k: Remove ath9k_hw_wow_event_to_string
      ath9k: Add a debugfs file for WOW
      ath9k: Simplify user pattern configuration
      ath9k: Add a HW structure for WOW
      ath9k: Register max WOW patterns
      ath9k: Move WOW registers to reg_wow.h
      ath9k: Remove incorrect register macros
      ath9k: Cleanup reg_wow.h
      ath9k: Fix max pattern check
      ath9k: Add support for more WOW patterns
      ath9k: Register correct WOW details with mac80211
      ath9k: Fix issues with WoW enable
      ath9k: Program AR_WA correctly
      ath9k: Clear TSF2 properly
      ath9k: Choose correct rate for 2GHz channel

Taehee Yoo (2):
      rtlwifi: add support to send beacon frame.
      rtlwifi: rtl8192cu: Set fw_ready flag

Troy Tan (5):
      rtlwifi: rtl8192ee: Fix adhoc fail
      rtlwifi: rtl8192ee: Fix TX hang due to failure to update TX write point
      rtlwifi: rtl8192ee: Fix parsing of received packet
      rtlwifi: rtl8192ee: Fix DMA stalls
      rtlwifi: rtl8192ee: Fix handling of new style descriptors

Vasanthakumar Thiagarajan (1):
      ath10k: Fix potential Rx ring corruption

Vladimir Kondratiev (9):
      wil6210: sync WMI with firmware
      wil6210: implement skb Tx status reporting
      wil6210: implement cfg80211 probe_client() op
      wil6210: move Rx reorder buffer allocation out of spinlock
      wil6210: remove old Tx work-around
      wil6210: avoid Tx descriptor double write
      wil6210: fix race between xmit and Tx vring de-allocation
      wil6210: more Tx debug
      wil6210: print ciphers in debug info

Vladimir Shulman (4):
      wil6210: Add Tx queue len configuration
      wil6210: tuning rings size
      wil6210: interrupt moderation configuration update
      wil6210: remove unnecessary interrupt moderation module parameters

Yanbo Li (1):
      ath10k: Enable the MCS8 and MCS9 at 2.4G band

Yogesh Ashok Powar (2):
      mwifiex: add support for SD8801
      mwifiex: add support for USB8801

 drivers/bcma/bcma_private.h                        |    8 +
 drivers/bcma/driver_chipcommon.c                   |   10 +-
 drivers/bcma/driver_pci.c                          |   68 +-
 drivers/bcma/host_pci.c                            |    6 +-
 drivers/bcma/main.c                                |   27 +-
 drivers/bcma/sprom.c                               |    3 +-
 drivers/net/wireless/ath/ath.h                     |    1 +
 drivers/net/wireless/ath/ath10k/Makefile           |    4 +-
 drivers/net/wireless/ath/ath10k/ce.c               |   12 +-
 drivers/net/wireless/ath/ath10k/ce.h               |    2 +-
 drivers/net/wireless/ath/ath10k/core.c             |   72 ++
 drivers/net/wireless/ath/ath10k/core.h             |   40 +-
 drivers/net/wireless/ath/ath10k/debug.c            |   34 +-
 drivers/net/wireless/ath/ath10k/debug.h            |   11 +-
 drivers/net/wireless/ath/ath10k/debugfs_sta.c      |  243 ++++++
 drivers/net/wireless/ath/ath10k/htc.c              |    6 +-
 drivers/net/wireless/ath/ath10k/htt.c              |    3 +-
 drivers/net/wireless/ath/ath10k/htt.h              |   87 ++-
 drivers/net/wireless/ath/ath10k/htt_rx.c           |  402 +++++++++-
 drivers/net/wireless/ath/ath10k/htt_tx.c           |   94 +--
 drivers/net/wireless/ath/ath10k/hw.c               |   58 ++
 drivers/net/wireless/ath/ath10k/hw.h               |  106 ++-
 drivers/net/wireless/ath/ath10k/mac.c              |  455 ++++++++---
 drivers/net/wireless/ath/ath10k/pci.c              |  151 +++-
 drivers/net/wireless/ath/ath10k/pci.h              |    2 +-
 drivers/net/wireless/ath/ath10k/rx_desc.h          |   25 +-
 drivers/net/wireless/ath/ath10k/targaddrs.h        |    5 +
 drivers/net/wireless/ath/ath10k/thermal.c          |    7 +-
 drivers/net/wireless/ath/ath10k/trace.h            |   68 ++
 drivers/net/wireless/ath/ath10k/txrx.c             |    9 +-
 drivers/net/wireless/ath/ath10k/wmi-ops.h          |  222 +++++-
 drivers/net/wireless/ath/ath10k/wmi-tlv.c          |  532 ++++++++++++-
 drivers/net/wireless/ath/ath10k/wmi-tlv.h          |   64 ++
 drivers/net/wireless/ath/ath10k/wmi.c              |  519 ++++++++++---
 drivers/net/wireless/ath/ath10k/wmi.h              |  155 +++-
 drivers/net/wireless/ath/ath5k/reset.c             |    2 +-
 drivers/net/wireless/ath/ath9k/ar9003_calib.c      |   61 +-
 drivers/net/wireless/ath/ath9k/ar9003_wow.c        |  315 ++++----
 drivers/net/wireless/ath/ath9k/ar953x_initvals.h   |    4 +-
 .../net/wireless/ath/ath9k/ar955x_1p0_initvals.h   |    4 +-
 drivers/net/wireless/ath/ath9k/ath9k.h             |   15 +-
 drivers/net/wireless/ath/ath9k/common-spectral.c   |    2 +-
 drivers/net/wireless/ath/ath9k/debug.c             |   68 ++
 drivers/net/wireless/ath/ath9k/gpio.c              |    2 +-
 drivers/net/wireless/ath/ath9k/htc.h               |    2 +-
 drivers/net/wireless/ath/ath9k/htc_drv_gpio.c      |    2 +-
 drivers/net/wireless/ath/ath9k/htc_drv_init.c      |    4 +-
 drivers/net/wireless/ath/ath9k/hw.c                |   10 +-
 drivers/net/wireless/ath/ath9k/hw.h                |   37 +-
 drivers/net/wireless/ath/ath9k/init.c              |    5 +-
 drivers/net/wireless/ath/ath9k/main.c              |    9 -
 drivers/net/wireless/ath/ath9k/pci.c               |    5 +-
 drivers/net/wireless/ath/ath9k/reg.h               |  125 +--
 drivers/net/wireless/ath/ath9k/reg_wow.h           |  128 +++
 drivers/net/wireless/ath/ath9k/wow.c               |  228 +++---
 drivers/net/wireless/ath/wil6210/Kconfig           |    9 -
 drivers/net/wireless/ath/wil6210/Makefile          |    1 -
 drivers/net/wireless/ath/wil6210/cfg80211.c        |  149 +++-
 drivers/net/wireless/ath/wil6210/main.c            |   73 +-
 drivers/net/wireless/ath/wil6210/netdev.c          |   15 +-
 drivers/net/wireless/ath/wil6210/rx_reorder.c      |    8 +-
 drivers/net/wireless/ath/wil6210/txrx.c            |   81 +-
 drivers/net/wireless/ath/wil6210/wil6210.h         |   26 +-
 drivers/net/wireless/ath/wil6210/wil_platform.c    |   12 +-
 .../net/wireless/ath/wil6210/wil_platform_msm.c    |  257 ------
 .../net/wireless/ath/wil6210/wil_platform_msm.h    |   24 -
 drivers/net/wireless/ath/wil6210/wmi.c             |   17 +-
 drivers/net/wireless/ath/wil6210/wmi.h             |   58 +-
 drivers/net/wireless/b43/Kconfig                   |    9 +
 drivers/net/wireless/b43/Makefile                  |    1 +
 drivers/net/wireless/b43/b43.h                     |    3 +
 drivers/net/wireless/b43/main.c                    |   70 +-
 drivers/net/wireless/b43/phy_ac.c                  |   92 +++
 drivers/net/wireless/b43/phy_ac.h                  |   38 +
 drivers/net/wireless/b43/phy_common.c              |    9 +-
 drivers/net/wireless/b43/phy_common.h              |    2 +
 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c   |   70 +-
 drivers/net/wireless/brcm80211/brcmfmac/bus.h      |   24 +-
 drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c |   31 +-
 drivers/net/wireless/brcm80211/brcmfmac/common.c   |   31 +-
 .../net/wireless/brcm80211/brcmfmac/commonring.h   |    2 +
 drivers/net/wireless/brcm80211/brcmfmac/core.c     |   39 +-
 drivers/net/wireless/brcm80211/brcmfmac/core.h     |   30 +
 drivers/net/wireless/brcm80211/brcmfmac/firmware.c |    6 +-
 drivers/net/wireless/brcm80211/brcmfmac/fwil.c     |    2 +-
 drivers/net/wireless/brcm80211/brcmfmac/fwil.h     |    1 +
 .../net/wireless/brcm80211/brcmfmac/fwil_types.h   |   41 +
 drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c   |   30 +-
 drivers/net/wireless/brcm80211/brcmfmac/pcie.c     |    2 +-
 drivers/net/wireless/brcm80211/brcmfmac/sdio.c     |  171 ++--
 drivers/net/wireless/brcm80211/brcmfmac/sdio.h     |   12 +-
 drivers/net/wireless/brcm80211/brcmfmac/usb.c      |    6 +-
 drivers/net/wireless/brcm80211/brcmsmac/debug.c    |    2 +-
 drivers/net/wireless/brcm80211/brcmutil/utils.c    |   32 +-
 .../net/wireless/brcm80211/include/brcmu_utils.h   |    4 +
 drivers/net/wireless/cw1200/fwio.c                 |   40 +-
 drivers/net/wireless/cw1200/scan.c                 |    8 +-
 drivers/net/wireless/hostap/hostap_ap.c            |    2 +-
 drivers/net/wireless/iwlwifi/dvm/main.c            |    7 +-
 drivers/net/wireless/iwlwifi/dvm/tx.c              |    2 +-
 drivers/net/wireless/iwlwifi/dvm/ucode.c           |    2 +-
 drivers/net/wireless/iwlwifi/iwl-config.h          |    2 +-
 drivers/net/wireless/iwlwifi/iwl-drv.c             |    5 -
 drivers/net/wireless/iwlwifi/iwl-fw-file.h         |    2 +
 drivers/net/wireless/iwlwifi/iwl-modparams.h       |    2 -
 drivers/net/wireless/iwlwifi/iwl-prph.h            |   26 +-
 drivers/net/wireless/iwlwifi/iwl-scd.h             |   41 +-
 drivers/net/wireless/iwlwifi/iwl-trans.h           |   29 +-
 drivers/net/wireless/iwlwifi/mvm/constants.h       |    2 +-
 drivers/net/wireless/iwlwifi/mvm/fw-api-rs.h       |   43 +-
 drivers/net/wireless/iwlwifi/mvm/fw.c              |    3 +-
 drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c        |   10 +-
 drivers/net/wireless/iwlwifi/mvm/mac80211.c        |   12 +-
 drivers/net/wireless/iwlwifi/mvm/mvm.h             |   23 +-
 drivers/net/wireless/iwlwifi/mvm/ops.c             |   28 +-
 drivers/net/wireless/iwlwifi/mvm/rs.c              |  241 +++++-
 drivers/net/wireless/iwlwifi/mvm/rs.h              |   14 +-
 drivers/net/wireless/iwlwifi/mvm/scan.c            |   24 +-
 drivers/net/wireless/iwlwifi/mvm/sta.c             |   15 +-
 drivers/net/wireless/iwlwifi/mvm/tdls.c            |   63 +-
 drivers/net/wireless/iwlwifi/mvm/utils.c           |   10 +-
 drivers/net/wireless/iwlwifi/pcie/internal.h       |   10 +-
 drivers/net/wireless/iwlwifi/pcie/trans.c          |    5 +-
 drivers/net/wireless/iwlwifi/pcie/tx.c             |   58 +-
 drivers/net/wireless/mwifiex/11h.c                 |  198 ++++-
 drivers/net/wireless/mwifiex/11n.c                 |    4 +-
 drivers/net/wireless/mwifiex/11n_rxreorder.c       |    2 +-
 drivers/net/wireless/mwifiex/cfg80211.c            |  816 +++++++++++++++-----
 drivers/net/wireless/mwifiex/cfp.c                 |    4 +-
 drivers/net/wireless/mwifiex/cmdevt.c              |   40 +-
 drivers/net/wireless/mwifiex/decl.h                |   21 +
 drivers/net/wireless/mwifiex/fw.h                  |   58 ++
 drivers/net/wireless/mwifiex/ie.c                  |   89 ++-
 drivers/net/wireless/mwifiex/init.c                |   12 +-
 drivers/net/wireless/mwifiex/main.c                |   14 +-
 drivers/net/wireless/mwifiex/main.h                |   60 +-
 drivers/net/wireless/mwifiex/pcie.c                |    2 +
 drivers/net/wireless/mwifiex/pcie.h                |    3 +
 drivers/net/wireless/mwifiex/scan.c                |   10 +-
 drivers/net/wireless/mwifiex/sdio.c                |    7 +
 drivers/net/wireless/mwifiex/sdio.h                |   23 +
 drivers/net/wireless/mwifiex/sta_cmd.c             |   17 +-
 drivers/net/wireless/mwifiex/sta_cmdresp.c         |    5 +
 drivers/net/wireless/mwifiex/sta_event.c           |   15 +-
 drivers/net/wireless/mwifiex/sta_ioctl.c           |   32 +-
 drivers/net/wireless/mwifiex/sta_tx.c              |    9 +-
 drivers/net/wireless/mwifiex/txrx.c                |    2 +-
 drivers/net/wireless/mwifiex/uap_cmd.c             |   70 ++
 drivers/net/wireless/mwifiex/uap_event.c           |   47 ++
 drivers/net/wireless/mwifiex/usb.c                 |   16 +
 drivers/net/wireless/mwifiex/usb.h                 |    4 +
 drivers/net/wireless/mwifiex/util.c                |    2 +-
 drivers/net/wireless/mwifiex/wmm.c                 |    3 +
 drivers/net/wireless/orinoco/main.c                |    2 +-
 drivers/net/wireless/orinoco/orinoco_pci.c         |    2 +-
 drivers/net/wireless/orinoco/orinoco_plx.c         |    2 +-
 drivers/net/wireless/orinoco/orinoco_tmd.c         |    2 +-
 drivers/net/wireless/rtlwifi/core.c                |   11 +
 drivers/net/wireless/rtlwifi/pci.c                 |   31 +-
 drivers/net/wireless/rtlwifi/pci.h                 |    7 +
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c        |    4 +
 drivers/net/wireless/rtlwifi/rtl8192ee/fw.c        |    6 +-
 drivers/net/wireless/rtlwifi/rtl8192ee/hw.c        |  166 +++-
 drivers/net/wireless/rtlwifi/rtl8192ee/reg.h       |    2 +
 drivers/net/wireless/rtlwifi/rtl8192ee/sw.c        |    3 +-
 drivers/net/wireless/rtlwifi/rtl8192ee/trx.c       |   36 +-
 drivers/net/wireless/rtlwifi/rtl8192ee/trx.h       |    3 +
 drivers/net/wireless/rtlwifi/wifi.h                |    1 +
 drivers/ssb/main.c                                 |   19 -
 include/linux/bcma/bcma.h                          |    1 +
 include/linux/bcma/bcma_driver_pci.h               |    2 +
 include/linux/bcma/bcma_regs.h                     |    2 +
 include/linux/ssb/ssb_regs.h                       |    1 +
 173 files changed, 6463 insertions(+), 2183 deletions(-)
 create mode 100644 drivers/net/wireless/ath/ath10k/debugfs_sta.c
 create mode 100644 drivers/net/wireless/ath/ath10k/hw.c
 create mode 100644 drivers/net/wireless/ath/ath9k/reg_wow.h
 delete mode 100644 drivers/net/wireless/ath/wil6210/wil_platform_msm.c
 delete mode 100644 drivers/net/wireless/ath/wil6210/wil_platform_msm.h
 create mode 100644 drivers/net/wireless/b43/phy_ac.c
 create mode 100644 drivers/net/wireless/b43/phy_ac.h

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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 next 2/6] bonding: implement bond_poll_controller()
From: Veaceslav Falico @ 2015-02-07  9:04 UTC (permalink / raw)
  To: Mahesh Bandewar
  Cc: Jay Vosburgh, Andy Gospodarek, Nikolay Aleksandrov, David Miller,
	netdev, Eric Dumazet
In-Reply-To: <1423270311-9181-1-git-send-email-maheshb@google.com>

On Fri, Feb 06, 2015 at 04:51:51PM -0800, Mahesh Bandewar wrote:
>This patches implements the poll_controller support for all
>bonding driver. If the slaves have poll_controller net_op defined,
>this implementation calls them. This is mode agnostic implementation
>and iterates through all slaves (based on mode) and calls respective
>handler.
>
>Signed-off-by: Mahesh Bandewar <maheshb@google.com>

Really good patchset, thank you. Two nitpicks below, nothing serious. Also,
please, add Doc/bonding.txt changes for every user-visible
change/enhancement, this doc is a go-to for a lot of users.

Otherwise, with the doc and other issues, pointed by Jay and Andy, fixed, I
guess it's good to go. The 0/ patch would be welcome too, btw.

>---
> drivers/net/bonding/bond_3ad.c  | 24 +++++++++++++++++++++
> drivers/net/bonding/bond_main.c | 47 +++++++++++++++++++++++++++++++++++++++++
> include/net/bond_3ad.h          |  1 +
> 3 files changed, 72 insertions(+)
>
>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>index 9b436696b95e..14f2ebe786c5 100644
>--- a/drivers/net/bonding/bond_3ad.c
>+++ b/drivers/net/bonding/bond_3ad.c
>@@ -2477,6 +2477,30 @@ int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info)
> 	return ret;
> }
>
>+#define BOND_3AD_PORT_OPERATIONAL \
>+		(AD_STATE_DISTRIBUTING | AD_STATE_COLLECTING | \
>+		 AD_STATE_SYNCHRONIZATION | AD_STATE_AGGREGATION)
>+
>+static int bond_3ad_port_operational(struct slave *slave)
>+{
>+	port_t *port = &SLAVE_AD_INFO(slave)->port;
>+
>+	return bond_slave_can_tx(slave) &&
>+	       (port->actor_oper_port_state & port->partner_oper.port_state &
>+		BOND_3AD_PORT_OPERATIONAL) == BOND_3AD_PORT_OPERATIONAL;
>+}
>+
>+/* bond_3ad_port_is_active - check if a slave port is active or not. A port
>+ * is active when it can forward traffic.
>+ *
>+ * @slave: slave port to check state for.
>+ * Returns: 0 if not active else is active.
>+ */
>+int bond_3ad_port_is_active(struct slave *slave)
>+{
>+	return bond_3ad_port_operational(slave);
>+}
>+
> int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
> 			 struct slave *slave)
> {
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index c9e519cb9214..a50ec87486f3 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -928,6 +928,53 @@ static inline void slave_disable_netpoll(struct slave *slave)
>
> static void bond_poll_controller(struct net_device *bond_dev)
> {
>+	struct bonding *bond = netdev_priv(bond_dev);
>+	struct slave *slave = NULL;
>+	struct list_head *iter;
>+	struct ad_info ad_info;
>+	struct aggregator *agg;
>+	const struct net_device_ops *ops;
>+	bool call_slave_netpoll;
>+
>+	if (BOND_MODE(bond) == BOND_MODE_8023AD)
>+		if (bond_3ad_get_active_agg_info(bond, &ad_info))
>+			return;
>+
>+	bond_for_each_slave(bond, slave, iter) {
>+		call_slave_netpoll = false;
>+		switch (BOND_MODE(bond)) {
>+		case BOND_MODE_8023AD:
>+			agg = SLAVE_AD_INFO(slave)->port.aggregator;
>+			if (!bond_slave_is_up(slave))

bond_3ad_port_is_active() already contains the check for being up.

>+				break;
>+			if (agg && agg->aggregator_identifier !=

Hm, should we poll it without an aggregator?

>+				ad_info.aggregator_id)
>+				break;
>+			if (!bond_3ad_port_is_active(slave) &&
>+			    ad_info.ports != 1)
>+				break;
>+
>+			call_slave_netpoll = true;
>+			break;
>+		default:
>+			if (bond_slave_is_up(slave))
>+				call_slave_netpoll = true;
>+			break;
>+		}
>+
>+		if (call_slave_netpoll) {
>+			ops = slave->dev->netdev_ops;
>+			if (ops->ndo_poll_controller) {

It's weird to see this check so down the road. Maybe reorg the logic to
something like:

bond_for_each_slave() {
	if (!bond_slave_is_up() || !bond_slave_has_ndo_poll())
		continue;

	if (BOND_MODE(bond) == 3AD && !bond_3ad_port_is_active())
		continue;

	slave-do_ndo_poll_stuff();
}

Just as a thought, might be easier to read/shorter.

>+				struct netpoll_info *ni =
>+					rcu_dereference_bh(slave->dev->npinfo);
>+
>+				if (down_trylock(&ni->dev_lock))
>+					continue;
>+				ops->ndo_poll_controller(slave->dev);
>+				up(&ni->dev_lock);
>+			}
>+		}
>+	}
> }
>
> static void bond_netpoll_cleanup(struct net_device *bond_dev)
>diff --git a/include/net/bond_3ad.h b/include/net/bond_3ad.h
>index f04cdbb7848e..6c455c646d61 100644
>--- a/include/net/bond_3ad.h
>+++ b/include/net/bond_3ad.h
>@@ -278,5 +278,6 @@ int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
> 			 struct slave *slave);
> int bond_3ad_set_carrier(struct bonding *bond);
> void bond_3ad_update_lacp_rate(struct bonding *bond);
>+int bond_3ad_port_is_active(struct slave *slave);
> #endif /* _NET_BOND_3AD_H */
>
>-- 
>2.2.0.rc0.207.ga3a616c
>

^ permalink raw reply

* Re: [PATCH next 5/6] bonding: Allow userspace to set macaddr on bonding-dev
From: Maciej Żenczykowski @ 2015-02-07  7:11 UTC (permalink / raw)
  To: Jay Vosburgh
  Cc: Mahesh Bandewar, Andy Gospodarek, Veaceslav Falico,
	Nikolay Aleksandrov, David Miller, netdev, Eric Dumazet
In-Reply-To: <7179.1423291742@famine>

The worry is about other machines connected to the same switch being able
to sniff/guess-timate enough to be able to flood a switch with LACP packets
and effectively join another machines aggregate, and thus potentially break
another machines network connectivity and/or sniff their traffic and/or spoof
their connectivity.

^ permalink raw reply

* Re: [PATCH next 5/6] bonding: Allow userspace to set macaddr on bonding-dev
From: Jay Vosburgh @ 2015-02-07  6:49 UTC (permalink / raw)
  To: Mahesh Bandewar
  Cc: Andy Gospodarek, Veaceslav Falico, Nikolay Aleksandrov,
	David Miller, netdev, Eric Dumazet, Maciej Żenczykowski
In-Reply-To: <CAF2d9ji=Z+wVz7AdpSeNmOwys0jqWsx6TYsCML_+Hw=u+QMt_A@mail.gmail.com>

Mahesh Bandewar <maheshb@google.com> wrote:

>On Fri, Feb 6, 2015 at 5:54 PM, Jay Vosburgh <jay.vosburgh@canonical.com> wrote:
>> Mahesh Bandewar <maheshb@google.com> wrote:
>>
>>>On Fri, Feb 6, 2015 at 5:20 PM, Jay Vosburgh <jay.vosburgh@canonical.com> wrote:
>>>> Mahesh Bandewar <maheshb@google.com> wrote:
>>>>
>>>>>This patch allows user-space to set the mac-address on the bonding device.
>>>>>This mac-address can not be NULL or a Multicast. If the mac-address is set
>>>>>from user-space; kernel will honor it and will not overwrite it. In the
>>>>>absense (value from user space); the logic will default to using the
>>>>>masters' mac as the mac address for the bonding device.
>>>>>
>>>>>It can be set using example code below -
>>>>>
>>>>>   # modprobe bonding mode=4
>>>>>   # sys_mac_addr=$(printf '%02x:%02x:%02x:%02x:%02x:%02x' \
>>>>>                    $(( (RANDOM & 0xFE) | 0x02 )) \
>>>>>                    $(( RANDOM & 0xFF )) \
>>>>>                    $(( RANDOM & 0xFF )) \
>>>>>                    $(( RANDOM & 0xFF )) \
>>>>>                    $(( RANDOM & 0xFF )) \
>>>>>                    $(( RANDOM & 0xFF )))
>>>>>   # echo $sys_mac_addr > /sys/class/net/bond0/bonding/ad_actor_system_mac_address
>>>>>   # echo +eth1 > /sys/class/net/bond0/bonding/slaves
>>>>>   ...
>>>>>   # ip link set bond0 up
>>>>
>>>>         How is this patch functionally different from setting the
>>>> bonding master's MAC address to a particular value prior to adding any
>>>> slaves?
>>>>
>>>
>>>Maciej is correct but I think I was bit ambiguous about it in the
>>>commit message which might have made you think this way. I'll reword
>>>the commit message.
>>
>>         Thanks; presumably there is some administrative reason for this.
>>
>The idea is that in an AD system the actor-partner communication is a
>business between them two only and no one in the L2 domain should
>care. These enhancements should obscure that should anyone try to
>sniff it. Probably I assumed too much and should add this idea behind
>the implementation in the commit log.

	Well, the LACPDUs can always be sniffed on ingress to the
destination linux system with something like tcpdump, but they don't
propagate, so I'm not sure how a third party would ever see them.  The
actor_system value isn't really a secret, either, in the sense of
needing to be kept hidden (your patch even adds it to
/proc/net/bonding/*).

	Has there been some kind of issue with this?

	In any event, the requirements for the actor_system in the
standard are pretty much that it's a globally unique MAC address, so
there's no real issue with permitting it to be set from that
perspective.

>>         Also, for patches 4, 5 and 6, I believe current practice is to
>> provide a netlink / iproute2 facility for options.
>>
>OK. I'll add them (netlink enhancements) in a separate set of patch(s).

	Also, I neglected to mention that the new options should be
added to Documentation/networking/bonding.txt.

>>>>>Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>>>>>---
>>>>> drivers/net/bonding/bond_3ad.c     |  7 ++++++-
>>>>> drivers/net/bonding/bond_main.c    |  1 +
>>>>> drivers/net/bonding/bond_options.c | 29 +++++++++++++++++++++++++++++
>>>>> drivers/net/bonding/bond_procfs.c  |  6 ++++++
>>>>> drivers/net/bonding/bond_sysfs.c   | 16 ++++++++++++++++
>>>>> include/net/bond_options.h         |  1 +
>>>>> include/net/bonding.h              |  1 +
>>>>> 7 files changed, 60 insertions(+), 1 deletion(-)
>>>>>
>>>>>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>>>>>index 1177f96194dd..373d3db3809f 100644
>>>>>--- a/drivers/net/bonding/bond_3ad.c
>>>>>+++ b/drivers/net/bonding/bond_3ad.c
>>>>>@@ -1914,7 +1914,12 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
>>>>>
>>>>>               BOND_AD_INFO(bond).system.sys_priority =
>>>>>                       bond->params.ad_actor_sysprio;
>>>>>-              BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
>>>>>+              if (is_zero_ether_addr(bond->params.ad_actor_sys_macaddr))
>>>>>+                      BOND_AD_INFO(bond).system.sys_mac_addr =
>>>>>+                          *((struct mac_addr *)bond->dev->dev_addr);
>>>>>+              else
>>>>>+                      BOND_AD_INFO(bond).system.sys_mac_addr =
>>>>>+                          *((struct mac_addr *)bond->params.ad_actor_sys_macaddr);
>>>>>
>>>>>               /* initialize how many times this module is called in one
>>>>>                * second (should be about every 100ms)
>>>>>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>>>>>index 561b2bde5aeb..1a6735ef2ea7 100644
>>>>>--- a/drivers/net/bonding/bond_main.c
>>>>>+++ b/drivers/net/bonding/bond_main.c
>>>>>@@ -4440,6 +4440,7 @@ static int bond_check_params(struct bond_params *params)
>>>>>       params->packets_per_slave = packets_per_slave;
>>>>>       params->tlb_dynamic_lb = 1; /* Default value */
>>>>>       params->ad_actor_sysprio = ad_actor_sysprio;
>>>>>+      eth_zero_addr(params->ad_actor_sys_macaddr);
>>>>>       if (packets_per_slave > 0) {
>>>>>               params->reciprocal_packets_per_slave =
>>>>>                       reciprocal_value(packets_per_slave);
>>>>>diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
>>>>>index d8f6760143ae..330d48b6a1e6 100644
>>>>>--- a/drivers/net/bonding/bond_options.c
>>>>>+++ b/drivers/net/bonding/bond_options.c
>>>>>@@ -72,6 +72,8 @@ static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
>>>>>                                 const struct bond_opt_value *newval);
>>>>> static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
>>>>>                                 const struct bond_opt_value *newval);
>>>>>+static int bond_option_ad_actor_sys_macaddr_set(struct bonding *bond,
>>>>>+                                const struct bond_opt_value *newval);
>>>>>
>>>>>
>>>>> static const struct bond_opt_value bond_mode_tbl[] = {
>>>>>@@ -396,6 +398,13 @@ static const struct bond_option bond_opts[BOND_OPT_LAST] = {
>>>>>               .values = bond_ad_actor_sysprio_tbl,
>>>>>               .set = bond_option_ad_actor_sysprio_set,
>>>>>       },
>>>>>+      [BOND_OPT_AD_ACTOR_SYS_MACADDR] = {
>>>>>+              .id = BOND_OPT_AD_ACTOR_SYS_MACADDR,
>>>>>+              .name = "ad_actor_system_mac_address",
>>>>>+              .unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)),
>>>>>+              .flags = BOND_OPTFLAG_RAWVAL | BOND_OPTFLAG_IFDOWN,
>>>>>+              .set = bond_option_ad_actor_sys_macaddr_set,
>>>>>+      },
>>>>> };
>>>>>
>>>>> /* Searches for an option by name */
>>>>>@@ -1376,3 +1385,23 @@ static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
>>>>>       bond->params.ad_actor_sysprio = newval->value;
>>>>>       return 0;
>>>>> }
>>>>>+
>>>>>+static int bond_option_ad_actor_sys_macaddr_set(struct bonding *bond,
>>>>>+                                          const struct bond_opt_value *newval)
>>>>>+{
>>>>>+      u8 macaddr[ETH_ALEN];
>>>>>+      int i;
>>>>>+
>>>>>+      i = sscanf(newval->string, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
>>>>>+                 &macaddr[0], &macaddr[1], &macaddr[2],
>>>>>+                 &macaddr[3], &macaddr[4], &macaddr[5]);
>>>>>+
>>>>>+      if (i != ETH_ALEN || !is_valid_ether_addr(macaddr)) {
>>>>>+              netdev_err(bond->dev, "Invalid MAC address.\n");
>>>>>+              return -EINVAL;
>>>>>+      }
>>>>>+
>>>>>+      ether_addr_copy(bond->params.ad_actor_sys_macaddr, macaddr);

	I think this operation should probably fail if the bond has any
slaves, as the new value will not actually propagate out to what's being
used in LACPDUs in that case.

	Looking at the other two new option patches, I think this
comment also applies to them.

	-J

>>>>>+      return 0;
>>>>>+}
>>>>>diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
>>>>>index 9e33c48886ef..81452ced852f 100644
>>>>>--- a/drivers/net/bonding/bond_procfs.c
>>>>>+++ b/drivers/net/bonding/bond_procfs.c
>>>>>@@ -136,6 +136,8 @@ static void bond_info_show_master(struct seq_file *seq)
>>>>>                          optval->string);
>>>>>               seq_printf(seq, "System priority: %d\n",
>>>>>                               BOND_AD_INFO(bond).system.sys_priority);
>>>>>+              seq_printf(seq, "System MAC address: %pM\n",
>>>>>+                              &BOND_AD_INFO(bond).system.sys_mac_addr);
>>>>>
>>>>>               if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
>>>>>                       seq_printf(seq, "bond %s has no active aggregator\n",
>>>>>@@ -198,6 +200,8 @@ static void bond_info_show_slave(struct seq_file *seq,
>>>>>                       seq_puts(seq, "details actor lacp pdu:\n");
>>>>>                       seq_printf(seq, "    system priority: %d\n",
>>>>>                                  port->actor_system_priority);
>>>>>+                      seq_printf(seq, "    system mac address: %pM\n",
>>>>>+                                 &port->actor_system);
>>>>>                       seq_printf(seq, "    port key: %d\n",
>>>>>                                  port->actor_oper_port_key);
>>>>>                       seq_printf(seq, "    port priority: %d\n",
>>>>>@@ -210,6 +214,8 @@ static void bond_info_show_slave(struct seq_file *seq,
>>>>>                       seq_puts(seq, "details partner lacp pdu:\n");
>>>>>                       seq_printf(seq, "    system priority: %d\n",
>>>>>                                  port->partner_oper.system_priority);
>>>>>+                      seq_printf(seq, "    system mac address: %pM\n",
>>>>>+                                 &port->partner_oper.system);
>>>>>                       seq_printf(seq, "    oper key: %d\n",
>>>>>                                  port->partner_oper.key);
>>>>>                       seq_printf(seq, "    port priority: %d\n",
>>>>>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
>>>>>index 4350aa06f867..91713d0b6685 100644
>>>>>--- a/drivers/net/bonding/bond_sysfs.c
>>>>>+++ b/drivers/net/bonding/bond_sysfs.c
>>>>>@@ -706,6 +706,21 @@ static ssize_t bonding_show_ad_actor_sysprio(struct device *d,
>>>>> static DEVICE_ATTR(ad_actor_system_priority, S_IRUGO | S_IWUSR,
>>>>>                  bonding_show_ad_actor_sysprio, bonding_sysfs_store_option);
>>>>>
>>>>>+static ssize_t bonding_show_ad_actor_sys_macaddr(struct device *d,
>>>>>+                                               struct device_attribute *attr,
>>>>>+                                               char *buf)
>>>>>+{
>>>>>+      struct bonding *bond = to_bond(d);
>>>>>+
>>>>>+      if (BOND_MODE(bond) == BOND_MODE_8023AD)
>>>>>+              return sprintf(buf, "%pM\n", bond->params.ad_actor_sys_macaddr);
>>>>>+
>>>>>+      return 0;
>>>>>+}
>>>>>+static DEVICE_ATTR(ad_actor_system_mac_address, S_IRUGO | S_IWUSR,
>>>>>+                 bonding_show_ad_actor_sys_macaddr,
>>>>>+                 bonding_sysfs_store_option);
>>>>>+
>>>>> static struct attribute *per_bond_attrs[] = {
>>>>>       &dev_attr_slaves.attr,
>>>>>       &dev_attr_mode.attr,
>>>>>@@ -740,6 +755,7 @@ static struct attribute *per_bond_attrs[] = {
>>>>>       &dev_attr_packets_per_slave.attr,
>>>>>       &dev_attr_tlb_dynamic_lb.attr,
>>>>>       &dev_attr_ad_actor_system_priority.attr,
>>>>>+      &dev_attr_ad_actor_system_mac_address.attr,
>>>>>       NULL,
>>>>> };
>>>>>
>>>>>diff --git a/include/net/bond_options.h b/include/net/bond_options.h
>>>>>index c2af1db37354..993ef73cd050 100644
>>>>>--- a/include/net/bond_options.h
>>>>>+++ b/include/net/bond_options.h
>>>>>@@ -64,6 +64,7 @@ enum {
>>>>>       BOND_OPT_SLAVES,
>>>>>       BOND_OPT_TLB_DYNAMIC_LB,
>>>>>       BOND_OPT_AD_ACTOR_SYSPRIO,
>>>>>+      BOND_OPT_AD_ACTOR_SYS_MACADDR,
>>>>>       BOND_OPT_LAST
>>>>> };
>>>>>
>>>>>diff --git a/include/net/bonding.h b/include/net/bonding.h
>>>>>index 7a5c79fcf866..cd2092e6bc71 100644
>>>>>--- a/include/net/bonding.h
>>>>>+++ b/include/net/bonding.h
>>>>>@@ -144,6 +144,7 @@ struct bond_params {
>>>>>       int tlb_dynamic_lb;
>>>>>       struct reciprocal_value reciprocal_packets_per_slave;
>>>>>       u16 ad_actor_sysprio;
>>>>>+      u8 ad_actor_sys_macaddr[ETH_ALEN];
>>>>> };
>>>>>
>>>>> struct bond_parm_tbl {
>>>>>--
>>>>>2.2.0.rc0.207.ga3a616c

---
	-Jay Vosburgh, jay.vosburgh@canonical.com

^ permalink raw reply

* Re: [PATCH 1/1] neighbour: Support broadcast ARP in neighbor PROPE state
From: Cong Wang @ 2015-02-07  6:46 UTC (permalink / raw)
  To: zhuyj
  Cc: Linux Kernel Network Developers, stefan.costandache,
	alexandre.dietsch, yue.tao, clinton.slabbert, eulfsam,
	David S. Miller
In-Reply-To: <1423120837-28102-1-git-send-email-zyjzyj2000@gmail.com>

On Wed, Feb 4, 2015 at 11:20 PM, zhuyj <zyjzyj2000@gmail.com> wrote:
> diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
> index bd29016..4d13edb 100644
> --- a/net/ipv4/Kconfig
> +++ b/net/ipv4/Kconfig
> @@ -259,6 +259,23 @@ config IP_PIMSM_V2
>           gated-5). This routing protocol is not used widely, so say N unless
>           you want to play with it.
>
> +config ARP_PROBE_BCAST
> +       bool "IP: ARP send broadcast ARP, if probing using unicast fails"
> +       default y

Why make it default to y? Since we use the current behavior for a long time?

^ permalink raw reply

* Re: [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo
From: Cong Wang @ 2015-02-07  6:39 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: David Miller, Linux Kernel Network Developers, vlee
In-Reply-To: <54D4512A.5080809@redhat.com>

Hi, Carlos

On Thu, Feb 5, 2015 at 9:29 PM, Carlos O'Donell <carlos@redhat.com> wrote:
>
> When does this hit mainline? I've got Cong's patch ready for glibc, but
> the usual procedure is to commit after mainline has the matching patch.
> Not that it really matters, but it's just a useful thing to be able to
> say the trickle down is linux->glibc.
>

It will be merged in the next merge window, currently it is just in net-next.

Thanks.

^ permalink raw reply

* Re: [PATCH next 4/6] bonding: Allow userspace to set system_priority
From: Jay Vosburgh @ 2015-02-07  6:19 UTC (permalink / raw)
  To: Andy Gospodarek
  Cc: Mahesh Bandewar, Andy Gospodarek, Veaceslav Falico,
	Nikolay Aleksandrov, David Miller, netdev, Eric Dumazet
In-Reply-To: <20150207033847.GD34197@gospo.home.greyhouse.net>

Andy Gospodarek <gospo@cumulusnetworks.com> wrote:

>On Fri, Feb 06, 2015 at 04:51:54PM -0800, Mahesh Bandewar wrote:
>> This patch allows user to randomize the system-priority in an ad-system.
>> The allowed range is 1 - 0xFFFF while default value is 0xFFFF. If user
>> does not specify this value, the system defaults to 0xFFFF, which is
>> what it was before this patch.
>> 
>> Following example code could set the value -
>>     # modprobe bonding mode=4
>>     # sys_prio=$(( 1 + RANDOM + RANDOM ))
>>     # echo $sys_prio > /sys/class/net/bond0/bonding/ad_actor_system_priority
>
>If I can convince you to change 'ad_actor_system_macaddr' to something
>different can I also convince you to change this to something shorter,
>too?  :)
>
>Maybe 'ad_sys_priority' or something?

	The name, verbose as it is, is from the 802.1AX standard, and
there's also a "partner_system_priority" (which is not a user-settable
thing, it's a field in the LACPDUs).  My suggestion would therefore be
"ad_actor_sys_prio" for this one, as I think there's some value in
continuity with the names from the standard.

	The MAC address one in the standard is just "actor_system";
there's a "partner_system" here, too, which is also a field in the
LACPDU.  I'm ok with calling that one just "actor_system," as presumably
anyone changing it will know what it means.

	-J

>Thanks!
>
>>     # echo +eth1 > /sys/class/net/bond0/bonding/slaves
>>     ...
>>     # ip link set bond0 up
>> 
>> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>> ---
>>  drivers/net/bonding/bond_3ad.c     |  5 ++++-
>>  drivers/net/bonding/bond_main.c    | 14 ++++++++++++++
>>  drivers/net/bonding/bond_options.c | 29 ++++++++++++++++++++++++++++-
>>  drivers/net/bonding/bond_procfs.c  |  2 ++
>>  drivers/net/bonding/bond_sysfs.c   | 15 +++++++++++++++
>>  include/net/bond_options.h         |  1 +
>>  include/net/bonding.h              |  1 +
>>  7 files changed, 65 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>> index 2a69095266c1..1177f96194dd 100644
>> --- a/drivers/net/bonding/bond_3ad.c
>> +++ b/drivers/net/bonding/bond_3ad.c
>> @@ -1912,7 +1912,8 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
>>  
>>  		BOND_AD_INFO(bond).aggregator_identifier = 0;
>>  
>> -		BOND_AD_INFO(bond).system.sys_priority = 0xFFFF;
>> +		BOND_AD_INFO(bond).system.sys_priority =
>> +			bond->params.ad_actor_sysprio;
>>  		BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
>>  
>>  		/* initialize how many times this module is called in one
>> @@ -1963,6 +1964,8 @@ void bond_3ad_bind_slave(struct slave *slave)
>>  			port->sm_vars &= ~AD_PORT_LACP_ENABLED;
>>  		/* actor system is the bond's system */
>>  		port->actor_system = BOND_AD_INFO(bond).system.sys_mac_addr;
>> +		port->actor_system_priority =
>> +		    BOND_AD_INFO(bond).system.sys_priority;
>>  		/* tx timer(to verify that no more than MAX_TX_IN_SECOND
>>  		 * lacpdu's are sent in one second)
>>  		 */
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index a50ec87486f3..561b2bde5aeb 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -4104,6 +4104,7 @@ static int bond_check_params(struct bond_params *params)
>>  	struct bond_opt_value newval;
>>  	const struct bond_opt_value *valptr;
>>  	int arp_all_targets_value;
>> +	u16 ad_actor_sysprio = 0;
>>  
>>  	/* Convert string parameters. */
>>  	if (mode) {
>> @@ -4398,6 +4399,18 @@ static int bond_check_params(struct bond_params *params)
>>  		fail_over_mac_value = BOND_FOM_NONE;
>>  	}
>>  
>> +	if (bond_mode == BOND_MODE_8023AD) {
>> +		bond_opt_initstr(&newval, "default");
>> +		valptr = bond_opt_parse(
>> +				bond_opt_get(BOND_OPT_AD_ACTOR_SYSPRIO),
>> +					     &newval);
>> +		if (!valptr) {
>> +			pr_err("Error: No ad_actor_sysprio default value");
>> +			return -EINVAL;
>> +		}
>> +		ad_actor_sysprio = valptr->value;
>> +	}
>> +
>>  	if (lp_interval == 0) {
>>  		pr_warn("Warning: ip_interval must be between 1 and %d, so it was reset to %d\n",
>>  			INT_MAX, BOND_ALB_DEFAULT_LP_INTERVAL);
>> @@ -4426,6 +4439,7 @@ static int bond_check_params(struct bond_params *params)
>>  	params->lp_interval = lp_interval;
>>  	params->packets_per_slave = packets_per_slave;
>>  	params->tlb_dynamic_lb = 1; /* Default value */
>> +	params->ad_actor_sysprio = ad_actor_sysprio;
>>  	if (packets_per_slave > 0) {
>>  		params->reciprocal_packets_per_slave =
>>  			reciprocal_value(packets_per_slave);
>> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
>> index 4df28943d222..d8f6760143ae 100644
>> --- a/drivers/net/bonding/bond_options.c
>> +++ b/drivers/net/bonding/bond_options.c
>> @@ -70,6 +70,8 @@ static int bond_option_slaves_set(struct bonding *bond,
>>  				  const struct bond_opt_value *newval);
>>  static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
>>  				  const struct bond_opt_value *newval);
>> +static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
>> +				  const struct bond_opt_value *newval);
>>  
>>  
>>  static const struct bond_opt_value bond_mode_tbl[] = {
>> @@ -186,6 +188,12 @@ static const struct bond_opt_value bond_tlb_dynamic_lb_tbl[] = {
>>  	{ NULL,  -1, 0}
>>  };
>>  
>> +static const struct bond_opt_value bond_ad_actor_sysprio_tbl[] = {
>> +	{ "minval",  1,     BOND_VALFLAG_MIN},
>> +	{ "maxval",  65535, BOND_VALFLAG_MAX | BOND_VALFLAG_DEFAULT},
>> +	{ NULL,      -1,    0},
>> +};
>> +
>>  static const struct bond_option bond_opts[BOND_OPT_LAST] = {
>>  	[BOND_OPT_MODE] = {
>>  		.id = BOND_OPT_MODE,
>> @@ -379,7 +387,15 @@ static const struct bond_option bond_opts[BOND_OPT_LAST] = {
>>  		.values = bond_tlb_dynamic_lb_tbl,
>>  		.flags = BOND_OPTFLAG_IFDOWN,
>>  		.set = bond_option_tlb_dynamic_lb_set,
>> -	}
>> +	},
>> +	[BOND_OPT_AD_ACTOR_SYSPRIO] = {
>> +		.id = BOND_OPT_AD_ACTOR_SYSPRIO,
>> +		.name = "ad_actor_system_priority",
>> +		.unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)),
>> +		.flags = BOND_OPTFLAG_IFDOWN,
>> +		.values = bond_ad_actor_sysprio_tbl,
>> +		.set = bond_option_ad_actor_sysprio_set,
>> +	},
>>  };
>>  
>>  /* Searches for an option by name */
>> @@ -1349,3 +1365,14 @@ static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
>>  
>>  	return 0;
>>  }
>> +
>> +
>> +static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
>> +					    const struct bond_opt_value *newval)
>> +{
>> +	netdev_info(bond->dev, "Setting ad_actor_sysprio to (%llu)\n",
>> +		    newval->value);
>> +
>> +	bond->params.ad_actor_sysprio = newval->value;
>> +	return 0;
>> +}
>> diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
>> index 83095a0b4b90..9e33c48886ef 100644
>> --- a/drivers/net/bonding/bond_procfs.c
>> +++ b/drivers/net/bonding/bond_procfs.c
>> @@ -134,6 +134,8 @@ static void bond_info_show_master(struct seq_file *seq)
>>  					  bond->params.ad_select);
>>  		seq_printf(seq, "Aggregator selection policy (ad_select): %s\n",
>>  			   optval->string);
>> +		seq_printf(seq, "System priority: %d\n",
>> +				BOND_AD_INFO(bond).system.sys_priority);
>>  
>>  		if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
>>  			seq_printf(seq, "bond %s has no active aggregator\n",
>> diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
>> index 7e9e151d4d61..4350aa06f867 100644
>> --- a/drivers/net/bonding/bond_sysfs.c
>> +++ b/drivers/net/bonding/bond_sysfs.c
>> @@ -692,6 +692,20 @@ static ssize_t bonding_show_packets_per_slave(struct device *d,
>>  static DEVICE_ATTR(packets_per_slave, S_IRUGO | S_IWUSR,
>>  		   bonding_show_packets_per_slave, bonding_sysfs_store_option);
>>  
>> +static ssize_t bonding_show_ad_actor_sysprio(struct device *d,
>> +					     struct device_attribute *attr,
>> +					     char *buf)
>> +{
>> +	struct bonding *bond = to_bond(d);
>> +
>> +	if (BOND_MODE(bond) == BOND_MODE_8023AD)
>> +		return sprintf(buf, "%hu\n", bond->params.ad_actor_sysprio);
>> +
>> +	return 0;
>> +}
>> +static DEVICE_ATTR(ad_actor_system_priority, S_IRUGO | S_IWUSR,
>> +		   bonding_show_ad_actor_sysprio, bonding_sysfs_store_option);
>> +
>>  static struct attribute *per_bond_attrs[] = {
>>  	&dev_attr_slaves.attr,
>>  	&dev_attr_mode.attr,
>> @@ -725,6 +739,7 @@ static struct attribute *per_bond_attrs[] = {
>>  	&dev_attr_lp_interval.attr,
>>  	&dev_attr_packets_per_slave.attr,
>>  	&dev_attr_tlb_dynamic_lb.attr,
>> +	&dev_attr_ad_actor_system_priority.attr,
>>  	NULL,
>>  };
>>  
>> diff --git a/include/net/bond_options.h b/include/net/bond_options.h
>> index ea6546d2c946..c2af1db37354 100644
>> --- a/include/net/bond_options.h
>> +++ b/include/net/bond_options.h
>> @@ -63,6 +63,7 @@ enum {
>>  	BOND_OPT_LP_INTERVAL,
>>  	BOND_OPT_SLAVES,
>>  	BOND_OPT_TLB_DYNAMIC_LB,
>> +	BOND_OPT_AD_ACTOR_SYSPRIO,
>>  	BOND_OPT_LAST
>>  };
>>  
>> diff --git a/include/net/bonding.h b/include/net/bonding.h
>> index 29f53eacac0a..7a5c79fcf866 100644
>> --- a/include/net/bonding.h
>> +++ b/include/net/bonding.h
>> @@ -143,6 +143,7 @@ struct bond_params {
>>  	int packets_per_slave;
>>  	int tlb_dynamic_lb;
>>  	struct reciprocal_value reciprocal_packets_per_slave;
>> +	u16 ad_actor_sysprio;
>>  };
>>  
>>  struct bond_parm_tbl {
>> -- 
>> 2.2.0.rc0.207.ga3a616c

---
	-Jay Vosburgh, jay.vosburgh@canonical.com

^ permalink raw reply

* Re: [PATCH net-next] bridge: Let bridge not age 'externally' learnt FDB entries, they are removed when 'external' entity notifies the aging
From: Scott Feldman @ 2015-02-07  5:53 UTC (permalink / raw)
  To: Siva Mannem
  Cc: B Viswanath, David Miller, Roopa Prabhu, Netdev,
	Jiří Pírko
In-Reply-To: <CA+CtxLTewFxJNH0OTCqcGb31Ov=TZMwDtz=H11My1NKY=tb9Jg@mail.gmail.com>

On Thu, Feb 5, 2015 at 7:27 PM, Siva Mannem <siva.mannem.lnx@gmail.com> wrote:
> On Fri, Feb 6, 2015 at 7:15 AM, Scott Feldman <sfeldma@gmail.com> wrote:
>> On Thu, Feb 5, 2015 at 10:31 AM, B Viswanath <marichika4@gmail.com> wrote:
>>> On 5 February 2015 at 23:25, Scott Feldman <sfeldma@gmail.com> wrote:
>>> <snip>
>>>>
>>>> CONs
>>>>
>>>> 1) Scale-ability.  The bridge driver can't keep up with ageing many
>>>> (10^5, for example) entries.
>>>> 2) Scale-ability.  Keeping the entries periodically refreshed requires
>>>> a refresh sync from
>>>> the device to the bridge driver, and the bridge driver/kernel can't keep up.
>>>> 3) With the bridge driver, the ageing settings are per-bridge, not per-port.
>>>>
>>>> Did I miss any points?
>>>
>>> There is one more
>>>
>>> 4. On links with wirespeed traffic, software ageing FDB entries
>>> independently without having the knowledge of the traffic means that
>>> CPU will ageout entries it should not. I don't know if this breaks
>>> some RFC, but it can certainly cause big packet loss.
>>
>> SW would only age out expired entries.  An entry not refreshed by HW
>> will expire.  But HW will refresh (to SW) active entries based on
>> traffic seen.  So I'm not seeing how SW will age out entries
>> prematurely.  I'm missing something.
>
> Hardware does not refresh(to SW) active entries based on the traffic
> seen, at least on the switches that I worked on. Even if it were to
> refresh, if the traffic is flowing at line rate(say x packets per
> sec), the refresh rate to SW is equal to x, which is very huge for cpu
> to handle.

I meant refresh as in re-sending learn notification for entry on a
periodic basis, say once a second.  Not refreshing by presenting pkt
to SW...that wouldn't scale at all, as you say.

> There are only two notifications to SW.
>
> 1)learn notification(when packet arrives that has smac which is not in
> hardware's FDB)
> 2)When the hardware ages the entry, it sends a age notification.

I think I'm coming around to your thinking of letting HW manage ageing
on HW-learned FDB entries.  I was hoping to keep ageing in SW for the
PROs I mentioned earlier, but it's not aligning very well with real
HW.  If we modify rocker to work like real HW (that was the point of
rocker in the first place), then we can re-introduce your patch to let
bridge ignore ageing on entries marked with added_by_external_learn.
Let me work on the rocker mods and followup.

-scott

^ permalink raw reply

* Re: [PATCH] vxlan: Wrong type passed to %pIS
From: Cong Wang @ 2015-02-07  5:13 UTC (permalink / raw)
  To: Rasmus Villemoes
  Cc: David S. Miller, Pravin B Shelar, Nicolas Dichtel,
	Linux Kernel Network Developers, LKML
In-Reply-To: <1423275451-3663-1-git-send-email-linux@rasmusvillemoes.dk>

On Fri, Feb 6, 2015 at 6:17 PM, Rasmus Villemoes
<linux@rasmusvillemoes.dk> wrote:
> src_ip is a pointer to a union vxlan_addr, one member of which is a
> struct sockaddr. Passing a pointer to src_ip is wrong; one should pass
> the value of src_ip itself. Since %pIS formally expects something of
> type struct sockaddr*, let's pass a pointer to the appropriate union
> member, though this of course doesn't change the generated code.
>


It is a union, this doesn't harm.

> Fixes: e4c7ed415387 ("vxlan: add ipv6 support")
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
>  drivers/net/vxlan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index a8c755dcab14..11defbb24183 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -991,7 +991,7 @@ static bool vxlan_snoop(struct net_device *dev,
>                 if (net_ratelimit())
>                         netdev_info(dev,
>                                     "%pM migrated from %pIS to %pIS\n",
> -                                   src_mac, &rdst->remote_ip, &src_ip);
> +                                   src_mac, &rdst->remote_ip.sa, &src_ip->sa);
>
>                 rdst->remote_ip = *src_ip;
>                 f->updated = jiffies;

Since you are on it, there is another similar place in vxlan too.

^ permalink raw reply

* [PATCH 3/3] stmmac: Add AXI burst length support to platform device.
From: Chen Baozi @ 2015-02-07  5:07 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: Chen Baozi, netdev
In-Reply-To: <1423285636-8623-1-git-send-email-cbz@baozis.org>

The AXI Bus Mode Register controls the AXI master behavior. It is mainly
used to control the burst splitting and the number of outstanding requests.
This register is present and valid only in GMAC-AXI configuration. The old
driver only supports this feature on PCI devices. This patch adds an
'snps,apl' properties in DT to enable it on platform devices.

Signed-off-by: Chen Baozi <chenbaozi@kylinos.com.cn>
---
 Documentation/devicetree/bindings/net/stmmac.txt      | 1 +
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
index c41afd9..8f3c834 100644
--- a/Documentation/devicetree/bindings/net/stmmac.txt
+++ b/Documentation/devicetree/bindings/net/stmmac.txt
@@ -43,6 +43,7 @@ Optional properties:
   available this clock is used for programming the Timestamp Addend Register.
   If not passed then the system clock will be used and this is fine on some
   platforms.
+- snps,abl: AXI Burst Length
 
 Examples:
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 3039de2..abbc897 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -230,6 +230,7 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
 			return -ENOMEM;
 		plat->dma_cfg = dma_cfg;
 		of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
+		of_property_read_u32(np, "snps,abl", &dma_cfg->burst_len);
 		dma_cfg->fixed_burst =
 			of_property_read_bool(np, "snps,fixed-burst");
 		dma_cfg->mixed_burst =
-- 
2.1.4

^ permalink raw reply related

* Re: [PATCH next 6/6] bonding: Implement user key part of port_key in an AD system.
From: Andy Gospodarek @ 2015-02-07  3:40 UTC (permalink / raw)
  To: Mahesh Bandewar
  Cc: Jay Vosburgh, Andy Gospodarek, Veaceslav Falico,
	Nikolay Aleksandrov, David Miller, netdev, Eric Dumazet
In-Reply-To: <1423270317-9352-1-git-send-email-maheshb@google.com>

On Fri, Feb 06, 2015 at 04:51:57PM -0800, Mahesh Bandewar wrote:
> The port key has three components - user-key, speed-part, and duplex-part.
> The LSBit is for the duplex-part, next 5 bits are for the speed while the
> remaining 10 bits are the user defined key bits. Get these 10 bits
> from the user-space (through the SysFs interface) and use it to form the
> admin port-key. Allowed range for the user-key is 0 - 1023 (10 bits). If
> it is not provided then use zero for the user-key-bits (default).
> 
> It can set using following example code -
> 
>    # modprobe bonding mode=4
>    # usr_port_key=$(( RANDOM & 0x3FF ))
>    # echo $usr_port_key > /sys/class/net/bond0/bonding/ad_actor_user_port_key
>    # echo +eth1 > /sys/class/net/bond0/bonding/slaves

If the other ones don't have 'actor' maybe drop it here too.

(Sorry to be picky about these, but as someone who has typed many of
these options a bunch it would be great to have shorter names in config
files.) 

>    ...
>    # ip link set bond0 up
> 
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> ---
>  drivers/net/bonding/bond_3ad.c     |  6 +++---
>  drivers/net/bonding/bond_main.c    | 10 ++++++++++
>  drivers/net/bonding/bond_options.c | 26 ++++++++++++++++++++++++++
>  drivers/net/bonding/bond_sysfs.c   | 15 +++++++++++++++
>  include/net/bond_options.h         |  1 +
>  include/net/bonding.h              |  1 +
>  6 files changed, 56 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index 373d3db3809f..c69c393ba8c5 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c
> @@ -1955,10 +1955,10 @@ void bond_3ad_bind_slave(struct slave *slave)
>  
>  		port->slave = slave;
>  		port->actor_port_number = SLAVE_AD_INFO(slave)->id;
> -		/* key is determined according to the link speed, duplex and user key(which
> -		 * is yet not supported)
> +		/* key is determined according to the link speed, duplex and
> +		 * user key
>  		 */
> -		port->actor_admin_port_key = 0;
> +		port->actor_admin_port_key = bond->params.ad_actor_portkey << 6;
>  		port->actor_admin_port_key |= __get_duplex(port);
>  		port->actor_admin_port_key |= (__get_link_speed(port) << 1);
>  		port->actor_oper_port_key = port->actor_admin_port_key;
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 1a6735ef2ea7..f9f001f35a91 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -4105,6 +4105,7 @@ static int bond_check_params(struct bond_params *params)
>  	const struct bond_opt_value *valptr;
>  	int arp_all_targets_value;
>  	u16 ad_actor_sysprio = 0;
> +	u16 ad_actor_portkey = 0;
>  
>  	/* Convert string parameters. */
>  	if (mode) {
> @@ -4409,6 +4410,14 @@ static int bond_check_params(struct bond_params *params)
>  			return -EINVAL;
>  		}
>  		ad_actor_sysprio = valptr->value;
> +
> +		valptr = bond_opt_parse(bond_opt_get(BOND_OPT_AD_ACTOR_PORTKEY),
> +					&newval);
> +		if (!valptr) {
> +			pr_err("Error: No ad_actor_portkey default value");
> +			return -EINVAL;
> +		}
> +		ad_actor_portkey = valptr->value;
>  	}
>  
>  	if (lp_interval == 0) {
> @@ -4441,6 +4450,7 @@ static int bond_check_params(struct bond_params *params)
>  	params->tlb_dynamic_lb = 1; /* Default value */
>  	params->ad_actor_sysprio = ad_actor_sysprio;
>  	eth_zero_addr(params->ad_actor_sys_macaddr);
> +	params->ad_actor_portkey = ad_actor_portkey;
>  	if (packets_per_slave > 0) {
>  		params->reciprocal_packets_per_slave =
>  			reciprocal_value(packets_per_slave);
> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
> index 330d48b6a1e6..c3f77c6d0d2e 100644
> --- a/drivers/net/bonding/bond_options.c
> +++ b/drivers/net/bonding/bond_options.c
> @@ -74,6 +74,8 @@ static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
>  				  const struct bond_opt_value *newval);
>  static int bond_option_ad_actor_sys_macaddr_set(struct bonding *bond,
>  				  const struct bond_opt_value *newval);
> +static int bond_option_ad_actor_portkey_set(struct bonding *bond,
> +				  const struct bond_opt_value *newval);
>  
>  
>  static const struct bond_opt_value bond_mode_tbl[] = {
> @@ -196,6 +198,12 @@ static const struct bond_opt_value bond_ad_actor_sysprio_tbl[] = {
>  	{ NULL,      -1,    0},
>  };
>  
> +static const struct bond_opt_value bond_ad_actor_portkey_tbl[] = {
> +	{ "minval",  0,     BOND_VALFLAG_MIN | BOND_VALFLAG_DEFAULT},
> +	{ "maxval",  1023,  BOND_VALFLAG_MAX},
> +	{ NULL,      -1,    0},
> +};
> +
>  static const struct bond_option bond_opts[BOND_OPT_LAST] = {
>  	[BOND_OPT_MODE] = {
>  		.id = BOND_OPT_MODE,
> @@ -405,6 +413,14 @@ static const struct bond_option bond_opts[BOND_OPT_LAST] = {
>  		.flags = BOND_OPTFLAG_RAWVAL | BOND_OPTFLAG_IFDOWN,
>  		.set = bond_option_ad_actor_sys_macaddr_set,
>  	},
> +	[BOND_OPT_AD_ACTOR_PORTKEY] = {
> +		.id = BOND_OPT_AD_ACTOR_PORTKEY,
> +		.name = "ad_actor_user_port_key",
> +		.unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)),
> +		.flags = BOND_OPTFLAG_IFDOWN,
> +		.values = bond_ad_actor_portkey_tbl,
> +		.set = bond_option_ad_actor_portkey_set,
> +	}
>  };
>  
>  /* Searches for an option by name */
> @@ -1405,3 +1421,13 @@ static int bond_option_ad_actor_sys_macaddr_set(struct bonding *bond,
>  
>  	return 0;
>  }
> +
> +static int bond_option_ad_actor_portkey_set(struct bonding *bond,
> +					    const struct bond_opt_value *newval)
> +{
> +	netdev_info(bond->dev, "Setting ad_actor_portkey to (%llu)\n",
> +		    newval->value);
> +
> +	bond->params.ad_actor_portkey = newval->value;
> +	return 0;
> +}
> diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
> index 91713d0b6685..17d84d5a1608 100644
> --- a/drivers/net/bonding/bond_sysfs.c
> +++ b/drivers/net/bonding/bond_sysfs.c
> @@ -721,6 +721,20 @@ static DEVICE_ATTR(ad_actor_system_mac_address, S_IRUGO | S_IWUSR,
>  		   bonding_show_ad_actor_sys_macaddr,
>  		   bonding_sysfs_store_option);
>  
> +static ssize_t bonding_show_ad_actor_portkey(struct device *d,
> +					     struct device_attribute *attr,
> +					     char *buf)
> +{
> +	struct bonding *bond = to_bond(d);
> +
> +	if (BOND_MODE(bond) == BOND_MODE_8023AD)
> +		return sprintf(buf, "%hu\n", bond->params.ad_actor_portkey);
> +
> +	return 0;
> +}
> +static DEVICE_ATTR(ad_actor_user_port_key, S_IRUGO | S_IWUSR,
> +		   bonding_show_ad_actor_portkey, bonding_sysfs_store_option);
> +
>  static struct attribute *per_bond_attrs[] = {
>  	&dev_attr_slaves.attr,
>  	&dev_attr_mode.attr,
> @@ -756,6 +770,7 @@ static struct attribute *per_bond_attrs[] = {
>  	&dev_attr_tlb_dynamic_lb.attr,
>  	&dev_attr_ad_actor_system_priority.attr,
>  	&dev_attr_ad_actor_system_mac_address.attr,
> +	&dev_attr_ad_actor_user_port_key.attr,
>  	NULL,
>  };
>  
> diff --git a/include/net/bond_options.h b/include/net/bond_options.h
> index 993ef73cd050..4c36455aacb4 100644
> --- a/include/net/bond_options.h
> +++ b/include/net/bond_options.h
> @@ -65,6 +65,7 @@ enum {
>  	BOND_OPT_TLB_DYNAMIC_LB,
>  	BOND_OPT_AD_ACTOR_SYSPRIO,
>  	BOND_OPT_AD_ACTOR_SYS_MACADDR,
> +	BOND_OPT_AD_ACTOR_PORTKEY,
>  	BOND_OPT_LAST
>  };
>  
> diff --git a/include/net/bonding.h b/include/net/bonding.h
> index cd2092e6bc71..e91db2566437 100644
> --- a/include/net/bonding.h
> +++ b/include/net/bonding.h
> @@ -144,6 +144,7 @@ struct bond_params {
>  	int tlb_dynamic_lb;
>  	struct reciprocal_value reciprocal_packets_per_slave;
>  	u16 ad_actor_sysprio;
> +	u16 ad_actor_portkey;
>  	u8 ad_actor_sys_macaddr[ETH_ALEN];
>  };
>  
> -- 
> 2.2.0.rc0.207.ga3a616c
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH next 4/6] bonding: Allow userspace to set system_priority
From: Andy Gospodarek @ 2015-02-07  3:38 UTC (permalink / raw)
  To: Mahesh Bandewar
  Cc: Jay Vosburgh, Andy Gospodarek, Veaceslav Falico,
	Nikolay Aleksandrov, David Miller, netdev, Eric Dumazet
In-Reply-To: <1423270314-9271-1-git-send-email-maheshb@google.com>

On Fri, Feb 06, 2015 at 04:51:54PM -0800, Mahesh Bandewar wrote:
> This patch allows user to randomize the system-priority in an ad-system.
> The allowed range is 1 - 0xFFFF while default value is 0xFFFF. If user
> does not specify this value, the system defaults to 0xFFFF, which is
> what it was before this patch.
> 
> Following example code could set the value -
>     # modprobe bonding mode=4
>     # sys_prio=$(( 1 + RANDOM + RANDOM ))
>     # echo $sys_prio > /sys/class/net/bond0/bonding/ad_actor_system_priority

If I can convince you to change 'ad_actor_system_macaddr' to something
different can I also convince you to change this to something shorter,
too?  :)

Maybe 'ad_sys_priority' or something?

Thanks!

>     # echo +eth1 > /sys/class/net/bond0/bonding/slaves
>     ...
>     # ip link set bond0 up
> 
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> ---
>  drivers/net/bonding/bond_3ad.c     |  5 ++++-
>  drivers/net/bonding/bond_main.c    | 14 ++++++++++++++
>  drivers/net/bonding/bond_options.c | 29 ++++++++++++++++++++++++++++-
>  drivers/net/bonding/bond_procfs.c  |  2 ++
>  drivers/net/bonding/bond_sysfs.c   | 15 +++++++++++++++
>  include/net/bond_options.h         |  1 +
>  include/net/bonding.h              |  1 +
>  7 files changed, 65 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index 2a69095266c1..1177f96194dd 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c
> @@ -1912,7 +1912,8 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
>  
>  		BOND_AD_INFO(bond).aggregator_identifier = 0;
>  
> -		BOND_AD_INFO(bond).system.sys_priority = 0xFFFF;
> +		BOND_AD_INFO(bond).system.sys_priority =
> +			bond->params.ad_actor_sysprio;
>  		BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
>  
>  		/* initialize how many times this module is called in one
> @@ -1963,6 +1964,8 @@ void bond_3ad_bind_slave(struct slave *slave)
>  			port->sm_vars &= ~AD_PORT_LACP_ENABLED;
>  		/* actor system is the bond's system */
>  		port->actor_system = BOND_AD_INFO(bond).system.sys_mac_addr;
> +		port->actor_system_priority =
> +		    BOND_AD_INFO(bond).system.sys_priority;
>  		/* tx timer(to verify that no more than MAX_TX_IN_SECOND
>  		 * lacpdu's are sent in one second)
>  		 */
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index a50ec87486f3..561b2bde5aeb 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -4104,6 +4104,7 @@ static int bond_check_params(struct bond_params *params)
>  	struct bond_opt_value newval;
>  	const struct bond_opt_value *valptr;
>  	int arp_all_targets_value;
> +	u16 ad_actor_sysprio = 0;
>  
>  	/* Convert string parameters. */
>  	if (mode) {
> @@ -4398,6 +4399,18 @@ static int bond_check_params(struct bond_params *params)
>  		fail_over_mac_value = BOND_FOM_NONE;
>  	}
>  
> +	if (bond_mode == BOND_MODE_8023AD) {
> +		bond_opt_initstr(&newval, "default");
> +		valptr = bond_opt_parse(
> +				bond_opt_get(BOND_OPT_AD_ACTOR_SYSPRIO),
> +					     &newval);
> +		if (!valptr) {
> +			pr_err("Error: No ad_actor_sysprio default value");
> +			return -EINVAL;
> +		}
> +		ad_actor_sysprio = valptr->value;
> +	}
> +
>  	if (lp_interval == 0) {
>  		pr_warn("Warning: ip_interval must be between 1 and %d, so it was reset to %d\n",
>  			INT_MAX, BOND_ALB_DEFAULT_LP_INTERVAL);
> @@ -4426,6 +4439,7 @@ static int bond_check_params(struct bond_params *params)
>  	params->lp_interval = lp_interval;
>  	params->packets_per_slave = packets_per_slave;
>  	params->tlb_dynamic_lb = 1; /* Default value */
> +	params->ad_actor_sysprio = ad_actor_sysprio;
>  	if (packets_per_slave > 0) {
>  		params->reciprocal_packets_per_slave =
>  			reciprocal_value(packets_per_slave);
> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
> index 4df28943d222..d8f6760143ae 100644
> --- a/drivers/net/bonding/bond_options.c
> +++ b/drivers/net/bonding/bond_options.c
> @@ -70,6 +70,8 @@ static int bond_option_slaves_set(struct bonding *bond,
>  				  const struct bond_opt_value *newval);
>  static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
>  				  const struct bond_opt_value *newval);
> +static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
> +				  const struct bond_opt_value *newval);
>  
>  
>  static const struct bond_opt_value bond_mode_tbl[] = {
> @@ -186,6 +188,12 @@ static const struct bond_opt_value bond_tlb_dynamic_lb_tbl[] = {
>  	{ NULL,  -1, 0}
>  };
>  
> +static const struct bond_opt_value bond_ad_actor_sysprio_tbl[] = {
> +	{ "minval",  1,     BOND_VALFLAG_MIN},
> +	{ "maxval",  65535, BOND_VALFLAG_MAX | BOND_VALFLAG_DEFAULT},
> +	{ NULL,      -1,    0},
> +};
> +
>  static const struct bond_option bond_opts[BOND_OPT_LAST] = {
>  	[BOND_OPT_MODE] = {
>  		.id = BOND_OPT_MODE,
> @@ -379,7 +387,15 @@ static const struct bond_option bond_opts[BOND_OPT_LAST] = {
>  		.values = bond_tlb_dynamic_lb_tbl,
>  		.flags = BOND_OPTFLAG_IFDOWN,
>  		.set = bond_option_tlb_dynamic_lb_set,
> -	}
> +	},
> +	[BOND_OPT_AD_ACTOR_SYSPRIO] = {
> +		.id = BOND_OPT_AD_ACTOR_SYSPRIO,
> +		.name = "ad_actor_system_priority",
> +		.unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)),
> +		.flags = BOND_OPTFLAG_IFDOWN,
> +		.values = bond_ad_actor_sysprio_tbl,
> +		.set = bond_option_ad_actor_sysprio_set,
> +	},
>  };
>  
>  /* Searches for an option by name */
> @@ -1349,3 +1365,14 @@ static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
>  
>  	return 0;
>  }
> +
> +
> +static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
> +					    const struct bond_opt_value *newval)
> +{
> +	netdev_info(bond->dev, "Setting ad_actor_sysprio to (%llu)\n",
> +		    newval->value);
> +
> +	bond->params.ad_actor_sysprio = newval->value;
> +	return 0;
> +}
> diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
> index 83095a0b4b90..9e33c48886ef 100644
> --- a/drivers/net/bonding/bond_procfs.c
> +++ b/drivers/net/bonding/bond_procfs.c
> @@ -134,6 +134,8 @@ static void bond_info_show_master(struct seq_file *seq)
>  					  bond->params.ad_select);
>  		seq_printf(seq, "Aggregator selection policy (ad_select): %s\n",
>  			   optval->string);
> +		seq_printf(seq, "System priority: %d\n",
> +				BOND_AD_INFO(bond).system.sys_priority);
>  
>  		if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
>  			seq_printf(seq, "bond %s has no active aggregator\n",
> diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
> index 7e9e151d4d61..4350aa06f867 100644
> --- a/drivers/net/bonding/bond_sysfs.c
> +++ b/drivers/net/bonding/bond_sysfs.c
> @@ -692,6 +692,20 @@ static ssize_t bonding_show_packets_per_slave(struct device *d,
>  static DEVICE_ATTR(packets_per_slave, S_IRUGO | S_IWUSR,
>  		   bonding_show_packets_per_slave, bonding_sysfs_store_option);
>  
> +static ssize_t bonding_show_ad_actor_sysprio(struct device *d,
> +					     struct device_attribute *attr,
> +					     char *buf)
> +{
> +	struct bonding *bond = to_bond(d);
> +
> +	if (BOND_MODE(bond) == BOND_MODE_8023AD)
> +		return sprintf(buf, "%hu\n", bond->params.ad_actor_sysprio);
> +
> +	return 0;
> +}
> +static DEVICE_ATTR(ad_actor_system_priority, S_IRUGO | S_IWUSR,
> +		   bonding_show_ad_actor_sysprio, bonding_sysfs_store_option);
> +
>  static struct attribute *per_bond_attrs[] = {
>  	&dev_attr_slaves.attr,
>  	&dev_attr_mode.attr,
> @@ -725,6 +739,7 @@ static struct attribute *per_bond_attrs[] = {
>  	&dev_attr_lp_interval.attr,
>  	&dev_attr_packets_per_slave.attr,
>  	&dev_attr_tlb_dynamic_lb.attr,
> +	&dev_attr_ad_actor_system_priority.attr,
>  	NULL,
>  };
>  
> diff --git a/include/net/bond_options.h b/include/net/bond_options.h
> index ea6546d2c946..c2af1db37354 100644
> --- a/include/net/bond_options.h
> +++ b/include/net/bond_options.h
> @@ -63,6 +63,7 @@ enum {
>  	BOND_OPT_LP_INTERVAL,
>  	BOND_OPT_SLAVES,
>  	BOND_OPT_TLB_DYNAMIC_LB,
> +	BOND_OPT_AD_ACTOR_SYSPRIO,
>  	BOND_OPT_LAST
>  };
>  
> diff --git a/include/net/bonding.h b/include/net/bonding.h
> index 29f53eacac0a..7a5c79fcf866 100644
> --- a/include/net/bonding.h
> +++ b/include/net/bonding.h
> @@ -143,6 +143,7 @@ struct bond_params {
>  	int packets_per_slave;
>  	int tlb_dynamic_lb;
>  	struct reciprocal_value reciprocal_packets_per_slave;
> +	u16 ad_actor_sysprio;
>  };
>  
>  struct bond_parm_tbl {
> -- 
> 2.2.0.rc0.207.ga3a616c
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] vxlan: Wrong type passed to %pIS
From: Joe Perches @ 2015-02-07  3:35 UTC (permalink / raw)
  To: Rasmus Villemoes
  Cc: David S. Miller, Pravin B Shelar, Nicolas Dichtel, netdev,
	linux-kernel
In-Reply-To: <1423275451-3663-1-git-send-email-linux@rasmusvillemoes.dk>

On Sat, 2015-02-07 at 03:17 +0100, Rasmus Villemoes wrote:
> src_ip is a pointer to a union vxlan_addr, one member of which is a
> struct sockaddr. Passing a pointer to src_ip is wrong; one should pass
> the value of src_ip itself. Since %pIS formally expects something of
> type struct sockaddr*, let's pass a pointer to the appropriate union
> member, though this of course doesn't change the generated code.

Hello Rasmus

Are you finding these mismatches by hand or
are you using some tool?

^ permalink raw reply

* Re: [PATCH next 5/6] bonding: Allow userspace to set macaddr on bonding-dev
From: Andy Gospodarek @ 2015-02-07  3:31 UTC (permalink / raw)
  To: Mahesh Bandewar
  Cc: Jay Vosburgh, Andy Gospodarek, Veaceslav Falico,
	Nikolay Aleksandrov, David Miller, netdev, Eric Dumazet,
	Maciej Żenczykowski
In-Reply-To: <20150207032207.GB34197@gospo.home.greyhouse.net>

On Fri, Feb 06, 2015 at 10:22:07PM -0500, Andy Gospodarek wrote:
> On Fri, Feb 06, 2015 at 06:41:05PM -0800, Mahesh Bandewar wrote:
> > On Fri, Feb 6, 2015 at 5:54 PM, Jay Vosburgh <jay.vosburgh@canonical.com> wrote:
> > > Mahesh Bandewar <maheshb@google.com> wrote:
> > >
> > >>On Fri, Feb 6, 2015 at 5:20 PM, Jay Vosburgh <jay.vosburgh@canonical.com> wrote:
> > >>> Mahesh Bandewar <maheshb@google.com> wrote:
> > >>>
> > >>>>This patch allows user-space to set the mac-address on the bonding device.
> > >>>>This mac-address can not be NULL or a Multicast. If the mac-address is set
> > >>>>from user-space; kernel will honor it and will not overwrite it. In the
> > >>>>absense (value from user space); the logic will default to using the
> > >>>>masters' mac as the mac address for the bonding device.
> > >>>>
> > >>>>It can be set using example code below -
> > >>>>
> > >>>>   # modprobe bonding mode=4
> > >>>>   # sys_mac_addr=$(printf '%02x:%02x:%02x:%02x:%02x:%02x' \
> > >>>>                    $(( (RANDOM & 0xFE) | 0x02 )) \
> > >>>>                    $(( RANDOM & 0xFF )) \
> > >>>>                    $(( RANDOM & 0xFF )) \
> > >>>>                    $(( RANDOM & 0xFF )) \
> > >>>>                    $(( RANDOM & 0xFF )) \
> > >>>>                    $(( RANDOM & 0xFF )))
> > >>>>   # echo $sys_mac_addr > /sys/class/net/bond0/bonding/ad_actor_system_mac_address
> > >>>>   # echo +eth1 > /sys/class/net/bond0/bonding/slaves
> > >>>>   ...
> > >>>>   # ip link set bond0 up
> > >>>
> > >>>         How is this patch functionally different from setting the
> > >>> bonding master's MAC address to a particular value prior to adding any
> > >>> slaves?
> > >>>
> > >>
> > >>Maciej is correct but I think I was bit ambiguous about it in the
> > >>commit message which might have made you think this way. I'll reword
> > >>the commit message.
> > >
> > >         Thanks; presumably there is some administrative reason for this.
> > >
> > The idea is that in an AD system the actor-partner communication is a
> > business between them two only and no one in the L2 domain should
> > care. These enhancements should obscure that should anyone try to
> > sniff it. Probably I assumed too much and should add this idea behind
> > the implementation in the commit log.
> > 
> > >         Also, for patches 4, 5 and 6, I believe current practice is to
> > > provide a netlink / iproute2 facility for options.
> > >
> > OK. I'll add them (netlink enhancements) in a separate set of patch(s).
> > 
> 
> Mahesh,
> 
> Overall this looks good.  My only comment (other than the suggestion
> that was already made to also add netlink support), would be a slight
> change to the name.
> 
> Would you consider renaming 'ad_actor_sys_macaddr' to something a bit
> shorter?  That is really long name.  Maybe just 'sys_mac_addr' instead?

Ugh, I mean to say 'ad_sys_mac_addr' since this is 802.3ad-specific it
would be good to have the 'ad' on the front since that is the only mode
that uses it.

> 
> Thanks,
> 
> -andy
> 
> > >         -J
> > >
> > >
> > >>>         -J
> > >>>
> > >>>>Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> > >>>>---
> > >>>> drivers/net/bonding/bond_3ad.c     |  7 ++++++-
> > >>>> drivers/net/bonding/bond_main.c    |  1 +
> > >>>> drivers/net/bonding/bond_options.c | 29 +++++++++++++++++++++++++++++
> > >>>> drivers/net/bonding/bond_procfs.c  |  6 ++++++
> > >>>> drivers/net/bonding/bond_sysfs.c   | 16 ++++++++++++++++
> > >>>> include/net/bond_options.h         |  1 +
> > >>>> include/net/bonding.h              |  1 +
> > >>>> 7 files changed, 60 insertions(+), 1 deletion(-)
> > >>>>
> > >>>>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> > >>>>index 1177f96194dd..373d3db3809f 100644
> > >>>>--- a/drivers/net/bonding/bond_3ad.c
> > >>>>+++ b/drivers/net/bonding/bond_3ad.c
> > >>>>@@ -1914,7 +1914,12 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
> > >>>>
> > >>>>               BOND_AD_INFO(bond).system.sys_priority =
> > >>>>                       bond->params.ad_actor_sysprio;
> > >>>>-              BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
> > >>>>+              if (is_zero_ether_addr(bond->params.ad_actor_sys_macaddr))
> > >>>>+                      BOND_AD_INFO(bond).system.sys_mac_addr =
> > >>>>+                          *((struct mac_addr *)bond->dev->dev_addr);
> > >>>>+              else
> > >>>>+                      BOND_AD_INFO(bond).system.sys_mac_addr =
> > >>>>+                          *((struct mac_addr *)bond->params.ad_actor_sys_macaddr);
> > >>>>
> > >>>>               /* initialize how many times this module is called in one
> > >>>>                * second (should be about every 100ms)
> > >>>>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> > >>>>index 561b2bde5aeb..1a6735ef2ea7 100644
> > >>>>--- a/drivers/net/bonding/bond_main.c
> > >>>>+++ b/drivers/net/bonding/bond_main.c
> > >>>>@@ -4440,6 +4440,7 @@ static int bond_check_params(struct bond_params *params)
> > >>>>       params->packets_per_slave = packets_per_slave;
> > >>>>       params->tlb_dynamic_lb = 1; /* Default value */
> > >>>>       params->ad_actor_sysprio = ad_actor_sysprio;
> > >>>>+      eth_zero_addr(params->ad_actor_sys_macaddr);
> > >>>>       if (packets_per_slave > 0) {
> > >>>>               params->reciprocal_packets_per_slave =
> > >>>>                       reciprocal_value(packets_per_slave);
> > >>>>diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
> > >>>>index d8f6760143ae..330d48b6a1e6 100644
> > >>>>--- a/drivers/net/bonding/bond_options.c
> > >>>>+++ b/drivers/net/bonding/bond_options.c
> > >>>>@@ -72,6 +72,8 @@ static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
> > >>>>                                 const struct bond_opt_value *newval);
> > >>>> static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
> > >>>>                                 const struct bond_opt_value *newval);
> > >>>>+static int bond_option_ad_actor_sys_macaddr_set(struct bonding *bond,
> > >>>>+                                const struct bond_opt_value *newval);
> > >>>>
> > >>>>
> > >>>> static const struct bond_opt_value bond_mode_tbl[] = {
> > >>>>@@ -396,6 +398,13 @@ static const struct bond_option bond_opts[BOND_OPT_LAST] = {
> > >>>>               .values = bond_ad_actor_sysprio_tbl,
> > >>>>               .set = bond_option_ad_actor_sysprio_set,
> > >>>>       },
> > >>>>+      [BOND_OPT_AD_ACTOR_SYS_MACADDR] = {
> > >>>>+              .id = BOND_OPT_AD_ACTOR_SYS_MACADDR,
> > >>>>+              .name = "ad_actor_system_mac_address",
> > >>>>+              .unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)),
> > >>>>+              .flags = BOND_OPTFLAG_RAWVAL | BOND_OPTFLAG_IFDOWN,
> > >>>>+              .set = bond_option_ad_actor_sys_macaddr_set,
> > >>>>+      },
> > >>>> };
> > >>>>
> > >>>> /* Searches for an option by name */
> > >>>>@@ -1376,3 +1385,23 @@ static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
> > >>>>       bond->params.ad_actor_sysprio = newval->value;
> > >>>>       return 0;
> > >>>> }
> > >>>>+
> > >>>>+static int bond_option_ad_actor_sys_macaddr_set(struct bonding *bond,
> > >>>>+                                          const struct bond_opt_value *newval)
> > >>>>+{
> > >>>>+      u8 macaddr[ETH_ALEN];
> > >>>>+      int i;
> > >>>>+
> > >>>>+      i = sscanf(newval->string, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
> > >>>>+                 &macaddr[0], &macaddr[1], &macaddr[2],
> > >>>>+                 &macaddr[3], &macaddr[4], &macaddr[5]);
> > >>>>+
> > >>>>+      if (i != ETH_ALEN || !is_valid_ether_addr(macaddr)) {
> > >>>>+              netdev_err(bond->dev, "Invalid MAC address.\n");
> > >>>>+              return -EINVAL;
> > >>>>+      }
> > >>>>+
> > >>>>+      ether_addr_copy(bond->params.ad_actor_sys_macaddr, macaddr);
> > >>>>+
> > >>>>+      return 0;
> > >>>>+}
> > >>>>diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
> > >>>>index 9e33c48886ef..81452ced852f 100644
> > >>>>--- a/drivers/net/bonding/bond_procfs.c
> > >>>>+++ b/drivers/net/bonding/bond_procfs.c
> > >>>>@@ -136,6 +136,8 @@ static void bond_info_show_master(struct seq_file *seq)
> > >>>>                          optval->string);
> > >>>>               seq_printf(seq, "System priority: %d\n",
> > >>>>                               BOND_AD_INFO(bond).system.sys_priority);
> > >>>>+              seq_printf(seq, "System MAC address: %pM\n",
> > >>>>+                              &BOND_AD_INFO(bond).system.sys_mac_addr);
> > >>>>
> > >>>>               if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
> > >>>>                       seq_printf(seq, "bond %s has no active aggregator\n",
> > >>>>@@ -198,6 +200,8 @@ static void bond_info_show_slave(struct seq_file *seq,
> > >>>>                       seq_puts(seq, "details actor lacp pdu:\n");
> > >>>>                       seq_printf(seq, "    system priority: %d\n",
> > >>>>                                  port->actor_system_priority);
> > >>>>+                      seq_printf(seq, "    system mac address: %pM\n",
> > >>>>+                                 &port->actor_system);
> > >>>>                       seq_printf(seq, "    port key: %d\n",
> > >>>>                                  port->actor_oper_port_key);
> > >>>>                       seq_printf(seq, "    port priority: %d\n",
> > >>>>@@ -210,6 +214,8 @@ static void bond_info_show_slave(struct seq_file *seq,
> > >>>>                       seq_puts(seq, "details partner lacp pdu:\n");
> > >>>>                       seq_printf(seq, "    system priority: %d\n",
> > >>>>                                  port->partner_oper.system_priority);
> > >>>>+                      seq_printf(seq, "    system mac address: %pM\n",
> > >>>>+                                 &port->partner_oper.system);
> > >>>>                       seq_printf(seq, "    oper key: %d\n",
> > >>>>                                  port->partner_oper.key);
> > >>>>                       seq_printf(seq, "    port priority: %d\n",
> > >>>>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
> > >>>>index 4350aa06f867..91713d0b6685 100644
> > >>>>--- a/drivers/net/bonding/bond_sysfs.c
> > >>>>+++ b/drivers/net/bonding/bond_sysfs.c
> > >>>>@@ -706,6 +706,21 @@ static ssize_t bonding_show_ad_actor_sysprio(struct device *d,
> > >>>> static DEVICE_ATTR(ad_actor_system_priority, S_IRUGO | S_IWUSR,
> > >>>>                  bonding_show_ad_actor_sysprio, bonding_sysfs_store_option);
> > >>>>
> > >>>>+static ssize_t bonding_show_ad_actor_sys_macaddr(struct device *d,
> > >>>>+                                               struct device_attribute *attr,
> > >>>>+                                               char *buf)
> > >>>>+{
> > >>>>+      struct bonding *bond = to_bond(d);
> > >>>>+
> > >>>>+      if (BOND_MODE(bond) == BOND_MODE_8023AD)
> > >>>>+              return sprintf(buf, "%pM\n", bond->params.ad_actor_sys_macaddr);
> > >>>>+
> > >>>>+      return 0;
> > >>>>+}
> > >>>>+static DEVICE_ATTR(ad_actor_system_mac_address, S_IRUGO | S_IWUSR,
> > >>>>+                 bonding_show_ad_actor_sys_macaddr,
> > >>>>+                 bonding_sysfs_store_option);
> > >>>>+
> > >>>> static struct attribute *per_bond_attrs[] = {
> > >>>>       &dev_attr_slaves.attr,
> > >>>>       &dev_attr_mode.attr,
> > >>>>@@ -740,6 +755,7 @@ static struct attribute *per_bond_attrs[] = {
> > >>>>       &dev_attr_packets_per_slave.attr,
> > >>>>       &dev_attr_tlb_dynamic_lb.attr,
> > >>>>       &dev_attr_ad_actor_system_priority.attr,
> > >>>>+      &dev_attr_ad_actor_system_mac_address.attr,
> > >>>>       NULL,
> > >>>> };
> > >>>>
> > >>>>diff --git a/include/net/bond_options.h b/include/net/bond_options.h
> > >>>>index c2af1db37354..993ef73cd050 100644
> > >>>>--- a/include/net/bond_options.h
> > >>>>+++ b/include/net/bond_options.h
> > >>>>@@ -64,6 +64,7 @@ enum {
> > >>>>       BOND_OPT_SLAVES,
> > >>>>       BOND_OPT_TLB_DYNAMIC_LB,
> > >>>>       BOND_OPT_AD_ACTOR_SYSPRIO,
> > >>>>+      BOND_OPT_AD_ACTOR_SYS_MACADDR,
> > >>>>       BOND_OPT_LAST
> > >>>> };
> > >>>>
> > >>>>diff --git a/include/net/bonding.h b/include/net/bonding.h
> > >>>>index 7a5c79fcf866..cd2092e6bc71 100644
> > >>>>--- a/include/net/bonding.h
> > >>>>+++ b/include/net/bonding.h
> > >>>>@@ -144,6 +144,7 @@ struct bond_params {
> > >>>>       int tlb_dynamic_lb;
> > >>>>       struct reciprocal_value reciprocal_packets_per_slave;
> > >>>>       u16 ad_actor_sysprio;
> > >>>>+      u8 ad_actor_sys_macaddr[ETH_ALEN];
> > >>>> };
> > >>>>
> > >>>> struct bond_parm_tbl {
> > >>>>--
> > >>>>2.2.0.rc0.207.ga3a616c
> > >>>>
> > >
> > > ---
> > >         -Jay Vosburgh, jay.vosburgh@canonical.com
> > --
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH next 5/6] bonding: Allow userspace to set macaddr on bonding-dev
From: Andy Gospodarek @ 2015-02-07  3:22 UTC (permalink / raw)
  To: Mahesh Bandewar
  Cc: Jay Vosburgh, Andy Gospodarek, Veaceslav Falico,
	Nikolay Aleksandrov, David Miller, netdev, Eric Dumazet,
	Maciej Żenczykowski
In-Reply-To: <CAF2d9ji=Z+wVz7AdpSeNmOwys0jqWsx6TYsCML_+Hw=u+QMt_A@mail.gmail.com>

On Fri, Feb 06, 2015 at 06:41:05PM -0800, Mahesh Bandewar wrote:
> On Fri, Feb 6, 2015 at 5:54 PM, Jay Vosburgh <jay.vosburgh@canonical.com> wrote:
> > Mahesh Bandewar <maheshb@google.com> wrote:
> >
> >>On Fri, Feb 6, 2015 at 5:20 PM, Jay Vosburgh <jay.vosburgh@canonical.com> wrote:
> >>> Mahesh Bandewar <maheshb@google.com> wrote:
> >>>
> >>>>This patch allows user-space to set the mac-address on the bonding device.
> >>>>This mac-address can not be NULL or a Multicast. If the mac-address is set
> >>>>from user-space; kernel will honor it and will not overwrite it. In the
> >>>>absense (value from user space); the logic will default to using the
> >>>>masters' mac as the mac address for the bonding device.
> >>>>
> >>>>It can be set using example code below -
> >>>>
> >>>>   # modprobe bonding mode=4
> >>>>   # sys_mac_addr=$(printf '%02x:%02x:%02x:%02x:%02x:%02x' \
> >>>>                    $(( (RANDOM & 0xFE) | 0x02 )) \
> >>>>                    $(( RANDOM & 0xFF )) \
> >>>>                    $(( RANDOM & 0xFF )) \
> >>>>                    $(( RANDOM & 0xFF )) \
> >>>>                    $(( RANDOM & 0xFF )) \
> >>>>                    $(( RANDOM & 0xFF )))
> >>>>   # echo $sys_mac_addr > /sys/class/net/bond0/bonding/ad_actor_system_mac_address
> >>>>   # echo +eth1 > /sys/class/net/bond0/bonding/slaves
> >>>>   ...
> >>>>   # ip link set bond0 up
> >>>
> >>>         How is this patch functionally different from setting the
> >>> bonding master's MAC address to a particular value prior to adding any
> >>> slaves?
> >>>
> >>
> >>Maciej is correct but I think I was bit ambiguous about it in the
> >>commit message which might have made you think this way. I'll reword
> >>the commit message.
> >
> >         Thanks; presumably there is some administrative reason for this.
> >
> The idea is that in an AD system the actor-partner communication is a
> business between them two only and no one in the L2 domain should
> care. These enhancements should obscure that should anyone try to
> sniff it. Probably I assumed too much and should add this idea behind
> the implementation in the commit log.
> 
> >         Also, for patches 4, 5 and 6, I believe current practice is to
> > provide a netlink / iproute2 facility for options.
> >
> OK. I'll add them (netlink enhancements) in a separate set of patch(s).
> 

Mahesh,

Overall this looks good.  My only comment (other than the suggestion
that was already made to also add netlink support), would be a slight
change to the name.

Would you consider renaming 'ad_actor_sys_macaddr' to something a bit
shorter?  That is really long name.  Maybe just 'sys_mac_addr' instead?

Thanks,

-andy

> >         -J
> >
> >
> >>>         -J
> >>>
> >>>>Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> >>>>---
> >>>> drivers/net/bonding/bond_3ad.c     |  7 ++++++-
> >>>> drivers/net/bonding/bond_main.c    |  1 +
> >>>> drivers/net/bonding/bond_options.c | 29 +++++++++++++++++++++++++++++
> >>>> drivers/net/bonding/bond_procfs.c  |  6 ++++++
> >>>> drivers/net/bonding/bond_sysfs.c   | 16 ++++++++++++++++
> >>>> include/net/bond_options.h         |  1 +
> >>>> include/net/bonding.h              |  1 +
> >>>> 7 files changed, 60 insertions(+), 1 deletion(-)
> >>>>
> >>>>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> >>>>index 1177f96194dd..373d3db3809f 100644
> >>>>--- a/drivers/net/bonding/bond_3ad.c
> >>>>+++ b/drivers/net/bonding/bond_3ad.c
> >>>>@@ -1914,7 +1914,12 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
> >>>>
> >>>>               BOND_AD_INFO(bond).system.sys_priority =
> >>>>                       bond->params.ad_actor_sysprio;
> >>>>-              BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
> >>>>+              if (is_zero_ether_addr(bond->params.ad_actor_sys_macaddr))
> >>>>+                      BOND_AD_INFO(bond).system.sys_mac_addr =
> >>>>+                          *((struct mac_addr *)bond->dev->dev_addr);
> >>>>+              else
> >>>>+                      BOND_AD_INFO(bond).system.sys_mac_addr =
> >>>>+                          *((struct mac_addr *)bond->params.ad_actor_sys_macaddr);
> >>>>
> >>>>               /* initialize how many times this module is called in one
> >>>>                * second (should be about every 100ms)
> >>>>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> >>>>index 561b2bde5aeb..1a6735ef2ea7 100644
> >>>>--- a/drivers/net/bonding/bond_main.c
> >>>>+++ b/drivers/net/bonding/bond_main.c
> >>>>@@ -4440,6 +4440,7 @@ static int bond_check_params(struct bond_params *params)
> >>>>       params->packets_per_slave = packets_per_slave;
> >>>>       params->tlb_dynamic_lb = 1; /* Default value */
> >>>>       params->ad_actor_sysprio = ad_actor_sysprio;
> >>>>+      eth_zero_addr(params->ad_actor_sys_macaddr);
> >>>>       if (packets_per_slave > 0) {
> >>>>               params->reciprocal_packets_per_slave =
> >>>>                       reciprocal_value(packets_per_slave);
> >>>>diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
> >>>>index d8f6760143ae..330d48b6a1e6 100644
> >>>>--- a/drivers/net/bonding/bond_options.c
> >>>>+++ b/drivers/net/bonding/bond_options.c
> >>>>@@ -72,6 +72,8 @@ static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
> >>>>                                 const struct bond_opt_value *newval);
> >>>> static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
> >>>>                                 const struct bond_opt_value *newval);
> >>>>+static int bond_option_ad_actor_sys_macaddr_set(struct bonding *bond,
> >>>>+                                const struct bond_opt_value *newval);
> >>>>
> >>>>
> >>>> static const struct bond_opt_value bond_mode_tbl[] = {
> >>>>@@ -396,6 +398,13 @@ static const struct bond_option bond_opts[BOND_OPT_LAST] = {
> >>>>               .values = bond_ad_actor_sysprio_tbl,
> >>>>               .set = bond_option_ad_actor_sysprio_set,
> >>>>       },
> >>>>+      [BOND_OPT_AD_ACTOR_SYS_MACADDR] = {
> >>>>+              .id = BOND_OPT_AD_ACTOR_SYS_MACADDR,
> >>>>+              .name = "ad_actor_system_mac_address",
> >>>>+              .unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)),
> >>>>+              .flags = BOND_OPTFLAG_RAWVAL | BOND_OPTFLAG_IFDOWN,
> >>>>+              .set = bond_option_ad_actor_sys_macaddr_set,
> >>>>+      },
> >>>> };
> >>>>
> >>>> /* Searches for an option by name */
> >>>>@@ -1376,3 +1385,23 @@ static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
> >>>>       bond->params.ad_actor_sysprio = newval->value;
> >>>>       return 0;
> >>>> }
> >>>>+
> >>>>+static int bond_option_ad_actor_sys_macaddr_set(struct bonding *bond,
> >>>>+                                          const struct bond_opt_value *newval)
> >>>>+{
> >>>>+      u8 macaddr[ETH_ALEN];
> >>>>+      int i;
> >>>>+
> >>>>+      i = sscanf(newval->string, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
> >>>>+                 &macaddr[0], &macaddr[1], &macaddr[2],
> >>>>+                 &macaddr[3], &macaddr[4], &macaddr[5]);
> >>>>+
> >>>>+      if (i != ETH_ALEN || !is_valid_ether_addr(macaddr)) {
> >>>>+              netdev_err(bond->dev, "Invalid MAC address.\n");
> >>>>+              return -EINVAL;
> >>>>+      }
> >>>>+
> >>>>+      ether_addr_copy(bond->params.ad_actor_sys_macaddr, macaddr);
> >>>>+
> >>>>+      return 0;
> >>>>+}
> >>>>diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
> >>>>index 9e33c48886ef..81452ced852f 100644
> >>>>--- a/drivers/net/bonding/bond_procfs.c
> >>>>+++ b/drivers/net/bonding/bond_procfs.c
> >>>>@@ -136,6 +136,8 @@ static void bond_info_show_master(struct seq_file *seq)
> >>>>                          optval->string);
> >>>>               seq_printf(seq, "System priority: %d\n",
> >>>>                               BOND_AD_INFO(bond).system.sys_priority);
> >>>>+              seq_printf(seq, "System MAC address: %pM\n",
> >>>>+                              &BOND_AD_INFO(bond).system.sys_mac_addr);
> >>>>
> >>>>               if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
> >>>>                       seq_printf(seq, "bond %s has no active aggregator\n",
> >>>>@@ -198,6 +200,8 @@ static void bond_info_show_slave(struct seq_file *seq,
> >>>>                       seq_puts(seq, "details actor lacp pdu:\n");
> >>>>                       seq_printf(seq, "    system priority: %d\n",
> >>>>                                  port->actor_system_priority);
> >>>>+                      seq_printf(seq, "    system mac address: %pM\n",
> >>>>+                                 &port->actor_system);
> >>>>                       seq_printf(seq, "    port key: %d\n",
> >>>>                                  port->actor_oper_port_key);
> >>>>                       seq_printf(seq, "    port priority: %d\n",
> >>>>@@ -210,6 +214,8 @@ static void bond_info_show_slave(struct seq_file *seq,
> >>>>                       seq_puts(seq, "details partner lacp pdu:\n");
> >>>>                       seq_printf(seq, "    system priority: %d\n",
> >>>>                                  port->partner_oper.system_priority);
> >>>>+                      seq_printf(seq, "    system mac address: %pM\n",
> >>>>+                                 &port->partner_oper.system);
> >>>>                       seq_printf(seq, "    oper key: %d\n",
> >>>>                                  port->partner_oper.key);
> >>>>                       seq_printf(seq, "    port priority: %d\n",
> >>>>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
> >>>>index 4350aa06f867..91713d0b6685 100644
> >>>>--- a/drivers/net/bonding/bond_sysfs.c
> >>>>+++ b/drivers/net/bonding/bond_sysfs.c
> >>>>@@ -706,6 +706,21 @@ static ssize_t bonding_show_ad_actor_sysprio(struct device *d,
> >>>> static DEVICE_ATTR(ad_actor_system_priority, S_IRUGO | S_IWUSR,
> >>>>                  bonding_show_ad_actor_sysprio, bonding_sysfs_store_option);
> >>>>
> >>>>+static ssize_t bonding_show_ad_actor_sys_macaddr(struct device *d,
> >>>>+                                               struct device_attribute *attr,
> >>>>+                                               char *buf)
> >>>>+{
> >>>>+      struct bonding *bond = to_bond(d);
> >>>>+
> >>>>+      if (BOND_MODE(bond) == BOND_MODE_8023AD)
> >>>>+              return sprintf(buf, "%pM\n", bond->params.ad_actor_sys_macaddr);
> >>>>+
> >>>>+      return 0;
> >>>>+}
> >>>>+static DEVICE_ATTR(ad_actor_system_mac_address, S_IRUGO | S_IWUSR,
> >>>>+                 bonding_show_ad_actor_sys_macaddr,
> >>>>+                 bonding_sysfs_store_option);
> >>>>+
> >>>> static struct attribute *per_bond_attrs[] = {
> >>>>       &dev_attr_slaves.attr,
> >>>>       &dev_attr_mode.attr,
> >>>>@@ -740,6 +755,7 @@ static struct attribute *per_bond_attrs[] = {
> >>>>       &dev_attr_packets_per_slave.attr,
> >>>>       &dev_attr_tlb_dynamic_lb.attr,
> >>>>       &dev_attr_ad_actor_system_priority.attr,
> >>>>+      &dev_attr_ad_actor_system_mac_address.attr,
> >>>>       NULL,
> >>>> };
> >>>>
> >>>>diff --git a/include/net/bond_options.h b/include/net/bond_options.h
> >>>>index c2af1db37354..993ef73cd050 100644
> >>>>--- a/include/net/bond_options.h
> >>>>+++ b/include/net/bond_options.h
> >>>>@@ -64,6 +64,7 @@ enum {
> >>>>       BOND_OPT_SLAVES,
> >>>>       BOND_OPT_TLB_DYNAMIC_LB,
> >>>>       BOND_OPT_AD_ACTOR_SYSPRIO,
> >>>>+      BOND_OPT_AD_ACTOR_SYS_MACADDR,
> >>>>       BOND_OPT_LAST
> >>>> };
> >>>>
> >>>>diff --git a/include/net/bonding.h b/include/net/bonding.h
> >>>>index 7a5c79fcf866..cd2092e6bc71 100644
> >>>>--- a/include/net/bonding.h
> >>>>+++ b/include/net/bonding.h
> >>>>@@ -144,6 +144,7 @@ struct bond_params {
> >>>>       int tlb_dynamic_lb;
> >>>>       struct reciprocal_value reciprocal_packets_per_slave;
> >>>>       u16 ad_actor_sysprio;
> >>>>+      u8 ad_actor_sys_macaddr[ETH_ALEN];
> >>>> };
> >>>>
> >>>> struct bond_parm_tbl {
> >>>>--
> >>>>2.2.0.rc0.207.ga3a616c
> >>>>
> >
> > ---
> >         -Jay Vosburgh, jay.vosburgh@canonical.com
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH next 5/6] bonding: Allow userspace to set macaddr on bonding-dev
From: Mahesh Bandewar @ 2015-02-07  2:41 UTC (permalink / raw)
  To: Jay Vosburgh
  Cc: Andy Gospodarek, Veaceslav Falico, Nikolay Aleksandrov,
	David Miller, netdev, Eric Dumazet, Maciej Żenczykowski
In-Reply-To: <4653.1423274042@famine>

On Fri, Feb 6, 2015 at 5:54 PM, Jay Vosburgh <jay.vosburgh@canonical.com> wrote:
> Mahesh Bandewar <maheshb@google.com> wrote:
>
>>On Fri, Feb 6, 2015 at 5:20 PM, Jay Vosburgh <jay.vosburgh@canonical.com> wrote:
>>> Mahesh Bandewar <maheshb@google.com> wrote:
>>>
>>>>This patch allows user-space to set the mac-address on the bonding device.
>>>>This mac-address can not be NULL or a Multicast. If the mac-address is set
>>>>from user-space; kernel will honor it and will not overwrite it. In the
>>>>absense (value from user space); the logic will default to using the
>>>>masters' mac as the mac address for the bonding device.
>>>>
>>>>It can be set using example code below -
>>>>
>>>>   # modprobe bonding mode=4
>>>>   # sys_mac_addr=$(printf '%02x:%02x:%02x:%02x:%02x:%02x' \
>>>>                    $(( (RANDOM & 0xFE) | 0x02 )) \
>>>>                    $(( RANDOM & 0xFF )) \
>>>>                    $(( RANDOM & 0xFF )) \
>>>>                    $(( RANDOM & 0xFF )) \
>>>>                    $(( RANDOM & 0xFF )) \
>>>>                    $(( RANDOM & 0xFF )))
>>>>   # echo $sys_mac_addr > /sys/class/net/bond0/bonding/ad_actor_system_mac_address
>>>>   # echo +eth1 > /sys/class/net/bond0/bonding/slaves
>>>>   ...
>>>>   # ip link set bond0 up
>>>
>>>         How is this patch functionally different from setting the
>>> bonding master's MAC address to a particular value prior to adding any
>>> slaves?
>>>
>>
>>Maciej is correct but I think I was bit ambiguous about it in the
>>commit message which might have made you think this way. I'll reword
>>the commit message.
>
>         Thanks; presumably there is some administrative reason for this.
>
The idea is that in an AD system the actor-partner communication is a
business between them two only and no one in the L2 domain should
care. These enhancements should obscure that should anyone try to
sniff it. Probably I assumed too much and should add this idea behind
the implementation in the commit log.

>         Also, for patches 4, 5 and 6, I believe current practice is to
> provide a netlink / iproute2 facility for options.
>
OK. I'll add them (netlink enhancements) in a separate set of patch(s).

>         -J
>
>
>>>         -J
>>>
>>>>Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>>>>---
>>>> drivers/net/bonding/bond_3ad.c     |  7 ++++++-
>>>> drivers/net/bonding/bond_main.c    |  1 +
>>>> drivers/net/bonding/bond_options.c | 29 +++++++++++++++++++++++++++++
>>>> drivers/net/bonding/bond_procfs.c  |  6 ++++++
>>>> drivers/net/bonding/bond_sysfs.c   | 16 ++++++++++++++++
>>>> include/net/bond_options.h         |  1 +
>>>> include/net/bonding.h              |  1 +
>>>> 7 files changed, 60 insertions(+), 1 deletion(-)
>>>>
>>>>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>>>>index 1177f96194dd..373d3db3809f 100644
>>>>--- a/drivers/net/bonding/bond_3ad.c
>>>>+++ b/drivers/net/bonding/bond_3ad.c
>>>>@@ -1914,7 +1914,12 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
>>>>
>>>>               BOND_AD_INFO(bond).system.sys_priority =
>>>>                       bond->params.ad_actor_sysprio;
>>>>-              BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
>>>>+              if (is_zero_ether_addr(bond->params.ad_actor_sys_macaddr))
>>>>+                      BOND_AD_INFO(bond).system.sys_mac_addr =
>>>>+                          *((struct mac_addr *)bond->dev->dev_addr);
>>>>+              else
>>>>+                      BOND_AD_INFO(bond).system.sys_mac_addr =
>>>>+                          *((struct mac_addr *)bond->params.ad_actor_sys_macaddr);
>>>>
>>>>               /* initialize how many times this module is called in one
>>>>                * second (should be about every 100ms)
>>>>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>>>>index 561b2bde5aeb..1a6735ef2ea7 100644
>>>>--- a/drivers/net/bonding/bond_main.c
>>>>+++ b/drivers/net/bonding/bond_main.c
>>>>@@ -4440,6 +4440,7 @@ static int bond_check_params(struct bond_params *params)
>>>>       params->packets_per_slave = packets_per_slave;
>>>>       params->tlb_dynamic_lb = 1; /* Default value */
>>>>       params->ad_actor_sysprio = ad_actor_sysprio;
>>>>+      eth_zero_addr(params->ad_actor_sys_macaddr);
>>>>       if (packets_per_slave > 0) {
>>>>               params->reciprocal_packets_per_slave =
>>>>                       reciprocal_value(packets_per_slave);
>>>>diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
>>>>index d8f6760143ae..330d48b6a1e6 100644
>>>>--- a/drivers/net/bonding/bond_options.c
>>>>+++ b/drivers/net/bonding/bond_options.c
>>>>@@ -72,6 +72,8 @@ static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
>>>>                                 const struct bond_opt_value *newval);
>>>> static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
>>>>                                 const struct bond_opt_value *newval);
>>>>+static int bond_option_ad_actor_sys_macaddr_set(struct bonding *bond,
>>>>+                                const struct bond_opt_value *newval);
>>>>
>>>>
>>>> static const struct bond_opt_value bond_mode_tbl[] = {
>>>>@@ -396,6 +398,13 @@ static const struct bond_option bond_opts[BOND_OPT_LAST] = {
>>>>               .values = bond_ad_actor_sysprio_tbl,
>>>>               .set = bond_option_ad_actor_sysprio_set,
>>>>       },
>>>>+      [BOND_OPT_AD_ACTOR_SYS_MACADDR] = {
>>>>+              .id = BOND_OPT_AD_ACTOR_SYS_MACADDR,
>>>>+              .name = "ad_actor_system_mac_address",
>>>>+              .unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)),
>>>>+              .flags = BOND_OPTFLAG_RAWVAL | BOND_OPTFLAG_IFDOWN,
>>>>+              .set = bond_option_ad_actor_sys_macaddr_set,
>>>>+      },
>>>> };
>>>>
>>>> /* Searches for an option by name */
>>>>@@ -1376,3 +1385,23 @@ static int bond_option_ad_actor_sysprio_set(struct bonding *bond,
>>>>       bond->params.ad_actor_sysprio = newval->value;
>>>>       return 0;
>>>> }
>>>>+
>>>>+static int bond_option_ad_actor_sys_macaddr_set(struct bonding *bond,
>>>>+                                          const struct bond_opt_value *newval)
>>>>+{
>>>>+      u8 macaddr[ETH_ALEN];
>>>>+      int i;
>>>>+
>>>>+      i = sscanf(newval->string, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
>>>>+                 &macaddr[0], &macaddr[1], &macaddr[2],
>>>>+                 &macaddr[3], &macaddr[4], &macaddr[5]);
>>>>+
>>>>+      if (i != ETH_ALEN || !is_valid_ether_addr(macaddr)) {
>>>>+              netdev_err(bond->dev, "Invalid MAC address.\n");
>>>>+              return -EINVAL;
>>>>+      }
>>>>+
>>>>+      ether_addr_copy(bond->params.ad_actor_sys_macaddr, macaddr);
>>>>+
>>>>+      return 0;
>>>>+}
>>>>diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
>>>>index 9e33c48886ef..81452ced852f 100644
>>>>--- a/drivers/net/bonding/bond_procfs.c
>>>>+++ b/drivers/net/bonding/bond_procfs.c
>>>>@@ -136,6 +136,8 @@ static void bond_info_show_master(struct seq_file *seq)
>>>>                          optval->string);
>>>>               seq_printf(seq, "System priority: %d\n",
>>>>                               BOND_AD_INFO(bond).system.sys_priority);
>>>>+              seq_printf(seq, "System MAC address: %pM\n",
>>>>+                              &BOND_AD_INFO(bond).system.sys_mac_addr);
>>>>
>>>>               if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
>>>>                       seq_printf(seq, "bond %s has no active aggregator\n",
>>>>@@ -198,6 +200,8 @@ static void bond_info_show_slave(struct seq_file *seq,
>>>>                       seq_puts(seq, "details actor lacp pdu:\n");
>>>>                       seq_printf(seq, "    system priority: %d\n",
>>>>                                  port->actor_system_priority);
>>>>+                      seq_printf(seq, "    system mac address: %pM\n",
>>>>+                                 &port->actor_system);
>>>>                       seq_printf(seq, "    port key: %d\n",
>>>>                                  port->actor_oper_port_key);
>>>>                       seq_printf(seq, "    port priority: %d\n",
>>>>@@ -210,6 +214,8 @@ static void bond_info_show_slave(struct seq_file *seq,
>>>>                       seq_puts(seq, "details partner lacp pdu:\n");
>>>>                       seq_printf(seq, "    system priority: %d\n",
>>>>                                  port->partner_oper.system_priority);
>>>>+                      seq_printf(seq, "    system mac address: %pM\n",
>>>>+                                 &port->partner_oper.system);
>>>>                       seq_printf(seq, "    oper key: %d\n",
>>>>                                  port->partner_oper.key);
>>>>                       seq_printf(seq, "    port priority: %d\n",
>>>>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
>>>>index 4350aa06f867..91713d0b6685 100644
>>>>--- a/drivers/net/bonding/bond_sysfs.c
>>>>+++ b/drivers/net/bonding/bond_sysfs.c
>>>>@@ -706,6 +706,21 @@ static ssize_t bonding_show_ad_actor_sysprio(struct device *d,
>>>> static DEVICE_ATTR(ad_actor_system_priority, S_IRUGO | S_IWUSR,
>>>>                  bonding_show_ad_actor_sysprio, bonding_sysfs_store_option);
>>>>
>>>>+static ssize_t bonding_show_ad_actor_sys_macaddr(struct device *d,
>>>>+                                               struct device_attribute *attr,
>>>>+                                               char *buf)
>>>>+{
>>>>+      struct bonding *bond = to_bond(d);
>>>>+
>>>>+      if (BOND_MODE(bond) == BOND_MODE_8023AD)
>>>>+              return sprintf(buf, "%pM\n", bond->params.ad_actor_sys_macaddr);
>>>>+
>>>>+      return 0;
>>>>+}
>>>>+static DEVICE_ATTR(ad_actor_system_mac_address, S_IRUGO | S_IWUSR,
>>>>+                 bonding_show_ad_actor_sys_macaddr,
>>>>+                 bonding_sysfs_store_option);
>>>>+
>>>> static struct attribute *per_bond_attrs[] = {
>>>>       &dev_attr_slaves.attr,
>>>>       &dev_attr_mode.attr,
>>>>@@ -740,6 +755,7 @@ static struct attribute *per_bond_attrs[] = {
>>>>       &dev_attr_packets_per_slave.attr,
>>>>       &dev_attr_tlb_dynamic_lb.attr,
>>>>       &dev_attr_ad_actor_system_priority.attr,
>>>>+      &dev_attr_ad_actor_system_mac_address.attr,
>>>>       NULL,
>>>> };
>>>>
>>>>diff --git a/include/net/bond_options.h b/include/net/bond_options.h
>>>>index c2af1db37354..993ef73cd050 100644
>>>>--- a/include/net/bond_options.h
>>>>+++ b/include/net/bond_options.h
>>>>@@ -64,6 +64,7 @@ enum {
>>>>       BOND_OPT_SLAVES,
>>>>       BOND_OPT_TLB_DYNAMIC_LB,
>>>>       BOND_OPT_AD_ACTOR_SYSPRIO,
>>>>+      BOND_OPT_AD_ACTOR_SYS_MACADDR,
>>>>       BOND_OPT_LAST
>>>> };
>>>>
>>>>diff --git a/include/net/bonding.h b/include/net/bonding.h
>>>>index 7a5c79fcf866..cd2092e6bc71 100644
>>>>--- a/include/net/bonding.h
>>>>+++ b/include/net/bonding.h
>>>>@@ -144,6 +144,7 @@ struct bond_params {
>>>>       int tlb_dynamic_lb;
>>>>       struct reciprocal_value reciprocal_packets_per_slave;
>>>>       u16 ad_actor_sysprio;
>>>>+      u8 ad_actor_sys_macaddr[ETH_ALEN];
>>>> };
>>>>
>>>> struct bond_parm_tbl {
>>>>--
>>>>2.2.0.rc0.207.ga3a616c
>>>>
>
> ---
>         -Jay Vosburgh, jay.vosburgh@canonical.com

^ permalink raw reply


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