Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa84505f authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik
Browse files

[PATCH] chelsio: transmit routine return values



The Chelsio driver does not return the correct values from
the transmit routine. It works because the values don't conflict,
but it is using the wrong defines. And -ENOMEM is not a legal return
value.

Since t1_sge_tx is only called in one place, making it static
allows compiler to be potentially inline it.

Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent ebc62fb3
Loading
Loading
Loading
Loading
+10 −9
Original line number Original line Diff line number Diff line
@@ -1332,7 +1332,7 @@ intr_handler_t t1_select_intr_handler(adapter_t *adapter)
 *
 *
 * This runs with softirqs disabled.
 * This runs with softirqs disabled.
 */
 */
unsigned int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter,
static int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter,
		     unsigned int qid, struct net_device *dev)
		     unsigned int qid, struct net_device *dev)
{
{
	struct sge *sge = adapter->sge;
	struct sge *sge = adapter->sge;
@@ -1352,9 +1352,10 @@ unsigned int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter,
			set_bit(dev->if_port, &sge->stopped_tx_queues);
			set_bit(dev->if_port, &sge->stopped_tx_queues);
			sge->stats.cmdQ_full[3]++;
			sge->stats.cmdQ_full[3]++;
			spin_unlock(&q->lock);
			spin_unlock(&q->lock);
			if (!netif_queue_stopped(dev))
				CH_ERR("%s: Tx ring full while queue awake!\n",
				CH_ERR("%s: Tx ring full while queue awake!\n",
				       adapter->name);
				       adapter->name);
			return 1;
			return NETDEV_TX_BUSY;
		}
		}
		if (unlikely(credits - count < q->stop_thres)) {
		if (unlikely(credits - count < q->stop_thres)) {
			sge->stats.cmdQ_full[3]++;
			sge->stats.cmdQ_full[3]++;
@@ -1389,7 +1390,7 @@ unsigned int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter,
			writel(F_CMDQ0_ENABLE, adapter->regs + A_SG_DOORBELL);
			writel(F_CMDQ0_ENABLE, adapter->regs + A_SG_DOORBELL);
		}
		}
	}
	}
	return 0;
	return NETDEV_TX_OK;
}
}


#define MK_ETH_TYPE_MSS(type, mss) (((mss) & 0x3FFF) | ((type) << 14))
#define MK_ETH_TYPE_MSS(type, mss) (((mss) & 0x3FFF) | ((type) << 14))
@@ -1449,7 +1450,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
		if (unlikely(skb->len < ETH_HLEN ||
		if (unlikely(skb->len < ETH_HLEN ||
			     skb->len > dev->mtu + eth_hdr_len(skb->data))) {
			     skb->len > dev->mtu + eth_hdr_len(skb->data))) {
			dev_kfree_skb_any(skb);
			dev_kfree_skb_any(skb);
			return NET_XMIT_SUCCESS;
			return NETDEV_TX_OK;
		}
		}


		/*
		/*
@@ -1467,7 +1468,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
			skb = skb_realloc_headroom(skb, sizeof(*cpl));
			skb = skb_realloc_headroom(skb, sizeof(*cpl));
			dev_kfree_skb_any(orig_skb);
			dev_kfree_skb_any(orig_skb);
			if (!skb)
			if (!skb)
				return -ENOMEM;
				return NETDEV_TX_OK;
		}
		}


		if (!(adapter->flags & UDP_CSUM_CAPABLE) &&
		if (!(adapter->flags & UDP_CSUM_CAPABLE) &&
@@ -1475,7 +1476,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
		    skb->nh.iph->protocol == IPPROTO_UDP)
		    skb->nh.iph->protocol == IPPROTO_UDP)
			if (unlikely(skb_checksum_help(skb, 0))) {
			if (unlikely(skb_checksum_help(skb, 0))) {
				dev_kfree_skb_any(skb);
				dev_kfree_skb_any(skb);
				return -ENOMEM;
				return NETDEV_TX_OK;
			}
			}


		/* Hmmm, assuming to catch the gratious arp... and we'll use
		/* Hmmm, assuming to catch the gratious arp... and we'll use
+0 −2
Original line number Original line Diff line number Diff line
@@ -89,8 +89,6 @@ int t1_sge_configure(struct sge *, struct sge_params *);
int t1_sge_set_coalesce_params(struct sge *, struct sge_params *);
int t1_sge_set_coalesce_params(struct sge *, struct sge_params *);
void t1_sge_destroy(struct sge *);
void t1_sge_destroy(struct sge *);
intr_handler_t t1_select_intr_handler(adapter_t *adapter);
intr_handler_t t1_select_intr_handler(adapter_t *adapter);
unsigned int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter,
		       unsigned int qid, struct net_device *netdev);
int t1_start_xmit(struct sk_buff *skb, struct net_device *dev);
int t1_start_xmit(struct sk_buff *skb, struct net_device *dev);
void t1_set_vlan_accel(struct adapter *adapter, int on_off);
void t1_set_vlan_accel(struct adapter *adapter, int on_off);
void t1_sge_start(struct sge *);
void t1_sge_start(struct sge *);