Re: [mpls-linux-general] Cleanups for 2.6.0-test9
Status: Beta
Brought to you by:
jleu
|
From: Ramon C. <cas...@in...> - 2003-11-18 10:27:54
|
On Tue, 18 Nov 2003, Vilyan Dimitrov wrote:
> Hi all,
>
>
> James, here are my 2 cents.
Hi Vilyan,
This was fixed in my yesterday's path:
+/*****
+ * Packet Type for MPLS Unicast Traffic register info.
+ *
+ **/
+static struct packet_type mpls_uc_packet_type = {
+ .type = __constant_htons(ETH_P_MPLS_UC), /* MPLS Unicast
PID */
+ .dev = NULL, /* All devices
*/
+ .func = mpls_rcv,
+#if LINUX_VERSION_CODE > 0x020575
+ .af_packet_priv = NULL,
+ .list = NULL,
+#endif
+};
+
However, I am syncing with p4 and eventually waiting for davem
implementation. I will then port my patchset to the latest James version.
Other things that are worth noting:
This could replace mpls_ref.c
+/****************************************************************************
+ * REFERENCE COUNT MANAGEMENT
+ *
+ *
+ *
+ *
+
****************************************************************************/
+
+/* Hold */
+#define mpls_in_info_hold(mii) \
+BUG_ON(!mii);\
+ atomic_inc(&mii->__refcnt);\
+
+#define mpls_out_info_hold(moi) \
+ BUG_ON(!moi);\
+ atomic_inc(&moi->__refcnt);\
+
+#define mpls_label_hold(label) \
+ BUG_ON(!ml);\
+ atomic_inc(&label->__refcnt);\
+
+#define mpls_dst_hold(dst) \
+ BUG_ON(!dst);\
+ atomic_inc(&dst->__refcnt);\
+
+
+/* Release */
+#define mpls_in_info_release(mii) \
+ BUG_ON(!mii);\
+ if (atomic_dec_and_test(&mii->__refcnt))\
+ __mpls_del_in_label(mii);
+
+#define mpls_out_info_release(moi) \
+BUG_ON(!moi);\
+ if (atomic_dec_and_test(&moi->__refcnt))\
+ __mpls_del_out_label(moi);
+
+#define mpls_label_release(label) \
+BUG_ON(!label);\
+ if (atomic_dec_and_test(&label->__refcnt))\
+ kmem_cache_free(mpls_label_cachep,ml);
+
+#define mpls_dst_release(md) \
+BUG_ON(!md);\
+ if (atomic_dec_and_test(&md->__refcnt))\
+{\
+ if (md->md_dst)\
+ dst_destroy(md->md_dst);\
+ kfree(md);\
+}
+
P4 is sloooooow :))) and James has done a lot of work to download, but
I'll keep you posted,
Regards,
R.
|