diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2018-07-19 12:43:56 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-21 10:12:30 -0700 |
commit | ba86ceee9d1b5aa71fe3db75b2ec5452c9a48307 (patch) | |
tree | d4af4b1cab727029b75e594f83c5cf99ecefed75 /drivers/s390/net/qeth_core.h | |
parent | s390/qeth: add statistics for consumed buffer elements (diff) | |
download | linux-dev-ba86ceee9d1b5aa71fe3db75b2ec5452c9a48307.tar.xz linux-dev-ba86ceee9d1b5aa71fe3db75b2ec5452c9a48307.zip |
s390/qeth: merge linearize-check into HW header construction
When checking whether an skb needs to be linearized to fit into an IO
buffer, it's desirable to consider the skb's final size and layout
(ie. after the HW header was added). But a subsequent linearization can
then cause the re-positioned HW header to violate its alignment
restrictions.
Dealing with this situation in two different code paths is quite tricky.
This patch integrates a) linearize-check and b) HW header construction
into one 3 step-sequence:
1. evaluate how the HW header needs to be added (to identify if it takes
up an additional buffer element), then
2. check if the required buffer elements exceed the device's limit.
Linearize when necessary and re-evaluate the HW header placement.
3. Add the HW header in the best-possible way:
a) push, without taking up an additional buffer element
b) push, but consume another buffer element
c) allocate a header object from the cache.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core.h')
-rw-r--r-- | drivers/s390/net/qeth_core.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 6d8005af67f5..2a5ec99643df 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -1047,7 +1047,9 @@ netdev_features_t qeth_features_check(struct sk_buff *skb, struct net_device *dev, netdev_features_t features); int qeth_vm_request_mac(struct qeth_card *card); -int qeth_push_hdr(struct sk_buff *skb, struct qeth_hdr **hdr, unsigned int len); +int qeth_add_hw_header(struct qeth_card *card, struct sk_buff *skb, + struct qeth_hdr **hdr, unsigned int len, + unsigned int *elements); /* exports for OSN */ int qeth_osn_assist(struct net_device *, void *, int); |