• Julian Wiedmann's avatar
    s390/qeth: size calculation outbound buffers · 7d969d2e
    Julian Wiedmann authored
    Depending on the device type, hard_start_xmit() builds different output
    buffer formats. For instance with HiperSockets, on both L2 and L3 we
    strip the ETH header from the skb - L3 doesn't need it, and L2 carries
    it in the buffer's header element.
    For this, we pass data_offset = ETH_HLEN all the way down to
    __qeth_fill_buffer(), where skb->data is then adjusted accordingly.
    But the initial size calculation still considers the *full* skb length
    (including the ETH header). So qeth_get_elements_no() can erroneously
    reject a skb as too big, even though it would actually fit into an
    output buffer once the ETH header has been trimmed off later.
    
    Fix this by passing an additional offset to qeth_get_elements_no(),
    that indicates where in the skb the on-wire data actually begins.
    Since the current code uses data_offset=-1 for some special handling
    on OSA, we need to clamp data_offset to 0...
    
    On HiperSockets this helps when sending ~MTU-size skbs with weird page
    alignment. No change for OSA or AF_IUCV.
    Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
    Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7d969d2e
qeth_l2_main.c 57.3 KB