OSDN Git Service

net: dsa: Refactor transmit path to eliminate duplication
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 31 Jul 2015 18:42:56 +0000 (11:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Jul 2015 22:45:37 +0000 (15:45 -0700)
commit4ed70ce9f01c998999e48642a768d9013bee2c4f
treea46d1aafd6b3f82cb854052ff24916ee8a8888af
parent6cec4f5e00a34a1c7407af302470246dd4f8be28
net: dsa: Refactor transmit path to eliminate duplication

All tagging protocols do the same thing: increment device statistics,
make room for the tag to be inserted, create the tag, invoke the parent
network device transmit function.

In order to prepare for adding netpoll support, which requires the tag
creation, but not using the parent network device transmit function, do
some little refactoring which eliminates duplication between the 4
tagging protocols supported.

We need to return a sk_buff pointer back to the caller because the tag
specific transmit function may have to reallocate the original skb (e.g:
tag_trailer.c) and this is the one we should be transmitting, not the
original sk_buff we were passed.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa_priv.h
net/dsa/slave.c
net/dsa/tag_brcm.c
net/dsa/tag_dsa.c
net/dsa/tag_edsa.c
net/dsa/tag_trailer.c