Hello !
If you are interested in creating a patch for supporting Titan GE in older Titan versions (1.0 and 1.1), then I have indicated the part of the diffs below that you will need to apply to the current driver
/*
+ * Do the slowpath route. This route is kicked off
+ * when the IP header is misaligned. Grrr ..
+ */
+static int titan_ge_slowpath(struct sk_buff *skb,
+ titan_ge_packet *packet,
+ struct net_device *netdev)
+{
+ struct sk_buff *copy_skb;
+
+ copy_skb = dev_alloc_skb(packet->len + 2);
+
+ if (!copy_skb) {
+ dev_kfree_skb_any(packet->skb);
+ return -1;
+ }
+
+ copy_skb->dev = netdev;
+ skb_reserve(copy_skb, 2);
+ skb_put(copy_skb, packet->len);
+
+ memcpy(copy_skb->data, skb->data, packet->len);
+
+ /* Titan supports Rx checksum offload */
+ copy_skb->ip_summed = CHECKSUM_HW;
+ copy_skb->csum = packet->checksum;
+
+ copy_skb->protocol = eth_type_trans(copy_skb, netdev);
+
+ dev_kfree_skb_any(packet->skb);
+#ifdef TITAN_RX_NAPI
+ netif_receive_skb(copy_skb);
+#else
+ netif_rx(copy_skb);
+#endif
+
+ return 0;
+}
+
+/*
* Threshold beyond which we do the cleaning of
* Tx queue and new allocation for the Rx
* queue
@@ -1434,10 +1421,11 @@
titan_ge_eth->rx_ring_skbs--;
+#ifdef TITAN_RX_NAPI
if (--titan_ge_eth->rx_work_limit < 0)
break;
received_packets++;
-
+#endif
stats->rx_packets++;
stats->rx_bytes += packet.len;
@@ -1456,36 +1444,41 @@
* idea is to cut down the number of checks and improve
* the fastpath.
*/
+ skb_put(skb, packet.len);
- skb_put(skb, packet.len - 2);
-
- /*
- * Increment data pointer by two since thats where
- * the MAC starts
- */
- skb_reserve(skb, 2);
- skb->protocol = eth_type_trans(skb, netdev);
- netif_receive_skb(skb);
+ if (titan_ge_slowpath(skb, &packet, netdev) < 0) + goto out_next;
+#ifdef TITAN_RX_NAPI
if (titan_ge_eth->rx_threshold > RX_THRESHOLD) {
ack = titan_ge_rx_task(netdev, titan_ge_eth);
TITAN_GE_WRITE((0x5048 + (port_num << 8)), ack);
titan_ge_eth->rx_threshold = 0;
} else
titan_ge_eth->rx_threshold++;
+#else
+ ack = titan_ge_rx_task(netdev, titan_ge_eth);
+ TITAN_GE_WRITE((0x5048 + (port_num << 8)), ack);
+#endif
+out_next:
+
+#ifdef TITAN_RX_NAPI
if (titan_ge_eth->tx_threshold > TX_THRESHOLD) {
titan_ge_eth->tx_threshold = 0;
titan_ge_free_tx_queue(titan_ge_eth);
}
else
titan_ge_eth->tx_threshold++;
+#endif
}
return received_packets;
}
Thanks Manish Lachwani