Netdev List
 help / color / mirror / Atom feed
* Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)
From: Vishwanathapura, Niranjana @ 2017-01-11  9:05 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, ira.weiny, Jeff Kirsher, David S. Miller,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w
In-Reply-To: <20170110081402.GH7218-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>

On Tue, Jan 10, 2017 at 10:14:02AM +0200, Leon Romanovsky wrote:
>On Mon, Jan 09, 2017 at 07:39:54PM -0800, Vishwanathapura, Niranjana wrote:
>> We are also looking into Jason’s suggestion to make hfi_vnic interface to
>> the bottom driver a generic interface. This will include moving some of the
>> netstack interfacing to the bottom hfi1 driver.
>
>Great, do you have rough estimation when will it be posted on the ML?
>
>Thanks
>

Hi Leon,

I am currently doing some prototype on this. I will respond with the interface 
definition first once I have it solidified. RFC v3 with implemetion will be 
later.

Niranjana


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

^ permalink raw reply

* Re: [PATCH v2 7/8] net: Rename TCA*BPF_DIGEST to ..._SHA256
From: Daniel Borkmann @ 2017-01-11  9:09 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Andy Lutomirski, Netdev, LKML, Linux Crypto Mailing List,
	Jason A. Donenfeld, Hannes Frederic Sowa, Alexei Starovoitov,
	Eric Dumazet, Eric Biggers, Tom Herbert, David S. Miller,
	Alexei Starovoitov
In-Reply-To: <CALCETrUHenMS1iomFr7+YEy_M3zaotrWbfMe93=BmzCbzJ0fLw@mail.gmail.com>

Hi Andy,

On 01/11/2017 04:11 AM, Andy Lutomirski wrote:
> On Tue, Jan 10, 2017 at 4:50 PM, Daniel Borkmann <daniel@iogearbox.net> wrote:
>> On 01/11/2017 12:24 AM, Andy Lutomirski wrote:
>>>
>>> This makes it easier to add another digest algorithm down the road if
>>> needed.  It also serves to force any programs that might have been
>>> written against a kernel that had the old field name to notice the
>>> change and make any necessary changes.
>>>
>>> This shouldn't violate any stable API policies, as no released kernel
>>> has ever had TCA*BPF_DIGEST.
>>
>> Imho, this and patch 6/8 is not really needed. Should there ever
>> another digest alg be used (doubt it), then you'd need a new nl
>> attribute and fdinfo line anyway to keep existing stuff intact.
>> Nobody made the claim that you can just change this underneath
>> and not respecting abi for existing applications when I read from
>> above that such apps now will get "forced" to notice a change.
>
> Fair enough.  I was more concerned about prerelease iproute2 versions,
> but maybe that's a nonissue.  I'll drop these two patches.

Ok. Sleeping over this a bit, how about a general rename into
"prog_tag" for fdinfo and TCA_BPF_TAG resp. TCA_ACT_BPF_TAG for
the netlink attributes, fwiw, it might reduce any assumptions on
this being made? If this would be preferable, I could cook that
patch against -net for renaming it?

Thanks,
Daniel

^ permalink raw reply

* Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)
From: Leon Romanovsky @ 2017-01-11  9:16 UTC (permalink / raw)
  To: Vishwanathapura, Niranjana
  Cc: Doug Ledford, ira.weiny, Jeff Kirsher, David S. Miller,
	linux-rdma, netdev, dennis.dalessandro
In-Reply-To: <20170111090539.GA78804@knc-06.sc.intel.com>

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

On Wed, Jan 11, 2017 at 01:05:39AM -0800, Vishwanathapura, Niranjana wrote:
> On Tue, Jan 10, 2017 at 10:14:02AM +0200, Leon Romanovsky wrote:
> > On Mon, Jan 09, 2017 at 07:39:54PM -0800, Vishwanathapura, Niranjana wrote:
> > > We are also looking into Jason’s suggestion to make hfi_vnic interface to
> > > the bottom driver a generic interface. This will include moving some of the
> > > netstack interfacing to the bottom hfi1 driver.
> >
> > Great, do you have rough estimation when will it be posted on the ML?
> >
> > Thanks
> >
>
> Hi Leon,
>
> I am currently doing some prototype on this. I will respond with the
> interface definition first once I have it solidified. RFC v3 with
> implemetion will be later.

It makes sense.
Thanks

>
> Niranjana
>
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* [PATCH net-next] net: thunderx: Make hfunc variable const type in nicvf_set_rxfh()
From: Robert Richter @ 2017-01-11  9:17 UTC (permalink / raw)
  To: David Miller; +Cc: Sunil Goutham, Robert Richter, netdev, Robert Richter

>From struct ethtool_ops:

        int     (*set_rxfh)(struct net_device *, const u32 *indir,
                            const u8 *key, const u8 hfunc);

Change function arg of hfunc to const type.

Signed-off-by: Robert Richter <rrichter@cavium.com>
---
 drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
index 2e74bbaa38e1..3a4761aa8efd 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
@@ -635,7 +635,7 @@ static int nicvf_get_rxfh(struct net_device *dev, u32 *indir, u8 *hkey,
 }
 
 static int nicvf_set_rxfh(struct net_device *dev, const u32 *indir,
-			  const u8 *hkey, u8 hfunc)
+			const u8 *hkey, const u8 hfunc)
 {
 	struct nicvf *nic = netdev_priv(dev);
 	struct nicvf_rss_info *rss = &nic->rss_info;
-- 
2.11.0

^ permalink raw reply related

* Re: [PATCH net-next] bridge: multicast to unicast
From: Johannes Berg @ 2017-01-11  9:17 UTC (permalink / raw)
  To: Linus Lüssing
  Cc: netdev, bridge, linux-wireless, linux-kernel, Michael Braun,
	David S . Miller, Felix Fietkau
In-Reply-To: <20170109231203.GC5513@otheros>


> > Exactly. My point is that this is breaking the expectation that
> > hosts are actually able to drop such packets.
> 
> [readding CCs I removed earlier]
> 
> Ah! Thanks. I was worried about creating packetloss :D.

Ah, well, no - at least not in this case.

> Hm, for this other other way round, I think it does not apply for
> the bridge multicast-to-unicast patch if I'm not misreading the
> bridge code:
> 
> For a packet with a link-layer multicast address but a unicast IP
> destination, the bridge MDB lookup will fail.
> (http://lxr.free-electrons.com/source/net/bridge/br_multicast.c?v=4.8
> #L178
>  returns NULL)
> 
> Case A): No multicast router on port:
> -> bridge, br_multicast_flood(), will drop the packet already
>    (no matter if multicast-to-unicast is enabled or not)
> 
> Case B): Multicast router present on port:
> -> The new patch does not apply multicast-to-unicast but just floods
>    packet unaltered
>    ("else { port = rport; addr = NULL; }" branch)

Ah, interesting. This is different then - the mac80211 code is not L3
aware at all.

johannes

^ permalink raw reply

* Re: [PATCH v2 2/2] stmmac: rename it to synopsys
From: kbuild test robot @ 2017-01-11 10:00 UTC (permalink / raw)
  To: Joao Pinto
  Cc: kbuild-all, davem, lars.persson, niklass, peppe.cavallaro,
	alexandre.torgue, netdev, Joao Pinto
In-Reply-To: <c74e6665ca14a4ca03b38cd3442ef0644d9e250d.1484059674.git.jpinto@synopsys.com>

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

Hi Joao,

[auto build test WARNING on net-next/master]
[also build test WARNING on next-20170111]
[cannot apply to v4.10-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Joao-Pinto/remove-dwc_eth_qos-and-rename-stmicro-stmmac/20170111-003912
config: m32r-allyesconfig (attached as .config)
compiler: m32r-linux-gcc (GCC) 6.2.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=m32r 

All warnings (new ones prefixed by >>):

   In file included from include/linux/printk.h:6:0,
                    from include/linux/kernel.h:13,
                    from include/asm-generic/bug.h:13,
                    from arch/m32r/include/asm/bug.h:3,
                    from include/linux/bug.h:4,
                    from include/linux/mmdebug.h:4,
                    from include/linux/gfp.h:4,
                    from include/linux/slab.h:14,
                    from drivers/net/ethernet/synopsys/dwmac1000_core.c:30:
   drivers/net/ethernet/synopsys/dwmac1000_core.c: In function 'dwmac1000_dump_regs':
   include/linux/kern_levels.h:4:18: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:299:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/net/ethernet/synopsys/dwmac1000_core.c:107:3: note: in expansion of macro 'pr_info'
      pr_info("\tReg No. %d (offset 0x%x): 0x%08x\n", i,
      ^~~~~~~
--
   In file included from include/linux/printk.h:6:0,
                    from include/linux/kernel.h:13,
                    from include/linux/list.h:8,
                    from include/linux/preempt.h:10,
                    from include/linux/spinlock.h:50,
                    from include/linux/phy.h:20,
                    from drivers/net/ethernet/synopsys/dwmac1000.h:25,
                    from drivers/net/ethernet/synopsys/dwmac1000_dma.c:30:
   drivers/net/ethernet/synopsys/dwmac1000_dma.c: In function 'dwmac1000_dump_dma_regs':
   include/linux/kern_levels.h:4:18: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:10:18: note: in expansion of macro 'KERN_SOH'
    #define KERN_ERR KERN_SOH "3" /* error conditions */
                     ^~~~~~~~
   include/linux/printk.h:292:9: note: in expansion of macro 'KERN_ERR'
     printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~
>> drivers/net/ethernet/synopsys/dwmac1000_dma.c:215:4: note: in expansion of macro 'pr_err'
       pr_err("\t Reg No. %d (offset 0x%x): 0x%08x\n", i,
       ^~~~~~
--
   In file included from include/linux/printk.h:6:0,
                    from include/linux/kernel.h:13,
                    from include/linux/list.h:8,
                    from include/linux/preempt.h:10,
                    from include/linux/spinlock.h:50,
                    from include/linux/phy.h:20,
                    from drivers/net/ethernet/synopsys/dwmac100.h:28,
                    from drivers/net/ethernet/synopsys/dwmac100_core.c:33:
   drivers/net/ethernet/synopsys/dwmac100_core.c: In function 'dwmac100_dump_mac_regs':
   include/linux/kern_levels.h:4:18: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:299:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/net/ethernet/synopsys/dwmac100_core.c:53:2: note: in expansion of macro 'pr_info'
     pr_info("\tcontrol reg (offset 0x%x): 0x%08x\n", MAC_CONTROL,
     ^~~~~~~
   include/linux/kern_levels.h:4:18: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:299:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_core.c:55:2: note: in expansion of macro 'pr_info'
     pr_info("\taddr HI (offset 0x%x): 0x%08x\n ", MAC_ADDR_HIGH,
     ^~~~~~~
   include/linux/kern_levels.h:4:18: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:299:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_core.c:57:2: note: in expansion of macro 'pr_info'
     pr_info("\taddr LO (offset 0x%x): 0x%08x\n", MAC_ADDR_LOW,
     ^~~~~~~
   include/linux/kern_levels.h:4:18: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:299:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_core.c:59:2: note: in expansion of macro 'pr_info'
     pr_info("\tmulticast hash HI (offset 0x%x): 0x%08x\n",
     ^~~~~~~
   include/linux/kern_levels.h:4:18: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:299:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_core.c:61:2: note: in expansion of macro 'pr_info'
     pr_info("\tmulticast hash LO (offset 0x%x): 0x%08x\n",
     ^~~~~~~
   include/linux/kern_levels.h:4:18: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:299:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_core.c:63:2: note: in expansion of macro 'pr_info'
     pr_info("\tflow control (offset 0x%x): 0x%08x\n",
     ^~~~~~~
   include/linux/kern_levels.h:4:18: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:299:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_core.c:65:2: note: in expansion of macro 'pr_info'
     pr_info("\tVLAN1 tag (offset 0x%x): 0x%08x\n", MAC_VLAN1,
     ^~~~~~~
   include/linux/kern_levels.h:4:18: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:299:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_core.c:67:2: note: in expansion of macro 'pr_info'
     pr_info("\tVLAN2 tag (offset 0x%x): 0x%08x\n", MAC_VLAN2,
     ^~~~~~~
--
   In file included from include/linux/kernel.h:13:0,
                    from include/linux/list.h:8,
                    from include/linux/preempt.h:10,
                    from include/linux/spinlock.h:50,
                    from include/linux/phy.h:20,
                    from drivers/net/ethernet/synopsys/dwmac100.h:28,
                    from drivers/net/ethernet/synopsys/dwmac100_dma.c:32:
   drivers/net/ethernet/synopsys/dwmac100_dma.c: In function 'dwmac100_dump_dma_regs':
>> drivers/net/ethernet/synopsys/dwmac100_dma.c:79:12: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'long unsigned int' [-Wformat=]
      pr_debug("\t CSR%d (offset 0x%x): 0x%08x\n", i,
               ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
>> drivers/net/ethernet/synopsys/dwmac100_dma.c:79:3: note: in expansion of macro 'pr_debug'
      pr_debug("\t CSR%d (offset 0x%x): 0x%08x\n", i,
      ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_dma.c:83:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tCSR20 (0x%x): 0x%08x, CSR21 (0x%x): 0x%08x\n",
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_dma.c:83:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tCSR20 (0x%x): 0x%08x, CSR21 (0x%x): 0x%08x\n",
     ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_dma.c:83:11: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tCSR20 (0x%x): 0x%08x, CSR21 (0x%x): 0x%08x\n",
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac100_dma.c:83:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tCSR20 (0x%x): 0x%08x, CSR21 (0x%x): 0x%08x\n",
     ^~~~~~~~
--
   In file included from include/linux/kernel.h:13:0,
                    from include/asm-generic/bug.h:13,
                    from arch/m32r/include/asm/bug.h:3,
                    from include/linux/bug.h:4,
                    from include/linux/io.h:23,
                    from drivers/net/ethernet/synopsys/dwmac4_dma.c:16:
   drivers/net/ethernet/synopsys/dwmac4_dma.c: In function '_dwmac4_dump_dma_regs':
>> drivers/net/ethernet/synopsys/dwmac4_dma.c:133:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tDMA_CHAN_CONTROL, offset: 0x%x, val: 0x%x\n", 0,
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
>> drivers/net/ethernet/synopsys/dwmac4_dma.c:133:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tDMA_CHAN_CONTROL, offset: 0x%x, val: 0x%x\n", 0,
     ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:135:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tDMA_CHAN_TX_CONTROL, offset: 0x%x, val: 0x%x\n", 0x4,
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:135:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tDMA_CHAN_TX_CONTROL, offset: 0x%x, val: 0x%x\n", 0x4,
     ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:137:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tDMA_CHAN_RX_CONTROL, offset: 0x%x, val: 0x%x\n", 0x8,
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:137:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tDMA_CHAN_RX_CONTROL, offset: 0x%x, val: 0x%x\n", 0x8,
     ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:139:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tDMA_CHAN_TX_BASE_ADDR, offset: 0x%x, val: 0x%x\n", 0x14,
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:139:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tDMA_CHAN_TX_BASE_ADDR, offset: 0x%x, val: 0x%x\n", 0x14,
     ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:141:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tDMA_CHAN_RX_BASE_ADDR, offset: 0x%x, val: 0x%x\n", 0x1c,
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:141:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tDMA_CHAN_RX_BASE_ADDR, offset: 0x%x, val: 0x%x\n", 0x1c,
     ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:143:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tDMA_CHAN_TX_END_ADDR, offset: 0x%x, val: 0x%x\n", 0x20,
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:143:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tDMA_CHAN_TX_END_ADDR, offset: 0x%x, val: 0x%x\n", 0x20,
     ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:145:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tDMA_CHAN_RX_END_ADDR, offset: 0x%x, val: 0x%x\n", 0x28,
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:145:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tDMA_CHAN_RX_END_ADDR, offset: 0x%x, val: 0x%x\n", 0x28,
     ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:147:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tDMA_CHAN_TX_RING_LEN, offset: 0x%x, val: 0x%x\n", 0x2c,
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:147:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tDMA_CHAN_TX_RING_LEN, offset: 0x%x, val: 0x%x\n", 0x2c,
     ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:149:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tDMA_CHAN_RX_RING_LEN, offset: 0x%x, val: 0x%x\n", 0x30,
              ^
   include/linux/printk.h:276:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:324:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:149:2: note: in expansion of macro 'pr_debug'
     pr_debug("\tDMA_CHAN_RX_RING_LEN, offset: 0x%x, val: 0x%x\n", 0x30,
     ^~~~~~~~
   drivers/net/ethernet/synopsys/dwmac4_dma.c:151:11: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     pr_debug("\tDMA_CHAN_INTR_ENA, offset: 0x%x, val: 0x%x\n", 0x34,
..

vim +/pr_info +107 drivers/net/ethernet/synopsys/dwmac1000_core.c

d2afb5bd drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c Giuseppe CAVALLARO 2014-09-01   91  
ebbb293f drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-09-17   92  	writel(value, ioaddr + GMAC_CONTROL);
ebbb293f drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-09-17   93  
ebbb293f drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-09-17   94  	value = readl(ioaddr + GMAC_CONTROL);
ebbb293f drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-09-17   95  
ebbb293f drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-09-17   96  	return !!(value & GMAC_CONTROL_IPC);
ebbb293f drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-09-17   97  }
ebbb293f drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-09-17   98  
7ed24bbe drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c Vince Bridgers     2014-07-31   99  static void dwmac1000_dump_regs(struct mac_device_info *hw)
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  100  {
7ed24bbe drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c Vince Bridgers     2014-07-31  101  	void __iomem *ioaddr = hw->pcsr;
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  102  	int i;
1f0f6388 drivers/net/stmmac/dwmac1000_core.c                  David S. Miller    2010-08-30  103  	pr_info("\tDWMAC1000 regs (base addr = 0x%p)\n", ioaddr);
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  104  
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  105  	for (i = 0; i < 55; i++) {
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  106  		int offset = i * 4;
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06 @107  		pr_info("\tReg No. %d (offset 0x%x): 0x%08x\n", i,
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  108  			offset, readl(ioaddr + offset));
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  109  	}
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  110  }
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  111  
7ed24bbe drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c Vince Bridgers     2014-07-31  112  static void dwmac1000_set_umac_addr(struct mac_device_info *hw,
7ed24bbe drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c Vince Bridgers     2014-07-31  113  				    unsigned char *addr,
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  114  				    unsigned int reg_n)
21d437cc drivers/net/stmmac/dwmac1000_core.c                  Giuseppe CAVALLARO 2010-01-06  115  {

:::::: The code at line 107 was first introduced by commit
:::::: 21d437cc66dcfd0119a4905214fbbe19f3e276dc stmmac: rename the gmac as dwmac1000 and split core and dma parts

:::::: TO: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
:::::: CC: David S. Miller <davem@davemloft.net>

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

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

^ permalink raw reply

* [PATCH/RFC net-next 0/2] net/sched: cls_flower: Support matching ARP
From: Simon Horman @ 2017-01-11 10:02 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: Dinan Gunawardena, netdev, oss-drivers, Simon Horman

Add support for support matching on ARP operation, and hardware and
protocol addresses for Ethernet hardware and IPv4 protocol addresses.

Simon Horman (2):
  flow disector: ARP support
  net/sched: cls_flower: Support matching on ARP

 include/net/flow_dissector.h | 19 +++++++++++++++
 include/uapi/linux/pkt_cls.h | 11 +++++++++
 net/core/flow_dissector.c    | 57 ++++++++++++++++++++++++++++++++++++++++++++
 net/sched/cls_flower.c       | 51 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 138 insertions(+)

-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply

* [PATCH/RFC net-next 1/2] flow disector: ARP support
From: Simon Horman @ 2017-01-11 10:02 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: Dinan Gunawardena, netdev, oss-drivers, Simon Horman
In-Reply-To: <1484128942-11745-1-git-send-email-simon.horman@netronome.com>

Allow dissection of (R)ARP operation hardware and protocol addresses
for Ethernet hardware and IPv4 protocol addresses.

There are currently no users of FLOW_DISSECTOR_KEY_ARP.
A follow-up patch will allow FLOW_DISSECTOR_KEY_ARP to be used by the
flower classifier.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 include/net/flow_dissector.h | 19 +++++++++++++++
 net/core/flow_dissector.c    | 57 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+)

diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h
index d896a33e00d4..ac9703018a3a 100644
--- a/include/net/flow_dissector.h
+++ b/include/net/flow_dissector.h
@@ -89,6 +89,24 @@ struct flow_dissector_key_addrs {
 };
 
 /**
+ * flow_dissector_key_arp:
+ *	@ports: Operation, source and target addresses for an ARP header
+ *              for Ethernet hardware addresses and IPv4 protocol addresses
+ *		sip: Sender IP address
+ *		tip: Target IP address
+ *		op:  Operation
+ *		sha: Sender hardware address
+ *		tpa: Target hardware address
+ */
+struct flow_dissector_key_arp {
+	__u32 sip;
+	__u32 tip;
+	__u8 op;
+	unsigned char sha[ETH_ALEN];
+	unsigned char tha[ETH_ALEN];
+};
+
+/**
  * flow_dissector_key_tp_ports:
  *	@ports: port numbers of Transport header
  *		src: source port number
@@ -141,6 +159,7 @@ enum flow_dissector_key_id {
 	FLOW_DISSECTOR_KEY_ICMP, /* struct flow_dissector_key_icmp */
 	FLOW_DISSECTOR_KEY_ETH_ADDRS, /* struct flow_dissector_key_eth_addrs */
 	FLOW_DISSECTOR_KEY_TIPC_ADDRS, /* struct flow_dissector_key_tipc_addrs */
+	FLOW_DISSECTOR_KEY_ARP, /* struct flow_dissector_key_arp */
 	FLOW_DISSECTOR_KEY_VLAN, /* struct flow_dissector_key_flow_vlan */
 	FLOW_DISSECTOR_KEY_FLOW_LABEL, /* struct flow_dissector_key_flow_tags */
 	FLOW_DISSECTOR_KEY_GRE_KEYID, /* struct flow_dissector_key_keyid */
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index fe4e1531976c..5b3800fe20f3 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -138,6 +138,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 	struct flow_dissector_key_control *key_control;
 	struct flow_dissector_key_basic *key_basic;
 	struct flow_dissector_key_addrs *key_addrs;
+	struct flow_dissector_key_arp *key_arp;
 	struct flow_dissector_key_ports *key_ports;
 	struct flow_dissector_key_icmp *key_icmp;
 	struct flow_dissector_key_tags *key_tags;
@@ -379,6 +380,62 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 
 		nhoff += FCOE_HEADER_LEN;
 		goto out_good;
+
+	case htons(ETH_P_ARP):
+	case htons(ETH_P_RARP): {
+		struct {
+			unsigned char ar_sha[ETH_ALEN];
+			unsigned char ar_sip[4];
+			unsigned char ar_tha[ETH_ALEN];
+			unsigned char ar_tip[4];
+		} *arp_eth, _arp_eth;
+		const struct arphdr *arp;
+		struct arphdr *_arp;
+
+		arp = __skb_header_pointer(skb, nhoff, sizeof(_arp), data,
+					   hlen, &_arp);
+		if (!arp)
+			goto out_bad;
+
+		if (arp->ar_hrd != htons(ARPHRD_ETHER) ||
+		    arp->ar_pro != htons(ETH_P_IP) ||
+		    arp->ar_hln != ETH_ALEN ||
+		    arp->ar_pln != 4 ||
+		    (arp->ar_op != htons(ARPOP_REPLY) &&
+		     arp->ar_op != htons(ARPOP_REQUEST)))
+			goto out_bad;
+
+		arp_eth = __skb_header_pointer(skb, nhoff + sizeof(_arp),
+					       sizeof(_arp_eth), data,
+					       hlen - sizeof(_arp),
+					       &_arp_eth);
+		if (!arp)
+			goto out_bad;
+
+		if (dissector_uses_key(flow_dissector,
+				       FLOW_DISSECTOR_KEY_ARP)) {
+
+			key_arp = skb_flow_dissector_target(flow_dissector,
+							    FLOW_DISSECTOR_KEY_ARP,
+							    target_container);
+
+			memcpy(&key_arp->sip, arp_eth->ar_sip,
+			       sizeof(key_arp->sip));
+			memcpy(&key_arp->tip, arp_eth->ar_tip,
+			       sizeof(key_arp->tip));
+
+			/* Only store the lower byte of the opcode;
+			 * this covers ARPOP_REPLY and ARPOP_REQUEST.
+			 */
+			key_arp->op = ntohs(arp->ar_op) & 0xff;
+
+			ether_addr_copy(key_arp->sha, arp_eth->ar_sha);
+			ether_addr_copy(key_arp->tha, arp_eth->ar_tha);
+		}
+
+		goto out_good;
+	}
+
 	default:
 		goto out_bad;
 	}
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related

* [PATCH/RFC net-next 2/2] net/sched: cls_flower: Support matching on ARP
From: Simon Horman @ 2017-01-11 10:02 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: Dinan Gunawardena, netdev, oss-drivers, Simon Horman
In-Reply-To: <1484128942-11745-1-git-send-email-simon.horman@netronome.com>

Support matching on ARP operation, and hardware and protocol addresses
for Ethernet hardware and IPv4 protocol addresses.

Example usage:

tc qdisc add dev eth0 ingress

tc filter add dev eth0 protocol arp parent ffff: flower indev eth0 \
	arp_op request arp_sip 10.0.0.1 action drop
tc filter add dev eth0 protocol rarp parent ffff: flower indev eth0 \
	arp_op reply arp_tha 52:54:3f:00:00:00/24 action drop

Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 include/uapi/linux/pkt_cls.h | 11 ++++++++++
 net/sched/cls_flower.c       | 51 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)

diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
index a081efbd61a2..1e5e1ddfdaca 100644
--- a/include/uapi/linux/pkt_cls.h
+++ b/include/uapi/linux/pkt_cls.h
@@ -416,6 +416,17 @@ enum {
 	TCA_FLOWER_KEY_ICMPV6_TYPE,	/* u8 */
 	TCA_FLOWER_KEY_ICMPV6_TYPE_MASK,/* u8 */
 
+	TCA_FLOWER_KEY_ARP_SIP,		/* be32 */
+	TCA_FLOWER_KEY_ARP_SIP_MASK,	/* be32 */
+	TCA_FLOWER_KEY_ARP_TIP,		/* be32 */
+	TCA_FLOWER_KEY_ARP_TIP_MASK,	/* be32 */
+	TCA_FLOWER_KEY_ARP_OP,		/* u8 */
+	TCA_FLOWER_KEY_ARP_OP_MASK,	/* u8 */
+	TCA_FLOWER_KEY_ARP_SHA,		/* ETH_ALEN */
+	TCA_FLOWER_KEY_ARP_SHA_MASK,	/* ETH_ALEN */
+	TCA_FLOWER_KEY_ARP_THA,		/* ETH_ALEN */
+	TCA_FLOWER_KEY_ARP_THA_MASK,	/* ETH_ALEN */
+
 	__TCA_FLOWER_MAX,
 };
 
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 970db7a41684..a3bfda3091a4 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -40,6 +40,7 @@ struct fl_flow_key {
 	};
 	struct flow_dissector_key_ports tp;
 	struct flow_dissector_key_icmp icmp;
+	struct flow_dissector_key_arp arp;
 	struct flow_dissector_key_keyid enc_key_id;
 	union {
 		struct flow_dissector_key_ipv4_addrs enc_ipv4;
@@ -401,6 +402,16 @@ static const struct nla_policy fl_policy[TCA_FLOWER_MAX + 1] = {
 	[TCA_FLOWER_KEY_ICMPV6_TYPE_MASK] = { .type = NLA_U8 },
 	[TCA_FLOWER_KEY_ICMPV6_CODE]	= { .type = NLA_U8 },
 	[TCA_FLOWER_KEY_ICMPV6_CODE_MASK] = { .type = NLA_U8 },
+	[TCA_FLOWER_KEY_ARP_SIP]	= { .type = NLA_U32 },
+	[TCA_FLOWER_KEY_ARP_SIP_MASK]	= { .type = NLA_U32 },
+	[TCA_FLOWER_KEY_ARP_TIP]	= { .type = NLA_U32 },
+	[TCA_FLOWER_KEY_ARP_TIP_MASK]	= { .type = NLA_U32 },
+	[TCA_FLOWER_KEY_ARP_OP]		= { .type = NLA_U8 },
+	[TCA_FLOWER_KEY_ARP_OP_MASK]	= { .type = NLA_U8 },
+	[TCA_FLOWER_KEY_ARP_SHA]	= { .len = ETH_ALEN },
+	[TCA_FLOWER_KEY_ARP_SHA_MASK]	= { .len = ETH_ALEN },
+	[TCA_FLOWER_KEY_ARP_THA]	= { .len = ETH_ALEN },
+	[TCA_FLOWER_KEY_ARP_THA_MASK]	= { .len = ETH_ALEN },
 };
 
 static void fl_set_key_val(struct nlattr **tb,
@@ -572,6 +583,23 @@ static int fl_set_key(struct net *net, struct nlattr **tb,
 			       &mask->icmp.code,
 			       TCA_FLOWER_KEY_ICMPV4_CODE_MASK,
 			       sizeof(key->icmp.code));
+	} else if (key->basic.n_proto == htons(ETH_P_ARP) ||
+		   key->basic.n_proto == htons(ETH_P_RARP)) {
+		fl_set_key_val(tb, &key->arp.sip, TCA_FLOWER_KEY_ARP_SIP,
+			       &mask->arp.sip, TCA_FLOWER_KEY_ARP_SIP_MASK,
+			       sizeof(key->arp.sip));
+		fl_set_key_val(tb, &key->arp.tip, TCA_FLOWER_KEY_ARP_TIP,
+			       &mask->arp.tip, TCA_FLOWER_KEY_ARP_TIP_MASK,
+			       sizeof(key->arp.tip));
+		fl_set_key_val(tb, &key->arp.op, TCA_FLOWER_KEY_ARP_OP,
+			       &mask->arp.op, TCA_FLOWER_KEY_ARP_OP_MASK,
+			       sizeof(key->arp.op));
+		fl_set_key_val(tb, key->arp.sha, TCA_FLOWER_KEY_ARP_SHA,
+			       mask->arp.sha, TCA_FLOWER_KEY_ARP_SHA_MASK,
+			       sizeof(key->arp.sha));
+		fl_set_key_val(tb, key->arp.tha, TCA_FLOWER_KEY_ARP_THA,
+			       mask->arp.tha, TCA_FLOWER_KEY_ARP_THA_MASK,
+			       sizeof(key->arp.tha));
 	}
 
 	if (tb[TCA_FLOWER_KEY_ENC_IPV4_SRC] ||
@@ -689,6 +717,8 @@ static void fl_init_dissector(struct cls_fl_head *head,
 	FL_KEY_SET_IF_MASKED(&mask->key, keys, cnt,
 			     FLOW_DISSECTOR_KEY_ICMP, icmp);
 	FL_KEY_SET_IF_MASKED(&mask->key, keys, cnt,
+			     FLOW_DISSECTOR_KEY_ARP, arp);
+	FL_KEY_SET_IF_MASKED(&mask->key, keys, cnt,
 			     FLOW_DISSECTOR_KEY_VLAN, vlan);
 	FL_KEY_SET_IF_MASKED(&mask->key, keys, cnt,
 			     FLOW_DISSECTOR_KEY_ENC_KEYID, enc_key_id);
@@ -1112,6 +1142,27 @@ static int fl_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
 				  TCA_FLOWER_KEY_ICMPV6_CODE_MASK,
 				  sizeof(key->icmp.code))))
 		goto nla_put_failure;
+	else if ((key->basic.n_proto == htons(ETH_P_ARP) ||
+		  key->basic.n_proto == htons(ETH_P_RARP)) &&
+		 (fl_dump_key_val(skb, &key->arp.sip,
+				  TCA_FLOWER_KEY_ARP_SIP, &mask->arp.sip,
+				  TCA_FLOWER_KEY_ARP_SIP_MASK,
+				  sizeof(key->arp.sip)) ||
+		  fl_dump_key_val(skb, &key->arp.tip,
+				  TCA_FLOWER_KEY_ARP_TIP, &mask->arp.tip,
+				  TCA_FLOWER_KEY_ARP_TIP_MASK,
+				  sizeof(key->arp.tip)) ||
+		  fl_dump_key_val(skb, &key->arp.op,
+				  TCA_FLOWER_KEY_ARP_OP, &mask->arp.op,
+				  TCA_FLOWER_KEY_ARP_OP_MASK,
+				  sizeof(key->arp.op)) ||
+		  fl_dump_key_val(skb, key->arp.sha, TCA_FLOWER_KEY_ARP_SHA,
+				  mask->arp.sha, TCA_FLOWER_KEY_ARP_SHA_MASK,
+				  sizeof(key->arp.sha)) ||
+		  fl_dump_key_val(skb, key->arp.tha, TCA_FLOWER_KEY_ARP_THA,
+				  mask->arp.tha, TCA_FLOWER_KEY_ARP_THA_MASK,
+				  sizeof(key->arp.tha))))
+		goto nla_put_failure;
 
 	if (key->enc_control.addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS &&
 	    (fl_dump_key_val(skb, &key->enc_ipv4.src,
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related

* [PATCH/RFC iproute2/net-next 0/2] net/sched: cls_flower: Support matching ARP
From: Simon Horman @ 2017-01-11 10:03 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Dinan Gunawardena, netdev, Simon Horman

Add support for support matching on ARP operation, and hardware and
protocol addresses for Ethernet hardware and IPv4 protocol addresses.

Simon Horman (2):
  tc: flower: update headers for TCA_FLOWER_KEY_ARP*
  tc: flower: Support matching ARP

 include/linux/pkt_cls.h |  11 +++
 man/man8/tc-flower.8    |  41 +++++++++-
 tc/f_flower.c           | 208 ++++++++++++++++++++++++++++++++++++++++++++----
 3 files changed, 243 insertions(+), 17 deletions(-)

-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply

* [PATCH/RFC iproute2/net-next 1/2] tc: flower: update headers for TCA_FLOWER_KEY_ARP*
From: Simon Horman @ 2017-01-11 10:03 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Dinan Gunawardena, netdev, Simon Horman
In-Reply-To: <1484128984-11891-1-git-send-email-simon.horman@netronome.com>

These are proposed changes for net-next.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 include/linux/pkt_cls.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index a081efbd61a2..1e5e1ddfdaca 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -416,6 +416,17 @@ enum {
 	TCA_FLOWER_KEY_ICMPV6_TYPE,	/* u8 */
 	TCA_FLOWER_KEY_ICMPV6_TYPE_MASK,/* u8 */
 
+	TCA_FLOWER_KEY_ARP_SIP,		/* be32 */
+	TCA_FLOWER_KEY_ARP_SIP_MASK,	/* be32 */
+	TCA_FLOWER_KEY_ARP_TIP,		/* be32 */
+	TCA_FLOWER_KEY_ARP_TIP_MASK,	/* be32 */
+	TCA_FLOWER_KEY_ARP_OP,		/* u8 */
+	TCA_FLOWER_KEY_ARP_OP_MASK,	/* u8 */
+	TCA_FLOWER_KEY_ARP_SHA,		/* ETH_ALEN */
+	TCA_FLOWER_KEY_ARP_SHA_MASK,	/* ETH_ALEN */
+	TCA_FLOWER_KEY_ARP_THA,		/* ETH_ALEN */
+	TCA_FLOWER_KEY_ARP_THA_MASK,	/* ETH_ALEN */
+
 	__TCA_FLOWER_MAX,
 };
 
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related

* [PATCH/RFC iproute2/net-next 2/2] tc: flower: Support matching ARP
From: Simon Horman @ 2017-01-11 10:03 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Dinan Gunawardena, netdev, Simon Horman
In-Reply-To: <1484128984-11891-1-git-send-email-simon.horman@netronome.com>

Support matching on ARP operation, and hardware and protocol addresses
for Ethernet hardware and IPv4 protocol addresses.

Example usage:

tc qdisc add dev eth0 ingress

tc filter add dev eth0 protocol arp parent ffff: flower indev eth0 \                    arp_op request arp_sip 10.0.0.1 action drop
tc filter add dev eth0 protocol rarp parent ffff: flower indev eth0 \                   arp_op reply arp_tha 52:54:3f:00:00:00/24 action drop

Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 man/man8/tc-flower.8 |  41 +++++++++-
 tc/f_flower.c        | 208 +++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 232 insertions(+), 17 deletions(-)

diff --git a/man/man8/tc-flower.8 b/man/man8/tc-flower.8
index 5904a9ecafdf..2dd2c5e6e4a5 100644
--- a/man/man8/tc-flower.8
+++ b/man/man8/tc-flower.8
@@ -34,7 +34,13 @@ flower \- flow based traffic control filter
 .BR dst_ip " | " src_ip " } "
 .IR PREFIX " | { "
 .BR dst_port " | " src_port " } "
-.IR port_number " } | "
+.IR port_number " } | { "
+.BR arp_tip " | " arp_sip " } "
+.IR PREFIX " | "
+.BR arp_op " { " request " | " reply " | "
+.IR OP " } | { "
+.BR arp_tha " | " arp_sha " } "
+.IR MASKED_LLADDR " | "
 .B enc_key_id
 .IR KEY-ID " | {"
 .BR enc_dst_ip " | " enc_src_ip " } { "
@@ -131,6 +137,36 @@ Match on ICMP type or code. Only available for
 .BR ip_proto " values " icmp  " and " icmpv6
 which have to be specified in beforehand.
 .TP
+.BI arp_tip " PREFIX"
+.TQ
+.BI arp_sip " PREFIX"
+Match on ARP or RARP sender or target IP address.
+.I PREFIX
+must be a valid IPv4 address optionally followed by a slash and the prefix
+length. If the prefix is missing, \fBtc\fR assumes a full-length host
+match.
+.TP
+.BI arp_op " ARP_OP"
+Match on ARP or RARP operation.
+.I ARP_OP
+may be
+.BR request ", " reply
+or an integer value 0, 1 or 2.  A mask may be optionally provided to limit
+the bits of the operation which are matched. A mask is provided by
+following the address with a slash and then the mask. It may be provided as
+an unsigned 8 bit value representing a bitwise mask. If the mask is missing
+then a match on all bits is assumed.
+.TP
+.BI arp_sha " MASKED_LLADDR"
+.TQ
+.BI arp_tha " MASKED_LLADDR"
+Match on ARP or RARP sender or target MAC address.  A mask may be optionally
+provided to limit the bits of the address which are matched. A mask is
+provided by following the address with a slash and then the mask. It may be
+provided in LLADDR format, in which case it is a bitwise mask, or as a
+number of high bits to match. If the mask is missing then a match on all
+bits is assumed.
+.TP
 .BI enc_key_id " NUMBER"
 .TQ
 .BI enc_dst_ip " PREFIX"
@@ -152,7 +188,8 @@ As stated above where applicable, matches of a certain layer implicitly depend
 on the matches of the next lower layer. Precisely, layer one and two matches
 (\fBindev\fR,  \fBdst_mac\fR and \fBsrc_mac\fR)
 have no dependency, layer three matches
-(\fBip_proto\fR, \fBdst_ip\fR and \fBsrc_ip\fR)
+(\fBip_proto\fR, \fBdst_ip\fR, \fBsrc_ip\fR, \fBarp_tip\fR, \fBarp_sip\fR,
+\fBarp_op\fR, \fBarp_tha\fR and \fBarp_sha\fR)
 depend on the
 .B protocol
 option of tc filter, layer four port matches
diff --git a/tc/f_flower.c b/tc/f_flower.c
index 99f5f8163ee0..d301db36a549 100644
--- a/tc/f_flower.c
+++ b/tc/f_flower.c
@@ -15,6 +15,7 @@
 #include <syslog.h>
 #include <string.h>
 #include <net/if.h>
+#include <linux/if_arp.h>
 #include <linux/if_ether.h>
 #include <linux/ip.h>
 #include <linux/tc_act/tc_vlan.h>
@@ -54,6 +55,11 @@ static void explain(void)
 		"                       src_port PORT-NUMBER |\n"
 		"                       type ICMP-TYPE |\n"
 		"                       code ICMP-CODE |\n"
+		"                       arp_tip PREFIX |\n"
+		"                       arp_sip PREFIX |\n"
+		"                       arp_op [ request | reply | OP ] |\n"
+		"                       arp_tha MASKED-LLADDR |\n"
+		"                       arp_sha MASKED-LLADDR |\n"
 		"                       enc_dst_ip [ IPV4-ADDR | IPV6-ADDR ] |\n"
 		"                       enc_src_ip [ IPV4-ADDR | IPV6-ADDR ] |\n"
 		"                       enc_key_id [ KEY-ID ] |\n"
@@ -192,27 +198,16 @@ err:
 	return -1;
 }
 
-static int flower_parse_ip_addr(char *str, __be16 eth_type,
-				int addr4_type, int mask4_type,
-				int addr6_type, int mask6_type,
-				struct nlmsghdr *n)
+static int __flower_parse_ip_addr(char *str, int family,
+				  int addr4_type, int mask4_type,
+				  int addr6_type, int mask6_type,
+				  struct nlmsghdr *n)
 {
 	int ret;
 	inet_prefix addr;
-	int family;
 	int bits;
 	int i;
 
-	if (eth_type == htons(ETH_P_IP)) {
-		family = AF_INET;
-	} else if (eth_type == htons(ETH_P_IPV6)) {
-		family = AF_INET6;
-	} else if (!eth_type) {
-		family = AF_UNSPEC;
-	} else {
-		return -1;
-	}
-
 	ret = get_prefix(&addr, str, family);
 	if (ret)
 		return -1;
@@ -245,6 +240,89 @@ static int flower_parse_ip_addr(char *str, __be16 eth_type,
 	return 0;
 }
 
+static int flower_parse_ip_addr(char *str, __be16 eth_type,
+				int addr4_type, int mask4_type,
+				int addr6_type, int mask6_type,
+				struct nlmsghdr *n)
+{
+	int family;
+
+	if (eth_type == htons(ETH_P_IP)) {
+		family = AF_INET;
+	} else if (eth_type == htons(ETH_P_IPV6)) {
+		family = AF_INET6;
+	} else if (!eth_type) {
+		family = AF_UNSPEC;
+	} else {
+		return -1;
+	}
+
+	return __flower_parse_ip_addr(str, family, addr4_type, addr6_type,
+				      mask4_type, mask6_type, n);
+}
+
+static bool flower_eth_type_arp(__be16 eth_type)
+{
+	return eth_type == htons(ETH_P_ARP) || eth_type == htons(ETH_P_RARP);
+}
+
+static int flower_parse_arp_ip_addr(char *str, __be16 eth_type,
+				    int addr_type, int mask_type,
+				    struct nlmsghdr *n)
+{
+	if (!flower_eth_type_arp(eth_type))
+		return -1;
+
+	return __flower_parse_ip_addr(str, AF_INET, addr_type, mask_type,
+				      TCA_FLOWER_UNSPEC, TCA_FLOWER_UNSPEC, n);
+}
+
+static int flower_parse_arp_op(char *str, __be16 eth_type,
+			       int op_type, int mask_type,
+			       struct nlmsghdr *n)
+{
+	char *slash;
+	int ret, err = -1;
+	uint8_t value, mask;
+
+	slash = strchr(str, '/');
+	if (slash)
+		*slash = '\0';
+
+	if (!flower_eth_type_arp(eth_type))
+		goto err;
+
+	if (!strcmp(str, "request")) {
+		value = ARPOP_REQUEST;
+	} else if (!strcmp(str, "reply")) {
+		value = ARPOP_REPLY;
+	} else {
+		ret = get_u8(&value, str, 10);
+		if (ret)
+			goto err;
+		if (value && value != ARPOP_REQUEST && value != ARPOP_REPLY)
+			goto err;
+	}
+
+	if (slash) {
+		ret = get_u8(&mask, slash + 1, 10);
+		if (ret)
+			goto err;
+	}
+	else {
+		mask = UINT8_MAX;
+	}
+
+	addattr8(n, MAX_MSG, op_type, value);
+	addattr8(n, MAX_MSG, mask_type, mask);
+
+	err = 0;
+err:
+	if (slash)
+		*slash = '/';
+	return err;
+}
+
 static int flower_icmp_attr_type(__be16 eth_type, __u8 ip_proto,
 				 enum flower_icmp_field field)
 {
@@ -530,6 +608,59 @@ static int flower_parse_opt(struct filter_util *qu, char *handle,
 				fprintf(stderr, "Illegal \"icmp code\"\n");
 				return -1;
 			}
+		} else if (matches(*argv, "arp_tip") == 0) {
+			NEXT_ARG();
+			ret = flower_parse_arp_ip_addr(*argv, vlan_ethtype ?
+						       vlan_ethtype : eth_type,
+						       TCA_FLOWER_KEY_ARP_TIP,
+						       TCA_FLOWER_KEY_ARP_TIP_MASK,
+						       n);
+			if (ret < 0) {
+				fprintf(stderr, "Illegal \"arp_tip\"\n");
+				return -1;
+			}
+		} else if (matches(*argv, "arp_sip") == 0) {
+			NEXT_ARG();
+			ret = flower_parse_arp_ip_addr(*argv, vlan_ethtype ?
+						       vlan_ethtype : eth_type,
+						       TCA_FLOWER_KEY_ARP_SIP,
+						       TCA_FLOWER_KEY_ARP_SIP_MASK,
+						       n);
+			if (ret < 0) {
+				fprintf(stderr, "Illegal \"arp_sip\"\n");
+				return -1;
+			}
+		} else if (matches(*argv, "arp_op") == 0) {
+			NEXT_ARG();
+			ret = flower_parse_arp_op(*argv, vlan_ethtype ?
+						  vlan_ethtype : eth_type,
+						  TCA_FLOWER_KEY_ARP_OP,
+						  TCA_FLOWER_KEY_ARP_OP_MASK,
+						  n);
+			if (ret < 0) {
+				fprintf(stderr, "Illegal \"arp_op\"\n");
+				return -1;
+			}
+		} else if (matches(*argv, "arp_tha") == 0) {
+			NEXT_ARG();
+			ret = flower_parse_eth_addr(*argv,
+						    TCA_FLOWER_KEY_ARP_THA,
+						    TCA_FLOWER_KEY_ARP_THA_MASK,
+						    n);
+			if (ret < 0) {
+				fprintf(stderr, "Illegal \"arp_tha\"\n");
+				return -1;
+			}
+		} else if (matches(*argv, "arp_sha") == 0) {
+			NEXT_ARG();
+			ret = flower_parse_eth_addr(*argv,
+						    TCA_FLOWER_KEY_ARP_SHA,
+						    TCA_FLOWER_KEY_ARP_SHA_MASK,
+						    n);
+			if (ret < 0) {
+				fprintf(stderr, "Illegal \"arp_sha\"\n");
+				return -1;
+			}
 		} else if (matches(*argv, "enc_dst_ip") == 0) {
 			NEXT_ARG();
 			ret = flower_parse_ip_addr(*argv, 0,
@@ -662,6 +793,10 @@ static void flower_print_eth_type(FILE *f, __be16 *p_eth_type,
 		fprintf(f, "ipv4");
 	else if (eth_type == htons(ETH_P_IPV6))
 		fprintf(f, "ipv6");
+	else if (eth_type == htons(ETH_P_ARP))
+		fprintf(f, "arp");
+	else if (eth_type == htons(ETH_P_RARP))
+		fprintf(f, "rarp");
 	else
 		fprintf(f, "%04x", ntohs(eth_type));
 	*p_eth_type = eth_type;
@@ -739,6 +874,13 @@ static void flower_print_ip_addr(FILE *f, char *name, __be16 eth_type,
 	else if (bits < len * 8)
 		fprintf(f, "/%d", bits);
 }
+static void flower_print_ip4_addr(FILE *f, char *name,
+				  struct rtattr *addr_attr,
+				  struct rtattr *mask_attr)
+{
+	return flower_print_ip_addr(f, name, htons(ETH_P_IP),
+				    addr_attr, mask_attr, 0, 0);
+}
 
 static void flower_print_port(FILE *f, char *name, struct rtattr *attr)
 {
@@ -759,6 +901,31 @@ static void flower_print_icmp(FILE *f, char *name, struct rtattr *attr)
 		fprintf(f, "\n  %s %d", name, rta_getattr_u8(attr));
 }
 
+static void flower_print_arp_op(FILE *f, char *name,
+				struct rtattr *op_attr,
+				struct rtattr *mask_attr)
+{
+	uint8_t op, mask;
+
+	if (!op_attr)
+		return;
+
+	op = rta_getattr_u8(op_attr);
+	mask = mask_attr ? rta_getattr_u8(mask_attr) : UINT8_MAX;
+
+	fprintf(f, "\n  %s ", name);
+
+	if (mask == UINT8_MAX && op == ARPOP_REQUEST)
+		fprintf(f, "request");
+	else if (mask == UINT8_MAX && op == ARPOP_REPLY)
+		fprintf(f, "reply");
+	else
+		fprintf(f, "%d", op);
+
+	if (mask != UINT8_MAX)
+		fprintf(f, "/%d", mask);
+}
+
 static int flower_print_opt(struct filter_util *qu, FILE *f,
 			    struct rtattr *opt, __u32 handle)
 {
@@ -834,6 +1001,17 @@ static int flower_print_opt(struct filter_util *qu, FILE *f,
 	if (nl_type >= 0)
 		flower_print_icmp(f, "icmp_code", tb[nl_type]);
 
+	flower_print_ip4_addr(f, "arp_sip", tb[TCA_FLOWER_KEY_ARP_SIP],
+			     tb[TCA_FLOWER_KEY_ARP_SIP_MASK]);
+	flower_print_ip4_addr(f, "arp_tip", tb[TCA_FLOWER_KEY_ARP_TIP],
+			     tb[TCA_FLOWER_KEY_ARP_TIP_MASK]);
+	flower_print_arp_op(f, "arp_op", tb[TCA_FLOWER_KEY_ARP_OP],
+			    tb[TCA_FLOWER_KEY_ARP_OP_MASK]);
+	flower_print_eth_addr(f, "arp_sha", tb[TCA_FLOWER_KEY_ARP_SHA],
+			      tb[TCA_FLOWER_KEY_ARP_SHA_MASK]);
+	flower_print_eth_addr(f, "arp_tha", tb[TCA_FLOWER_KEY_ARP_THA],
+			      tb[TCA_FLOWER_KEY_ARP_THA_MASK]);
+
 	flower_print_ip_addr(f, "enc_dst_ip",
 			     tb[TCA_FLOWER_KEY_ENC_IPV4_DST_MASK] ?
 			     htons(ETH_P_IP) : htons(ETH_P_IPV6),
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related

* Re: next-20170110 build: 1 failures 4 warnings (next-20170110)
From: Sekhar Nori @ 2017-01-11 10:09 UTC (permalink / raw)
  To: Stephen Rothwell, Mark Brown
  Cc: linaro-kernel, kernel-build-reports, netdev, stephen hemminger,
	Michael Scherban, linux-next, Murali Karicheri, J, KEERTHY,
	David S. Miller, linux-arm-kernel
In-Reply-To: <20170111072131.51449059@canb.auug.org.au>

On Wednesday 11 January 2017 01:51 AM, Stephen Rothwell wrote:
> Hi Mark,
> 
> On Tue, 10 Jan 2017 18:16:07 +0000 Mark Brown <broonie@kernel.org> wrote:
>>
>> On Tue, Jan 10, 2017 at 07:21:32AM +0000, Build bot for Mark Brown wrote:
>>
>> Today's -next fails to build an arm allmodconfig due to:
>>
>>> 	arm-allmodconfig
>>> ../drivers/net/ethernet/ti/netcp_core.c:1951:28: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]  
>>
>> caused by 6a8162e99ef344 (net: netcp: store network statistics in 64
>> bits).  It's assigning the function
>>
>>   static struct rtnl_link_stats64 *
>>   netcp_get_stats(struct net_device *ndev, struct rtnl_link_stats64 *stats)
>>
>> to ndo_get_stats64 which expects a function returning void.
> 
> Yes, but only because commit bc1f44709cf2 ("net: make ndo_get_stats64 a
> void function") entered the net-next tree on the same day ... so it
> needs a followup fixup patch for this new usage.

Keerthy sent a patch fixing this yesterday. Looks like he will have to
spin another version though.

https://patchwork.ozlabs.org/patch/713224/

Thanks,
Sekhar

^ permalink raw reply

* Re: net/atm: warning in alloc_tx/__might_sleep
From: Andrey Konovalov @ 2017-01-11 10:18 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Cong Wang, David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, netdev, LKML, Al Viro,
	Dmitry Vyukov, Kostya Serebryany, syzkaller
In-Reply-To: <CANn89iLxQPAt0e5Yc0yYFFQtoQwuRsdAwH9m1d4oqWQ3W=DZTQ@mail.gmail.com>

On Tue, Jan 10, 2017 at 6:40 PM, Eric Dumazet <edumazet@google.com> wrote:
> On Tue, Jan 10, 2017 at 9:35 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>> On Mon, Jan 9, 2017 at 9:20 AM, Andrey Konovalov <andreyknvl@google.com> wrote:
>>
>> The fix should be straight-forward. Mind to try the attached patch?

Hi Cong,

Your patch with schedule() removed as suggested by Eric fixes the issue.

Tested-by: Andrey Konovalov <andreyknvl@google.com>

Thanks!

>
>
> You forgot to remove schedule() ?
>
>   schedule();
> + wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);

^ permalink raw reply

* Re: [PATCH/RFC net-next 0/2] net/sched: cls_flower: Support matching ARP
From: Jiri Pirko @ 2017-01-11 10:27 UTC (permalink / raw)
  To: Simon Horman; +Cc: Jiri Pirko, Dinan Gunawardena, netdev, oss-drivers
In-Reply-To: <1484128942-11745-1-git-send-email-simon.horman@netronome.com>

Wed, Jan 11, 2017 at 11:02:20AM CET, simon.horman@netronome.com wrote:
>Add support for support matching on ARP operation, and hardware and
>protocol addresses for Ethernet hardware and IPv4 protocol addresses.

This patchset looks fine to me. Please feel free to submit it.

Thanks!

^ permalink raw reply

* Re: [PATCH v2 2/2] stmmac: rename it to synopsys
From: Joao Pinto @ 2017-01-11 10:35 UTC (permalink / raw)
  To: Jie Deng, Joao Pinto, davem
  Cc: lars.persson, niklass, peppe.cavallaro, alexandre.torgue, netdev,
	CARLOS.PALMINHA
In-Reply-To: <40521f32-436d-b31d-92a4-4cff97f3411d@synopsys.com>

Hi Jie,

Às 4:00 AM de 1/11/2017, Jie Deng escreveu:
> Hi Joao,
> 
> 
> On 2017/1/10 22:52, Joao Pinto wrote:
>> This patch renames stmicro/stmmac to synopsys/ since it is a standard
>> ethernet software package regarding synopsys ethernet controllers, supporting
>> the majority of Synopsys Ethernet IPs. The config IDs remain the same, for
>> retro-compatibility, only the description was changed.
>>
>> Signed-off-by: Joao Pinto <jpinto@synopsys.com>
>> ---
>> changes v1->v2:
>> - nothing changed. Just to keep up with patch set version
>>
>> @@ -1,5 +1,5 @@
>>  config STMMAC_ETH
>> -	tristate "STMicroelectronics 10/100/1000 Ethernet driver"
>> +	tristate "Synopsys Ethernet drivers"
>>  	depends on HAS_IOMEM && HAS_DMA
>>  	select MII
>>  	select PHYLIB
>> @@ -14,7 +14,7 @@ config STMMAC_ETH
>>  if STMMAC_ETH
>>  
> "Synopsys Ethernet drivers" is too generic. The name should reflect the
> controller. This driver is for Synopsys GMAC 10M/100M/1G IPs. We will submit a
> driver for the new 25G/40G/50G/100G XLGMAC IP in the future.

As you know Synopsys is an IP vendor that as a wide range of IPs related to
Ethernet. stmmac is a driver that was well built and well maintained and
supports most of those Ethernet IPs, so it has the potential to be the official
Synopsys Ethernet driver suite in the future.

Let's make baby steps. For now stmmac supports 10M/100M/1G and also QoS which is
a separated IP and the different IP cores are selected by device tree.

In the future it would be usefull to be selectable by Kconfig options, making it
more clear to the kernel user. For example:

Synopsys Ethernet drivers
  eQoS Core
  10M Core
  100M Core
  1G Core
  25G Core
  ....

The XLGMAC will be great for our users and I will be 100% available to help you
with it.

Thanks,
Joao

>>  config STMMAC_PLATFORM
>> -	tristate "STMMAC Platform bus support"
>> +	tristate "Platform bus support"
>>  	depends on STMMAC_ETH
>>  	select MFD_SYSCON
>>  	default y
>> @@ -149,13 +149,13 @@ config DWMAC_SUNXI
>>  endif
>>  
>>  config STMMAC_PCI
>> -	tristate "STMMAC PCI bus support"
>> +	tristate "PCI bus support"
>>  	depends on STMMAC_ETH && PCI
>>  	---help---
>>  	  This is to select the Synopsys DWMAC available on PCI devices,
>>  	  if you have a controller with this interface, say Y or M here.
>>  
>> -	  This PCI support is tested on XLINX XC2V3000 FF1152AMT0221
>> +	  This PCI support was tested on XLINX XC2V3000 FF1152AMT0221
>>  	  D1215994A VIRTEX FPGA board.
> The name is also too generic. Please try to reflect the controller.
> 
> Thanks,
> Jie
> 

^ permalink raw reply

* Re: [PATCH net-next] bridge: multicast to unicast
From: IgorMitsyanko @ 2017-01-11 11:26 UTC (permalink / raw)
  To: Felix Fietkau, Johannes Berg, Linus Lüssing,
	Stephen Hemminger
  Cc: netdev, bridge, linux-wireless, linux-kernel, David S . Miller,
	M. Braun
In-Reply-To: <73f29777-cf95-de99-f7a9-9d82e94c298d@nbd.name>

On 01/11/2017 12:27 AM, Felix Fietkau wrote:
> On 2017-01-10 11:56, Johannes Berg wrote:
>> On Tue, 2017-01-10 at 05:18 +0100, Linus Lüssing wrote:
>>> On Mon, Jan 09, 2017 at 01:30:32PM -0800, Stephen Hemminger wrote:
>>>> I wonder if MAC80211 should be doing IGMP snooping and not bridge
>>>> in this environment.
>>>
>>> In the long term, yes. For now, not quite sure.
>>
>> There's no "for now" in the kernel. Code added now will have to be
>> maintained essentially forever.
> I'm not sure that putting the IGMP snooping code in mac80211 is a good
> idea, that would be quite a bit of code duplication.
> This implementation works, it's very simple, and it's quite flexible for
> a number of use cases.
>
> Is there any remaining objection to merging this in principle (aside
> from potential issues with the code)?
>
> - Felix
>


Hi Felix, can we consider two examples configurations with multicast 
traffic:

1. AP is a source of multicast traffic itself, no bridge on AP. For 
example, wireless video server streaming to several clients.
In this situation, we can not make use of possible advantages given by 
mc-to-uc conversion?

2. A configuration with AP + STA + 3 client devices behind STA.
                             ----|client 1|
                             |
|  mc  |----|AP|----|STA|---|---|client 2|
|server|                    |
                             ----|client 3|

Multicast server behind AP streams MC video traffic. All 3 clients 
behind the STA have joined the multicast group.
I'm not sure if this case will be handled correctly with mc-to-uc 
conversion in bridge on AP?

^ permalink raw reply

* Re: [PATCH net-next] bridge: multicast to unicast
From: Felix Fietkau @ 2017-01-11 11:30 UTC (permalink / raw)
  To: IgorMitsyanko, Johannes Berg, Linus Lüssing,
	Stephen Hemminger
  Cc: netdev, bridge, linux-wireless, linux-kernel, David S . Miller,
	M. Braun
In-Reply-To: <058f2afd-2502-e2e5-6427-1536fcd5851f@quantenna.com>

On 2017-01-11 12:26, IgorMitsyanko wrote:
> On 01/11/2017 12:27 AM, Felix Fietkau wrote:
>> On 2017-01-10 11:56, Johannes Berg wrote:
>>> On Tue, 2017-01-10 at 05:18 +0100, Linus Lüssing wrote:
>>>> On Mon, Jan 09, 2017 at 01:30:32PM -0800, Stephen Hemminger wrote:
>>>>> I wonder if MAC80211 should be doing IGMP snooping and not bridge
>>>>> in this environment.
>>>>
>>>> In the long term, yes. For now, not quite sure.
>>>
>>> There's no "for now" in the kernel. Code added now will have to be
>>> maintained essentially forever.
>> I'm not sure that putting the IGMP snooping code in mac80211 is a good
>> idea, that would be quite a bit of code duplication.
>> This implementation works, it's very simple, and it's quite flexible for
>> a number of use cases.
>>
>> Is there any remaining objection to merging this in principle (aside
>> from potential issues with the code)?
>>
>> - Felix
>>
> 
> 
> Hi Felix, can we consider two examples configurations with multicast 
> traffic:
> 
> 1. AP is a source of multicast traffic itself, no bridge on AP. For 
> example, wireless video server streaming to several clients.
> In this situation, we can not make use of possible advantages given by 
> mc-to-uc conversion?
You could simply put the AP interface in a bridge, no need to have any
other bridge members present.

> 2. A configuration with AP + STA + 3 client devices behind STA.
>                              ----|client 1|
>                              |
> |  mc  |----|AP|----|STA|---|---|client 2|
> |server|                    |
>                              ----|client 3|
> 
> Multicast server behind AP streams MC video traffic. All 3 clients 
> behind the STA have joined the multicast group.
> I'm not sure if this case will be handled correctly with mc-to-uc 
> conversion in bridge on AP?
What do you mean by "3 client devices behind STA"? Are you using a
4-addr STA, multicast routing, or some kind of vendor specific "client
bridge" hackery?

- Felix

^ permalink raw reply

* Re: [PATCH v2 0/2] remove dwc_eth_qos and rename stmicro/stmmac
From: Alexandre Torgue @ 2017-01-11 11:39 UTC (permalink / raw)
  To: Joao Pinto, davem; +Cc: lars.persson, niklass, peppe.cavallaro, netdev
In-Reply-To: <cover.1484059674.git.jpinto@synopsys.com>

Hi Jao,

On 01/10/2017 03:52 PM, Joao Pinto wrote:
> This patch set removes the synopsys/dwc_eth_qos since it was merged recently
> to stmmac (dwmac-dwc-qos-eth glue driver).
>
> It also renames stmicro/stmmac to synopsys/ since it is a standard ethernet
> software package regarding synopsys ethernet controllers, supporting the
> majority of Synopsys Ethernet IPs.

I understand the reason to rename stmmac driver. The only risk I see is 
that usual user will be a little bit lost to find code. It seems there 
no risk of backward compatibility with current/old DT (I assume you 
already checked this point).
Let's see what David think about that but if there no risk of backward 
compatibility with DT, I agree with the series.

Regards
Alex



>
> In the future we should make an effort to migrate to this new synopsys/
> driver package all the Ethernet Synopsys IP drivers scattered in net/ethernet.
>
> Joao Pinto (2):
>   synopsys: remove dwc_eth_qos driver
>   stmmac: rename it to synopsys
>
>  .../bindings/net/{stmmac.txt => synopsys.txt}      |    0
>  MAINTAINERS                                        |   11 +-
>  arch/arm/configs/multi_v7_defconfig                |    3 +-
>  drivers/net/ethernet/Kconfig                       |    3 +-
>  drivers/net/ethernet/Makefile                      |    3 +-
>  drivers/net/ethernet/stmicro/Kconfig               |   21 -
>  drivers/net/ethernet/stmicro/Makefile              |    5 -
>  drivers/net/ethernet/stmicro/stmmac/Kconfig        |  162 --
>  drivers/net/ethernet/stmicro/stmmac/Makefile       |   25 -
>  drivers/net/ethernet/synopsys/Kconfig              |  165 +-
>  drivers/net/ethernet/synopsys/Makefile             |   28 +-
>  .../{stmicro/stmmac => synopsys}/altr_tse_pcs.c    |    0
>  .../{stmicro/stmmac => synopsys}/altr_tse_pcs.h    |    0
>  .../{stmicro/stmmac => synopsys}/chain_mode.c      |    0
>  .../ethernet/{stmicro/stmmac => synopsys}/common.h |    0
>  .../ethernet/{stmicro/stmmac => synopsys}/descs.h  |    0
>  .../{stmicro/stmmac => synopsys}/descs_com.h       |    0
>  drivers/net/ethernet/synopsys/dwc_eth_qos.c        | 2996 --------------------
>  .../stmmac => synopsys}/dwmac-dwc-qos-eth.c        |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-generic.c   |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-ipq806x.c   |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-lpc18xx.c   |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-meson.c     |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-meson8b.c   |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-oxnas.c     |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-rk.c        |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-socfpga.c   |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-sti.c       |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-stm32.c     |    0
>  .../{stmicro/stmmac => synopsys}/dwmac-sunxi.c     |    0
>  .../{stmicro/stmmac => synopsys}/dwmac100.h        |    0
>  .../{stmicro/stmmac => synopsys}/dwmac1000.h       |    0
>  .../{stmicro/stmmac => synopsys}/dwmac1000_core.c  |    0
>  .../{stmicro/stmmac => synopsys}/dwmac1000_dma.c   |    0
>  .../{stmicro/stmmac => synopsys}/dwmac100_core.c   |    0
>  .../{stmicro/stmmac => synopsys}/dwmac100_dma.c    |    0
>  .../ethernet/{stmicro/stmmac => synopsys}/dwmac4.h |    0
>  .../{stmicro/stmmac => synopsys}/dwmac4_core.c     |    0
>  .../{stmicro/stmmac => synopsys}/dwmac4_descs.c    |    0
>  .../{stmicro/stmmac => synopsys}/dwmac4_descs.h    |    0
>  .../{stmicro/stmmac => synopsys}/dwmac4_dma.c      |    0
>  .../{stmicro/stmmac => synopsys}/dwmac4_dma.h      |    0
>  .../{stmicro/stmmac => synopsys}/dwmac4_lib.c      |    0
>  .../{stmicro/stmmac => synopsys}/dwmac_dma.h       |    0
>  .../{stmicro/stmmac => synopsys}/dwmac_lib.c       |    0
>  .../{stmicro/stmmac => synopsys}/enh_desc.c        |    0
>  .../ethernet/{stmicro/stmmac => synopsys}/mmc.h    |    0
>  .../{stmicro/stmmac => synopsys}/mmc_core.c        |    0
>  .../{stmicro/stmmac => synopsys}/norm_desc.c       |    0
>  .../{stmicro/stmmac => synopsys}/ring_mode.c       |    0
>  .../ethernet/{stmicro/stmmac => synopsys}/stmmac.h |    0
>  .../{stmicro/stmmac => synopsys}/stmmac_ethtool.c  |    0
>  .../{stmicro/stmmac => synopsys}/stmmac_hwtstamp.c |    0
>  .../{stmicro/stmmac => synopsys}/stmmac_main.c     |    0
>  .../{stmicro/stmmac => synopsys}/stmmac_mdio.c     |    0
>  .../{stmicro/stmmac => synopsys}/stmmac_pci.c      |    0
>  .../{stmicro/stmmac => synopsys}/stmmac_pcs.h      |    0
>  .../{stmicro/stmmac => synopsys}/stmmac_platform.c |    0
>  .../{stmicro/stmmac => synopsys}/stmmac_platform.h |    0
>  .../{stmicro/stmmac => synopsys}/stmmac_ptp.c      |    0
>  .../{stmicro/stmmac => synopsys}/stmmac_ptp.h      |    0
>  61 files changed, 180 insertions(+), 3242 deletions(-)
>  rename Documentation/devicetree/bindings/net/{stmmac.txt => synopsys.txt} (100%)
>  delete mode 100644 drivers/net/ethernet/stmicro/Kconfig
>  delete mode 100644 drivers/net/ethernet/stmicro/Makefile
>  delete mode 100644 drivers/net/ethernet/stmicro/stmmac/Kconfig
>  delete mode 100644 drivers/net/ethernet/stmicro/stmmac/Makefile
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/altr_tse_pcs.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/altr_tse_pcs.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/chain_mode.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/common.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/descs.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/descs_com.h (100%)
>  delete mode 100644 drivers/net/ethernet/synopsys/dwc_eth_qos.c
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-dwc-qos-eth.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-generic.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-ipq806x.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-lpc18xx.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-meson.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-meson8b.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-oxnas.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-rk.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-socfpga.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-sti.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-stm32.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac-sunxi.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac100.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac1000.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac1000_core.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac1000_dma.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac100_core.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac100_dma.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac4.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac4_core.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac4_descs.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac4_descs.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac4_dma.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac4_dma.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac4_lib.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac_dma.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/dwmac_lib.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/enh_desc.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/mmc.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/mmc_core.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/norm_desc.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/ring_mode.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac_ethtool.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac_hwtstamp.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac_main.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac_mdio.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac_pci.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac_pcs.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac_platform.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac_platform.h (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac_ptp.c (100%)
>  rename drivers/net/ethernet/{stmicro/stmmac => synopsys}/stmmac_ptp.h (100%)
>

^ permalink raw reply

* [PATCH net-next 00/13] s390: qeth patches
From: Ursula Braun @ 2017-01-11 11:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, stable, ubraun

Hi Dave,

here are several fixes for the s390 qeth driver, built for net-next.

Thanks,
Ursula

Julian Wiedmann (8):
  s390/qeth: Allow reading hsuid from sysfs while card is DOWN
  s390/qeth: Remove unused define QETH_IP_HEADER_SIZE
  s390/qeth: drop unused parameter from qeth_l2_del_all_macs()
  s390/qeth: when setting group MAC, don't convert return code twice
  s390/qeth: consolidate errno translation for MAC management
  s390/qeth: extract qeth_l2_remove_mac()
  s390/qeth: shuffle MAC management functions around
  s390/qeth: issue STARTLAN as first IPA command

Thomas Richter (3):
  s390/qeth: rework RX/TX checksum offload command to use call back
    functions
  s390/qeth: test RX/TX checksum offload reply from hardware
  s390/qeth: display warning for OSA3 RX/TX checksum offloading

Ursula Braun (2):
  s390/qeth: fix retrieval of vipa and proxy-arp addresses
  s390/qeth: remove OSN-devices

 drivers/s390/net/qeth_core.h      |  33 ---
 drivers/s390/net/qeth_core_main.c | 188 +++++++++-------
 drivers/s390/net/qeth_core_mpc.c  |   3 -
 drivers/s390/net/qeth_core_mpc.h  |  27 ++-
 drivers/s390/net/qeth_core_sys.c  |  17 --
 drivers/s390/net/qeth_l2_main.c   | 456 +++++++++++---------------------------
 drivers/s390/net/qeth_l3_main.c   |  15 --
 drivers/s390/net/qeth_l3_sys.c    |  33 ++-
 8 files changed, 268 insertions(+), 504 deletions(-)

-- 
2.8.4

^ permalink raw reply

* [PATCH net-next 01/13] s390/qeth: rework RX/TX checksum offload
From: Ursula Braun @ 2017-01-11 11:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, stable, ubraun
In-Reply-To: <20170111115600.4524-1-ubraun@linux.vnet.ibm.com>

From: Thomas Richter <tmricht@linux.vnet.ibm.com>

Rework the RX/TX checksum offloading command sequence to use
the provided function call back mechanims to return card
data to the device driver.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Reviewed-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
 drivers/s390/net/qeth_core.h      |  2 -
 drivers/s390/net/qeth_core_main.c | 96 ++++++++++++++++++++++++++-------------
 drivers/s390/net/qeth_core_mpc.h  |  7 +++
 3 files changed, 72 insertions(+), 33 deletions(-)

diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 6d4b68c4..41e4665 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -674,8 +674,6 @@ struct qeth_card_info {
 	int broadcast_capable;
 	int unique_id;
 	struct qeth_card_blkt blkt;
-	__u32 csum_mask;
-	__u32 tx_csum_mask;
 	enum qeth_ipa_promisc_modes promisc_mode;
 	__u32 diagass_support;
 	__u32 hwtrap;
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index e335583..5ab80ea 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -5289,18 +5289,6 @@ int qeth_setassparms_cb(struct qeth_card *card,
 		if (cmd->hdr.prot_version == QETH_PROT_IPV6)
 			card->options.ipa6.enabled_funcs = cmd->hdr.ipa_enabled;
 	}
-	if (cmd->data.setassparms.hdr.assist_no == IPA_INBOUND_CHECKSUM &&
-	    cmd->data.setassparms.hdr.command_code == IPA_CMD_ASS_START) {
-		card->info.csum_mask = cmd->data.setassparms.data.flags_32bit;
-		QETH_CARD_TEXT_(card, 3, "csum:%d", card->info.csum_mask);
-	}
-	if (cmd->data.setassparms.hdr.assist_no == IPA_OUTBOUND_CHECKSUM &&
-	    cmd->data.setassparms.hdr.command_code == IPA_CMD_ASS_START) {
-		card->info.tx_csum_mask =
-			cmd->data.setassparms.data.flags_32bit;
-		QETH_CARD_TEXT_(card, 3, "tcsu:%d", card->info.tx_csum_mask);
-	}
-
 	return 0;
 }
 EXPORT_SYMBOL_GPL(qeth_setassparms_cb);
@@ -6060,23 +6048,78 @@ int qeth_core_ethtool_get_settings(struct net_device *netdev,
 }
 EXPORT_SYMBOL_GPL(qeth_core_ethtool_get_settings);
 
+/* Callback to handle checksum offload command reply from OSA card.
+ * Verify that required features have been enabled on the card.
+ * Return error in hdr->return_code as this value is checked by caller.
+ *
+ * Always returns zero to indicate no further messages from the OSA card.
+ */
+static int qeth_ipa_checksum_run_cmd_cb(struct qeth_card *card,
+					struct qeth_reply *reply,
+					unsigned long data)
+{
+	struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data;
+	struct qeth_checksum_cmd *chksum_cb =
+				(struct qeth_checksum_cmd *)reply->param;
+
+	QETH_CARD_TEXT(card, 4, "chkdoccb");
+	if (cmd->hdr.return_code)
+		return 0;
+
+	memset(chksum_cb, 0, sizeof(*chksum_cb));
+	if (cmd->data.setassparms.hdr.command_code == IPA_CMD_ASS_START) {
+		chksum_cb->supported =
+				cmd->data.setassparms.data.chksum.supported;
+		QETH_CARD_TEXT_(card, 3, "strt:%x", chksum_cb->supported);
+	}
+	if (cmd->data.setassparms.hdr.command_code == IPA_CMD_ASS_ENABLE) {
+		chksum_cb->supported =
+				cmd->data.setassparms.data.chksum.supported;
+		chksum_cb->enabled =
+				cmd->data.setassparms.data.chksum.enabled;
+		QETH_CARD_TEXT_(card, 3, "supp:%x", chksum_cb->supported);
+		QETH_CARD_TEXT_(card, 3, "enab:%x", chksum_cb->enabled);
+	}
+	return 0;
+}
+
+/* Send command to OSA card and check results. */
+static int qeth_ipa_checksum_run_cmd(struct qeth_card *card,
+				     enum qeth_ipa_funcs ipa_func,
+				     __u16 cmd_code, long data,
+				     struct qeth_checksum_cmd *chksum_cb)
+{
+	struct qeth_cmd_buffer *iob;
+	int rc = -ENOMEM;
+
+	QETH_CARD_TEXT(card, 4, "chkdocmd");
+	iob = qeth_get_setassparms_cmd(card, ipa_func, cmd_code,
+				       sizeof(__u32), QETH_PROT_IPV4);
+	if (iob)
+		rc = qeth_send_setassparms(card, iob, sizeof(__u32), data,
+					   qeth_ipa_checksum_run_cmd_cb,
+					   chksum_cb);
+	return rc;
+}
+
 static int qeth_send_checksum_on(struct qeth_card *card, int cstype)
 {
-	long rxtx_arg;
+	struct qeth_checksum_cmd chksum_cb;
 	int rc;
 
-	rc = qeth_send_simple_setassparms(card, cstype, IPA_CMD_ASS_START, 0);
+	rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_START, 0,
+				       &chksum_cb);
 	if (rc) {
+		qeth_send_simple_setassparms(card, cstype, IPA_CMD_ASS_STOP, 0);
 		dev_warn(&card->gdev->dev,
 			 "Starting HW checksumming for %s failed, using SW checksumming\n",
 			 QETH_CARD_IFNAME(card));
 		return rc;
 	}
-	rxtx_arg = (cstype == IPA_OUTBOUND_CHECKSUM) ? card->info.tx_csum_mask
-						     : card->info.csum_mask;
-	rc = qeth_send_simple_setassparms(card, cstype, IPA_CMD_ASS_ENABLE,
-					  rxtx_arg);
+	rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_ENABLE,
+				       chksum_cb.supported, &chksum_cb);
 	if (rc) {
+		qeth_send_simple_setassparms(card, cstype, IPA_CMD_ASS_STOP, 0);
 		dev_warn(&card->gdev->dev,
 			 "Enabling HW checksumming for %s failed, using SW checksumming\n",
 			 QETH_CARD_IFNAME(card));
@@ -6090,19 +6133,10 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype)
 
 static int qeth_set_ipa_csum(struct qeth_card *card, int on, int cstype)
 {
-	int rc;
-
-	if (on) {
-		rc = qeth_send_checksum_on(card, cstype);
-		if (rc)
-			return -EIO;
-	} else {
-		rc = qeth_send_simple_setassparms(card, cstype,
-						  IPA_CMD_ASS_STOP, 0);
-		if (rc)
-			return -EIO;
-	}
-	return 0;
+	int rc = (on) ? qeth_send_checksum_on(card, cstype)
+		      : qeth_send_simple_setassparms(card, cstype,
+						     IPA_CMD_ASS_STOP, 0);
+	return rc ? -EIO : 0;
 }
 
 static int qeth_set_ipa_tso(struct qeth_card *card, int on)
diff --git a/drivers/s390/net/qeth_core_mpc.h b/drivers/s390/net/qeth_core_mpc.h
index 6cccc9a..f54ea72 100644
--- a/drivers/s390/net/qeth_core_mpc.h
+++ b/drivers/s390/net/qeth_core_mpc.h
@@ -352,11 +352,18 @@ struct qeth_arp_query_info {
 	char *udata;
 };
 
+/* IPA Assist checksum offload reply layout. */
+struct qeth_checksum_cmd {
+	__u32 supported;
+	__u32 enabled;
+} __packed;
+
 /* SETASSPARMS IPA Command: */
 struct qeth_ipacmd_setassparms {
 	struct qeth_ipacmd_setassparms_hdr hdr;
 	union {
 		__u32 flags_32bit;
+		struct qeth_checksum_cmd chksum;
 		struct qeth_arp_cache_entry add_arp_entry;
 		struct qeth_arp_query_data query_arp;
 		__u8 ip[16];
-- 
2.8.4

^ permalink raw reply related

* [PATCH net-next 03/13] s390/qeth: warning for OSA3 RX/TX checksum offloading
From: Ursula Braun @ 2017-01-11 11:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, stable, ubraun
In-Reply-To: <20170111115600.4524-1-ubraun@linux.vnet.ibm.com>

From: Thomas Richter <tmricht@linux.vnet.ibm.com>

When RX/TX checksum offloading is turned on and the adapter is
an OSA 3 card in layer 3 mode, the checksum offloading is only
performed when both peers use different adapters. If both peers
share an OSA 3 card, communication is a memory copy and
checksum offloading is not performed.

This patch adds a warning to inform the administrator.

OSA 3 in layer 2 mode does not offer the RX/TX checksum
offload feature.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Reviewed-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
 drivers/s390/net/qeth_core_main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 49b813f..ca8309f 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -6116,6 +6116,11 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype)
 		if ((required_features & chksum_cb.supported) !=
 		    required_features)
 			rc = -EIO;
+		else if (!(QETH_IPA_CHECKSUM_LP2LP & chksum_cb.supported) &&
+			 cstype == IPA_INBOUND_CHECKSUM)
+			dev_warn(&card->gdev->dev,
+				 "Hardware checksumming is performed only if %s and its peer use different OSA Express 3 ports\n",
+				 QETH_CARD_IFNAME(card));
 	}
 	if (rc) {
 		qeth_send_simple_setassparms(card, cstype, IPA_CMD_ASS_STOP, 0);
-- 
2.8.4

^ permalink raw reply related

* [PATCH net-next 04/13] s390/qeth: Allow reading hsuid in state DOWN
From: Ursula Braun @ 2017-01-11 11:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, stable, ubraun
In-Reply-To: <20170111115600.4524-1-ubraun@linux.vnet.ibm.com>

From: Julian Wiedmann <jwi@linux.vnet.ibm.com>

Accessing the current hsuid via card->options.hsuid is perfectly
fine, even when the card is DOWN.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Reviewed-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
---
 drivers/s390/net/qeth_l3_sys.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
index 0e00a5c..3cd4d9f 100644
--- a/drivers/s390/net/qeth_l3_sys.c
+++ b/drivers/s390/net/qeth_l3_sys.c
@@ -250,9 +250,6 @@ static ssize_t qeth_l3_dev_hsuid_show(struct device *dev,
 	if (card->info.type != QETH_CARD_TYPE_IQD)
 		return -EPERM;
 
-	if (card->state == CARD_STATE_DOWN)
-		return -EPERM;
-
 	memcpy(tmp_hsuid, card->options.hsuid, sizeof(tmp_hsuid));
 	EBCASC(tmp_hsuid, 8);
 	return sprintf(buf, "%s\n", tmp_hsuid);
-- 
2.8.4

^ permalink raw reply related

* [PATCH net-next 05/13] s390/qeth: Remove QETH_IP_HEADER_SIZE
From: Ursula Braun @ 2017-01-11 11:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, stable, ubraun
In-Reply-To: <20170111115600.4524-1-ubraun@linux.vnet.ibm.com>

From: Julian Wiedmann <jwi@linux.vnet.ibm.com>

Remove unused define QETH_IP_HEADER_SIZE.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Reviewed-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
---
 drivers/s390/net/qeth_core.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 41e4665..774ae51 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -281,8 +281,6 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,
 #define QETH_HIGH_WATERMARK_PACK 5
 #define QETH_WATERMARK_PACK_FUZZ 1
 
-#define QETH_IP_HEADER_SIZE 40
-
 /* large receive scatter gather copy break */
 #define QETH_RX_SG_CB (PAGE_SIZE >> 1)
 #define QETH_RX_PULL_LEN 256
-- 
2.8.4

^ permalink raw reply related

* [PATCH net-next 06/13] s390/qeth: drop qeth_l2_del_all_macs() parameter
From: Ursula Braun @ 2017-01-11 11:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, stable, ubraun
In-Reply-To: <20170111115600.4524-1-ubraun@linux.vnet.ibm.com>

From: Julian Wiedmann <jwi@linux.vnet.ibm.com>

The only caller passes del = 0, so remove both the parameter and
the code that handles != 0.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Reviewed-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
---
 drivers/s390/net/qeth_l2_main.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 9c921c28..3025f56 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -216,7 +216,7 @@ static int qeth_l2_write_mac(struct qeth_card *card, struct qeth_mac *mac)
 	return rc;
 }
 
-static void qeth_l2_del_all_macs(struct qeth_card *card, int del)
+static void qeth_l2_del_all_macs(struct qeth_card *card)
 {
 	struct qeth_mac *mac;
 	struct hlist_node *tmp;
@@ -224,13 +224,6 @@ static void qeth_l2_del_all_macs(struct qeth_card *card, int del)
 
 	spin_lock_bh(&card->mclock);
 	hash_for_each_safe(card->mac_htable, i, tmp, mac, hnode) {
-		if (del) {
-			if (mac->is_uc)
-				qeth_l2_send_setdelmac(card, mac->mac_addr,
-						IPA_CMD_DELVMAC);
-			else
-				qeth_l2_send_delgroupmac(card, mac->mac_addr);
-		}
 		hash_del(&mac->hnode);
 		kfree(mac);
 	}
@@ -425,7 +418,7 @@ static void qeth_l2_stop_card(struct qeth_card *card, int recovery_mode)
 		card->state = CARD_STATE_SOFTSETUP;
 	}
 	if (card->state == CARD_STATE_SOFTSETUP) {
-		qeth_l2_del_all_macs(card, 0);
+		qeth_l2_del_all_macs(card);
 		qeth_clear_ipacmd_list(card);
 		card->state = CARD_STATE_HARDSETUP;
 	}
-- 
2.8.4

^ permalink raw reply related


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