• J
    s390/qeth: merge linearize-check into HW header construction · ba86ceee
    Julian Wiedmann 提交于
    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: NJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    ba86ceee
qeth_l2_main.c 65.5 KB