Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH v2] team: Add vlan tx offload to hw_enc_features
From: David Miller @ 2019-08-09  5:42 UTC (permalink / raw)
  To: yuehaibing
  Cc: j.vosburgh, vfalico, andy, jiri, jay.vosburgh, linux-kernel,
	netdev
In-Reply-To: <20190808062247.38352-1-yuehaibing@huawei.com>

From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 8 Aug 2019 14:22:47 +0800

> We should also enable team's vlan tx offload in hw_enc_features,
> pass the vlan packets to the slave devices with vlan tci, let the
> slave handle vlan tunneling offload implementation.
> 
> Fixes: 3268e5cb494d ("team: Advertise tunneling offload features")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: fix commit log typo

Applied and queued up for -stable.

^ permalink raw reply

* Re: [PATCH] liquidio: Use pcie_flr() instead of reimplementing it
From: David Miller @ 2019-08-09  5:41 UTC (permalink / raw)
  To: efremov
  Cc: bjorn.helgaas, dchickles, sburla, fmanlunas, netdev, linux-pci,
	linux-kernel
In-Reply-To: <20190808045753.5474-1-efremov@linux.com>

From: Denis Efremov <efremov@linux.com>
Date: Thu,  8 Aug 2019 07:57:53 +0300

> octeon_mbox_process_cmd() directly writes the PCI_EXP_DEVCTL_BCR_FLR
> bit, which bypasses timing requirements imposed by the PCIe spec.
> This patch fixes the function to use the pcie_flr() interface instead.
> 
> Signed-off-by: Denis Efremov <efremov@linux.com>

Applied to net-next.

^ permalink raw reply

* Re: [PATCH net v3] net/tls: prevent skb_orphan() from leaking TLS plain text with offload
From: David Miller @ 2019-08-09  5:40 UTC (permalink / raw)
  To: jakub.kicinski
  Cc: netdev, davejwatson, borisp, aviadye, john.fastabend, daniel,
	willemb, edumazet, alexei.starovoitov, oss-drivers
In-Reply-To: <20190808000359.20785-1-jakub.kicinski@netronome.com>

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Wed,  7 Aug 2019 17:03:59 -0700

> sk_validate_xmit_skb() and drivers depend on the sk member of
> struct sk_buff to identify segments requiring encryption.
> Any operation which removes or does not preserve the original TLS
> socket such as skb_orphan() or skb_clone() will cause clear text
> leaks.
> 
> Make the TCP socket underlying an offloaded TLS connection
> mark all skbs as decrypted, if TLS TX is in offload mode.
> Then in sk_validate_xmit_skb() catch skbs which have no socket
> (or a socket with no validation) and decrypted flag set.
> 
> Note that CONFIG_SOCK_VALIDATE_XMIT, CONFIG_TLS_DEVICE and
> sk->sk_validate_xmit_skb are slightly interchangeable right now,
> they all imply TLS offload. The new checks are guarded by
> CONFIG_TLS_DEVICE because that's the option guarding the
> sk_buff->decrypted member.
> 
> Second, smaller issue with orphaning is that it breaks
> the guarantee that packets will be delivered to device
> queues in-order. All TLS offload drivers depend on that
> scheduling property. This means skb_orphan_partial()'s
> trick of preserving partial socket references will cause
> issues in the drivers. We need a full orphan, and as a
> result netem delay/throttling will cause all TLS offload
> skbs to be dropped.
> 
> Reusing the sk_buff->decrypted flag also protects from
> leaking clear text when incoming, decrypted skb is redirected
> (e.g. by TC).
> 
> See commit 0608c69c9a80 ("bpf: sk_msg, sock{map|hash} redirect
> through ULP") for justification why the internal flag is safe.
> The only location which could leak the flag in is tcp_bpf_sendmsg(),
> which is taken care of by clearing the previously unused bit.
> 
> v2:
>  - remove superfluous decrypted mark copy (Willem);
>  - remove the stale doc entry (Boris);
>  - rely entirely on EOR marking to prevent coalescing (Boris);
>  - use an internal sendpages flag instead of marking the socket
>    (Boris).
> v3 (Willem):
>  - reorganize the can_skb_orphan_partial() condition;
>  - fix the flag leak-in through tcp_bpf_sendmsg.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Applied, thanks Jakub.

^ permalink raw reply

* Re: [PATCH net 0/2] Fix batched event generation for skbedit action
From: David Miller @ 2019-08-09  5:37 UTC (permalink / raw)
  To: mrv; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri
In-Reply-To: <1565207849-11442-1-git-send-email-mrv@mojatatu.com>

From: Roman Mashak <mrv@mojatatu.com>
Date: Wed,  7 Aug 2019 15:57:27 -0400

> When adding or deleting a batch of entries, the kernel sends up to
> TCA_ACT_MAX_PRIO (defined to 32 in kernel) entries in an event to user
> space. However it does not consider that the action sizes may vary and
> require different skb sizes.
> 
> For example, consider the following script adding 32 entries with all
> supported skbedit parameters and cookie (in order to maximize netlink
> messages size):
 ...
> patch 1 adds callback in tc_action_ops of skbedit action, which calculates
> the action size, and passes size to tcf_add_notify()/tcf_del_notify().
> 
> patch 2 updates the TDC test suite with relevant skbedit test cases.

Series applied and queued up for -stable, thanks.

^ permalink raw reply

* [PATCH v2] net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context
From: Fuqian Huang @ 2019-08-09  5:35 UTC (permalink / raw)
  Cc: David S . Miller, netdev, linux-kernel, Fuqian Huang

As spin_unlock_irq will enable interrupts.
Function tsi108_stat_carry is called from interrupt handler tsi108_irq.
Interrupts are enabled in interrupt handler.
Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq
in IRQ context to avoid this.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
Changes in v2:
  - Preserve reverse christmas tree ordering of local variables.

 drivers/net/ethernet/tundra/tsi108_eth.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index 78a7de3fb622..c62f474b6d08 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -371,9 +371,10 @@ tsi108_stat_carry_one(int carry, int carry_bit, int carry_shift,
 static void tsi108_stat_carry(struct net_device *dev)
 {
 	struct tsi108_prv_data *data = netdev_priv(dev);
+	unsigned long flags;
 	u32 carry1, carry2;
 
-	spin_lock_irq(&data->misclock);
+	spin_lock_irqsave(&data->misclock, flags);
 
 	carry1 = TSI_READ(TSI108_STAT_CARRY1);
 	carry2 = TSI_READ(TSI108_STAT_CARRY2);
@@ -441,7 +442,7 @@ static void tsi108_stat_carry(struct net_device *dev)
 			      TSI108_STAT_TXPAUSEDROP_CARRY,
 			      &data->tx_pause_drop);
 
-	spin_unlock_irq(&data->misclock);
+	spin_unlock_irqrestore(&data->misclock, flags);
 }
 
 /* Read a stat counter atomically with respect to carries.
-- 
2.11.0


^ permalink raw reply related

* Re: [PATCH V4 0/9] Fixes for metadata accelreation
From: Jason Wang @ 2019-08-09  5:35 UTC (permalink / raw)
  To: David Miller
  Cc: mst, kvm, virtualization, netdev, linux-kernel, linux-mm, jgg
In-Reply-To: <20190808.221543.450194346419371363.davem@davemloft.net>


On 2019/8/9 下午1:15, David Miller wrote:
> From: Jason Wang <jasowang@redhat.com>
> Date: Wed,  7 Aug 2019 03:06:08 -0400
>
>> This series try to fix several issues introduced by meta data
>> accelreation series. Please review.
>   ...
>
> My impression is that patch #7 will be changed to use spinlocks so there
> will be a v5.
>

Yes. V5 is on the way.

Thanks


^ permalink raw reply

* Re: [PATCH net-next] r8169: allocate rx buffers using alloc_pages_node
From: David Miller @ 2019-08-09  5:35 UTC (permalink / raw)
  To: hkallweit1; +Cc: nic_swsd, netdev
In-Reply-To: <7d79d794-b41c-101f-0720-59eea88bf9ab@gmail.com>

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Wed, 7 Aug 2019 21:38:22 +0200

> We allocate 16kb per rx buffer, so we can avoid some overhead by using
> alloc_pages_node directly instead of bothering kmalloc_node. Due to
> this change buffers are page-aligned now, therefore the alignment check
> can be removed.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH net-next] fq_codel: remove set but not used variables 'prev_ecn_mark' and 'prev_drop_count'
From: David Miller @ 2019-08-09  5:32 UTC (permalink / raw)
  To: yuehaibing; +Cc: jhs, xiyou.wangcong, jiri, dave.taht, linux-kernel, netdev
In-Reply-To: <20190808.223136.1507513183278607177.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Thu, 08 Aug 2019 22:31:36 -0700 (PDT)

> From: YueHaibing <yuehaibing@huawei.com>
> Date: Wed, 7 Aug 2019 21:10:55 +0800
> 
>> Fixes gcc '-Wunused-but-set-variable' warning:
>> 
>> net/sched/sch_fq_codel.c: In function fq_codel_dequeue:
>> net/sched/sch_fq_codel.c:288:23: warning: variable prev_ecn_mark set but not used [-Wunused-but-set-variable]
>> net/sched/sch_fq_codel.c:288:6: warning: variable prev_drop_count set but not used [-Wunused-but-set-variable]
>> 
>> They are not used since commit 77ddaff218fc ("fq_codel: Kill
>> useless per-flow dropped statistic")
>> 
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> Do you even compile test this stuff?
> 
>   CC [M]  net/sched/sch_fq_codel.o
> net/sched/sch_fq_codel.c: In function ‘fq_codel_dequeue’:
> net/sched/sch_fq_codel.c:309:42: error: ‘prev_drop_count’ undeclared (first use in this function); did you mean ‘page_ref_count’?

Never mind, this is my fault.

I was build testing the patch on the wrong tree, I'm very sorry.

^ permalink raw reply

* Re: [PATCH net-next] fq_codel: remove set but not used variables 'prev_ecn_mark' and 'prev_drop_count'
From: David Miller @ 2019-08-09  5:31 UTC (permalink / raw)
  To: yuehaibing; +Cc: jhs, xiyou.wangcong, jiri, dave.taht, linux-kernel, netdev
In-Reply-To: <20190807131055.66668-1-yuehaibing@huawei.com>

From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 7 Aug 2019 21:10:55 +0800

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> net/sched/sch_fq_codel.c: In function fq_codel_dequeue:
> net/sched/sch_fq_codel.c:288:23: warning: variable prev_ecn_mark set but not used [-Wunused-but-set-variable]
> net/sched/sch_fq_codel.c:288:6: warning: variable prev_drop_count set but not used [-Wunused-but-set-variable]
> 
> They are not used since commit 77ddaff218fc ("fq_codel: Kill
> useless per-flow dropped statistic")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Do you even compile test this stuff?

  CC [M]  net/sched/sch_fq_codel.o
net/sched/sch_fq_codel.c: In function ‘fq_codel_dequeue’:
net/sched/sch_fq_codel.c:309:42: error: ‘prev_drop_count’ undeclared (first use in this function); did you mean ‘page_ref_count’?
  flow->dropped += q->cstats.drop_count - prev_drop_count;
                                          ^~~~~~~~~~~~~~~
                                          page_ref_count
net/sched/sch_fq_codel.c:309:42: note: each undeclared identifier is reported only once for each function it appears in
net/sched/sch_fq_codel.c:310:40: error: ‘prev_ecn_mark’ undeclared (first use in this function); did you mean ‘pmd_pfn_mask’?
  flow->dropped += q->cstats.ecn_mark - prev_ecn_mark;
                                        ^~~~~~~~~~~~~
                                        pmd_pfn_mask
make[1]: *** [scripts/Makefile.build:274: net/sched/sch_fq_codel.o] Error 1
make: *** [Makefile:1769: net/sched/sch_fq_codel.o] Error 2

^ permalink raw reply

* Re: [PATCH net-next] net/ncsi: allow to customize BMC MAC Address offset
From: Tao Ren @ 2019-08-09  5:29 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Jakub Kicinski, netdev@vger.kernel.org, openbmc@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, Samuel Mendoza-Jonas,
	David S . Miller, William Kennington
In-Reply-To: <20190808230312.GS27917@lunn.ch>

On 8/8/19 4:03 PM, Andrew Lunn wrote:
>> After giving it more thought, I'm thinking about adding ncsi dt node
>> with following structure (mac/ncsi similar to mac/mdio/phy):
>>
>> &mac0 {
>>     /* MAC properties... */
>>
>>     use-ncsi;
> 
> This property seems to be specific to Faraday FTGMAC100. Are you going
> to make it more generic? 

I'm also using ftgmac100 on my platform, and I don't have plan to change this property.

>>     ncsi {
>>         /* ncsi level properties if any */
>>
>>         package@0 {
> 
> You should get Rob Herring involved. This is not really describing
> hardware, so it might get rejected by the device tree maintainer.

Got it. Thank you for the sharing, and let me think it over :-)

>> 1) mac driver doesn't need to parse "mac-offset" stuff: these
>> ncsi-network-controller specific settings should be parsed in ncsi
>> stack.
> 
>> 2) get_bmc_mac_address command is a channel specific command, and
>> technically people can configure different offset/formula for
>> different channels.
> 
> Does that mean the NCSA code puts the interface into promiscuous mode?
> Or at least adds these unicast MAC addresses to the MAC receive
> filter? Humm, ftgmac100 only seems to support multicast address
> filtering, not unicast filters, so it must be using promisc mode, if
> you expect to receive frames using this MAC address.

Uhh, I actually didn't think too much about this: basically it's how to configure frame filtering when there are multiple packages/channels active: single BMC MAC or multiple BMC MAC is also allowed?
I don't have the answer yet, but will talk to NCSI expert and figure it out.


Thanks,

Tao

^ permalink raw reply

* Re: [PATCH net-next] net: dsa: sja1105: remove set but not used variables 'tx_vid' and 'rx_vid'
From: David Miller @ 2019-08-09  5:29 UTC (permalink / raw)
  To: yuehaibing
  Cc: olteanv, andrew, vivien.didelot, f.fainelli, linux-kernel, netdev
In-Reply-To: <20190807130856.60792-1-yuehaibing@huawei.com>

From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 7 Aug 2019 21:08:56 +0800

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/dsa/sja1105/sja1105_main.c: In function sja1105_fdb_dump:
> drivers/net/dsa/sja1105/sja1105_main.c:1226:14: warning:
>  variable tx_vid set but not used [-Wunused-but-set-variable]
> drivers/net/dsa/sja1105/sja1105_main.c:1226:6: warning:
>  variable rx_vid set but not used [-Wunused-but-set-variable]
> 
> They are not used since commit 6d7c7d948a2e ("net: dsa:
> sja1105: Fix broken learning with vlan_filtering disabled")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied to 'net'.

^ permalink raw reply

* Re: [PATCH net-next] mlxsw: spectrum: Extend to support Spectrum-3 ASIC
From: David Miller @ 2019-08-09  5:27 UTC (permalink / raw)
  To: idosch; +Cc: netdev, jiri, petrm, mlxsw, idosch
In-Reply-To: <20190807104231.16085-1-idosch@idosch.org>

From: Ido Schimmel <idosch@idosch.org>
Date: Wed,  7 Aug 2019 13:42:31 +0300

> From: Jiri Pirko <jiri@mellanox.com>
> 
> Extend existing driver for Spectrum and Spectrum-2 ASICs
> to support Spectrum-3 ASIC as well.
> 
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> Reviewed-by: Petr Machata <petrm@mellanox.com>
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next v3 00/10] net: stmmac: Improvements for -next
From: David Miller @ 2019-08-09  5:20 UTC (permalink / raw)
  To: Jose.Abreu
  Cc: netdev, Joao.Pinto, peppe.cavallaro, alexandre.torgue,
	mcoquelin.stm32, linux-stm32, linux-arm-kernel, linux-kernel
In-Reply-To: <cover.1565164729.git.joabreu@synopsys.com>

From: Jose Abreu <Jose.Abreu@synopsys.com>
Date: Wed,  7 Aug 2019 10:03:08 +0200

> [ This is just a rebase of v2 into latest -next in order to avoid a merge
> conflict ]
> 
> Couple of improvements for -next tree. More info in commit logs.

Series applied, thank you.

^ permalink raw reply

* linux-next: manual merge of the usb tree with the net-next tree
From: Stephen Rothwell @ 2019-08-09  5:19 UTC (permalink / raw)
  To: Greg KH, David Miller, Networking
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Benjamin Poirier

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

Hi all,

Today's linux-next merge of the usb tree got conflicts in:

  drivers/staging/Kconfig
  drivers/staging/Makefile

between commit:

  955315b0dc8c ("qlge: Move drivers/net/ethernet/qlogic/qlge/ to drivers/staging/qlge/")

from the net-next tree and commit:

  71ed79b0e4be ("USB: Move wusbcore and UWB to staging as it is obsolete")

from the usb tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/staging/Kconfig
index 0b8a614be11e,cf419d9c942d..000000000000
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@@ -120,6 -120,7 +120,9 @@@ source "drivers/staging/kpc2000/Kconfig
  
  source "drivers/staging/isdn/Kconfig"
  
 +source "drivers/staging/qlge/Kconfig"
 +
+ source "drivers/staging/wusbcore/Kconfig"
+ source "drivers/staging/uwb/Kconfig"
+ 
  endif # STAGING
diff --cc drivers/staging/Makefile
index 741152511a10,38179bc842a8..000000000000
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@@ -50,4 -50,5 +50,6 @@@ obj-$(CONFIG_EROFS_FS)		+= erofs
  obj-$(CONFIG_FIELDBUS_DEV)     += fieldbus/
  obj-$(CONFIG_KPC2000)		+= kpc2000/
  obj-$(CONFIG_ISDN_CAPI)		+= isdn/
 +obj-$(CONFIG_QLGE)		+= qlge/
+ obj-$(CONFIG_UWB)		+= uwb/
+ obj-$(CONFIG_USB_WUSB)		+= wusbcore/

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* Re: [PATCH] net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context
From: David Miller @ 2019-08-09  5:17 UTC (permalink / raw)
  To: huangfq.daxian; +Cc: netdev, linux-kernel
In-Reply-To: <20190807074300.23135-1-huangfq.daxian@gmail.com>

From: Fuqian Huang <huangfq.daxian@gmail.com>
Date: Wed,  7 Aug 2019 15:43:00 +0800

> @@ -372,8 +372,9 @@ static void tsi108_stat_carry(struct net_device *dev)
>  {
>  	struct tsi108_prv_data *data = netdev_priv(dev);
>  	u32 carry1, carry2;
> +	unsigned long flags;

Please preserve reverse christmas tree ordering of local variables.

Thank you.

^ permalink raw reply

* Re: [PATCH V4 0/9] Fixes for metadata accelreation
From: David Miller @ 2019-08-09  5:15 UTC (permalink / raw)
  To: jasowang; +Cc: mst, kvm, virtualization, netdev, linux-kernel, linux-mm, jgg
In-Reply-To: <20190807070617.23716-1-jasowang@redhat.com>

From: Jason Wang <jasowang@redhat.com>
Date: Wed,  7 Aug 2019 03:06:08 -0400

> This series try to fix several issues introduced by meta data
> accelreation series. Please review.
 ...

My impression is that patch #7 will be changed to use spinlocks so there
will be a v5.

^ permalink raw reply

* Re: [net-next v3] tipc: add loopback device tracking
From: David Miller @ 2019-08-09  5:11 UTC (permalink / raw)
  To: john.rutherford; +Cc: netdev, tipc-discussion
In-Reply-To: <20190807025229.1599-1-john.rutherford@dektech.com.au>

From: john.rutherford@dektech.com.au
Date: Wed,  7 Aug 2019 12:52:29 +1000

> From: John Rutherford <john.rutherford@dektech.com.au>
> 
> Since node internal messages are passed directly to the socket, it is not
> possible to observe those messages via tcpdump or wireshark.
> 
> We now remedy this by making it possible to clone such messages and send
> the clones to the loopback interface.  The clones are dropped at reception
> and have no functional role except making the traffic visible.
> 
> The feature is enabled if network taps are active for the loopback device.
> pcap filtering restrictions require the messages to be presented to the
> receiving side of the loopback device.
> 
> v3 - Function dev_nit_active used to check for network taps.
>    - Procedure netif_rx_ni used to send cloned messages to loopback device.
> 
> Signed-off-by: John Rutherford <john.rutherford@dektech.com.au>
> Acked-by: Jon Maloy <jon.maloy@ericsson.com>
> Acked-by: Ying Xue <ying.xue@windriver.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH net-next v5 2/3] net: phy: add support for clause 37 auto-negotiation
From: Tao Ren @ 2019-08-09  5:06 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Andrew Lunn, Florian Fainelli, Heiner Kallweit, David S . Miller,
	Arun Parameswaran, Justin Chen, netdev, lkml,
	openbmc@lists.ozlabs.org
In-Reply-To: <CA+h21hpcmpXZZrN6NYwAMhqrOKK2oGq27iiRiDBFT-zAvvZfWA@mail.gmail.com>

On 8/8/19 9:58 PM, Vladimir Oltean wrote:
> On Fri, 9 Aug 2019 at 02:48, Tao Ren <taoren@fb.com> wrote:
>>
>> From: Heiner Kallweit <hkallweit1@gmail.com>
>>
>> This patch adds support for clause 37 1000Base-X auto-negotiation.
>> It's compile-tested only as I don't have fiber equipment.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
> 
> This needs your signed-off-by as well.

I see. I didn't understand signed-off-by correctly and removed myself from the list explicitly. Adding it back now..


Thanks,

Tao

^ permalink raw reply

* Re: [PATCH v2] bonding: Add vlan tx offload to hw_enc_features
From: David Miller @ 2019-08-09  5:02 UTC (permalink / raw)
  To: yuehaibing
  Cc: j.vosburgh, vfalico, andy, jiri, jay.vosburgh, linux-kernel,
	netdev
In-Reply-To: <20190807021959.58572-1-yuehaibing@huawei.com>

From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 7 Aug 2019 10:19:59 +0800

> As commit 30d8177e8ac7 ("bonding: Always enable vlan tx offload")
> said, we should always enable bonding's vlan tx offload, pass the
> vlan packets to the slave devices with vlan tci, let them to handle
> vlan implementation.
> 
> Now if encapsulation protocols like VXLAN is used, skb->encapsulation
> may be set, then the packet is passed to vlan device which based on
> bonding device. However in netif_skb_features(), the check of
> hw_enc_features:
> 
> 	 if (skb->encapsulation)
>                  features &= dev->hw_enc_features;
> 
> clears NETIF_F_HW_VLAN_CTAG_TX/NETIF_F_HW_VLAN_STAG_TX. This results
> in same issue in commit 30d8177e8ac7 like this:
> 
> vlan_dev_hard_start_xmit
>   -->dev_queue_xmit
>     -->validate_xmit_skb
>       -->netif_skb_features //NETIF_F_HW_VLAN_CTAG_TX is cleared
>       -->validate_xmit_vlan
>         -->__vlan_hwaccel_push_inside //skb->tci is cleared
> ...
>  --> bond_start_xmit
>    --> bond_xmit_hash //BOND_XMIT_POLICY_ENCAP34
>      --> __skb_flow_dissect // nhoff point to IP header
>         -->  case htons(ETH_P_8021Q)
>              // skb_vlan_tag_present is false, so
>              vlan = __skb_header_pointer(skb, nhoff, sizeof(_vlan),
>              //vlan point to ip header wrongly
> 
> Fixes: b2a103e6d0af ("bonding: convert to ndo_fix_features")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>

Applied and queued up for -stable.

^ permalink raw reply

* Re: [PATCH v2] net: sched: sch_taprio: fix memleak in error path for sched list parse
From: David Miller @ 2019-08-09  5:01 UTC (permalink / raw)
  To: ivan.khoronzhuk
  Cc: vinicius.gomes, jhs, xiyou.wangcong, jiri, netdev, linux-kernel
In-Reply-To: <20190806224540.24912-1-ivan.khoronzhuk@linaro.org>

From: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Date: Wed,  7 Aug 2019 01:45:40 +0300

> In error case, all entries should be freed from the sched list
> before deleting it. For simplicity use rcu way.
> 
> Fixes: 5a781ccbd19e46 ("tc: Add support for configuring the taprio scheduler")
> Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>

Applied and queued up for -stable, thank you.

^ permalink raw reply

* Re: [PATCH net-next v5 2/3] net: phy: add support for clause 37 auto-negotiation
From: Vladimir Oltean @ 2019-08-09  4:58 UTC (permalink / raw)
  To: Tao Ren
  Cc: Andrew Lunn, Florian Fainelli, Heiner Kallweit, David S . Miller,
	Arun Parameswaran, Justin Chen, netdev, lkml, openbmc
In-Reply-To: <20190808234816.4189789-1-taoren@fb.com>

On Fri, 9 Aug 2019 at 02:48, Tao Ren <taoren@fb.com> wrote:
>
> From: Heiner Kallweit <hkallweit1@gmail.com>
>
> This patch adds support for clause 37 1000Base-X auto-negotiation.
> It's compile-tested only as I don't have fiber equipment.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---

This needs your signed-off-by as well.

>  drivers/net/phy/phy_device.c | 139 +++++++++++++++++++++++++++++++++++
>  include/linux/phy.h          |   5 ++
>  2 files changed, 144 insertions(+)
>
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 252a712d1b2b..7c5315302937 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1617,6 +1617,40 @@ static int genphy_config_advert(struct phy_device *phydev)
>         return changed;
>  }
>
> +/**
> + * genphy_c37_config_advert - sanitize and advertise auto-negotiation parameters
> + * @phydev: target phy_device struct
> + *
> + * Description: Writes MII_ADVERTISE with the appropriate values,
> + *   after sanitizing the values to make sure we only advertise
> + *   what is supported.  Returns < 0 on error, 0 if the PHY's advertisement
> + *   hasn't changed, and > 0 if it has changed. This function is intended
> + *   for Clause 37 1000Base-X mode.
> + */
> +static int genphy_c37_config_advert(struct phy_device *phydev)
> +{
> +       u16 adv = 0;
> +
> +       /* Only allow advertising what this PHY supports */
> +       linkmode_and(phydev->advertising, phydev->advertising,
> +                    phydev->supported);
> +
> +       if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
> +                             phydev->advertising))
> +               adv |= ADVERTISE_1000XFULL;
> +       if (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
> +                             phydev->advertising))
> +               adv |= ADVERTISE_1000XPAUSE;
> +       if (linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
> +                             phydev->advertising))
> +               adv |= ADVERTISE_1000XPSE_ASYM;
> +
> +       return phy_modify_changed(phydev, MII_ADVERTISE,
> +                                 ADVERTISE_1000XFULL | ADVERTISE_1000XPAUSE |
> +                                 ADVERTISE_1000XHALF | ADVERTISE_1000XPSE_ASYM,
> +                                 adv);
> +}
> +
>  /**
>   * genphy_config_eee_advert - disable unwanted eee mode advertisement
>   * @phydev: target phy_device struct
> @@ -1726,6 +1760,54 @@ int genphy_config_aneg(struct phy_device *phydev)
>  }
>  EXPORT_SYMBOL(genphy_config_aneg);
>
> +/**
> + * genphy_c37_config_aneg - restart auto-negotiation or write BMCR
> + * @phydev: target phy_device struct
> + *
> + * Description: If auto-negotiation is enabled, we configure the
> + *   advertising, and then restart auto-negotiation.  If it is not
> + *   enabled, then we write the BMCR. This function is intended
> + *   for use with Clause 37 1000Base-X mode.
> + */
> +int genphy_c37_config_aneg(struct phy_device *phydev)
> +{
> +       int err, changed;
> +
> +       if (AUTONEG_ENABLE != phydev->autoneg)
> +               return genphy_setup_forced(phydev);
> +
> +       err = phy_modify(phydev, MII_BMCR, BMCR_SPEED1000 | BMCR_SPEED100,
> +                        BMCR_SPEED1000);
> +       if (err)
> +               return err;
> +
> +       changed = genphy_c37_config_advert(phydev);
> +       if (changed < 0) /* error */
> +               return changed;
> +
> +       if (!changed) {
> +               /* Advertisement hasn't changed, but maybe aneg was never on to
> +                * begin with?  Or maybe phy was isolated?
> +                */
> +               int ctl = phy_read(phydev, MII_BMCR);
> +
> +               if (ctl < 0)
> +                       return ctl;
> +
> +               if (!(ctl & BMCR_ANENABLE) || (ctl & BMCR_ISOLATE))
> +                       changed = 1; /* do restart aneg */
> +       }
> +
> +       /* Only restart aneg if we are advertising something different
> +        * than we were before.
> +        */
> +       if (changed > 0)
> +               return genphy_restart_aneg(phydev);
> +
> +       return 0;
> +}
> +EXPORT_SYMBOL(genphy_c37_config_aneg);
> +
>  /**
>   * genphy_aneg_done - return auto-negotiation status
>   * @phydev: target phy_device struct
> @@ -1864,6 +1946,63 @@ int genphy_read_status(struct phy_device *phydev)
>  }
>  EXPORT_SYMBOL(genphy_read_status);
>
> +/**
> + * genphy_c37_read_status - check the link status and update current link state
> + * @phydev: target phy_device struct
> + *
> + * Description: Check the link, then figure out the current state
> + *   by comparing what we advertise with what the link partner
> + *   advertises. This function is for Clause 37 1000Base-X mode.
> + */
> +int genphy_c37_read_status(struct phy_device *phydev)
> +{
> +       int lpa, err, old_link = phydev->link;
> +
> +       /* Update the link, but return if there was an error */
> +       err = genphy_update_link(phydev);
> +       if (err)
> +               return err;
> +
> +       /* why bother the PHY if nothing can have changed */
> +       if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link)
> +               return 0;
> +
> +       phydev->duplex = DUPLEX_UNKNOWN;
> +       phydev->pause = 0;
> +       phydev->asym_pause = 0;
> +
> +       if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) {
> +               lpa = phy_read(phydev, MII_LPA);
> +               if (lpa < 0)
> +                       return lpa;
> +
> +               linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
> +                                phydev->lp_advertising, lpa & LPA_LPACK);
> +               linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
> +                                phydev->lp_advertising, lpa & LPA_1000XFULL);
> +               linkmode_mod_bit(ETHTOOL_LINK_MODE_Pause_BIT,
> +                                phydev->lp_advertising, lpa & LPA_1000XPAUSE);
> +               linkmode_mod_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
> +                                phydev->lp_advertising,
> +                                lpa & LPA_1000XPAUSE_ASYM);
> +
> +               phy_resolve_aneg_linkmode(phydev);
> +       } else if (phydev->autoneg == AUTONEG_DISABLE) {
> +               int bmcr = phy_read(phydev, MII_BMCR);
> +
> +               if (bmcr < 0)
> +                       return bmcr;
> +
> +               if (bmcr & BMCR_FULLDPLX)
> +                       phydev->duplex = DUPLEX_FULL;
> +               else
> +                       phydev->duplex = DUPLEX_HALF;
> +       }
> +
> +       return 0;
> +}
> +EXPORT_SYMBOL(genphy_c37_read_status);
> +
>  /**
>   * genphy_soft_reset - software reset the PHY via BMCR_RESET bit
>   * @phydev: target phy_device struct
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 462b90b73f93..81a2921512ee 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -1077,6 +1077,11 @@ int genphy_suspend(struct phy_device *phydev);
>  int genphy_resume(struct phy_device *phydev);
>  int genphy_loopback(struct phy_device *phydev, bool enable);
>  int genphy_soft_reset(struct phy_device *phydev);
> +
> +/* Clause 37 */
> +int genphy_c37_config_aneg(struct phy_device *phydev);
> +int genphy_c37_read_status(struct phy_device *phydev);
> +
>  static inline int genphy_no_soft_reset(struct phy_device *phydev)
>  {
>         return 0;
> --
> 2.17.1
>

^ permalink raw reply

* Re: [PATCH net] net: phy: rtl8211f: do a double read to get real time link status
From: Yonglong Liu @ 2019-08-09  4:57 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: davem, netdev, linux-kernel, linuxarm, salil.mehta, yisen.zhuang,
	shiju.jose
In-Reply-To: <20190808203415.GO27917@lunn.ch>



On 2019/8/9 4:34, Andrew Lunn wrote:
> On Thu, Aug 08, 2019 at 10:01:39PM +0200, Heiner Kallweit wrote:
>> On 08.08.2019 21:40, Andrew Lunn wrote:
>>>> @@ -568,6 +568,11 @@ int phy_start_aneg(struct phy_device *phydev)
>>>>  	if (err < 0)
>>>>  		goto out_unlock;
>>>>  
>>>> +	/* The PHY may not yet have cleared aneg-completed and link-up bit
>>>> +	 * w/o this delay when the following read is done.
>>>> +	 */
>>>> +	usleep_range(1000, 2000);
>>>> +
>>>
>>> Hi Heiner
>>>
>>> Does 802.3 C22 say anything about this?
>>>
>> C22 says:
>> "The Auto-Negotiation process shall be restarted by setting bit 0.9 to a logic one. This bit is self-
>> clearing, and a PHY shall return a value of one in bit 0.9 until the Auto-Negotiation process has been
>> initiated."
>>
>> Maybe we should read bit 0.9 in genphy_update_link() after having read BMSR and report
>> aneg-complete and link-up as false (no matter of their current value) if 0.9 is set.
> 
> Yes. That sounds sensible.
> 
>      Andrew
> 
> .
> 

Hi Heiner:
	I have test more than 50 times, it works. Previously less
than 20 times must be recurrence. so I think this patch solved the
problem.
	And I checked about 40 times of the time gap between read
and autoneg started, all of them is more than 2ms, as below:

  kworker/u257:1-670   [015] ....    27.182632: mdio_access: mii-0000:bd:00.3 write phy:0x07 reg:0x00 val:0x1240
  kworker/u257:1-670   [015] ....    27.184670: mdio_access: mii-0000:bd:00.3 read  phy:0x07 reg:0x01 val:0x7989


^ permalink raw reply

* Re: [PATCH net-next 5/5] r8152: change rx_frag_head_sz and rx_max_agg_num dynamically
From: David Miller @ 2019-08-09  4:51 UTC (permalink / raw)
  To: hayeswang
  Cc: jakub.kicinski, maciejromanfijalkowski, netdev, nic_swsd,
	linux-kernel, linux-usb
In-Reply-To: <0835B3720019904CB8F7AA43166CEEB2F18D0FFE@RTITMBSVM03.realtek.com.tw>

From: Hayes Wang <hayeswang@realtek.com>
Date: Fri, 9 Aug 2019 03:38:53 +0000

> Jakub Kicinski [jakub.kicinski@netronome.com]
> [..]> The kernel could support it. And I has finished it.
>> > However, when I want to test it by ethtool, I couldn't find suitable command.
>> > I couldn't find relative feature in the source code of ethtool, either.
> 
>> It's possible it's not implemented in the user space tool 🤔
>>
>> Looks like it got posted here:
>>
>> https://www.spinics.net/lists/netdev/msg299877.html
>>
>> But perhaps never finished?
> 
> May I implement both sysfs and set_tunalbe for copybreak first
> before the user space tool is ready? Otherwise, the user couldn't
> change the copybreak now.

No, fix the tool please.

^ permalink raw reply

* Re: [patch net-next rfc 3/7] net: rtnetlink: add commands to add and delete alternative ifnames
From: Roopa Prabhu @ 2019-08-09  4:11 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: netdev, David Miller, Jakub Kicinski, Stephen Hemminger,
	David Ahern, dcbw, Michal Kubecek, Andrew Lunn, parav,
	Saeed Mahameed, mlxsw
In-Reply-To: <20190719110029.29466-4-jiri@resnulli.us>

On Fri, Jul 19, 2019 at 4:00 AM Jiri Pirko <jiri@resnulli.us> wrote:
>
> From: Jiri Pirko <jiri@mellanox.com>
>
> Add two commands to add and delete alternative ifnames for net device.
> Each net device can have multiple alternative names.
>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
>  include/linux/netdevice.h      |   4 ++
>  include/uapi/linux/if.h        |   1 +
>  include/uapi/linux/if_link.h   |   1 +
>  include/uapi/linux/rtnetlink.h |   7 +++
>  net/core/dev.c                 |  58 ++++++++++++++++++-
>  net/core/rtnetlink.c           | 102 +++++++++++++++++++++++++++++++++
>  security/selinux/nlmsgtab.c    |   4 +-
>  7 files changed, 175 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 74f99f127b0e..6922fdb483ca 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -920,10 +920,14 @@ struct tlsdev_ops;
>
>  struct netdev_name_node {
>         struct hlist_node hlist;
> +       struct list_head list;
>         struct net_device *dev;
>         char *name;
>  };
>
> +int netdev_name_node_alt_create(struct net_device *dev, char *name);
> +int netdev_name_node_alt_destroy(struct net_device *dev, char *name);
> +
>  /*
>   * This structure defines the management hooks for network devices.
>   * The following hooks can be defined; unless noted otherwise, they are
> diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h
> index 7fea0fd7d6f5..4bf33344aab1 100644
> --- a/include/uapi/linux/if.h
> +++ b/include/uapi/linux/if.h
> @@ -33,6 +33,7 @@
>  #define        IFNAMSIZ        16
>  #endif /* __UAPI_DEF_IF_IFNAMSIZ */
>  #define        IFALIASZ        256
> +#define        ALTIFNAMSIZ     128
>  #include <linux/hdlc/ioctl.h>
>
>  /* For glibc compatibility. An empty enum does not compile. */
> diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
> index 4a8c02cafa9a..92268946e04a 100644
> --- a/include/uapi/linux/if_link.h
> +++ b/include/uapi/linux/if_link.h
> @@ -167,6 +167,7 @@ enum {
>         IFLA_NEW_IFINDEX,
>         IFLA_MIN_MTU,
>         IFLA_MAX_MTU,
> +       IFLA_ALT_IFNAME_MOD, /* Alternative ifname to add/delete */
>         __IFLA_MAX
>  };
>
> diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
> index ce2a623abb75..b36cfd83eb76 100644
> --- a/include/uapi/linux/rtnetlink.h
> +++ b/include/uapi/linux/rtnetlink.h
> @@ -164,6 +164,13 @@ enum {
>         RTM_GETNEXTHOP,
>  #define RTM_GETNEXTHOP RTM_GETNEXTHOP
>
> +       RTM_NEWALTIFNAME = 108,
> +#define RTM_NEWALTIFNAME       RTM_NEWALTIFNAME
> +       RTM_DELALTIFNAME,
> +#define RTM_DELALTIFNAME       RTM_DELALTIFNAME
> +       RTM_GETALTIFNAME,
> +#define RTM_GETALTIFNAME       RTM_GETALTIFNAME
> +

I might have missed the prior discussion, why do we need new commands
?. can't this simply be part of RTM_*LINK and we use RTM_SETLINK to
set alternate names ?



>         __RTM_MAX,
>  #define RTM_MAX                (((__RTM_MAX + 3) & ~3) - 1)
>  };
> diff --git a/net/core/dev.c b/net/core/dev.c
> index ad0d42fbdeee..2a3be2b279d3 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -244,7 +244,13 @@ static struct netdev_name_node *netdev_name_node_alloc(struct net_device *dev,
>  static struct netdev_name_node *
>  netdev_name_node_head_alloc(struct net_device *dev)
>  {
> -       return netdev_name_node_alloc(dev, dev->name);
> +       struct netdev_name_node *name_node;
> +
> +       name_node = netdev_name_node_alloc(dev, dev->name);
> +       if (!name_node)
> +               return NULL;
> +       INIT_LIST_HEAD(&name_node->list);
> +       return name_node;
>  }
>
>  static void netdev_name_node_free(struct netdev_name_node *name_node)
> @@ -288,6 +294,55 @@ static struct netdev_name_node *netdev_name_node_lookup_rcu(struct net *net,
>         return NULL;
>  }
>
> +int netdev_name_node_alt_create(struct net_device *dev, char *name)
> +{
> +       struct netdev_name_node *name_node;
> +       struct net *net = dev_net(dev);
> +
> +       name_node = netdev_name_node_lookup(net, name);
> +       if (name_node)
> +               return -EEXIST;
> +       name_node = netdev_name_node_alloc(dev, name);
> +       if (!name_node)
> +               return -ENOMEM;
> +       netdev_name_node_add(net, name_node);
> +       /* The node that holds dev->name acts as a head of per-device list. */
> +       list_add_tail(&name_node->list, &dev->name_node->list);
> +
> +       return 0;
> +}
> +EXPORT_SYMBOL(netdev_name_node_alt_create);
> +
> +static void __netdev_name_node_alt_destroy(struct netdev_name_node *name_node)
> +{
> +       list_del(&name_node->list);
> +       netdev_name_node_del(name_node);
> +       kfree(name_node->name);
> +       netdev_name_node_free(name_node);
> +}
> +
> +int netdev_name_node_alt_destroy(struct net_device *dev, char *name)
> +{
> +       struct netdev_name_node *name_node;
> +       struct net *net = dev_net(dev);
> +
> +       name_node = netdev_name_node_lookup(net, name);
> +       if (!name_node)
> +               return -ENOENT;
> +       __netdev_name_node_alt_destroy(name_node);
> +
> +       return 0;
> +}
> +EXPORT_SYMBOL(netdev_name_node_alt_destroy);
> +
> +static void netdev_name_node_alt_flush(struct net_device *dev)
> +{
> +       struct netdev_name_node *name_node, *tmp;
> +
> +       list_for_each_entry_safe(name_node, tmp, &dev->name_node->list, list)
> +               __netdev_name_node_alt_destroy(name_node);
> +}
> +
>  /* Device list insertion */
>  static void list_netdevice(struct net_device *dev)
>  {
> @@ -8258,6 +8313,7 @@ static void rollback_registered_many(struct list_head *head)
>                 dev_uc_flush(dev);
>                 dev_mc_flush(dev);
>
> +               netdev_name_node_alt_flush(dev);
>                 netdev_name_node_free(dev->name_node);
>
>                 if (dev->netdev_ops->ndo_uninit)
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 1ee6460f8275..7a2010b16e10 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -1750,6 +1750,8 @@ static const struct nla_policy ifla_policy[IFLA_MAX+1] = {
>         [IFLA_CARRIER_DOWN_COUNT] = { .type = NLA_U32 },
>         [IFLA_MIN_MTU]          = { .type = NLA_U32 },
>         [IFLA_MAX_MTU]          = { .type = NLA_U32 },
> +       [IFLA_ALT_IFNAME_MOD]   = { .type = NLA_STRING,
> +                                   .len = ALTIFNAMSIZ - 1 },
>  };
>
>  static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {
> @@ -3373,6 +3375,103 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr *nlh,
>         return err;
>  }
>
> +static int rtnl_newaltifname(struct sk_buff *skb, struct nlmsghdr *nlh,
> +                            struct netlink_ext_ack *extack)
> +{
> +       struct net *net = sock_net(skb->sk);
> +       struct nlattr *tb[IFLA_MAX + 1];
> +       struct net_device *dev;
> +       struct ifinfomsg *ifm;
> +       char *new_alt_ifname;
> +       int err;
> +
> +       err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack);
> +       if (err)
> +               return err;
> +
> +       err = rtnl_ensure_unique_netns(tb, extack, true);
> +       if (err)
> +               return err;
> +
> +       ifm = nlmsg_data(nlh);
> +       if (ifm->ifi_index > 0) {
> +               dev = __dev_get_by_index(net, ifm->ifi_index);
> +       } else if (tb[IFLA_IFNAME]) {
> +               char ifname[IFNAMSIZ];
> +
> +               nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
> +               dev = __dev_get_by_name(net, ifname);
> +       } else {
> +               return -EINVAL;
> +       }
> +
> +       if (!dev)
> +               return -ENODEV;
> +
> +       if (!tb[IFLA_ALT_IFNAME_MOD])
> +               return -EINVAL;
> +
> +       new_alt_ifname = nla_strdup(tb[IFLA_ALT_IFNAME_MOD], GFP_KERNEL);
> +       if (!new_alt_ifname)
> +               return -ENOMEM;
> +
> +       err = netdev_name_node_alt_create(dev, new_alt_ifname);
> +       if (err)
> +               goto out_free_new_alt_ifname;
> +
> +       return 0;
> +
> +out_free_new_alt_ifname:
> +       kfree(new_alt_ifname);
> +       return err;
> +}
> +
> +static int rtnl_delaltifname(struct sk_buff *skb, struct nlmsghdr *nlh,
> +                            struct netlink_ext_ack *extack)
> +{
> +       struct net *net = sock_net(skb->sk);
> +       struct nlattr *tb[IFLA_MAX + 1];
> +       struct net_device *dev;
> +       struct ifinfomsg *ifm;
> +       char *del_alt_ifname;
> +       int err;
> +
> +       err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack);
> +       if (err)
> +               return err;
> +
> +       err = rtnl_ensure_unique_netns(tb, extack, true);
> +       if (err)
> +               return err;
> +
> +       ifm = nlmsg_data(nlh);
> +       if (ifm->ifi_index > 0) {
> +               dev = __dev_get_by_index(net, ifm->ifi_index);
> +       } else if (tb[IFLA_IFNAME]) {
> +               char ifname[IFNAMSIZ];
> +
> +               nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
> +               dev = __dev_get_by_name(net, ifname);
> +       } else {
> +               return -EINVAL;
> +       }
> +
> +       if (!dev)
> +               return -ENODEV;
> +
> +       if (!tb[IFLA_ALT_IFNAME_MOD])
> +               return -EINVAL;
> +
> +       del_alt_ifname = nla_strdup(tb[IFLA_ALT_IFNAME_MOD], GFP_KERNEL);
> +       if (!del_alt_ifname)
> +               return -ENOMEM;
> +
> +       err = netdev_name_node_alt_destroy(dev, del_alt_ifname);
> +       kfree(del_alt_ifname);
> +
> +       return err;
> +}
> +
>  static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
>  {
>         struct net *net = sock_net(skb->sk);
> @@ -5331,6 +5430,9 @@ void __init rtnetlink_init(void)
>         rtnl_register(PF_UNSPEC, RTM_GETROUTE, NULL, rtnl_dump_all, 0);
>         rtnl_register(PF_UNSPEC, RTM_GETNETCONF, NULL, rtnl_dump_all, 0);
>
> +       rtnl_register(PF_UNSPEC, RTM_NEWALTIFNAME, rtnl_newaltifname, NULL, 0);
> +       rtnl_register(PF_UNSPEC, RTM_DELALTIFNAME, rtnl_delaltifname, NULL, 0);
> +
>         rtnl_register(PF_BRIDGE, RTM_NEWNEIGH, rtnl_fdb_add, NULL, 0);
>         rtnl_register(PF_BRIDGE, RTM_DELNEIGH, rtnl_fdb_del, NULL, 0);
>         rtnl_register(PF_BRIDGE, RTM_GETNEIGH, rtnl_fdb_get, rtnl_fdb_dump, 0);
> diff --git a/security/selinux/nlmsgtab.c b/security/selinux/nlmsgtab.c
> index 58345ba0528e..a712b54c666c 100644
> --- a/security/selinux/nlmsgtab.c
> +++ b/security/selinux/nlmsgtab.c
> @@ -83,6 +83,8 @@ static const struct nlmsg_perm nlmsg_route_perms[] =
>         { RTM_NEWNEXTHOP,       NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
>         { RTM_DELNEXTHOP,       NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
>         { RTM_GETNEXTHOP,       NETLINK_ROUTE_SOCKET__NLMSG_READ  },
> +       { RTM_NEWALTIFNAME,     NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
> +       { RTM_DELALTIFNAME,     NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
>  };
>
>  static const struct nlmsg_perm nlmsg_tcpdiag_perms[] =
> @@ -166,7 +168,7 @@ int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm)
>                  * structures at the top of this file with the new mappings
>                  * before updating the BUILD_BUG_ON() macro!
>                  */
> -               BUILD_BUG_ON(RTM_MAX != (RTM_NEWNEXTHOP + 3));
> +               BUILD_BUG_ON(RTM_MAX != (RTM_NEWALTIFNAME + 3));
>                 err = nlmsg_perm(nlmsg_type, perm, nlmsg_route_perms,
>                                  sizeof(nlmsg_route_perms));
>                 break;
> --
> 2.21.0
>

^ permalink raw reply

* RE: [PATCH net-next 5/5] r8152: change rx_frag_head_sz and rx_max_agg_num dynamically
From: Hayes Wang @ 2019-08-09  3:38 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Maciej Fijalkowski, netdev@vger.kernel.org, nic_swsd,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
In-Reply-To: <20190808114325.5c346d3a@cakuba.netronome.com>

Jakub Kicinski [jakub.kicinski@netronome.com]
[..]> The kernel could support it. And I has finished it.
> > However, when I want to test it by ethtool, I couldn't find suitable command.
> > I couldn't find relative feature in the source code of ethtool, either.

> It's possible it's not implemented in the user space tool 🤔
>
> Looks like it got posted here:
>
> https://www.spinics.net/lists/netdev/msg299877.html
>
> But perhaps never finished?

May I implement both sysfs and set_tunalbe for copybreak first
before the user space tool is ready? Otherwise, the user couldn't
change the copybreak now.

Best Regards,
Hayes

^ 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