Commit 45115553 authored by David S. Miller's avatar David S. Miller

Merge branch 'sfx-fixes'

Edward Cree says:

====================
sfc: couple of fixes

First patch addresses a construct that causes sparse to error out.
With that fixed, sparse makes some warnings on ef10.c, second patch
 fixes one of them.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 48051c37 6d43131c
...@@ -828,9 +828,7 @@ static int efx_ef10_alloc_piobufs(struct efx_nic *efx, unsigned int n) ...@@ -828,9 +828,7 @@ static int efx_ef10_alloc_piobufs(struct efx_nic *efx, unsigned int n)
static int efx_ef10_link_piobufs(struct efx_nic *efx) static int efx_ef10_link_piobufs(struct efx_nic *efx)
{ {
struct efx_ef10_nic_data *nic_data = efx->nic_data; struct efx_ef10_nic_data *nic_data = efx->nic_data;
_MCDI_DECLARE_BUF(inbuf, MCDI_DECLARE_BUF(inbuf, MC_CMD_LINK_PIOBUF_IN_LEN);
max(MC_CMD_LINK_PIOBUF_IN_LEN,
MC_CMD_UNLINK_PIOBUF_IN_LEN));
struct efx_channel *channel; struct efx_channel *channel;
struct efx_tx_queue *tx_queue; struct efx_tx_queue *tx_queue;
unsigned int offset, index; unsigned int offset, index;
...@@ -839,8 +837,6 @@ static int efx_ef10_link_piobufs(struct efx_nic *efx) ...@@ -839,8 +837,6 @@ static int efx_ef10_link_piobufs(struct efx_nic *efx)
BUILD_BUG_ON(MC_CMD_LINK_PIOBUF_OUT_LEN != 0); BUILD_BUG_ON(MC_CMD_LINK_PIOBUF_OUT_LEN != 0);
BUILD_BUG_ON(MC_CMD_UNLINK_PIOBUF_OUT_LEN != 0); BUILD_BUG_ON(MC_CMD_UNLINK_PIOBUF_OUT_LEN != 0);
memset(inbuf, 0, sizeof(inbuf));
/* Link a buffer to each VI in the write-combining mapping */ /* Link a buffer to each VI in the write-combining mapping */
for (index = 0; index < nic_data->n_piobufs; ++index) { for (index = 0; index < nic_data->n_piobufs; ++index) {
MCDI_SET_DWORD(inbuf, LINK_PIOBUF_IN_PIOBUF_HANDLE, MCDI_SET_DWORD(inbuf, LINK_PIOBUF_IN_PIOBUF_HANDLE,
...@@ -920,6 +916,10 @@ static int efx_ef10_link_piobufs(struct efx_nic *efx) ...@@ -920,6 +916,10 @@ static int efx_ef10_link_piobufs(struct efx_nic *efx)
return 0; return 0;
fail: fail:
/* inbuf was defined for MC_CMD_LINK_PIOBUF. We can use the same
* buffer for MC_CMD_UNLINK_PIOBUF because it's shorter.
*/
BUILD_BUG_ON(MC_CMD_LINK_PIOBUF_IN_LEN < MC_CMD_UNLINK_PIOBUF_IN_LEN);
while (index--) { while (index--) {
MCDI_SET_DWORD(inbuf, UNLINK_PIOBUF_IN_TXQ_INSTANCE, MCDI_SET_DWORD(inbuf, UNLINK_PIOBUF_IN_TXQ_INSTANCE,
nic_data->pio_write_vi_base + index); nic_data->pio_write_vi_base + index);
...@@ -2183,7 +2183,7 @@ static int efx_ef10_tx_tso_desc(struct efx_tx_queue *tx_queue, ...@@ -2183,7 +2183,7 @@ static int efx_ef10_tx_tso_desc(struct efx_tx_queue *tx_queue,
/* Modify IPv4 header if needed. */ /* Modify IPv4 header if needed. */
ip->tot_len = 0; ip->tot_len = 0;
ip->check = 0; ip->check = 0;
ipv4_id = ip->id; ipv4_id = ntohs(ip->id);
} else { } else {
/* Modify IPv6 header if needed. */ /* Modify IPv6 header if needed. */
struct ipv6hdr *ipv6 = ipv6_hdr(skb); struct ipv6hdr *ipv6 = ipv6_hdr(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment