From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamal Hadi Salim Subject: Re: [PATCH v3 net-next 1/1] net_sched: Introduce skbmod action Date: Tue, 6 Sep 2016 08:08:17 -0400 Message-ID: References: <1472386756-23085-1-git-send-email-jhs@emojatatu.com> <1472400467.14381.252.camel@edumazet-glaptop3.roam.corp.google.com> <1472494817.14381.267.camel@edumazet-glaptop3.roam.corp.google.com> <2a6e36a6-f128-ba9d-4d69-90ff5383fb75@mojatatu.com> <68852282-b009-7b5b-6887-1630935b1913@mojatatu.com> <1472561089.14381.296.camel@edumazet-glaptop3.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net, netdev@vger.kernel.org, daniel@iogearbox.net, xiyou.wangcong@gmail.com To: Eric Dumazet Return-path: Received: from mail-yb0-f178.google.com ([209.85.213.178]:35659 "EHLO mail-yb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932327AbcIFMIT (ORCPT ); Tue, 6 Sep 2016 08:08:19 -0400 Received: by mail-yb0-f178.google.com with SMTP id g5so13867062yba.2 for ; Tue, 06 Sep 2016 05:08:19 -0700 (PDT) In-Reply-To: <1472561089.14381.296.camel@edumazet-glaptop3.roam.corp.google.com> Sender: netdev-owner@vger.kernel.org List-ID: ng On 16-08-30 08:44 AM, Eric Dumazet wrote: > On Tue, 2016-08-30 at 07:57 -0400, Jamal Hadi Salim wrote: >> if (flags & SKBMOD_F_SWAPMAC) { >> u8 tmpaddr[ETH_ALEN]; >> /*XXX: I am sure we can come up with something more efficient */ >> ether_addr_copy(tmpaddr, eth_hdr(skb)->h_dest); >> ether_addr_copy(eth_hdr(skb)->h_dest, eth_hdr(skb)->h_source); >> ether_addr_copy(eth_hdr(skb)->h_source, tmpaddr); >> } > > While ether_addr_copy() is accepting u8 pointers, data must be aligned to u16 at least. > > (See comments in include/linux/etherdevice.h) > > Some arches/compilers might do things here that would generate a trap > if tmpaddr is not aligned. > Hrm. How do you suggest dealing with this? cheers, jamal